本文整理汇总了Java中javax.jcr.ImportUUIDBehavior类的典型用法代码示例。如果您正苦于以下问题:Java ImportUUIDBehavior类的具体用法?Java ImportUUIDBehavior怎么用?Java ImportUUIDBehavior使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ImportUUIDBehavior类属于javax.jcr包,在下文中一共展示了ImportUUIDBehavior类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: importXml
import javax.jcr.ImportUUIDBehavior; //导入依赖的package包/类
public void importXml(InputStream inputStream,boolean overwrite) throws Exception{
if(!permissionService.isAdmin()){
throw new NoPermissionException();
}
String rootNodePath=getRootNode().getPath();
if(overwrite){
session.importXML(rootNodePath, inputStream,ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING);
}else{
session.importXML(rootNodePath, inputStream,ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
}
session.save();
}
开发者ID:youseries,项目名称:urule,代码行数:13,代码来源:RepositoryServiceImpl.java
示例2: loadContentIntoRepo
import javax.jcr.ImportUUIDBehavior; //导入依赖的package包/类
private void loadContentIntoRepo( String repoId )
throws RepositoryException, IOException
{
Node n = JcrUtils.getOrAddNode( session.getRootNode(), "repositories" );
n = JcrUtils.getOrAddNode( n, repoId );
n = JcrUtils.getOrAddNode( n, "content" );
n = JcrUtils.getOrAddNode( n, "org" );
n = JcrUtils.getOrAddNode( n, "apache" );
GZIPInputStream inputStream = new GZIPInputStream( getClass().getResourceAsStream( "/artifacts.xml.gz" ) );
session.importXML( n.getPath(), inputStream, ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW );
session.save();
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:14,代码来源:JcrRepositoryStatisticsGatheringTest.java
示例3: NewsModuleVersionHandler
import javax.jcr.ImportUUIDBehavior; //导入依赖的package包/类
/**
* Constructor.
* Here you can register deltas for tasks that need to be run when UPDATING an EXISTING module.
*/
public NewsModuleVersionHandler() {
register(DeltaBuilder.update("1.1.1", "Add a userrole news-editor")
.addTask(new BootstrapSingleResource("Userrole config", "Installing a userrole for the news module",
"/mgnl-bootstrap/magnolia-news-module/userroles/userroles.news-editor.xml", ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING)));
register(DeltaBuilder.update("1.1.4", "Upgrading news module to Magnolia 5.5")
.addTask(new RemoveNodeTask("Remove old nodes", "/modules/" + MODULE_NAME + "/apps"))
.addTask(new RemoveNodeTask("Remove old nodes", "/modules/" + MODULE_NAME + "/dialogs"))
);
register(DeltaBuilder.update("1.1.6", "Un-nesting news items")
.addTask(new FindAndMoveNestedNewsTask())
);
}
开发者ID:tricode,项目名称:magnolia-news,代码行数:19,代码来源:NewsModuleVersionHandler.java
示例4: BlogsModuleVersionHandler
import javax.jcr.ImportUUIDBehavior; //导入依赖的package包/类
/**
* Constructor.
* Here you can register deltas for tasks that need to be run when UPDATING an EXISTING module.
*/
public BlogsModuleVersionHandler() {
register(DeltaBuilder.update("1.1.1", "Add a userrole blog-editor")
.addTask(new BootstrapSingleModuleResource("Userrole config", "Installing a userrole for the blog module",
"/userroles/userroles.blog-editor.xml", ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING))
);
register(DeltaBuilder.update("1.1.2", "Updating blog module")
.addTask(new BootstrapSingleModuleResource("Rendering config", "Installing new freemarker context attributes for blogfn alias",
"/config/config.modules.rendering.renderers.freemarker.contextAttributes.blogfn.xml", ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING))
);
register(DeltaBuilder.update("1.1.3", "Updating blog module")
.addTask(new BootstrapSingleResource("Update config", "Fix dialog setting on edit blog folder",
"/mgnl-bootstrap/updates/config.modules.magnolia-blogs-module.apps.tricode-blogs.subApps.browser.actions.editFolder.xml", ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING))
.addTask(new BootstrapSingleResource("Update config", "Add new action for editing initial activation date",
"/mgnl-bootstrap/updates/config.modules.magnolia-blogs-module.apps.tricode-blogs.subApps.browser.actions.editActivationDate.xml", ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING))
.addTask(new BootstrapSingleResource("Update config", "Add new edit activation date action to action bar",
"/mgnl-bootstrap/updates/config.modules.magnolia-blogs-module.apps.tricode-blogs.subApps.browser.actionbar.sections.blog.groups.activationActions.items.editActivationDate.xml", ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING))
);
register(DeltaBuilder.update("1.1.5", "Upgrading blog module to Magnolia 5.5")
.addTask(new RemoveNodeTask("Remove old nodes", "/modules/" + MODULE_NAME + "/apps"))
.addTask(new RemoveNodeTask("Remove old nodes", "/modules/" + MODULE_NAME + "/dialogs"))
);
register(DeltaBuilder.update("1.1.8", "Add publish date to blogs")
.addTask(new BootstrapSingleModuleResource("Update config", "Add new CurrentDateField definition",
"/config/config.modules.ui-framework.fieldTypes.currentDateField.xml", ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING))
);
}
开发者ID:tricode,项目名称:magnolia-blog,代码行数:35,代码来源:BlogsModuleVersionHandler.java
示例5: ModuleDependencyBootstrapTask
import javax.jcr.ImportUUIDBehavior; //导入依赖的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
示例6: init
import javax.jcr.ImportUUIDBehavior; //导入依赖的package包/类
@Override
public boolean init(Session session, Root root, NamePathMapper namePathMapper,
boolean isWorkspaceImport, int uuidBehavior,
ReferenceChangeTracker referenceTracker, SecurityProvider securityProvider) {
if (!(session instanceof JackrabbitSession)) {
log.debug("Importing protected user content requires a JackrabbitSession");
return false;
}
this.session = (JackrabbitSession) session;
this.root = root;
this.namePathMapper = namePathMapper;
this.referenceTracker = referenceTracker;
if (initialized) {
throw new IllegalStateException("Already initialized");
}
if (uuidBehavior == ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW) {
log.debug("ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW isn't supported when importing users or groups.");
return false;
}
if (!initUserManager(isWorkspaceImport, securityProvider)) {
return false;
}
userManager = new UserManagerImpl(root, namePathMapper, securityProvider);
initialized = true;
return initialized;
}
开发者ID:denismo,项目名称:jackrabbit-dynamodb-store,代码行数:33,代码来源:UserImporter.java
注:本文中的javax.jcr.ImportUUIDBehavior类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论