@Test public void testGetPropertiesToCopy() { DocumentModel doc = new SimpleDocumentModel("dublincore"); ScopedMap map = doc.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:coverage dc:subjects", true); map.put(BulkEditHelper.BULK_EDIT_PREFIX + "dc:creator", true); List<String> propertiesToCopy = BulkEditHelper.getPropertiesToCopy(doc); assertEquals(4, propertiesToCopy.size()); assertTrue(propertiesToCopy.contains("dc:title")); assertTrue(propertiesToCopy.contains("dc:coverage")); assertTrue(propertiesToCopy.contains("dc:subjects")); assertTrue(propertiesToCopy.contains("dc:creator")); assertFalse(propertiesToCopy.contains("dc:description")); }
@Deprecated protected static List<String> getPropertiesToCopy(DocumentModel sourceDoc) { List<String> propertiesToCopy = new ArrayList<String>(); for (Map.Entry<String, Serializable> entry : sourceDoc.getContextData().entrySet()) { String key = entry.getKey(); if (key.startsWith(BULK_EDIT_PREFIX)) { String[] properties = key.replace(BULK_EDIT_PREFIX, "").split( " "); Serializable value = entry.getValue(); if (value instanceof Boolean && (Boolean) value) { for (String property : properties) { if (!property.startsWith(CONTEXT_DATA)) { propertiesToCopy.add(property); } } } } } return propertiesToCopy; }
BulkEditHelper { @Deprecated protected static List<String> getPropertiesToCopy(DocumentModel sourceDoc) { List<String> propertiesToCopy = new ArrayList<String>(); for (Map.Entry<String, Serializable> entry : sourceDoc.getContextData().entrySet()) { String key = entry.getKey(); if (key.startsWith(BULK_EDIT_PREFIX)) { String[] properties = key.replace(BULK_EDIT_PREFIX, "").split( " "); Serializable value = entry.getValue(); if (value instanceof Boolean && (Boolean) value) { for (String property : properties) { if (!property.startsWith(CONTEXT_DATA)) { propertiesToCopy.add(property); } } } } } return propertiesToCopy; } }
BulkEditHelper { @Deprecated protected static List<String> getPropertiesToCopy(DocumentModel sourceDoc) { List<String> propertiesToCopy = new ArrayList<String>(); for (Map.Entry<String, Serializable> entry : sourceDoc.getContextData().entrySet()) { String key = entry.getKey(); if (key.startsWith(BULK_EDIT_PREFIX)) { String[] properties = key.replace(BULK_EDIT_PREFIX, "").split( " "); Serializable value = entry.getValue(); if (value instanceof Boolean && (Boolean) value) { for (String property : properties) { if (!property.startsWith(CONTEXT_DATA)) { propertiesToCopy.add(property); } } } } } return propertiesToCopy; } private  BulkEditHelper(); }
BulkEditHelper { @Deprecated protected static List<String> getPropertiesToCopy(DocumentModel sourceDoc) { List<String> propertiesToCopy = new ArrayList<String>(); for (Map.Entry<String, Serializable> entry : sourceDoc.getContextData().entrySet()) { String key = entry.getKey(); if (key.startsWith(BULK_EDIT_PREFIX)) { String[] properties = key.replace(BULK_EDIT_PREFIX, "").split( " "); Serializable value = entry.getValue(); if (value instanceof Boolean && (Boolean) value) { for (String property : properties) { if (!property.startsWith(CONTEXT_DATA)) { propertiesToCopy.add(property); } } } } } return propertiesToCopy; } 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 protected static List<String> getPropertiesToCopy(DocumentModel sourceDoc) { List<String> propertiesToCopy = new ArrayList<String>(); for (Map.Entry<String, Serializable> entry : sourceDoc.getContextData().entrySet()) { String key = entry.getKey(); if (key.startsWith(BULK_EDIT_PREFIX)) { String[] properties = key.replace(BULK_EDIT_PREFIX, "").split( " "); Serializable value = entry.getValue(); if (value instanceof Boolean && (Boolean) value) { for (String property : properties) { if (!property.startsWith(CONTEXT_DATA)) { propertiesToCopy.add(property); } } } } } return propertiesToCopy; } 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; }