BEA Systems, Inc.

com.beasys.commerce.portal.admin.jspbeans
Class PortalLayoutJspBean

java.lang.Object
  |
  +--com.beasys.commerce.axiom.jsp.JspBeanBase
        |
        +--com.beasys.commerce.portal.admin.jspbeans.PortalLayoutJspBean

public class PortalLayoutJspBean
extends JspBeanBase

The class that includes various portlet layout algorithms used by the various layout.jsp (Administration Tool) pages.

See Also:
Serialized Form

Fields inherited from class com.beasys.commerce.axiom.jsp.JspBeanBase
DEFAULT_CATEGORY
 
Constructor Summary
PortalLayoutJspBean()
          Creates a new instance.
 
Method Summary
 void calcXYForNewPortlets(java.util.LinkedList addList, java.util.LinkedList sortedColumnList, PortalColumnInformation[] columnInfo)
          Calculates the X and Y for each portal in an 'add set' of portlets.
 Portlet[][] getAllPortletsFor(java.lang.String aPortalName, java.lang.String aGroupName, java.lang.String aUserName)
          Returns an 2 dimensional array (sorted in row/column) of AVAILABLE portlets for a portal for a portal, group, and user.
 Portlet[] getAvailablePortletsForPortal(java.lang.String aPortalName)
          Returns an array of available portlets for a portal at the portal level.
 PortalColumnInformation[] getPortalColumnInfo(java.lang.String portalName)
          Returns the column information for a portal.
 Portlet getPortletFor(java.lang.String layoutScope, java.lang.String portalName, java.lang.String groupName, java.lang.String userName, java.lang.String portletName)
          Returns the visible portlets based upon the scope of the request.
 Portlet[][] getPortletRC(int numCols, java.util.Hashtable aMap)
          Redo the Row/Column representation of the portlets based on the new layout.
 java.lang.String[] getVisiblePortletNamesFor(java.lang.String layoutScope, java.lang.String portalName, java.lang.String groupName, java.lang.String userName)
          Returns the visible portlet names based upon the scope of the request.
 void processMoveCommand(java.lang.String theCommand, Portlet thePortlet)
          Processes a move command from the layout tool.
 boolean removePortletFor(java.lang.String layoutScope, java.lang.String portalName, java.lang.String groupName, java.lang.String userName, Portlet aPortlet)
          Removes (turns off the visible bit) a portlet for the scope of the request.
 void resequencePortletsFor(java.lang.String layoutScope, java.lang.String portalName, java.lang.String groupName, java.lang.String userName, int thePortalColumn, Portlet theMovedPortlet, java.lang.String moveCmd)
          Re-sequences the portlets for a given layout scope.
 void sequencePortlets(java.lang.String layoutScope, java.lang.String portalName, java.lang.String groupName, java.lang.String userName, java.util.Vector aPortletVec)
          Sequences the portlets in a column for a given layout scope.
 void setPortalColumnInfo(Portal aPortal, PortalColumnInformation[] colInfo)
          Sets the portal column information for a portal.
 java.util.LinkedList sortIntoColumns(Portlet[] portlets, PortalColumnInformation[] columnInfo)
          Sorts an array of portlets into columns.
 void sortPortlets(java.util.ArrayList thePortletArrayList)
          Sorts an ArrayList of portlets
 void sortPortlets(java.util.Vector thePortletVec)
          Sorts a vector of portlets
 boolean updateColumnInfo(java.util.HashMap bufferedColWidthHashMap, javax.servlet.http.HttpServletRequest request, Portal thePortal)
          Updates the column information for a Portal.
 boolean updatePortletFor(java.lang.String layoutScope, java.lang.String portalName, java.lang.String groupName, java.lang.String userName, Portlet aPortlet)
          Updates a portlet for the scope of the request.
 boolean updatePortlets(java.util.HashMap thePortletHashMap, javax.servlet.http.HttpServletRequest request, java.lang.String layoutScope, java.lang.String portalName, java.lang.String groupName, java.lang.String userName)
          Updates a portlet for the scope of the request.
 boolean updatePortlets(java.util.HashMap thePortletHashMap, javax.servlet.http.HttpServletRequest request, java.lang.String layoutScope, java.lang.String portalName, java.lang.String groupName, java.lang.String userName, java.util.Hashtable originalMap)
          Updates a portlet for the scope of the request.
 
