com.sage.orion.sdata.servlet.accpac
Class PortletsService

java.lang.Object
  extended by com.sage.orion.sdata.servlet.accpac.PortletsService

public class PortletsService
extends java.lang.Object

The class is responsible for getting all the authorized portlets for the user.


Constructor Summary
PortletsService(ApplicationContext applicationContext, ResourceContextImpl resourceContext)
          Constructor
 
Method Summary
 java.util.Map<com.sage.accpac.sm.ActiveApplication,java.util.List<com.sage.orion.sdata.servlet.accpac.Portlet>> getAccpacPortlets()
          Gets the accpac portlets.
 java.util.List<PortalPortlet> getAuthorizedPortalPortlets()
          Gets all the authorized portlets for the user.
static java.util.List<com.sage.orion.sdata.servlet.accpac.Portlet> getDisplayablePortlets(com.sage.accpac.sm.Program program, java.lang.String appID, java.lang.String appVersion, java.util.Map<java.lang.String,com.sage.orion.sdata.servlet.accpac.Portlet> portletMap, boolean isTimecardUser)
          get a list of displayable Portlet objects for the given application
 java.util.List<com.sage.orion.sdata.servlet.accpac.Portlet> getPortalPortlets()
          Gets the portal61a portlets.
 java.util.Map<java.lang.String,com.sage.orion.sdata.servlet.accpac.Portlet> getPortletsForStartupApp(com.sage.accpac.sm.ActiveApplication activeApp)
          get a map of Portlet objects for the given application that can start up successfully
 java.util.List<com.sage.orion.sdata.servlet.accpac.Portlet> getWorkshopPortlets()
          Gets the SDK workshop portlets.
 boolean isAccessToPortletAllowed(java.lang.String rawPortletID)
           Indicates whether or not the user associated with this service is allowed to access the portlet in question.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortletsService

public PortletsService(ApplicationContext applicationContext,
                       ResourceContextImpl resourceContext)
Constructor

Parameters:
applicationContext - The ApplicationContext.
resourceContext - The ResourceContext.
Method Detail

getAuthorizedPortalPortlets

public java.util.List<PortalPortlet> getAuthorizedPortalPortlets()
Gets all the authorized portlets for the user. The method never returns null.

Returns:
The list of authorized portlets for the user.

getPortalPortlets

public java.util.List<com.sage.orion.sdata.servlet.accpac.Portlet> getPortalPortlets()
Gets the portal61a portlets. The method never returns null.

Returns:
The portal61a portlets.

getWorkshopPortlets

public java.util.List<com.sage.orion.sdata.servlet.accpac.Portlet> getWorkshopPortlets()
Gets the SDK workshop portlets. The method never returns null.

Returns:
The wkshp61a portlets.

getAccpacPortlets

public java.util.Map<com.sage.accpac.sm.ActiveApplication,java.util.List<com.sage.orion.sdata.servlet.accpac.Portlet>> getAccpacPortlets()
Gets the accpac portlets. The method never returns null.

Returns:
The accpac portlets.

getPortletsForStartupApp

public java.util.Map<java.lang.String,com.sage.orion.sdata.servlet.accpac.Portlet> getPortletsForStartupApp(com.sage.accpac.sm.ActiveApplication activeApp)
get a map of Portlet objects for the given application that can start up successfully

Parameters:
activeApp - the ActiveApplication
Returns:
a map of Portlet objects or null if the application fails to start up

isAccessToPortletAllowed

public boolean isAccessToPortletAllowed(java.lang.String rawPortletID)

Indicates whether or not the user associated with this service is allowed to access the portlet in question.

NOTE: If the portlet ID is null or blank (which could be the case if someone manually specified a shortcut without a portlet ID), this method returns false because such a portlet does not exist and thus cannot be accessed. Also, this method returns false both for cases where a "get" of the portlet would have returned "not found" and where it would have returned "forbidden" (found but not allowed to access).

Parameters:
rawPortletID - The ID of the portlet in question.
Returns:
Whether or not the user associated with this service is allowed to access the portlet in question (this includes cases where a "get" of the portlet would have returned "not found" as well as cases where the "get" would have returned "forbidden").

getDisplayablePortlets

public static java.util.List<com.sage.orion.sdata.servlet.accpac.Portlet> getDisplayablePortlets(com.sage.accpac.sm.Program program,
                                                                                                 java.lang.String appID,
                                                                                                 java.lang.String appVersion,
                                                                                                 java.util.Map<java.lang.String,com.sage.orion.sdata.servlet.accpac.Portlet> portletMap,
                                                                                                 boolean isTimecardUser)
get a list of displayable Portlet objects for the given application

Parameters:
program - the Program to which the user who has signed on
appID - the application ID
appVersion - the application version
portletMap - the map of installed Portlet objects that we want to check for the given application (this may or may not be the full map of installed objects for that application).
isTimecardUser - whether or not the current user is a timecard user
Returns:
a non-null list of Portlet objects


Copyright © 2011 Sage Software, Inc. All rights reserved.