/** * Call-backs for start of Namespace scope */ private void walkStartNamespaces(ExporterCrawlerParameters parameters, Exporter exporter) { Collection<String> prefixes = namespaceService.getPrefixes(); for (String prefix : prefixes) { if (!prefix.equals("xml")) { String uri = namespaceService.getNamespaceURI(prefix); exporter.startNamespace(prefix, uri); } } }
/** * Call-backs for start of Namespace scope */ private void walkStartNamespaces(ExporterCrawlerParameters parameters, Exporter exporter) { Collection<String> prefixes = namespaceService.getPrefixes(); for (String prefix : prefixes) { if (!prefix.equals("xml")) { String uri = namespaceService.getNamespaceURI(prefix); exporter.startNamespace(prefix, uri); } } }
when(namespaceService.getNamespaceURI(NamespaceService.CONTENT_MODEL_PREFIX)) .thenReturn(NamespaceService.CONTENT_MODEL_1_0_URI); when(contextFactory.getDefaultIntialDirContext()).thenReturn(initialDirContext);
@Before public void setUp() throws Exception { namespaceService = mock(NamespaceService.class); Collection<String> cmAlways = new ArrayList<String>(); cmAlways.add("cm"); when(namespaceService.getPrefixes(anyString())).thenReturn(cmAlways); when(namespaceService.getNamespaceURI(anyString())).thenReturn("cm"); nodeService = mock(NodeService.class); Path rootPath = newPath(null, "/"); Path homeFolderPath = newPath(rootPath, "cm:homeFolder"); folderPath1 = newPath(homeFolderPath, "cm:folder1"); folderPath2 = newPath(homeFolderPath, "cm:folder2"); folder1 = newFolder(folderPath1); folder2 = newFolder(folderPath2); content1 = newContent(folderPath1, "cm:content1"); nodeInfoFactory = new NodeInfoFactory(nodeService, namespaceService); nodeChange = new NodeChange(nodeInfoFactory, namespaceService, content1); }
public NodeRef execute() throws Exception { // Check that the namespace is in the namespace service String uri = namespaceService.getNamespaceURI("test2"); assertNotNull(uri); Collection<ConstraintDefinition> constraints = dictionaryService.getConstraints(TEST_MODEL_TWO, true); assertEquals(1, constraints.size()); assertEquals("test2:con1", constraints.iterator().next().getName().getPrefixString()); // Update model NodeRef workingCopy = DictionaryModelTypeTest.this.cociService.checkout(modelNode); ContentWriter contentWriter2 = DictionaryModelTypeTest.this.contentService.getWriter(workingCopy, ContentModel.PROP_CONTENT, true); contentWriter2.putContent(MODEL_TWO_INVALID_XML); return workingCopy; } });
public NodeRef execute() throws Exception { // Check that the namespace is in the namespace service String uri = namespaceService.getNamespaceURI("test1"); assertNotNull(uri); // Create a model node PropertyMap properties = new PropertyMap(1); properties.put(QName.createQName("http://www.alfresco.org/test/testmodel1/1.0", "prop2"), "false"); // boolean NodeRef node = nodeService.createNode( rootNodeRef, ContentModel.ASSOC_CHILDREN, QName.createQName(NamespaceService.ALFRESCO_URI, "node1"), QName.createQName("http://www.alfresco.org/test/testmodel1/1.0", "base"), properties).getChildRef(); assertNotNull(node); return node; } }, false, true);
public NodeRef execute() throws Exception String uri = namespaceService.getNamespaceURI("test1"); assertNotNull(uri); String uri2 = DictionaryModelTypeTest.this.namespaceService.getNamespaceURI("test1"); assertEquals(uri2, "http://www.alfresco.org/test/testmodel1/1.0");
String uri = this.namespaceService.getNamespaceURI("test2"); assertNull(uri);
String uri = this.namespaceService.getNamespaceURI("test3"); assertNull(uri);
String uri = this.namespaceService.getNamespaceURI("test1"); assertNull(uri);
String uri = this.namespaceService.getNamespaceURI("test1"); assertNull(uri);