• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java InstallContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中info.magnolia.module.InstallContext的典型用法代码示例。如果您正苦于以下问题:Java InstallContext类的具体用法?Java InstallContext怎么用?Java InstallContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



InstallContext类属于info.magnolia.module包,在下文中一共展示了InstallContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: execute

import info.magnolia.module.InstallContext; //导入依赖的package包/类
@Override
public void execute(final InstallContext installContext) throws TaskExecutionException {
    try {
        final Session session = MgnlContext.getJCRSession(NewsRepositoryConstants.COLLABORATION);

        final Node rootNode = session.getRootNode();
        final int numberOfMovedNodes = processNewsItems(installContext, rootNode, 0);

        if (numberOfMovedNodes > 0) {
            installContext.info("Nested news items were found and have been un-nested.");
            installContext.info("Note: If present, duplicate news items now have a name that ends with '-duplicate'.");
            installContext.info("Please check all news items and re-publish if needed.");
        }
    } catch (RepositoryException e) {
        throw new TaskExecutionException("Error while un-nesting event nodes", e);
    }
}
 
开发者ID:tricode,项目名称:magnolia-news,代码行数:18,代码来源:FindAndMoveNestedNewsTask.java


示例2: getExtraInstallTasks

import info.magnolia.module.InstallContext; //导入依赖的package包/类
@Override
protected List<Task> getExtraInstallTasks(InstallContext installContext) {
    List<Task> tasks = new ArrayList<Task>(super.getExtraInstallTasks(installContext));
    tasks.add(new NodeExistsDelegateTask("", "/modules/ui-admincentral/config/appLauncherLayout/groups/manage/apps/neatconfiguration", null,
            new CreateNodeTask("", "/modules/ui-admincentral/config/appLauncherLayout/groups/manage/apps", "neatconfiguration", NodeTypes.ContentNode.NAME)));
    tasks.add(new MoveNodeTask("", "/modules/ui-admincentral/config/appLauncherLayout/groups/manage/apps/configuration", "/modules/ui-admincentral/config/appLauncherLayout/groups/tools/apps/configuration", false));
    tasks.add(new NodeExistsDelegateTask("", "/modules/ui-admincentral/apps/stkSiteApp/subApps",
            new SetPropertyTask("config", "/modules/ui-admincentral/apps/stkSiteApp/subApps", "extends", "/modules/neat-tweaks-developers/apps/neatconfiguration/subApps")));
    tasks.add(new NodeExistsDelegateTask("", "/modules/ui-admincentral/apps/stkThemesApp/subApps",
            new SetPropertyTask("config", "/modules/ui-admincentral/apps/stkThemesApp/subApps", "extends", "/modules/neat-tweaks-developers/apps/neatconfiguration/subApps")));
    tasks.add(new NodeExistsDelegateTask("", "/modules/ui-admincentral/apps/stkChannelsApp/subApps",
            new SetPropertyTask("config", "/modules/ui-admincentral/apps/stkChannelsApp/subApps", "extends", "/modules/neat-tweaks-developers/apps/neatconfiguration/subApps")));
    tasks.add(new NodeExistsDelegateTask("", "/modules/ui-admincentral/apps/stkDialogsApp/subApps",
            new SetPropertyTask("config", "/modules/ui-admincentral/apps/stkDialogsApp/subApps", "extends", "/modules/neat-tweaks-developers/apps/neatconfiguration/subApps")));
    tasks.add(new NodeExistsDelegateTask("", "/modules/ui-admincentral/apps/stkTemplateDefsApp/subApps",
            new SetPropertyTask("config", "/modules/ui-admincentral/apps/stkTemplateDefsApp/subApps", "extends", "/modules/neat-tweaks-developers/apps/neatconfiguration/subApps")));
    tasks.add(new IsModuleInstalledOrRegistered("STK JPG Image generator", "standard-templating-kit",
            new BootstrapSingleResource("", "", "/mgnl-bootstrap/standard-templating-kit/config.modules.imaging.config.generators.stk-jpg.xml")));
    return tasks;
}
 