Methods inherited from class com.beasys.commerce.axiom.jsp.JspBeanBase
findStringInArray, hasSpecialHTMLChars, isStringLetterOrDigit, validateDoubleValue, validateDoubleValue, validateGroupName, validateIntValue, validateIntValue, validateLength, validateUserName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortalLayoutJspBean

public PortalLayoutJspBean()
Creates a new instance.
Method Detail

sortPortlets

public void sortPortlets(java.util.Vector thePortletVec)
Sorts a vector of portlets
Parameters:
thePortletVec - A vector of portlet references that represent a column.

sortPortlets

public void sortPortlets(java.util.ArrayList thePortletArrayList)
Sorts an ArrayList of portlets
Parameters:
thePortletArrayList - The array list of portlets that represent a column.

getAvailablePortletsForPortal

public Portlet[] getAvailablePortletsForPortal(java.lang.String aPortalName)
Returns an array of available portlets for a portal at the portal level.
Parameters:
aPortalName - The portal name.
Returns:
An array of portlets found. If not found, it returns an empty array.

getAllPortletsFor

public Portlet[][] getAllPortletsFor(java.lang.String aPortalName,
                                     java.lang.String aGroupName,
                                     java.lang.String aUserName)
Returns an 2 dimensional array (sorted in row/column) of AVAILABLE portlets for a portal for a portal, group, and user. If the user is not null, then it returns all of the available portlets to the user. If the user is null, then it returns all available portlets for the group and portal. If the group is null, then it returns all available portlets for the portal.
Parameters:
aPortalName - The portal name.
aGroupName - The group name.
aUserName - The user name.
Returns:
An array of portlets found. If not found, it returns null;

resequencePortletsFor

public void resequencePortletsFor(java.lang.String layoutScope,
                                  java.lang.String portalName,
                                  java.lang.String groupName,
                                  java.lang.String userName,
                                  int thePortalColumn,
                                  Portlet theMovedPortlet,
                                  java.lang.String moveCmd)
Re-sequences the portlets for a given layout scope.
Parameters:
layoutScope - The scope of the layout (portal, group, user)
portalName - The name of the portal.
groupName - The name of the group.
userName - The name of the user.
thePortalColumn - The position of the portal column affected.
theMovedPortlet - The portlet that has moved.
moveCmd - The move comand (MoveDown, MoveUp, MoveLeft, MoveRight, Remove).

sequencePortlets

public void sequencePortlets(java.lang.String layoutScope,
                             java.lang.String portalName,
                             java.lang.String groupName,
                             java.lang.String userName,
                             java.util.Vector aPortletVec)
Sequences the portlets in a column for a given layout scope.
Parameters:
layoutScope - The scope of the layout (portal, group, user)
portalName - The name of the portal.
groupName - The name of the group.
userName - The name of the user.
aPortletVec - A vector of portlets representing all portlets in a column.

sortIntoColumns

public java.util.LinkedList sortIntoColumns(Portlet[] portlets,
                                            PortalColumnInformation[] columnInfo)
Sorts an array of portlets into columns. It only sorts the references in the array and does not update the entities in the persistent store.
Parameters:
Portlets - An array of portlets to be sorted.
columnInfo - The column information for the portal that contains the portlets.
Returns:
A linked list of vectors where each vector is all of the portlets in the column. Returns an empty list if an error or their are no portlets.

calcXYForNewPortlets

public void calcXYForNewPortlets(java.util.LinkedList addList,
                                 java.util.LinkedList sortedColumnList,
                                 PortalColumnInformation[] columnInfo)
Calculates the X and Y for each portal in an 'add set' of portlets. An add set is a set of new portlets that will be added to a portal. This method does not add them it just updates the in memory portlet X and Y.
Parameters:
addSet - a Set of Portlet references.
sortedColumnSet - a Set of vectors containing portlets sorted into columns.
columnInfo - The column information for the portal. Each vector is a column.

getVisiblePortletNamesFor

public java.lang.String[] getVisiblePortletNamesFor(java.lang.String layoutScope,
                                                    java.lang.String portalName,
                                                    java.lang.String groupName,
                                                    java.lang.String userName)
Returns the visible portlet names based upon the scope of the request.
Parameters:
layoutScope - The scope of the layout (portal, group, user)
portalName - The name of the portal.
groupName - The name of the group.
userName - The name of the user.
Returns:
An array of portlet names.
See Also:
PortalFinderJspBean

