public class

ProjectsTransform

extends AbstractAppTransform
implements LayoutTransform
java.lang.Object
   ↳ com.microstrategy.web.transform.AbstractTransform
     ↳ com.microstrategy.web.transform.AbstractLayoutTransform
       ↳ com.microstrategy.web.app.transforms.AbstractAppTransform
         ↳ com.microstrategy.web.app.transforms.ProjectsTransform

Class Overview

This transform renders the list of projects to show to the user for logging in.

Summary

Constants
int DISPLAY_ALL Allowed value for the displayFlag formal parameter.
int DISPLAY_DESCRIPTION Allowed value for the displayFlag formal parameter.
int DISPLAY_IMAGE Allowed value for the displayFlag formal parameter.
int DISPLAY_NAME Allowed value for the displayFlag formal parameter.
int DISPLAY_SERVER_NAME Allowed value for the displayFlag formal parameter.
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.
String FP_IMAGE_PROJECT This constant is deprecated. The formal parameter this constant is related with has been deprecated
String FP_IMAGE_PROJECT_HEIGHT This constant is deprecated. The formal parameter this constant is related with has been deprecated
String FP_IMAGE_PROJECT_WIDTH This constant is deprecated. The formal parameter this constant is related with has been deprecated
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.
String FP_SORT_KEY Constant specifying the name of the formal parameter that represents the key to be used for sorting the projects.
String FP_SORT_ORDER Constant specifying the name of the formal parameter that represents the order in which the projects will be sorted.
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.
int SORT_ASCENDING Allowed value for the sortOrder formal parameter.
int SORT_DESCENDING Allowed value for the sortOrder formal parameter.
int SORT_KEY_DEFAULT Allowed value for the sortKey formal parameter.
int SORT_KEY_ISERVER_NAME Allowed value for the sortKey formal parameter.
int SORT_KEY_PROJECT_DESCRIPTION Allowed value for the sortKey formal parameter.
int SORT_KEY_PROJECT_NAME Allowed value for the sortKey formal parameter.
[Expand]
Inherited Constants
From class com.microstrategy.web.app.transforms.AbstractAppTransform
Fields
public FormalParameter displayFlag Indicates the flag that indicates which information should be displayed about the project.
public FormalParameter imageProject This field is deprecated. source of image for projects will be obtained from CSS style
public FormalParameter imageProjectHeight This field is deprecated. Size of image for projects will be obtained from CSS style
public FormalParameter imageProjectWidth This field is deprecated. Size of image for projects will be obtained from CSS style
public FormalParameter numColumns Indicates the number of columns to use on the table that will hold each one of the projects to render.
public FormalParameter sortKey Indicates the key to be used for sorting the project list before rendering it to users.
public FormalParameter sortOrder Indicates the order to be used for sorting the project list before rendering it to users.
public FormalParameter useStyleSorting Indicates the sorting settings to use for listing projects.
[Expand]
Inherited Fields
From class com.microstrategy.web.app.transforms.AbstractAppTransform
Public Constructors
ProjectsTransform()
Default constructor.
Public Methods
boolean areThereMessagesToDisplay()
Determines if there are error messages to display to the user
boolean areThereProjectsToDisplay()
Determines if there are projects to display to the user, where s/he can connect to
static int compareStrings(String str1, String str2)
static HashList generateServerLists(ArrayList originalList)
static Comparator getConfigurationSortComparator()
String getDescription()
Returns the textual description of the transform
ArrayList getErrorProjectsList()
Obtain the list of projects with connection errors to display to the user
ArrayList getProjectsList()
Obtain the list of projects to display to the user
Class getSupportedBeanType()
Returns the supported bean type.
boolean hasNextProject(ProjectInformation projectInfo)
void initializeTransform(Transformable data)
This method initialize the private and protected fields of the transform.
boolean isProjectDescriptionAvailable(ProjectInformation projectInfo)
Utility method that checks on the project information if a description is available or not
void renderAnchorTag(MarkupOutput out, ProjectInformation projectInfo)
Renders the project object's name as a link on the final HTML output
void renderEmptyProjectList(MarkupOutput out)
Renders a message to the users in case there are no projects in the projects list
void renderMessagesSection(MarkupOutput out, ArrayList projectErrorList)
Render the section where any error message will be displayed to the user.
void renderMessagesSection(MarkupOutput out)
Render the section where any error message will be displayed to the user.
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
void renderProjectDescription(MarkupOutput out, ProjectInformation projectInfo)
Renders the project object's description on the final HTML output
void renderProjectImage(MarkupOutput out, ProjectInformation projectInfo)
Renders the image to be displayed as a link for the project on the final HTML output.
void renderProjectImage(MarkupOutput out, ProjectInformation projectInfo, WebEvent event)
This method is deprecated. Image Icon no longer includes the event link
void renderProjectList(MarkupOutput out, ArrayList projectsList)
Render the section where the list of projects available to the user will be displayed.
void renderProjectName(MarkupOutput out, ProjectInformation projectInfo, WebEvent event)
Renders the project object's name as a link on the final HTML output
void renderProjectName(MarkupOutput out, ProjectInformation projectInfo)
Renders the project object's name as a link on the final HTML output.
void renderProjectNameWithoutAnchor(MarkupOutput out, ProjectInformation projectInfo)
Renders the project object's name as a link on the final HTML output
void renderServerAlias(MarkupOutput out, ProjectInformation projectInfo)
Renders the project object's server alias on the final HTML output
void transformForRequestSuccessful(MarkupOutput out)
Generates the graphical output for the ProjectsBean when the bean's status is WebBeanRequestSuccessful.
Protected Methods
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.
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.
WebEvent getOpenHomeEvent(ProjectInformation projectInfo)
Generate the WebEvent that will indicate where to take the user once the password has been changed.
WebEvent getOpenProjectEvent(ProjectInformation projectInfo)
Generate the WebEvent event that will be used for rendering the project information as links.
String getProjectImageSrc()
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.
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.
[Expand]
Inherited Methods
From class com.microstrategy.web.app.transforms.AbstractAppTransform
From class com.microstrategy.web.transform.AbstractLayoutTransform
From class com.microstrategy.web.transform.AbstractTransform
From class java.lang.Object
From interface com.microstrategy.web.app.transforms.AppTransform
From interface com.microstrategy.web.transform.LayoutTransform
From interface com.microstrategy.web.transform.Transform