开发者ID:rah003,项目名称:neat-tweaks,代码行数:21,代码来源:NeatTweaks4DevelopersVersionHandler.java


示例3: getExtraInstallTasks

import info.magnolia.module.InstallContext; //导入依赖的package包/类
/**
 * Override this method when defining tasks that need to be executed when INITIALLY INSTALLING the module.
 *
 * @param installContext Context of the install, can be used to display messages
 * @return A list of tasks to execute on initial install
 */
@Override
protected List<Task> getExtraInstallTasks(final InstallContext installContext) {
    final List<Task> tasks = Lists.newArrayList(super.getExtraInstallTasks(installContext));

    return tasks;
}
 
开发者ID:tricode,项目名称:magnolia-news,代码行数:13,代码来源:NewsModuleVersionHandler.java


示例4: getExtraInstallTasks

import info.magnolia.module.InstallContext; //导入依赖的package包/类
@Override
protected List<Task> getExtraInstallTasks(InstallContext ctx) {
    final List<Task> tasks = new ArrayList<Task>();
    tasks.addAll(super.getExtraInstallTasks(ctx));

    tasks.add(new CheckAndModifyPropertyValueTask("Use different URI2Repository manager", "Updates URI2RepositoryManager", RepositoryConstants.CONFIG, "/server/URI2RepositoryMapping",
            "class", "info.magnolia.cms.beans.config.URI2RepositoryManager", "nl.gertontenham.magnolia.templating.tools.managers.SiteURI2RepositoryManager"));

    return tasks;
}
 
开发者ID:gtenham,项目名称:magnolia-templating,代码行数:11,代码来源:FoundationToolsModuleVersionHandler.java


示例5: getExtraInstallTasks

import info.magnolia.module.InstallContext; //导入依赖的package包/类
@Override
protected List<Task> getExtraInstallTasks(InstallContext ctx) {
    final List<Task> tasks = new ArrayList<Task>();
    tasks.addAll(super.getExtraInstallTasks(ctx));

    tasks.addAll(getGenericTasks());

    return tasks;
}
 
开发者ID:gtenham,项目名称:magnolia-templating,代码行数:10,代码来源:FoundationTemplatingModuleVersionHandler.java


示例6: getExtraInstallTasks

import info.magnolia.module.InstallContext; //导入依赖的package包/类
/**
 * Override this method when defining tasks that need to be executed when INITIALLY INSTALLING the module.
 *
 * @param installContext Context of the install, can be used to display messages
 * @return A list of tasks to execute on initial install
 */
@Override
protected List<Task> getExtraInstallTasks(final InstallContext installContext) {
    final List<Task> tasks = new ArrayList<>();
    tasks.addAll(super.getExtraInstallTasks(installContext));

    return tasks;
}
 
开发者ID:tricode,项目名称:magnolia-blog,代码行数:14,代码来源:BlogsModuleVersionHandler.java


示例7: getStartupTasks

import info.magnolia.module.InstallContext; //导入依赖的package包/类
@Override
protected List<Task> getStartupTasks(final InstallContext installContext) {
    final List<Task> startupTasks = new ArrayList<>(0);
    startupTasks.addAll(super.getStartupTasks(installContext));

    if ("SNAPSHOT".equals(installContext.getCurrentModuleDefinition().getVersion().getClassifier())) {
        // force updates for snapshots
        startupTasks.add(new RemoveNodeTask("Remove snapshot information", "", "config", "/modules/" + MODULE_NAME + "/commands"));
        startupTasks.add(new ModuleBootstrapTask());
    }

    return startupTasks;
}
 
开发者ID:tricode,项目名称:magnolia-blog,代码行数:14,代码来源:BlogsModuleVersionHandler.java


示例8: ModuleDependencyBootstrapTask