getPortletFor

public Portlet getPortletFor(java.lang.String layoutScope,
                             java.lang.String portalName,
                             java.lang.String groupName,
                             java.lang.String userName,
                             java.lang.String portletName)
Returns the visible portlets based upon the scope of the request.
Parameters:
layoutScope - The scope of the layout (portal, group, user)
portalName - The name of the portal.
groupName - The name of the group.
userName - The name of the user.
Returns:
An array of portlets.
See Also:
PortalFinderJspBean

removePortletFor

public boolean removePortletFor(java.lang.String layoutScope,
                                java.lang.String portalName,
                                java.lang.String groupName,
                                java.lang.String userName,
                                Portlet aPortlet)
Removes (turns off the visible bit) a portlet for the scope of the request.
Parameters:
layoutScope - The scope of the layout (portal, group, user)
portalName - The name of the portal.
groupName - The name of the group.
userName - The name of the user.
aPortlet - The portlet to remove (make invisible).
Returns:
true if successful; false if not.
See Also:
PortalFinderJspBean

updatePortletFor

public boolean updatePortletFor(java.lang.String layoutScope,
                                java.lang.String portalName,
                                java.lang.String groupName,
                                java.lang.String userName,
                                Portlet aPortlet)
Updates a portlet for the scope of the request.
Parameters:
layoutScope - The scope of the layout (portal, group, user)
portalName - The name of the portal.
groupName - The name of the group.
userName - The name of the user.
aPortlet - The portlet to remove (make invisible).
Returns:
true if successful; false if not.
See Also:
PortalFinderJspBean

getPortalColumnInfo

public PortalColumnInformation[] getPortalColumnInfo(java.lang.String portalName)
Returns the column information for a portal.
Parameters:
portalName - The name of the portal.
Returns:
The Portal Column Information.

setPortalColumnInfo

public void setPortalColumnInfo(Portal aPortal,
                                PortalColumnInformation[] colInfo)
Sets the portal column information for a portal.
Parameters:
aPortal - The Portal.
colInfo - The column information.

processMoveCommand

public void processMoveCommand(java.lang.String theCommand,
                               Portlet thePortlet)
Processes a move command from the layout tool.
Parameters:
theCommand - The command to process (MoveDown, MoveUp, MoveLeft, MoveRight, Remove).
thePortlet - The portlet for the command.

updatePortlets

public boolean updatePortlets(java.util.HashMap thePortletHashMap,
                              javax.servlet.http.HttpServletRequest request,
                              java.lang.String layoutScope,
                              java.lang.String portalName,
                              java.lang.String groupName,
                              java.lang.String userName)
Updates a portlet for the scope of the request.
Parameters:
request - The HTTP request.
layoutScope - The scope of the layout (portal, group, user)
portalName - The name of the portal.
groupName - The name of the group.
userName - The name of the user.
Returns:
true if successful; false if not.

updateColumnInfo

public boolean updateColumnInfo(java.util.HashMap bufferedColWidthHashMap,
                                javax.servlet.http.HttpServletRequest request,
                                Portal thePortal)
Updates the column information for a Portal.
Parameters:
bufferedColWidthHashMap - The column widths.
request - The HTTP request.
thePortal - The portal.
Returns:
true if successful; false if not.

updatePortlets

public boolean updatePortlets(java.util.HashMap thePortletHashMap,
                              javax.servlet.http.HttpServletRequest request,
                              java.lang.String layoutScope,
                              java.lang.String portalName,
                              java.lang.String groupName,
                              java.lang.String userName,
                              java.util.Hashtable originalMap)
Updates a portlet for the scope of the request. This will only work for the end user tools. Which are those available directly off of the portal.
Parameters:
request - The HTTP request.
layoutScope - The scope of the layout (portal, group, user)
portalName - The name of the portal.
groupName - The name of the group.
userName - The name of the user.
originalMap - the original values of the portlets. This will be changed to match the new layout.
Returns:
true if successful; false if not.

getPortletRC

public Portlet[][] getPortletRC(int numCols,
                                java.util.Hashtable aMap)
Redo the Row/Column representation of the portlets based on the new layout.
Parameters:
aMap -  
numCols -  
Returns:
Portlet[][]

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved