@Test @LogCaptureFeature.FilterOn(logLevel = "WARN") public void testGetTagOnDocumentWithMissingFacet() { DocumentModel relation = session.createDocumentModel("/", "foo", "Relation"); relation = session.createDocument(relation); session.save(); tagService.getTags(session, relation.getId()); assertTrue(logCaptureResult.getCaughtEventMessages().isEmpty()); }
@SuppressWarnings("unchecked") protected List<Map<String, Serializable>> getTags(DocumentModel docModel) { if (docModel.hasFacet(TAG_FACET)) { return (List<Map<String, Serializable>>) docModel.getPropertyValue(TAG_LIST); } else { return new ArrayList<>(); } }
FacetedTagService extends AbstractTagService { @SuppressWarnings("unchecked") protected List<Map<String, Serializable>> getTags(DocumentModel docModel) { if (docModel.hasFacet(TAG_FACET)) { return (List<Map<String, Serializable>>) docModel.getPropertyValue(TAG_LIST); } else { return new ArrayList<>(); } } }
FacetedTagService extends AbstractTagService { @SuppressWarnings("unchecked") protected List<Map<String, Serializable>> getTags(DocumentModel docModel) { if (docModel.hasFacet(TAG_FACET)) { return (List<Map<String, Serializable>>) docModel.getPropertyValue(TAG_LIST); } else { return new ArrayList<>(); } }  }
FacetedTagService extends AbstractTagService { @SuppressWarnings("unchecked") protected List<Map<String, Serializable>> getTags(DocumentModel docModel) { if (docModel.hasFacet(TAG_FACET)) { return (List<Map<String, Serializable>>) docModel.getPropertyValue(TAG_LIST); } else { return new ArrayList<>(); } }  @Override boolean hasFeature(Feature feature); @Override boolean supportsTag(CoreSession session, String docId); @Override void doTag(CoreSession session, String docId, String label, String username); @Override void doUntag(CoreSession session, String docId, String label); @Override boolean canUntag(CoreSession session, String docId, String label); @Override Set<String> doGetTags(CoreSession session, String docId); @Override void doCopyTags(CoreSession session, String srcDocId, String dstDocId, boolean removeExistingTags); @Override List<String> doGetTagDocumentIds(CoreSession session, String label); @Override Set<String> doGetTagSuggestions(CoreSession session, String label); @Override List<Tag> getTagCloud(CoreSession session, String docId, String username, Boolean normalize); }
FacetedTagService extends AbstractTagService { @SuppressWarnings("unchecked") protected List<Map<String, Serializable>> getTags(DocumentModel docModel) { if (docModel.hasFacet(TAG_FACET)) { return (List<Map<String, Serializable>>) docModel.getPropertyValue(TAG_LIST); } else { return new ArrayList<>(); } }  @Override boolean hasFeature(Feature feature); @Override boolean supportsTag(CoreSession session, String docId); @Override void doTag(CoreSession session, String docId, String label, String username); @Override void doUntag(CoreSession session, String docId, String label); @Override boolean canUntag(CoreSession session, String docId, String label); @Override Set<String> doGetTags(CoreSession session, String docId); @Override void doCopyTags(CoreSession session, String srcDocId, String dstDocId, boolean removeExistingTags); @Override List<String> doGetTagDocumentIds(CoreSession session, String label); @Override Set<String> doGetTagSuggestions(CoreSession session, String label); @Override List<Tag> getTagCloud(CoreSession session, String docId, String username, Boolean normalize); static final String LABEL_PROPERTY; static final String USERNAME_PROPERTY; static final String DISABLE_VERSIONING; }