import info.magnolia.module.InstallContext; //导入依赖的package包/类
public ModuleDependencyBootstrapTask(final String bootstrapResourcePath, final String dependencyName) {
    super("Bootstrap " + dependencyName, "Bootstraps " + dependencyName + " content if installed.", dependencyName,
            new BootstrapResourcesTask(StringUtils.EMPTY, StringUtils.EMPTY, ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING) {
                @Override
                protected boolean acceptResource(final InstallContext ctx, final String name) {
                    final String path = StringUtils.removeEnd(bootstrapResourcePath, "/") + "/" + dependencyName + "/";
                    return name.startsWith(path) && name.endsWith(".xml");
                }
            });
}
 
开发者ID:tricode,项目名称:magnolia-blog,代码行数:11,代码来源:ModuleDependencyBootstrapTask.java


示例9: getInstallConditions

import info.magnolia.module.InstallContext; //导入依赖的package包/类
@Override
protected List<Condition> getInstallConditions() {
    List<Condition> conditions = new ArrayList<Condition>(super.getInstallConditions());
    conditions.add(new AbstractCondition("NeatCentral Theme check",
            "neatcentral theme must be configured in order to use functionality if this module succesfully. Please edit your magnolia.properties file and set magnolia.ui.vaadin.theme property to value \"neatcentral53\" or \"neatcentral54\" (w/o quotes) based on your Magnolia version.") {

        @Override
        public boolean check(InstallContext installContext) {
            MagnoliaConfigurationProperties props = Components.getComponent(MagnoliaConfigurationProperties.class);
            String theme = props.getProperty("magnolia.ui.vaadin.theme");
            return "neatcentral53".equals(theme) || "neatcentral54".equals(theme) || theme.startsWith("neatcentralcustom");
        }
    });
    return conditions;
}
 
开发者ID:rah003,项目名称:neat-tweaks,代码行数:16,代码来源:DefaultNeatVersionHandler.java


示例10: getExtraInstallTasks

import info.magnolia.module.InstallContext; //导入依赖的package包/类
@Override
protected List<Task> getExtraInstallTasks(InstallContext installContext) {
    List<Task> tasks = new ArrayList<Task>(super.getExtraInstallTasks(installContext));
    if (!LicenseFileExtractor.getInstance().get(LicenseFileExtractor.VERSION_NUMBER).startsWith("5.4")) {
        tasks.add(new InstallTextResourceTask("/ui-admincentral/neat_theme.css"));
    } else {
        tasks.add(new CreateNodePathTask("admincentral", "/", NodeTypes.Folder.NAME));
    }
    return tasks;
}
 
开发者ID:rah003,项目名称:neat-tweaks,代码行数:11,代码来源:DefaultNeatVersionHandler.java


示例11: getBasicInstallTasks

import info.magnolia.module.InstallContext; //导入依赖的package包/类
@Override
protected List<Task> getBasicInstallTasks(InstallContext installContext) {
    List<Task> tasks = new ArrayList<Task>();
    tasks.add(new IsModuleInstalledOrRegistered("remove old neat-tweaks if exists", "", "neat-tweaks",
            new ArrayDelegateTask("",
                    new RemoveNodeTask("","","config","/modules/neat-tweaks"),
                    new RemoveNodeTask("","","config","/modules/ui-admincentral/config/appLauncherLayout/groups/manage/apps/neatconfiguration"),
                    new MoveNodeTask("", "/modules/ui-admincentral/config/appLauncherLayout/groups/tools/apps/configuration", "/modules/ui-admincentral/config/appLauncherLayout/groups/manage/apps/configuration", false)
                    )));
    tasks.addAll(super.getBasicInstallTasks(installContext));
    return tasks;
}
 
开发者ID:rah003,项目名称:neat-tweaks,代码行数:13,代码来源:DefaultNeatVersionHandler.java


示例12: getBasicInstallTasks

