@Test public void testCommonSchemas() throws Exception { List<DocumentModel> docs = createTestDocuments(); List<String> commonSchemas = BulkEditHelper.getCommonSchemas(docs); assertFalse(commonSchemas.isEmpty()); assertEquals(5, commonSchemas.size()); assertTrue(commonSchemas.contains("uid")); assertTrue(commonSchemas.contains("dublincore")); assertTrue(commonSchemas.contains("common")); assertTrue(commonSchemas.contains("files")); assertTrue(commonSchemas.contains("relatedtext")); assertFalse(commonSchemas.contains("note")); assertFalse(commonSchemas.contains("file")); }
public static List<String> getCommonSchemas(List<DocumentModel> docs) { List<String> schemas = null; for (DocumentModel doc : docs) { List<String> docSchemas = Arrays.asList(doc.getSchemas()); if (schemas == null) { schemas = new ArrayList<String>(); schemas.addAll(docSchemas); } else { schemas.retainAll(docSchemas); } } return schemas; }
BulkEditHelper { public static List<String> getCommonSchemas(List<DocumentModel> docs) { List<String> schemas = null; for (DocumentModel doc : docs) { List<String> docSchemas = Arrays.asList(doc.getSchemas()); if (schemas == null) { schemas = new ArrayList<String>(); schemas.addAll(docSchemas); } else { schemas.retainAll(docSchemas); } } return schemas; } }
BulkEditHelper { public static List<String> getCommonSchemas(List<DocumentModel> docs) { List<String> schemas = null; for (DocumentModel doc : docs) { List<String> docSchemas = Arrays.asList(doc.getSchemas()); if (schemas == null) { schemas = new ArrayList<String>(); schemas.addAll(docSchemas); } else { schemas.retainAll(docSchemas); } } return schemas; } private  BulkEditHelper(); }
BulkEditHelper { public static List<String> getCommonSchemas(List<DocumentModel> docs) { List<String> schemas = null; for (DocumentModel doc : docs) { List<String> docSchemas = Arrays.asList(doc.getSchemas()); if (schemas == null) { schemas = new ArrayList<String>(); schemas.addAll(docSchemas); } else { schemas.retainAll(docSchemas); } } return schemas; } 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 { public static List<String> getCommonSchemas(List<DocumentModel> docs) { List<String> schemas = null; for (DocumentModel doc : docs) { List<String> docSchemas = Arrays.asList(doc.getSchemas()); if (schemas == null) { schemas = new ArrayList<String>(); schemas.addAll(docSchemas); } else { schemas.retainAll(docSchemas); } } return schemas; } 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; }