QName safeQName = QName.createQNameWithValidLocalName(NamespaceService.CONTENT_MODEL_1_0_URI, workingName);
QName safeQName = QName.createQNameWithValidLocalName(NamespaceService.CONTENT_MODEL_1_0_URI, workingName);
ContentModel.PROP_NAME); QName childAssocQName = QName .createQNameWithValidLocalName(VirtualContentModel.VIRTUAL_CONTENT_MODEL_1_0_URI, childName.toString()); if (qnamePattern.isMatch(childAssocQName))
ContentModel.PROP_NAME); QName childAssocQName = QName .createQNameWithValidLocalName(VirtualContentModel.VIRTUAL_CONTENT_MODEL_1_0_URI, childName.toString()); if (qnamePattern.isMatch(childAssocQName))
private void setUpTestAssociations(NodeRef actualNodeRef) rootChildrenQNames[0] = QName.createQNameWithValidLocalName(VirtualContentModel.VIRTUAL_CONTENT_MODEL_1_0_URI, "Node2"); rootChildrenQNames[1] = QName.createQNameWithValidLocalName(VirtualContentModel.VIRTUAL_CONTENT_MODEL_1_0_URI, "Node1"); node2ChildNameString); node2Test1_2_TXTNodeRef = node2ChildAssoc.getChildRef(); rootChildrenQNames[2] = QName.createQNameWithValidLocalName(NamespaceService.CONTENT_MODEL_1_0_URI, node2ChildNameString); node2ChildrenQNames[0] = QName.createQNameWithValidLocalName(VirtualContentModel.VIRTUAL_CONTENT_MODEL_1_0_URI, "Node2_1"); node2ChildrenQNames[1] = node2ChildAssoc.getQName(); rootChildrenQNames[2 + i] = QName.createQNameWithValidLocalName(NamespaceService.CONTENT_MODEL_1_0_URI, childAssoc.getQName().getLocalName()); node2_1ChildrenQNames[i - 1] = childAssoc.getQName();
Serializable name = properties.get(ContentModel.PROP_NAME); QName assocChildName = QName .createQNameWithValidLocalName(VirtualContentModel.VIRTUAL_CONTENT_MODEL_1_0_URI, name.toString()); if (qnamePattern.isMatch(assocChildName))
Serializable name = properties.get(ContentModel.PROP_NAME); QName assocChildName = QName .createQNameWithValidLocalName(VirtualContentModel.VIRTUAL_CONTENT_MODEL_1_0_URI, name.toString()); if (qnamePattern.isMatch(assocChildName))
Serializable childName = refProperties.get(ContentModel.PROP_NAME); QName childAssocQName = QName .createQNameWithValidLocalName(VirtualContentModel.VIRTUAL_CONTENT_MODEL_1_0_URI, childName.toString()); ChildAssociationRef assoc = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS,
emailService.importMessage(delivery, m); QName safeQName = QName.createQNameWithValidLocalName(NamespaceService.CONTENT_MODEL_1_0_URI, TEST_CASE_SENSITIVITY_SUBJECT); List<ChildAssociationRef> assocs = nodeService.getChildAssocs(testUserHomeFolder, ContentModel.ASSOC_CONTAINS, safeQName); assertEquals(1, assocs.size()); emailService.importMessage(delivery, m); safeQName = QName.createQNameWithValidLocalName(NamespaceService.CONTENT_MODEL_1_0_URI, TEST_CASE_SENSITIVITY_SUBJECT.toUpperCase() + "(1)"); assocs = nodeService.getChildAssocs(testUserHomeFolder, ContentModel.ASSOC_CONTAINS, safeQName); assertEquals(1, assocs.size());
rootNodeRef, ContentModel.ASSOC_CHILDREN, QName.createQNameWithValidLocalName(NamespaceService.CONTENT_MODEL_1_0_URI, fileName), ContentModel.TYPE_CONTENT, props);
Serializable childName = refProperties.get(ContentModel.PROP_NAME); QName childAssocQName = QName .createQNameWithValidLocalName(VirtualContentModel.VIRTUAL_CONTENT_MODEL_1_0_URI, childName.toString()); ChildAssociationRef assoc = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS,
QName archiveAssocQName = QName.createQNameWithValidLocalName( NamespaceService.SYSTEM_MODEL_1_0_URI, archiveNodeName); addChild(userArchiveNodeRef, archiveNodeRef, ContentModel.ASSOC_ARCHIVED_LINK, archiveAssocQName);
QName archiveAssocQName = QName.createQNameWithValidLocalName( NamespaceService.SYSTEM_MODEL_1_0_URI, archiveNodeName); addChild(userArchiveNodeRef, archiveNodeRef, ContentModel.ASSOC_ARCHIVED_LINK, archiveAssocQName);
parentReference); QName vChildAssocQName = QName .createQNameWithValidLocalName(VirtualContentModel.VIRTUAL_CONTENT_MODEL_1_0_URI, actualChildAssocRef.getQName().getLocalName()); ChildAssociationRef childAssocRef = new ChildAssociationRef(actualChildAssocRef.getTypeQName(),
parentReference); QName vChildAssocQName = QName .createQNameWithValidLocalName(VirtualContentModel.VIRTUAL_CONTENT_MODEL_1_0_URI, actualChildAssocRef.getQName().getLocalName()); ChildAssociationRef childAssocRef = new ChildAssociationRef(actualChildAssocRef.getTypeQName(),
parent); assertNotNull(firstAssoc.getQName()); assertEquals(QName.createQNameWithValidLocalName(VirtualContentModel.VIRTUAL_CONTENT_MODEL_1_0_URI, "Node2"), firstAssoc.getQName());
@Test public void testGetPrimaryParent() throws Exception { // check that the primary parent node of level 1 virtual folder is // actual folder and not the root node from json template NodeRef node2 = nodeService.getChildByName(virtualFolder1NodeRef, ContentModel.ASSOC_CONTAINS, "Node2"); assertNotNull(node2); ChildAssociationRef primaryParent = nodeService.getPrimaryParent(node2); assertNotNull(primaryParent); NodeRef parentRef = primaryParent.getParentRef(); assertEquals(virtualFolder1NodeRef, parentRef); assertEquals(QName .createQNameWithValidLocalName(VirtualContentModel.VIRTUAL_CONTENT_MODEL_1_0_URI, "Node2"),primaryParent.getQName()); // check that the primary parent node of level 2 virtual folder is his // virtual folder parent NodeRef node2_1 = nodeService.getChildByName(node2, ContentModel.ASSOC_CONTAINS, "Node2_1"); assertNotNull(node2_1); primaryParent = nodeService.getPrimaryParent(node2_1); assertNotNull(primaryParent); parentRef = primaryParent.getParentRef(); assertEquals(node2, parentRef); }