import info.magnolia.module.InstallContext; //导入依赖的package包/类
@Override
protected List<Task> getBasicInstallTasks(InstallContext installContext) {
    List<Task> tasks = new ArrayList<Task>();
    tasks.add(new CreateNodeTask("", "", "scripts", "/", "selectFields", NodeTypes.Folder.NAME));
    tasks.addAll(super.getBasicInstallTasks(installContext));
    return tasks;
}
 
开发者ID:rah003,项目名称:scripted-select,代码行数:8,代码来源:NeatScriptedSelectVersionHandler.java


示例13: getExtraInstallTasks

import info.magnolia.module.InstallContext; //导入依赖的package包/类
@Override
protected List<Task> getExtraInstallTasks(InstallContext installContext) {
    List<Task> tasks = new ArrayList<Task>();
    tasks.add(new SetPropertyTask("Replace template selector in pages:createPage dialog",
            RepositoryConstants.CONFIG, "/modules/pages/dialogs/createPage/form/tabs/tabPage/fields/template",
            "class", TemplateSelectorDefinition.class.getName()));
    tasks.add(new SetPropertyTask("Replace template selector in pages:editTemplate dialog",
            RepositoryConstants.CONFIG, "/modules/pages/dialogs/editTemplate/form/tabs/tabTemplate/fields/template",
            "class", TemplateSelectorDefinition.class.getName()));
    return tasks;
}
 
开发者ID:magnoliales,项目名称:magnolia-handlebars,代码行数:12,代码来源:HandlebarsVersionHandler.java


示例14: getExtraInstallTasks

import info.magnolia.module.InstallContext; //导入依赖的package包/类
@Override
protected List<Task> getExtraInstallTasks(final InstallContext installContext) {
    List<Task> tasks = new ArrayList<>();
    tasks.add(_addAppToLauncher);
    tasks.add(_addUriRepositoryMapping);
    return tasks;
}
 
开发者ID:aperto,项目名称:magnolia-vanity-url,代码行数:8,代码来源:VanityUrlModuleVersionHandler.java


示例15: processNewsItems

import info.magnolia.module.InstallContext; //导入依赖的package包/类
private static int processNewsItems(final InstallContext installContext, final Node rootNode, int numberOfMovedNodes)
        throws RepositoryException, TaskExecutionException {
    final List<Node> allNewsNodes = NodeUtil.asList(NodeUtil.getNodes(rootNode, NewsNodeTypes.News.NAME));

    for (Node newsNode : allNewsNodes) {
        if (newsNode.hasNodes()) {
            final NodeIterator subNodesIterator = newsNode.getNodes();

            while (subNodesIterator.hasNext()) {
                final Node subNode = subNodesIterator.nextNode();

                if ("image".equalsIgnoreCase(subNode.getName())) {
                    continue;
                }

                // Found a nested news item node, let's move it to the rootNode
                String targetPath = determineTargetPath(rootNode, subNode);

                if (rootNode.getSession().nodeExists(targetPath)) {
                    // Target node exists! Do not overwrite it, but rename the old node before moving it
                    targetPath += "-duplicate";
                }

                // Moving node
                new MoveNodeTask(
                        "Moving news item node",
                        "Moving node '" + subNode.getName() + "' to: " + rootNode.getPath(),
                        NewsRepositoryConstants.COLLABORATION,
                        subNode.getPath(),
                        targetPath,
                        false
                ).execute(installContext);

                numberOfMovedNodes++;
            }
        }
    }

    // ALso check sub folders (if there are any)
    final List<Node> allFolderNodes = NodeUtil.asList(NodeUtil.getNodes(rootNode, NewsNodeTypes.Folder.NAME));

    for (Node folderNode : allFolderNodes) {
        numberOfMovedNodes += processNewsItems(installContext, folderNode, numberOfMovedNodes);
    }

    return numberOfMovedNodes;
}
 
开发者ID:tricode,项目名称:magnolia-news,代码行数:48,代码来源:FindAndMoveNestedNewsTask.java



注:本文中的info.magnolia.module.InstallContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TagMetadata类代码示例发布时间:2022-05-23
下一篇:
Java EntityMinecartHopper类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap