@Test public void testCopyMetadata() throws Exception { List<DocumentModel> docs = createTestDocuments(); Framework.getLocalService(EventService.class).waitForAsyncCompletion(); List<String> commonSchemas = BulkEditHelper.getCommonSchemas(docs); DocumentModel sourceDoc = new SimpleDocumentModel(commonSchemas); sourceDoc.setProperty("dublincore", "title", "new title"); sourceDoc.setProperty("dublincore", "description", "new description"); sourceDoc.setPropertyValue("dublincore:creator", "new creator"); sourceDoc.setPropertyValue("dc:source", "new source"); ScopedMap map = sourceDoc.getContextData(); map.put(BulkEditHelper.BULK_EDIT_PREFIX + "dc:title", true); map.put(BulkEditHelper.BULK_EDIT_PREFIX + "dc:description", false); map.put(BulkEditHelper.BULK_EDIT_PREFIX + "dc:creator", true); map.put(BulkEditHelper.BULK_EDIT_PREFIX + "dc:source", false); BulkEditHelper.copyMetadata(session, sourceDoc, docs); for (DocumentModel doc : docs) { assertEquals("new title", doc.getPropertyValue("dc:title")); assertEquals("new creator", doc.getProperty("dc:creator").getValue()); assertFalse("new description".equals(doc.getPropertyValue("dc:description"))); assertFalse("new source".equals(doc.getPropertyValue("dc:source"))); } }
@Deprecated public static void copyMetadata(CoreSession session, DocumentModel sourceDoc, List<DocumentModel> targetDocs) throws ClientException { Framework.getLocalService(BulkEditService.class).updateDocuments(session, sourceDoc, targetDocs); }
BulkEditHelper { @Deprecated public static void copyMetadata(CoreSession session, DocumentModel sourceDoc, List<DocumentModel> targetDocs) throws ClientException { Framework.getLocalService(BulkEditService.class).updateDocuments(session, sourceDoc, targetDocs); } }
BulkEditHelper { @Deprecated public static void copyMetadata(CoreSession session, DocumentModel sourceDoc, List<DocumentModel> targetDocs) throws ClientException { Framework.getLocalService(BulkEditService.class).updateDocuments(session, sourceDoc, targetDocs); } private  BulkEditHelper(); }
BulkEditHelper { @Deprecated public static void copyMetadata(CoreSession session, DocumentModel sourceDoc, List<DocumentModel> targetDocs) throws ClientException { Framework.getLocalService(BulkEditService.class).updateDocuments(session, sourceDoc, targetDocs); } private  BulkEditHelper(); static List<String> getCommonLayouts(TypeManager typeManager,
            List<DocumentModel> docs); static List<String> getCommonLayouts(TypeManager typeManager,
            List<DocumentModel> docs, String mode); static List<String> getCommonSchemas(List<DocumentModel> docs); @Deprecated static void copyMetadata(CoreSession session,
            DocumentModel sourceDoc, List<DocumentModel> targetDocs); }
BulkEditHelper { @Deprecated public static void copyMetadata(CoreSession session, DocumentModel sourceDoc, List<DocumentModel> targetDocs) throws ClientException { Framework.getLocalService(BulkEditService.class).updateDocuments(session, sourceDoc, targetDocs); } private  BulkEditHelper(); static List<String> getCommonLayouts(TypeManager typeManager,
            List<DocumentModel> docs); static List<String> getCommonLayouts(TypeManager typeManager,
            List<DocumentModel> docs, String mode); static List<String> getCommonSchemas(List<DocumentModel> docs); @Deprecated static void copyMetadata(CoreSession session,
            DocumentModel sourceDoc, List<DocumentModel> targetDocs); @Deprecated
    static final String BULK_EDIT_PREFIX; @Deprecated
    static final String CONTEXT_DATA; }