本文整理汇总了Java中org.alfresco.webservice.types.Store类的典型用法代码示例。如果您正苦于以下问题:Java Store类的具体用法?Java Store怎么用?Java Store使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Store类属于org.alfresco.webservice.types包,在下文中一共展示了Store类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testWrite
import org.alfresco.webservice.types.Store; //导入依赖的package包/类
@Test
public void testWrite() throws Exception {
RepositoryServiceSoapBindingStub aRepoService = nodeWriter.getAlfrescoService().getRepositoryService();
CML aCML = createDefaultMockResult(aRepoService, "Test Batch Writer Content", "Text content", "/app:company_home/cm:Test_x0020_Batch_x0020_Writer/cm:Test_x0020_Batch_x0020_Writer_x0020_Content", "00000000-0000-0000-0000-000000000003", false);
List<NodeList> aData = createDefaultNodeListList("Test Batch Writer Content", "Text content", "cm:Test_x0020_Batch_x0020_Writer_x0020_Content", null, false);
compositeWriter.write(aData);
// Verify sent CML
verify(aRepoService, times(1)).update(eq(aCML));
verify(aRepoService, times(0)).query(any(Store.class), any(Query.class), anyBoolean());
verify(aRepoService, times(3)).get(any(Predicate.class));
RestTemplate aRestTemplate = contentWriter.getRestTemplate();
verify(aRestTemplate, times(1)).put(any(String.class), any(Object.class), Matchers.<Map<String,?>>any());
}
示例2: testConvertFullPath
import org.alfresco.webservice.types.Store; //导入依赖的package包/类
@Test
public void testConvertFullPath() throws Exception {
List<String> aResult = categoryConverter.convert("/cm:generalclassifiable/cm:Regions/cm:EUROPE/cm:Western Europe/cm:France");
assertNotNull(aResult);
assertEquals(1, aResult.size());
aResult = categoryConverter.convert("/cm:generalclassifiable/cm:Regions/cm:EUROPE/cm:Western Europe/cm:France");
assertNotNull(aResult);
assertEquals(1, aResult.size());
aResult = categoryConverter.convert("/cm:generalclassifiable/cm:Regions/cm:EUROPE/cm:Western Europe/cm:France");
assertNotNull(aResult);
assertEquals(1, aResult.size());
assertEquals(NODE_REF1, aResult.get(0));
verify(repoService, times(1)).query(any(Store.class), any(Query.class), anyBoolean());
}
示例3: testWriteEmpty
import org.alfresco.webservice.types.Store; //导入依赖的package包/类
@Test
public void testWriteEmpty() throws Exception {
List<NodeList> aData = new ArrayList<NodeList>();
nodeWriter.write(aData);
RepositoryServiceSoapBindingStub aRepoService = nodeWriter.getAlfrescoService().getRepositoryService();
verify(aRepoService, times(0)).update(any(CML.class));
verify(aRepoService, times(0)).query(any(Store.class), any(Query.class), anyBoolean());
verify(aRepoService, times(0)).get(any(Predicate.class));
}
示例4: testWrite
import org.alfresco.webservice.types.Store; //导入依赖的package包/类
@Test
@DirtiesContext
public void testWrite() throws Exception {
RepositoryServiceSoapBindingStub aRepoService = nodeWriter.getAlfrescoService().getRepositoryService();
CML aCML = createDefaultMockResult(aRepoService, "Test Batch Writer Content", "Text content", "/app:company_home/cm:Test_x0020_Batch_x0020_Writer/cm:Test_x0020_Batch_x0020_Writer_x0020_Content", "00000000-0000-0000-0000-000000000003", false);
List<NodeList> aData = createDefaultNodeListList("Test Batch Writer Content", "Text content", "cm:Test_x0020_Batch_x0020_Writer_x0020_Content", null, false);
nodeWriter.write(aData);
// Verify sent CML
verify(aRepoService, times(1)).update(eq(aCML));
verify(aRepoService, times(0)).query(any(Store.class), any(Query.class), anyBoolean());
verify(aRepoService, times(3)).get(any(Predicate.class));
updateMockContext(aRepoService, "00000000-0000-0000-0000-000000000003", "/app:company_home/cm:Test_x0020_Batch_x0020_Writer/cm:Test_x0020_Batch_x0020_Writer_x0020_Content");
aCML = new CML();
ParentReference aFolderReference = new ParentReference(fr.acxio.tools.agia.alfresco.AlfrescoServicesConsumer.STORE, null, "/app:company_home/cm:Test_x0020_Batch_x0020_Writer", Constants.ASSOC_CONTAINS, "{http://www.alfresco.org/model/content/1.0}Test Batch Writer Content 2");
NamedValue aDocumentNameProperty = new NamedValue("{http://www.alfresco.org/model/content/1.0}name", false, "Test Batch Writer Content 2", null);
NamedValue aDocumentTitleProperty = new NamedValue("{http://www.alfresco.org/model/content/1.0}title", false, "Text content", null);
CMLCreate aDocumentCreate = new CMLCreate("2", aFolderReference, null, null, null, "{http://www.alfresco.org/model/content/1.0}content", new NamedValue[] {aDocumentNameProperty, aDocumentTitleProperty});
CMLAddAspect aDocumentAspect = new CMLAddAspect("{http://www.alfresco.org/model/content/1.0}titled", null, null, "2");
FileInputStream aInputStream = new FileInputStream("src/test/resources/testFiles/content1.pdf");
CMLWriteContent aDocumentContent = new CMLWriteContent(Constants.PROP_CONTENT, ContentUtils.convertToByteArray(aInputStream), new ContentFormat("application/pdf", null), null, "2");
aCML.setAddAspect(new CMLAddAspect[] {aDocumentAspect});
aCML.setCreate(new CMLCreate[] {aDocumentCreate});
aCML.setWriteContent(new CMLWriteContent[] {aDocumentContent});
aCML.setCreateAssociation(new CMLCreateAssociation[] {});
aCML.setUpdate(new CMLUpdate[] {});
aCML.setDelete(new CMLDelete[] {});
UpdateResult[] aUpdateResult2 = new UpdateResult[1];
aUpdateResult2[0] = new UpdateResult();
aUpdateResult2[0].setDestination(new Reference(fr.acxio.tools.agia.alfresco.AlfrescoServicesConsumer.STORE, "00000000-0000-0000-0000-000000000004", "/app:company_home/cm:Test_x0020_Batch_x0020_Writer/cm:Test_x0020_Batch_x0020_Writer_x0020_Content_2"));
when(aRepoService.update(eq(aCML))).thenReturn(aUpdateResult2);
aData = createDefaultNodeListList("Test Batch Writer Content 2", "Text content", "cm:Test_x0020_Batch_x0020_Writer_x0020_Content_x0020_2", null, false);
nodeWriter.write(aData);
// Verify sent CML
verify(aRepoService, times(1)).update(eq(aCML));
verify(aRepoService, times(0)).query(any(Store.class), any(Query.class), anyBoolean());
verify(aRepoService, times(4)).get(any(Predicate.class));
}
示例5: testWriteUpdate
import org.alfresco.webservice.types.Store; //导入依赖的package包/类
@Test
@DirtiesContext
public void testWriteUpdate() throws Exception {
RepositoryServiceSoapBindingStub aRepoService = nodeWriter.getAlfrescoService().getRepositoryService();
CML aCML = createDefaultMockResult(aRepoService, "Test Batch Writer ContentU", "Text content", "/app:company_home/cm:Test_x0020_Batch_x0020_Writer/cm:Test_x0020_Batch_x0020_Writer_x0020_ContentU", "00000000-0000-0000-0000-000000000004", true);
List<NodeList> aData = createDefaultNodeListList("Test Batch Writer ContentU", "Text content", "cm:Test_x0020_Batch_x0020_Writer_x0020_ContentU", null, true);
nodeWriter.write(aData);
// Verify sent CML
verify(aRepoService, times(1)).update(eq(aCML));
verify(aRepoService, times(0)).query(any(Store.class), any(Query.class), anyBoolean());
verify(aRepoService, times(3)).get(any(Predicate.class));
updateMockContext(aRepoService, "00000000-0000-0000-0000-000000000004", "/app:company_home/cm:Test_x0020_Batch_x0020_Writer/cm:Test_x0020_Batch_x0020_Writer_x0020_ContentU");
aCML = new CML();
NamedValue aDocumentNameProperty = new NamedValue("{http://www.alfresco.org/model/content/1.0}name", false, "Test Batch Writer ContentU", null);
NamedValue aDocumentTitleProperty = new NamedValue("{http://www.alfresco.org/model/content/1.0}title", false, "Text content UPDATED", null);
Reference aDocReference = new Reference(AlfrescoServicesConsumer.STORE, "00000000-0000-0000-0000-000000000004", "/app:company_home/cm:Test_x0020_Batch_x0020_Writer/cm:Test_x0020_Batch_x0020_Writer_x0020_ContentU");
Predicate sWhereNode = new Predicate(new Reference[] {aDocReference}, null, null);
CMLUpdate aDocumentUpdate = new CMLUpdate(new NamedValue[] {aDocumentNameProperty, aDocumentTitleProperty}, sWhereNode, null);
CMLAddAspect aDocumentAspect = new CMLAddAspect("{http://www.alfresco.org/model/content/1.0}titled", null, sWhereNode, null);
FileInputStream aInputStream = new FileInputStream("src/test/resources/testFiles/content1.pdf");
CMLWriteContent aDocumentContent = new CMLWriteContent(Constants.PROP_CONTENT, ContentUtils.convertToByteArray(aInputStream), new ContentFormat("application/pdf", null), sWhereNode, null);
aCML.setAddAspect(new CMLAddAspect[] {aDocumentAspect});
aCML.setCreate(new CMLCreate[] {});
aCML.setWriteContent(new CMLWriteContent[] {aDocumentContent});
aCML.setCreateAssociation(new CMLCreateAssociation[] {});
aCML.setUpdate(new CMLUpdate[] {aDocumentUpdate});
aCML.setDelete(new CMLDelete[] {});
UpdateResult[] aUpdateResult2 = new UpdateResult[1];
aUpdateResult2[0] = new UpdateResult();
aUpdateResult2[0].setDestination(new Reference(fr.acxio.tools.agia.alfresco.AlfrescoServicesConsumer.STORE, "00000000-0000-0000-0000-000000000004", "/app:company_home/cm:Test_x0020_Batch_x0020_Writer/cm:Test_x0020_Batch_x0020_Writer_x0020_ContentU"));
when(aRepoService.update(eq(aCML))).thenReturn(aUpdateResult2);
aData = createDefaultNodeListList("Test Batch Writer ContentU", "Text content UPDATED", "cm:Test_x0020_Batch_x0020_Writer_x0020_ContentU", VersionOperation.UPDATE, false);
nodeWriter.write(aData);
// Verify sent CML
verify(aRepoService, times(1)).update(eq(aCML));
verify(aRepoService, times(0)).query(any(Store.class), any(Query.class), anyBoolean());
verify(aRepoService, times(3)).get(any(Predicate.class));
}
示例6: testWrite
import org.alfresco.webservice.types.Store; //导入依赖的package包/类
@Test
public void testWrite() throws Exception {
List<NodeList> aData = new ArrayList<NodeList>();
NodeList aNodeList = new NodeList();
Folder aRootFolder = new Folder();
aRootFolder.setParent(null);
aRootFolder.setType(new QName("cm:folder", namespaceContext));
aRootFolder.addProperty(new Property(new QName("cm:name", namespaceContext), "company_home"));
aRootFolder.setPathElement("app:company_home");
Folder aTestFolder = new Folder();
aTestFolder.setParent(aRootFolder);
aRootFolder.addFolder(aTestFolder);
aTestFolder.setType(new QName("cm:folder", namespaceContext));
aTestFolder.addProperty(new Property(new QName("cm:name", namespaceContext), "Test Batch Writer"));
aTestFolder.setPathElement("cm:Test_x0020_Batch_x0020_Writer");
Document aDocument = new Document();
aDocument.setParent(aTestFolder);
aTestFolder.addDocument(aDocument);
aDocument.setType(new QName("cm:content", namespaceContext));
aDocument.addProperty(new Property(new QName("cm:name", namespaceContext), "Test Batch Writer Content"));
aDocument.addProperty(new Property(new QName("cm:title", namespaceContext), "Text content"));
aDocument.addAspect(new Aspect(new QName("cm:titled", namespaceContext)));
aDocument.setContentPath("src/test/resources/testFiles/content1.pdf");
aDocument.setMimeType("application/pdf");
aDocument.setPathElement("cm:Test_x0020_Batch_x0020_Writer_x0020_Content");
aNodeList.add(aRootFolder);
aNodeList.add(aTestFolder);
aNodeList.add(aDocument);
aData.add(aNodeList);
nodeWriter.write(aData);
// Verify sent CML
RepositoryServiceSoapBindingStub aRepoService = nodeWriter.getAlfrescoService().getRepositoryService();
CML aCML = new CML();
ParentReference aRootfolderReference = new ParentReference(fr.acxio.tools.agia.alfresco.AlfrescoServicesConsumer.STORE, null, "/app:company_home", Constants.ASSOC_CONTAINS, "{http://www.alfresco.org/model/content/1.0}Test Batch Writer");
NamedValue aFolderNameProperty = new NamedValue("{http://www.alfresco.org/model/content/1.0}name", false, "Test Batch Writer", null);
CMLCreate aFolderCreate = new CMLCreate("1", aRootfolderReference, null, null, null, "{http://www.alfresco.org/model/content/1.0}folder", new NamedValue[] {aFolderNameProperty});
ParentReference aFolderReference = new ParentReference(fr.acxio.tools.agia.alfresco.AlfrescoServicesConsumer.STORE, null, "/app:company_home/cm:Test_x0020_Batch_x0020_Writer", Constants.ASSOC_CONTAINS, "{http://www.alfresco.org/model/content/1.0}Test Batch Writer Content");
NamedValue aDocumentNameProperty = new NamedValue("{http://www.alfresco.org/model/content/1.0}name", false, "Test Batch Writer Content", null);
NamedValue aDocumentTitleProperty = new NamedValue("{http://www.alfresco.org/model/content/1.0}title", false, "Text content", null);
CMLCreate aDocumentCreate = new CMLCreate("2", aFolderReference, null, null, null, "{http://www.alfresco.org/model/content/1.0}content", new NamedValue[] {aDocumentNameProperty, aDocumentTitleProperty});
CMLAddAspect aDocumentAspect = new CMLAddAspect("{http://www.alfresco.org/model/content/1.0}titled", null, null, "2");
FileInputStream aInputStream = new FileInputStream("src/test/resources/testFiles/content1.pdf");
CMLWriteContent aDocumentContent = new CMLWriteContent(Constants.PROP_CONTENT, ContentUtils.convertToByteArray(aInputStream), new ContentFormat("application/pdf", null), null, "2");
aCML.setAddAspect(new CMLAddAspect[] {aDocumentAspect});
aCML.setCreate(new CMLCreate[] {aFolderCreate, aDocumentCreate});
aCML.setWriteContent(new CMLWriteContent[] {aDocumentContent});
aCML.setCreateAssociation(new CMLCreateAssociation[] {});
aCML.setUpdate(new CMLUpdate[] {});
aCML.setDelete(new CMLDelete[] {});
verify(aRepoService, times(1)).update(eq(aCML));
verify(aRepoService, times(0)).query(any(Store.class), any(Query.class), anyBoolean());
verify(aRepoService, times(3)).get(any(Predicate.class));
}
示例7: getStoreRef
import org.alfresco.webservice.types.Store; //导入依赖的package包/类
/**
* Gets the store reference string for a given Store object.
*
* @param store the store
* @return String the store reference string
*/
public static String getStoreRef(Store store)
{
return store.getScheme() + "://" + store.getAddress();
}