Class CmsDefaultResourceStatusProvider


  • public class CmsDefaultResourceStatusProvider
    extends java.lang.Object
    Helper class to generate all the data which is necessary for the resource status dialog(s).

    • Method Detail

      • getContainerpageRelationTargets

        public static CmsRelationTargetListBean getContainerpageRelationTargets​(CmsObject cms,
                                                                                CmsUUID source,
                                                                                java.util.List<CmsUUID> additionalIds,
                                                                                boolean cancelIfChanged)
                                                                         throws CmsException
        Gets the relation targets for a resource.

        Parameters:
        cms - the current CMS context
        source - the structure id of the resource for which we want the relation targets
        additionalIds - the structure ids of additional resources to include with the relation targets
        cancelIfChanged - if this is true, this method will stop immediately if it finds a changed resource among the relation targets
        Returns:
        a bean containing a list of relation targets
        Throws:
        CmsException - if something goes wrong
      • getContainerpageRelationTargetsLimited

        public static CmsRelationTargetListBean getContainerpageRelationTargetsLimited​(CmsObject cms,
                                                                                       CmsUUID source,
                                                                                       java.util.List<CmsUUID> additionalIds,
                                                                                       boolean cancelIfChanged)
                                                                                throws CmsException,
                                                                                       org.opencms.gwt.CmsDefaultResourceStatusProvider.TooManyRelationsException
        Gets the relation targets for a resource.

        Parameters:
        cms - the current CMS context
        source - the structure id of the resource for which we want the relation targets
        additionalIds - the structure ids of additional resources to include with the relation targets
        cancelIfChanged - if this is true, this method will stop immediately if it finds a changed resource among the relation targets
        Returns:
        a bean containing a list of relation targets
        Throws:
        CmsException - if something goes wrong
        org.opencms.gwt.CmsDefaultResourceStatusProvider.TooManyRelationsException - if too many relations are found
      • getFormatterInfo

        public static java.util.Map<java.lang.String,​java.lang.String> getFormatterInfo​(CmsObject cms,
                                                                                              I_CmsFormatterBean bean)
        Gets the additional information related to the formatter.
        Parameters:
        cms - the CMS context
        bean - the formatter bean
        Returns:
        the additional information about the formatter
      • getResourceStatus

        public CmsResourceStatusBean getResourceStatus​(javax.servlet.http.HttpServletRequest request,
                                                       CmsObject cms,
                                                       CmsUUID structureId,
                                                       java.lang.String contentLocale,
                                                       boolean includeTargets,
                                                       CmsUUID detailContentId,
                                                       java.util.List<CmsUUID> additionalStructureIds,
                                                       java.util.Map<java.lang.String,​java.lang.String> context)
                                                throws CmsException
        Collects all the data to display in the resource status dialog.

        Parameters:
        request - the current request
        cms - the current CMS context
        structureId - the structure id of the resource for which we want the information
        contentLocale - the content locale
        includeTargets - true if relation targets should be included
        detailContentId - the structure id of the detail content if present
        additionalStructureIds - structure ids of additional resources to include with the relation targets
        context - context parameters used for displaying additional infos
        Returns:
        the resource status information
        Throws:
        CmsException - if something goes wrong
      • sortRelations

        public void sortRelations​(CmsObject cms,
                                  CmsResourceStatusBean resStatus)
        Sorts relation beans from other sites by site order.

        Parameters:
        cms - the current CMS context
        resStatus - the bean in which to sort the relation beans
      • getTargets

        protected java.util.List<CmsResourceStatusRelationBeangetTargets​(CmsObject cms,
                                                                           java.lang.String locale,
                                                                           CmsResource resource,
                                                                           java.util.List<CmsUUID> additionalStructureIds)
                                                                    throws CmsException,
                                                                           org.opencms.gwt.CmsDefaultResourceStatusProvider.TooManyRelationsException
        Gets the list of relation targets for a resource.

        Parameters:
        cms - the current CMS context
        locale - the locale
        resource - the resource for which we want the relation targets
        additionalStructureIds - structure ids of additional resources to include with the relation target
        Returns:
        the list of relation beans for the relation targets
        Throws:
        CmsException - if something goes wrong
        org.opencms.gwt.CmsDefaultResourceStatusProvider.TooManyRelationsException - if too many relations are found