/** * Updates the type for a link xml element node.<p> * * @param element the link element node to update * @param type the relation type to set */ public static void updateType(Element element, CmsRelationType type) { updateAttribute(element, CmsLink.ATTRIBUTE_TYPE, type.getNameForXml()); }
/** * Updates the given xml element with this link information.<p> * * @param link the link to get the information from * @param element the <link> element to update */ public static void updateXmlForVfsFile(CmsLink link, Element element) { // if element is not null if (element != null) { // update the type attribute updateAttribute(element, CmsLink.ATTRIBUTE_TYPE, link.getType().getNameForXml()); // update the sub-elements updateXml(link, element, false); } }
/** * Returns all weak relation types.<p> * * @return a list of {@link CmsRelationType} objects */ public static List<CmsRelationType> getAllWeak() { return filterWeak(getAll()); }
/** * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) */ public int compare(CmsRelation r1, CmsRelation r2) { if (r1 == r2) { return 0; } String p1 = r1.getSourcePath() + r1.getTargetPath() + r1.getType().getId(); String p2 = r2.getSourcePath() + r2.getTargetPath() + r2.getType().getId(); return p1.compareTo(p2); } };
/** * Returns a localized name for the given relation type.<p> * * @param locale the locale * * @return a localized name */ public String getLocalizedName(Locale locale) { return getLocalizedName(Messages.get().getBundle(locale)); }
/** * Returns all relation types for relations defined in the content.<p> * * @return a list of {@link CmsRelationType} objects */ public static List getAllDefinedInContent() { return filterDefinedInContent(getAll()); }
/** * Returns all strong relation types.<p> * * @return a list of {@link CmsRelationType} objects */ public static List getAllStrong() { return filterStrong(getAll()); }
/** * Returns an extended filter with the given source relation path restriction.<p> * * @param path the source relation path to filter * * @return an extended filter with the given source relation path restriction */ public CmsRelationFilter filterPath(String path) { CmsRelationFilter filter = (CmsRelationFilter)clone(); filter.m_path = path; return filter; }
/** * Returns the number of not visible resources with broken links.<p> * * @return the number of not visible resources with broken links */ public int getNotVisibleResourcesCount() { if (m_resourcesWithBrokenLinks == null) { // compute it if needed getResourcesWithBrokenLinks(); } return m_notVisibleResourcesCount; }
/** * Utility method which prepares a filter for relations which point *to* a given structure id.<p> * * @param structureId the structure id * * @return the new relation filter */ public static CmsRelationFilter relationsToStructureId(CmsUUID structureId) { return TARGETS.filterStructureId(structureId); }
/** * Returns the string strong or weak.<p> * * @return the string strong or weak * * @see #isStrong() */ public String getType() { return isStrong() ? VALUE_STRONG : VALUE_WEAK; }
/** * Updates the given xml element with this link information.<p> * * @param link the link to get the information from * @param element the <link> element to update */ public static void updateXmlForVfsFile(CmsLink link, Element element) { // if element is not null if (element != null) { // update the type attribute updateAttribute(element, CmsLink.ATTRIBUTE_TYPE, link.getType().getNameForXml()); // update the sub-elements updateXml(link, element, false); } }
/** * Updates the type for a link xml element node.<p> * * @param element the link element node to update * @param type the relation type to set */ public static void updateType(Element element, CmsRelationType type) { updateAttribute(element, CmsLink.ATTRIBUTE_TYPE, type.getNameForXml()); }
/** * Returns all weak relation types.<p> * * @return a list of {@link CmsRelationType} objects */ public static List getAllWeak() { return filterWeak(getAll()); }
/** * Returns an extended filter that will extend the result to the given path and all its subresources.<p> * * @return an extended filter with including subresources */ public CmsRelationFilter filterIncludeChildren() { CmsRelationFilter filter = (CmsRelationFilter)clone(); filter.m_includeSubresources = true; return filter; }
/** * Returns the number of not visible resources with broken links.<p> * * @return the number of not visible resources with broken links */ public int getNotVisibleResourcesCount() { if (m_resourcesWithBrokenLinks == null) { // compute it if needed getResourcesWithBrokenLinks(); } return m_notVisibleResourcesCount; }
/** * Utility method which prepares a filter for relations which point *from* a given structure id.<p> * * @param structureId the structure id * * @return the new relation filter */ public static CmsRelationFilter relationsFromStructureId(CmsUUID structureId) { return SOURCES.filterStructureId(structureId); }
/** * Returns an extended filter that will extend the result to the given path and all its subresources.<p> * * @return an extended filter with including subresources */ public CmsRelationFilter filterIncludeChildren() { CmsRelationFilter filter = (CmsRelationFilter)this.clone(); filter.m_includeSubresources = true; return filter; }
/** * Returns an extended filter with the given structure id restriction.<p> * * @param structureId the structure id to filter * * @return an extended filter with the given structure id restriction */ public CmsRelationFilter filterStructureId(CmsUUID structureId) { CmsRelationFilter filter = (CmsRelationFilter)this.clone(); filter.m_structureId = structureId; return filter; }
/** * Returns an extended filter with the given source relation path restriction.<p> * * @param path the source relation path to filter * * @return an extended filter with the given source relation path restriction */ public CmsRelationFilter filterPath(String path) { CmsRelationFilter filter = (CmsRelationFilter)this.clone(); filter.m_path = path; return filter; }