Constants

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

Constant Value: -1 (0xffffffff)

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

Constant Value: 4 (0x00000004)

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

Constant Value: 1 (0x00000001)

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

Constant Value: 2 (0x00000002)

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

Constant Value: 8 (0x00000008)

public static final 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.

Constant Value: "displayFlag"

public static final String FP_IMAGE_PROJECT

This constant is 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.

Constant Value: "imageProject"

public static final String FP_IMAGE_PROJECT_HEIGHT

This constant is 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.

Constant Value: "imageProjectHeight"

public static final String FP_IMAGE_PROJECT_WIDTH

This constant is 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.

Constant Value: "imageProjectWidth"

public static final 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.

Constant Value: "numColumns"

public static final 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.

Constant Value: "sortKey"

public static final 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.

Constant Value: "sortOrder"

public static final 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

Constant Value: "useStyleSorting"

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

Constant Value: 0 (0x00000000)

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

Constant Value: 1 (0x00000001)

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

Constant Value: 0 (0x00000000)

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

Constant Value: 3 (0x00000003)

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

Constant Value: 2 (0x00000002)

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

Constant Value: 1 (0x00000001)

Fields

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

public FormalParameter imageProject

This field is 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.

public FormalParameter imageProjectHeight

This field is 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.

public FormalParameter imageProjectWidth

This field is 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.

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.

public FormalParameter sortKey

Indicates the key to be used for sorting the project list before rendering it to users. Valid values include those defined on the SORT_KEY_PROJECT_NAME, SORT_KEY_PROJECT_DESCRIPTION and similar constants.

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.

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.

Public Constructors

public ProjectsTransform ()

Default constructor. Initializes formal parameters.

Public Methods

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.

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.

public static int compareStrings (String str1, String str2)

public static HashList generateServerLists (ArrayList originalList)

public static Comparator getConfigurationSortComparator ()

public String getDescription ()

Returns the textual description of the transform

Returns
  • the description of the transform

public 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

public 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

public Class getSupportedBeanType ()

Returns the supported bean type. This transform supports ProjectsBean instances

Returns

public boolean hasNextProject (ProjectInformation projectInfo)

public void initializeTransform (Transformable data)

This method initialize the private and protected fields of the transform.

Parameters
data bean that will be transformed

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.

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

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.

public void renderMessagesSection (MarkupOutput out, 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.

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.

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

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

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

public void renderProjectImage (MarkupOutput out, ProjectInformation projectInfo, WebEvent event)

This method is 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

public void renderProjectList (MarkupOutput out, 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.

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

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

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

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

public void transformForRequestSuccessful (MarkupOutput out)

Generates the graphical output for the ProjectsBean when the bean's status is WebBeanRequestSuccessful.

Parameters
out MarkupOutput instance where to create the HTML output

Protected Methods

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.

Parameters
event WebEvent instance from where the details of the anchor are to be generated.
Returns
  • an AnchorTag instance initialized with the event information.

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.

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.

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.

protected 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.

protected 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.

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.