本文整理汇总了Java中org.alfresco.service.cmr.repository.StoreRef.STORE_REF_WORKSPACE_SPACESSTORE属性的典型用法代码示例。如果您正苦于以下问题:Java StoreRef.STORE_REF_WORKSPACE_SPACESSTORE属性的具体用法?Java StoreRef.STORE_REF_WORKSPACE_SPACESSTORE怎么用?Java StoreRef.STORE_REF_WORKSPACE_SPACESSTORE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.alfresco.service.cmr.repository.StoreRef
的用法示例。
在下文中一共展示了StoreRef.STORE_REF_WORKSPACE_SPACESSTORE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testRoundTripKeepsCategoriesWhenWithinSameStore
/**
* Round-trip of export then import will result in the imported content having the same categories
* assigned to it as for the exported content -- provided the source and destination stores are the same.
*/
@SuppressWarnings("unchecked")
@Category(RedundantTests.class)
public void testRoundTripKeepsCategoriesWhenWithinSameStore() throws Exception
{
// Use a store ref that has the bootstrapped categories
StoreRef storeRef = StoreRef.STORE_REF_WORKSPACE_SPACESSTORE;
NodeRef rootNode = nodeService.getRootNode(storeRef);
ChildAssociationRef contentChildAssocRef = createContentWithCategories(storeRef, rootNode);
// Export/import
File acpFile = exportContent(contentChildAssocRef.getParentRef());
FileInfo importFolderFileInfo = importContent(acpFile, rootNode);
// Check categories
NodeRef importedFileNode = fileFolderService.searchSimple(importFolderFileInfo.getNodeRef(), "test.txt");
assertNotNull("Couldn't find imported file: test.txt", importedFileNode);
assertTrue(nodeService.hasAspect(importedFileNode, ContentModel.ASPECT_GEN_CLASSIFIABLE));
List<NodeRef> importedFileCategories = (List<NodeRef>)
nodeService.getProperty(importedFileNode, ContentModel.PROP_CATEGORIES);
assertCategoriesEqual(importedFileCategories,
"Regions",
"Software Document Classification");
}
示例2: testRoundTripLosesCategoriesImportingToDifferentStore
/**
* If the source and destination stores are not the same, then a round-trip of export then import
* will result in the imported content not having the categories assigned to it that were present
* on the exported content.
*/
@SuppressWarnings("unchecked")
@Category(RedundantTests.class)
public void testRoundTripLosesCategoriesImportingToDifferentStore() throws Exception
{
// Use a store ref that has the bootstrapped categories
StoreRef storeRef = StoreRef.STORE_REF_WORKSPACE_SPACESSTORE;
NodeRef rootNode = nodeService.getRootNode(storeRef);
ChildAssociationRef contentChildAssocRef = createContentWithCategories(storeRef, rootNode);
// Export
File acpFile = exportContent(contentChildAssocRef.getParentRef());
// Import - destination store is different from export store.
NodeRef destRootNode = nodeService.getRootNode(this.storeRef);
FileInfo importFolderFileInfo = importContent(acpFile, destRootNode);
// Check categories
NodeRef importedFileNode = fileFolderService.searchSimple(importFolderFileInfo.getNodeRef(), "test.txt");
assertNotNull("Couldn't find imported file: test.txt", importedFileNode);
assertTrue(nodeService.hasAspect(importedFileNode, ContentModel.ASPECT_GEN_CLASSIFIABLE));
List<NodeRef> importedFileCategories = (List<NodeRef>)
nodeService.getProperty(importedFileNode, ContentModel.PROP_CATEGORIES);
assertEquals("No categories should have been imported for the content", 0, importedFileCategories.size());
}
示例3: getStoreRef
/**
* Work out which StoreRef this store belongs to.
* @param String representing a store
* @return StoreRef
*/
public StoreRef getStoreRef(String store)
{
if (store != null && !store.isEmpty())
{
switch (store.toLowerCase())
{
case LIVE_NODES:
return StoreRef.STORE_REF_WORKSPACE_SPACESSTORE;
case VERSIONS:
return STORE_REF_VERSION2_SPACESSTORE;
case DELETED:
return StoreRef.STORE_REF_ARCHIVE_SPACESSTORE;
case HISTORY:
return STORE_REF_HISTORY;
}
}
throw new InvalidArgumentException(InvalidArgumentException.DEFAULT_MESSAGE_ID,
new Object[] { ": scope allowed values: nodes,deleted-nodes,versions" });
}
示例4: parseRepositoryNode
/**
* Creates a {@link RepositoryNodeRef} reference from the default
* {@link StoreRef}, SpacesStore and from the node id given by the cursor's
* current token.
*
* @param cursor
* @return A {@link RepositoryNodeRef} reference.
*/
private RepositoryNodeRef parseRepositoryNode(Cursor cursor)
{
String id = cursor.tokens[cursor.i];
cursor.i++;
return new RepositoryNodeRef(new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE,
id));
}
示例5: materializeAssocQName
private QName materializeAssocQName(QName assocQName)
{
// Version nodes have too long assocQNames so we try
// to detect references with "material" protocols in order to
// replace the assocQNames with material correspondents.
try
{
String lName = assocQName.getLocalName();
NodeRef nrAssocQName = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE,
lName);
if (Reference.fromNodeRef(nrAssocQName)!= null)
{
nrAssocQName = smartStore.materializeIfPossible(nrAssocQName);
QName materialAssocQName = QName.createQName(assocQName.getNamespaceURI(),
nrAssocQName.getId());
return materialAssocQName;
}
else
{
return assocQName;
}
}
catch (VirtualizationException e)
{
// We assume it can not be put through the
// isReference-virtualize-materialize.
if (logger.isDebugEnabled())
{
logger.debug("Defaulting on materializeAssocQName due to error.",
e);
}
return assocQName;
}
}
示例6: createContentNode
/**
* @return
*/
private TransferManifestNormalNode createContentNode(/*String transferId*/) throws Exception
{
TransferManifestNormalNode node = new TransferManifestNormalNode();
String uuid = GUID.generate();
NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, uuid);
node.setNodeRef(nodeRef);
node.setUuid(uuid);
byte[] dummyContent = "This is some dummy content.".getBytes("UTF-8");
node.setType(ContentModel.TYPE_CONTENT);
/**
* Get guest home
*/
NodeRef parentFolder = guestHome;
String nodeName = uuid + ".testnode" + getNameSuffix();
List<ChildAssociationRef> parents = new ArrayList<ChildAssociationRef>();
ChildAssociationRef primaryAssoc = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, parentFolder, QName
.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, nodeName), node.getNodeRef(), true, -1);
parents.add(primaryAssoc);
node.setParentAssocs(parents);
node.setParentPath(nodeService.getPath(parentFolder));
node.setPrimaryParentAssoc(primaryAssoc);
Map<QName, Serializable> props = new HashMap<QName, Serializable>();
props.put(ContentModel.PROP_NODE_UUID, uuid);
props.put(ContentModel.PROP_NAME, nodeName);
ContentData contentData = new ContentData("/" + uuid, "text/plain", dummyContent.length, "UTF-8");
props.put(ContentModel.PROP_CONTENT, contentData);
node.setProperties(props);
return node;
}
示例7: createFolderNode
private TransferManifestNormalNode createFolderNode(String folderName) throws Exception
{
TransferManifestNormalNode node = new TransferManifestNormalNode();
String uuid = GUID.generate();
NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, uuid);
node.setNodeRef(nodeRef);
node.setUuid(uuid);
node.setType(ContentModel.TYPE_FOLDER);
NodeRef parentFolder = repositoryHelper.getGuestHome();
String nodeName = folderName == null ? uuid + ".folder" + getNameSuffix() : folderName;
List<ChildAssociationRef> parents = new ArrayList<ChildAssociationRef>();
ChildAssociationRef primaryAssoc = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, parentFolder, QName
.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, nodeName), node.getNodeRef(), true, -1);
parents.add(primaryAssoc);
node.setParentAssocs(parents);
node.setParentPath(nodeService.getPath(parentFolder));
node.setPrimaryParentAssoc(primaryAssoc);
Map<QName, Serializable> props = new HashMap<QName, Serializable>();
props.put(ContentModel.PROP_NODE_UUID, uuid);
props.put(ContentModel.PROP_NAME, nodeName);
node.setProperties(props);
return node;
}
示例8: setup
@Before
public void setup() throws Exception
{
this.dummyTemplateNodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, GUID.generate());
// Mock the required services
this.serviceRegistryMock = mock(ServiceRegistry.class);
this.nodeServiceMock = mock(NodeService.class);
this.searchServiceMock = mock(SearchService.class);
this.namespaceServiceMock = mock(NamespaceService.class);
this.fileFolderServiceMock = mock(FileFolderService.class);
this.personServiceMock = mock(PersonService.class);
this.preferenceServiceMock = mock(PreferenceService.class);
this.repositoryHelperMock = mock(Repository.class);
this.templateLoaderMock = mock(TemplateLoader.class);
when(serviceRegistryMock.getNodeService()).thenReturn(nodeServiceMock);
when(serviceRegistryMock.getSearchService()).thenReturn(searchServiceMock);
when(serviceRegistryMock.getNamespaceService()).thenReturn(namespaceServiceMock);
when(serviceRegistryMock.getFileFolderService()).thenReturn(fileFolderServiceMock);
when(serviceRegistryMock.getPersonService()).thenReturn(personServiceMock);
when(serviceRegistryMock.getContentService()).thenReturn(mock(ContentService.class));
when(repositoryHelperMock.getRootHome()).thenReturn(new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, GUID.generate()));
when(fileFolderServiceMock.getLocalizedSibling(dummyTemplateNodeRef)).thenReturn(dummyTemplateNodeRef);
this.emailHelper = new EmailHelper();
emailHelper.setServiceRegistry(serviceRegistryMock);
emailHelper.setPreferenceService(preferenceServiceMock);
emailHelper.setRepositoryHelper(repositoryHelperMock);
emailHelper.setCompanyHomeChildName("app:company_home");
//test init
emailHelper.init();
// Note: set the template loader after the init method
emailHelper.setTemplateLoader(templateLoaderMock);
}
示例9: getStore
private StoreRef getStore(LuceneQueryBuilderContext<Q, S, E> luceneContext)
{
ArrayList<StoreRef> stores = luceneContext.getLuceneQueryParserAdaptor().getSearchParameters().getStores();
if(stores.size() < 1)
{
// default
return StoreRef.STORE_REF_WORKSPACE_SPACESSTORE;
}
return stores.get(0);
}
示例10: executeImpl
/**
* {@inheritDoc}
*/
@Override
protected Map<String, Object> executeImpl(final WebScriptRequest req, final Status status, final Cache cache)
{
final String baseStoreParam = this.getParameter(req, PARAM_BASE_STORE);
final StoreRef baseStore = baseStoreParam != null && !baseStoreParam.isEmpty() ? new StoreRef(baseStoreParam)
: StoreRef.STORE_REF_WORKSPACE_SPACESSTORE;
final NodeRef storeArchiveNode = this.nodeArchiveService.getStoreArchiveNode(baseStore);
final Map<String, Object> model = this.executeImpl(req, storeArchiveNode, status, cache);
return model;
}
示例11: getStore
private <Q, S, E extends Throwable> StoreRef getStore(LuceneQueryParserAdaptor<Q, S, E> lqpa)
{
ArrayList<StoreRef> stores = lqpa.getSearchParameters().getStores();
if(stores.size() < 1)
{
// default
return StoreRef.STORE_REF_WORKSPACE_SPACESSTORE;
}
return stores.get(0);
}
示例12: createContentNode
/**
* @return TransferManifestNormalNode
*/
private TransferManifestNormalNode createContentNode(NodeRef parentFolder, String nodeName) throws Exception
{
TransferManifestNormalNode node = new TransferManifestNormalNode();
String uuid = GUID.generate();
NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, uuid);
node.setNodeRef(nodeRef);
node.setUuid(uuid);
byte[] dummyContent = "This is some dummy content.".getBytes("UTF-8");
node.setType(ContentModel.TYPE_CONTENT);
node.setAncestorType(ContentModel.TYPE_CONTENT);
/**
* Get guest home
*/
List<ChildAssociationRef> parents = new ArrayList<ChildAssociationRef>();
ChildAssociationRef primaryAssoc = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, parentFolder, QName
.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, nodeName), node.getNodeRef(), true, -1);
parents.add(primaryAssoc);
node.setParentAssocs(parents);
node.setParentPath(null);
node.setPrimaryParentAssoc(primaryAssoc);
Map<QName, Serializable> props = new HashMap<QName, Serializable>();
props.put(ContentModel.PROP_NODE_UUID, uuid);
props.put(ContentModel.PROP_NAME, nodeName);
ContentData contentData = new ContentData("/" + uuid, "text/plain", dummyContent.length, "UTF-8");
props.put(ContentModel.PROP_CONTENT, contentData);
node.setProperties(props);
return node;
}
示例13: createFolderNode
/**
* @return TransferManifestNormalNode
*/
private TransferManifestNormalNode createFolderNode(NodeRef parentFolder, String nodeName) throws Exception
{
TransferManifestNormalNode node = new TransferManifestNormalNode();
String uuid = GUID.generate();
NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, uuid);
node.setNodeRef(nodeRef);
node.setUuid(uuid);
node.setType(ContentModel.TYPE_FOLDER);
node.setAncestorType(ContentModel.TYPE_FOLDER);
/**
* Get guest home
*/
List<ChildAssociationRef> parents = new ArrayList<ChildAssociationRef>();
ChildAssociationRef primaryAssoc = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, parentFolder, QName
.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, nodeName), node.getNodeRef(), true, -1);
parents.add(primaryAssoc);
node.setParentAssocs(parents);
node.setParentPath(null);
node.setPrimaryParentAssoc(primaryAssoc);
Map<QName, Serializable> props = new HashMap<QName, Serializable>();
props.put(ContentModel.PROP_NODE_UUID, uuid);
props.put(ContentModel.PROP_NAME, nodeName);
node.setProperties(props);
return node;
}
示例14: a_non_exisiting_target_for_an_association_can_be_asserted
@Test
public void a_non_exisiting_target_for_an_association_can_be_asserted() {
final NodeRef nonExistingTarget = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, "1");
final QName assoc = ContentModel.ASSOC_CONTAINS;
nodeService.createAssociation(nodeRef, nodeRef, assoc);
assertThat(nodeRef).doesNotHaveTargetAssociationTo(assoc, nonExistingTarget);
}
示例15: getNodeRef
private NodeRef getNodeRef(String id)
{
AuthenticationUtil.setFullyAuthenticatedUser(user1);
// The following call to new NodeRef(...) returns a NodeRef like:
// workspace://SpacesStore/9db76769-96de-4de4-bdb4-a127130af362
// We call tenantService.getName(nodeRef) to get a fully qualified NodeRef as Solr returns this.
// They look like:
// workspace://@[email protected]/9db76769-96de-4de4-bdb4-a127130af362
NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, id);
nodeRef = tenantService.getName(nodeRef);
return nodeRef;
}