Class ProjectsTransform

    • Field Detail

      • DISPLAY_IMAGE

        public static final int DISPLAY_IMAGE
        Allowed value for the displayFlag formal parameter. Indicates an image should be displayed next to each project.
        Value is 1
        See Also:
        Constant Field Values
      • DISPLAY_NAME

        public static final int DISPLAY_NAME
        Allowed value for the displayFlag formal parameter. Indicates the name of the project should be displayed.
        Value is 2
        See Also:
        Constant Field Values
      • DISPLAY_DESCRIPTION

        public static final int DISPLAY_DESCRIPTION
        Allowed value for the displayFlag formal parameter. Indicates the description of the project should be displayed.
        Value is 4
        See Also:
        Constant Field Values
      • DISPLAY_SERVER_NAME

        public static final int DISPLAY_SERVER_NAME
        Allowed value for the displayFlag formal parameter. Indicates the server name where this project is located should be displayed.
        Value is 8
        See Also:
        Constant Field Values
      • DISPLAY_ALL

        public static final int DISPLAY_ALL
        Allowed value for the displayFlag formal parameter. Convenience flag that indicates the image and all the information of the project should be displayed Value is 4294967295
        See Also:
        Constant Field Values
      • SORT_ASCENDING

        public static final int SORT_ASCENDING
        Allowed value for the sortOrder formal parameter. Convenience flag that indicates the sort order for the project list will be ascending Value is 0
        Since:
        MicroStrategy Web 8.0.0
        See Also:
        Constant Field Values
      • SORT_DESCENDING

        public static final int SORT_DESCENDING
        Allowed value for the sortOrder formal parameter. Convenience flag that indicates the sort order for the project list will be descending Value is 1
        Since:
        MicroStrategy Web 8.0.0
        See Also:
        Constant Field Values
      • SORT_KEY_DEFAULT

        public static final int SORT_KEY_DEFAULT
        Allowed value for the sortKey formal parameter. Convenience flag that indicates there will not be a particular sort key for the project list, they will be rendered in the same order as they were found. Value is 0
        Since:
        MicroStrategy Web 8.0.0
        See Also:
        Constant Field Values
      • SORT_KEY_PROJECT_NAME

        public static final int SORT_KEY_PROJECT_NAME
        Allowed value for the sortKey formal parameter. Convenience flag that indicates the sort for the project list will be based on the project name. Value is 1
        Since:
        MicroStrategy Web 8.0.0
        See Also:
        Constant Field Values
      • SORT_KEY_PROJECT_DESCRIPTION

        public static final int SORT_KEY_PROJECT_DESCRIPTION
        Allowed value for the sortKey formal parameter. Convenience flag that indicates the sort for the project list will be based on the project description. Value is 2
        Since:
        MicroStrategy Web 8.0.0
        See Also:
        Constant Field Values
      • SORT_KEY_ISERVER_NAME

        public static final int SORT_KEY_ISERVER_NAME
        Allowed value for the sortKey formal parameter. Convenience flag that indicates the sort for the project list will be based on the IServer name. Value is 3
        Since:
        MicroStrategy Web 8.0.0
        See Also:
        Constant Field Values
      • useStyleSorting

        public FormalParameter useStyleSorting
        Indicates the sorting settings to use for listing projects. Determines whether sort settings will be taken from formal parameter definitions such as sortOrder and sortKey, or if it should take into consideration sorting settings defined at the server configuration properties level.
        Since:
        MicroStrategy Web 9.0.0
      • sortOrder

        public FormalParameter sortOrder
        Indicates the order to be used for sorting the project list before rendering it to users. Valid values include those defined on the SORT_ASCENDING and SORT_DESCENDING constants.
        Since:
        MicroStrategy Web 8.0.0
      • imageProject

        public FormalParameter imageProject
        Deprecated.
        source of image for projects will be obtained from CSS style
        Indicates the image to be displayed next to each project.
        The value to indicate should be a valid image file name, with any necessary path information not included already on the resourcesFolderImage application configuration parameter. The image specified here will be rendered at the left of the project name when this transform generates the HTML code to output. The size of the image will be specified by the imageProjectWidth and imageProjectHeight formal parameters.
      • displayFlag

        public FormalParameter displayFlag
        Indicates the flag that indicates which information should be displayed about the project.
        The information may include object name, description and other information. Multiple fields might be rendered at the same time. For indicating which fields to show, the value to assign to this formal parameter should be a bitwise flag combining constants such as DISPLAY_NAME, DISPLAY_DESCRIPTION, etc. For a complete list, refer to ProjectsTransform.
        Usage: If name, description and server should be displayed, the value to assign to the formal parameter would be 17 (2 + 4 + 8). Default value is DISPLAY_ALL
      • numColumns

        public FormalParameter numColumns
        Indicates the number of columns to use on the table that will hold each one of the projects to render.
        The value indicates how the HTML table will be generated. By default, the number of columns it will have is 2.
      • imageProjectWidth

        public FormalParameter imageProjectWidth
        Deprecated.
        Size of image for projects will be obtained from CSS style
        Indicates the width of the image to be displayed next to each project.
        If the default image to use specified on the imageProject formal parameter is changed, chances are this value will need to be updated too.
      • imageProjectHeight

        public FormalParameter imageProjectHeight
        Deprecated.
        Size of image for projects will be obtained from CSS style
        Indicates the height of the image to be displayed next to each project.
        If the default image to use specified on the imageProject formal parameter is changed, chances are this value will need to be updated too.
      • FP_SORT_ORDER

        public static final java.lang.String FP_SORT_ORDER
        Constant specifying the name of the formal parameter that represents the order in which the projects will be sorted. Value is sortOrder.
        Since:
        MicroStrategy Web 8.0.0
        See Also:
        Constant Field Values
      • FP_SORT_KEY

        public static final java.lang.String FP_SORT_KEY
        Constant specifying the name of the formal parameter that represents the key to be used for sorting the projects. Value is sortKey.
        Since:
        MicroStrategy Web 8.0.0
        See Also:
        Constant Field Values
      • FP_USE_STYLE_SORTING

        public static final java.lang.String FP_USE_STYLE_SORTING
        Constant specifying the name of the formal parameter that represents the flag that determines which settings are to be considered for project sorting. Value is useStyleSorting
        Since:
        MicroStrategy Web 9.0.0
        See Also:
        Constant Field Values
      • FP_IMAGE_PROJECT

        public static final java.lang.String FP_IMAGE_PROJECT
        Deprecated.
        The formal parameter this constant is related with has been deprecated
        Constant specifying the name of the formal parameter that represents the image to be displayed next to each project. Value is imageProject.
        See Also:
        Constant Field Values
      • FP_DISPLAY_FLAG

        public static final java.lang.String FP_DISPLAY_FLAG
        Constant specifying the name of the formal parameter that represents the flag that specifies the information to render from each project. Value is displayFlag.
        See Also:
        Constant Field Values
      • FP_NUMBER_OF_COLUMNS

        public static final java.lang.String FP_NUMBER_OF_COLUMNS
        Constant specifying the name of the formal parameter that represents the number of columns on the HTML table that will contain each project. Value is numColumns.
        See Also:
        Constant Field Values
      • FP_IMAGE_PROJECT_WIDTH

        public static final java.lang.String FP_IMAGE_PROJECT_WIDTH
        Deprecated.
        The formal parameter this constant is related with has been deprecated
        Constant specifying the name of the formal parameter that represents the width of the image to be displayed next to each project. Value is imageProjectWidth.
        See Also:
        Constant Field Values
      • FP_IMAGE_PROJECT_HEIGHT

        public static final java.lang.String FP_IMAGE_PROJECT_HEIGHT
        Deprecated.
        The formal parameter this constant is related with has been deprecated
        Constant specifying the name of the formal parameter that represents the height of the image to be displayed next to each project. Value is imageProjectHeight.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ProjectsTransform

        public ProjectsTransform()
        Default constructor. Initializes formal parameters.
    • Method Detail

      • getDescription

        public java.lang.String getDescription()
        Returns the textual description of the transform
        Specified by:
        getDescription in interface Transform
        Returns:
        the description of the transform
      • renderProjectImage

        public void renderProjectImage​(MarkupOutput out,
                                       ProjectInformation projectInfo)
        Renders the image to be displayed as a link for the project on the final HTML output. The event for the link is calculated internally based on the getOpenProjectEvent method.
        Parameters:
        out - MarkupOutput instance where to save the HTML to render
        projectInfo - a ProjectInformation instance containing the details of the project to show
        Since:
        MicroStrategy Web 8.0.0
      • getProjectImageSrc

        protected java.lang.String getProjectImageSrc()
        Returns:
        String with the location of the project image icon to be displayed for projects, only in case where the user has enabled Accessibility. Otherwise, icon will be rendered using CSS styles.
        Since:
        MicroStrategy Web 8.1.1
      • renderProjectImage

        public void renderProjectImage​(MarkupOutput out,
                                       ProjectInformation projectInfo,
                                       WebEvent event)
        Deprecated.
        Image Icon no longer includes the event link
        Renders the image to be displayed as a link for the project on the final HTML output, as indicated on the formal parameter
        Parameters:
        out - MarkupOutput instance where to save the HTML to render
        projectInfo - a ProjectInformation instance containing the details of the project to show
        event - WebEvent instance with the details of the event to associate to the image link to be displayed
      • renderProjectName

        public void renderProjectName​(MarkupOutput out,
                                      ProjectInformation projectInfo)
        Renders the project object's name as a link on the final HTML output. The event for the link is calculated internally based on the getOpenProjectEvent method.
        Parameters:
        out - MarkupOutput instance where to save the HTML to render
        projectInfo - a ProjectInformation instance containing the details of the project to show
        Since:
        MicroStrategy Web 8.0.0
      • renderProjectName

        public void renderProjectName​(MarkupOutput out,
                                      ProjectInformation projectInfo,
                                      WebEvent event)
        Renders the project object's name as a link on the final HTML output
        Parameters:
        out - MarkupOutput instance where to save the HTML to render
        projectInfo - a ProjectInformation instance containing the details of the project to show
        event - WebEvent instance with the details of the event to associate to the link to be displayed
      • renderProjectNameWithoutAnchor

        public void renderProjectNameWithoutAnchor​(MarkupOutput out,
                                                   ProjectInformation projectInfo)
        Renders the project object's name as a link on the final HTML output
        Parameters:
        out - MarkupOutput instance where to save the HTML to render
        projectInfo - a ProjectInformation instance containing the details of the project to show
        event - WebEvent instance with the details of the event to associate to the link to be displayed
      • renderAnchorTag

        public void renderAnchorTag​(MarkupOutput out,
                                    ProjectInformation projectInfo)
        Renders the project object's name as a link on the final HTML output
        Parameters:
        out - MarkupOutput instance where to save the HTML to render
        projectInfo - a ProjectInformation instance containing the details of the project to show
        event - WebEvent instance with the details of the event to associate to the link to be displayed
      • renderServerAlias

        public void renderServerAlias​(MarkupOutput out,
                                      ProjectInformation projectInfo)
        Renders the project object's server alias on the final HTML output
        Parameters:
        out - MarkupOutput instance where to save the HTML to render
        projectInfo - a ProjectInformation instance containing the details of the project to show
      • isProjectDescriptionAvailable

        public boolean isProjectDescriptionAvailable​(ProjectInformation projectInfo)
        Utility method that checks on the project information if a description is available or not
        Parameters:
        projectInfo - a ProjectInformation instance containing the details of the project to show
        Returns:
        boolean value of True if there's a description for the project, otherwise it returns False.
        Since:
        MicroStrategy Web 8.0.0
      • renderProjectDescription

        public void renderProjectDescription​(MarkupOutput out,
                                             ProjectInformation projectInfo)
        Renders the project object's description on the final HTML output
        Parameters:
        out - MarkupOutput instance where to save the HTML to render
        projectInfo - a ProjectInformation instance containing the details of the project to show
      • renderObject

        public void renderObject​(MarkupOutput out,
                                 ProjectInformation projectInfo)
        Renders a single project object on the final HTML output, including all the fields indicated on the displayFlag formal parameter value
        Parameters:
        out - MarkupOutput instance where to save the HTML to render
        projectInfo - a ProjectInformation instance containing the details of the project to show
      • renderEmptyProjectList

        public void renderEmptyProjectList​(MarkupOutput out)
        Renders a message to the users in case there are no projects in the projects list
        Parameters:
        out - MarkupOutput instance where the HTML to be rendered is saved.
        Since:
        MicroStrategy Web 8.0.0
      • renderProjectList

        public void renderProjectList​(MarkupOutput out,
                                      java.util.ArrayList projectsList)
        Render the section where the list of projects available to the user will be displayed.
        Parameters:
        out - MarkupOutput instance where the contents to show to the user will be saved.
        projectsList - ArrayList of ProjectInformation instances with the details of the projects available to the user.
      • renderMessagesSection

        public void renderMessagesSection​(MarkupOutput out)
        Render the section where any error message will be displayed to the user. The information to render by default will come from the list of projects returned by the getErrorProjectsList method, which are the ones where they or the I-Server is not available because change of password is required.
        Parameters:
        out - MarkupOutput instance where the contents to show to the user will be saved.
        Since:
        MicroStrategy Web 8.0.0
      • generateAnchor

        protected AnchorTag generateAnchor​(WebEvent event)
        Overwrites the parent method by specifying the level of information to include on the links according to the event being associated with them.
        Overrides:
        generateAnchor in class AbstractAppTransform
        Parameters:
        event - WebEvent instance from where the details of the anchor are to be generated.
        Returns:
        an AnchorTag instance initialized with the event information.
        Since:
        MicroStrategy Web 8.0.0
      • renderMessagesSection

        public void renderMessagesSection​(MarkupOutput out,
                                          java.util.ArrayList projectErrorList)
        Render the section where any error message will be displayed to the user. Typically this section will include information about the projects or I-Server not available because change of password is required or because the maximum number of user connections has been met for some I-servers.
        Parameters:
        out - MarkupOutput instance where the contents to show to the user will be saved.
        projectErrorList - ArrayList of ProjectInformation instances with the details of the projects or I-Server not available to the user because some error was generated while trying to access them.
      • getProjectsList

        public java.util.ArrayList getProjectsList()
        Obtain the list of projects to display to the user
        Returns:
        ArrayList instance with the list of projects to render to the user
        Since:
        MicroStrategy Web 8.0.0
      • getErrorProjectsList

        public java.util.ArrayList getErrorProjectsList()
        Obtain the list of projects with connection errors to display to the user
        Returns:
        ArrayList instance with the list of projects that had errors, to render to the user
        Since:
        MicroStrategy Web 8.0.0
      • areThereProjectsToDisplay

        public boolean areThereProjectsToDisplay()
        Determines if there are projects to display to the user, where s/he can connect to
        Returns:
        boolean value indicating if there are projects running where the user can connect to.
        Since:
        MicroStrategy Web 8.0.0
      • areThereMessagesToDisplay

        public boolean areThereMessagesToDisplay()
        Determines if there are error messages to display to the user
        Returns:
        boolean value indicating if there are error messages that should be displayed.
        Since:
        MicroStrategy Web 8.0.0
      • sortProjectList

        protected void sortProjectList()
        Given the values of the formal parameters such as sortKey and sortOrder, a Comparator object will be requested to the getSortComparator() method for getting the project list to be rendered by this transform sorted.
        Since:
        MicroStrategy Web 8.0.0
      • generateServerLists

        public static HashList generateServerLists​(java.util.ArrayList originalList)
      • getSortComparator

        protected java.util.Comparator getSortComparator()
        Given the values of the formal parameters such as sortKey sortOrder and useStyleSorting, this method will generate a Comparator instance to be used for sorting the project list to be rendered by this transform.
        Returns:
        a Comparator instance that will be used for sorting the list of projects according to the keys specified on the transform formal parameters.
        Since:
        MicroStrategy Web 8.0.0
      • getConfigurationSortComparator

        public static java.util.Comparator getConfigurationSortComparator()
      • getOpenHomeEvent

        protected WebEvent getOpenHomeEvent​(ProjectInformation projectInfo)
        Generate the WebEvent that will indicate where to take the user once the password has been changed. This event information is used as argument for the getChangePasswordEvent method.
        Parameters:
        projectInfo - ProjectInformation with the details about the project to connect to
        Returns:
        a WebEvent instance for opening the home or welcome page of the application, or where the user should be taken to after expired passwords get changed. Returns null if the application does not support it.
      • getChangePasswordEvent

        protected WebEvent getChangePasswordEvent​(ProjectInformation projectInfo)
        Generate the WebEvent that will be used for allowing the user to change the password if it is required before showing the project list corresponding to an I-Server.
        Parameters:
        projectInfo - ProjectInformation instance with the information about the server that didn't allow the user to see the projects until the password gets changed.
        Returns:
        a WebEvent for opening the change password page. Returns null if the application doesn't support it.
      • getOpenProjectEvent

        protected WebEvent getOpenProjectEvent​(ProjectInformation projectInfo)
        Generate the WebEvent event that will be used for rendering the project information as links. This event will indicate where the user is supposed to be taken after s/he has selected the project to go to. By default, the event to use is the one for opening the Start Page selected by the user in Preferences.
        Parameters:
        projectInfo - ProjectInformation instance with the information about the project
        Returns:
        a WebEvent for opening the project information. Returns null if the application doesn't support it.
      • compareStrings

        public static int compareStrings​(java.lang.String str1,
                                         java.lang.String str2)