Interface PortletService
- All Superinterfaces:
com.appiancorp.services.ContextSensitiveService
,Service
This interface defines methods for access to and modification of portlets.
Portlets may have their own security settings, or they may inherit the security settings of the page on which they exist. Portlets may also be shared, so that the same portlet can be placed on several different pages.
Methods of service classes can all throw the unchecked exception
ServiceException
if any
system-level error (for example, server failure) occurs, and will in general
throw a checked exception (InvalidXXXException
) when an entity
to be retrieved is inaccessible, instead of returning null
.
Exceptions to this paradigm (including the use of ResultList
as
described below) are noted. All checked exceptions extend
AppianException
.
It may be necessary to retrieve a subset of results as opposed to an entire
collection, and also to sort the subset by some property of the returned
object. "Paging" methods which return a
ResultPage
are provided in certain
instances for this purpose. The ResultPage
will contain the
sorted subset of results
(via Result.getResults()
), and the
total number of items in the available result set
(via ResultPage.getAvailableItems()
).
It may also be necessary to retrieve some results, even if all results
cannot be retrieved (for instance, some of the entities corresponding
to a list of entity IDs may no longer exist). Methods which return a
ResultList
are provided for this
purpose. The Result.getResults()
method in this case will return all results which can be retrieved. In
addition, there will be a list of result codes
(ResultList.getResultCodes()
) that
represent the successful retrieval of an entity, or, if the entity could
not be retrieved, the reason for the failure. See the CODE_XXX
constants in ResultList
for details.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Integer
Deprecated.A constant used to indicate both activated and deactivated portlets will be included from portlet searchesstatic final Integer
Deprecated.A constant used to indicate only activated portlets will be included from portlet searchesstatic final boolean
Deprecated.static final boolean
Deprecated.static final Integer
Deprecated.A constant used to indicate only deactivated portlets will be included from portlet searchesstatic final boolean
Deprecated.static final boolean
Deprecated.static final boolean
Deprecated.static final boolean
Deprecated.static final boolean
Deprecated.static final boolean
Deprecated.static final boolean
Deprecated.static final boolean
Deprecated.static final boolean
Deprecated.static final boolean
Deprecated.static final Long
Deprecated.A constant used to indicate that no pages will be excluded from portlet searchesstatic final Integer
Deprecated.A constant used to indicate that the user can administer the requested portlet.static final Integer
Deprecated.A constant used to indicate that the user can edit the requested portlet.static final Integer
Deprecated.A constant used to indicate that the requested portlet id was not valid.static final Integer
Deprecated.A constant used to indicate that the user does not have adequate privileges to retrieve the requested portlet.static final Integer
Deprecated.A constant used to indicate that the user can view the requested portlet.static final boolean
Deprecated.static final Integer
Deprecated.A constant used to indicate both shared and unshared portlets will be included from portlet searchesstatic final Integer
Deprecated.A constant used to indicate only shared portlets will be included from portlet searchesstatic final Integer
Deprecated.A constant used to indicate only unshared portlets will be included from portlet searchesstatic final boolean
Deprecated.static final boolean
Deprecated.static final boolean
Deprecated.static final boolean
Deprecated.static final boolean
Deprecated.Fields inherited from interface com.appiancorp.services.ContextSensitiveService
SET_SERVICE_CONTEXT_METHOD_NAME
-
Method Summary
Modifier and TypeMethodDescriptioncreatePortlet
(Portlet p_) Deprecated.Creates a portlet.Long[]
createPortlets
(Portlet[] ps_) Deprecated.Creates portlets in bulk.Portlet[]
findPortletsPaging
(String type_, String searchTerms_, Long p_, Integer sharedType_, Integer state_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Deprecated.Gets a ResultPage containing a list of portlets of the given type obtained by searching for a string in name/description.int
getAccessLevelForPortlet
(Long portletId_) Deprecated.Gets the current user's access level for the specified portlet.int[]
getAccessLevelForPortlets
(Long[] portletIds_) Deprecated.Gets the current user's access level for the specified portlets.getInheritedRoleMapForPortlet
(Long portletId_, Long pageId_) Deprecated.Returns the role map that the portlet inherits from its page.getPortlet
(Long portletId_) Deprecated.Gets a portletPortlet[]
getPortlets
(Long[] portletIds_) Deprecated.getPortletsList
(Long[] portletIds_) Deprecated.Returns a ResultList containingPortlet
instances for valid ids and result codes for all ids.getPortletsPaging
(Long[] portletIds_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Deprecated.Gets a ResultPage containing a list of portlets as specified by the portlet idsgetRoleMapForPortlet
(Long portletId_) Deprecated.Get the role map for a portlet NOTE: This should not be used to verify the access level that the current user has on the portlet because the access level can depend on other properties of the portlet such asinheritsSecurity
andshareable
.void
setRoleMapForPortlet
(Long portletId_, PortalRoleMap map_) Deprecated.Set the role map for a portletvoid
unsharePortlet
(Long portletId_, Long pageId_, boolean force_) Deprecated.Make a shared portlet non-shareable and clear it's uuid if it has one.void
updatePortlet
(Portlet portlet_) Deprecated.Update a portlet In order to update a portlet the fields following fields must be populated:id
,shareable
,inheritsSecurity
,portletType
,name
,frame
,public
.void
updatePortletParameters
(Long portletId_, Map parameterValueMap_) Deprecated.Update the portlet's name/value pairs of its parametersvoid
updatePortlets
(Portlet[] portlets_) Deprecated.Update portlets in bulk.void
updatePortletsParameters
(Long[] portletIds_, Map[] parameterValueMaps_) Deprecated.Update the portlets' name/value pairs of their parametersMethods inherited from interface com.appiancorp.services.ContextSensitiveService
setServiceContext
-
Field Details
-
NO_PAGE
Deprecated.A constant used to indicate that no pages will be excluded from portlet searches -
SHARED_AND_UNSHARED_PORTLET
Deprecated.A constant used to indicate both shared and unshared portlets will be included from portlet searches -
SHARED_PORTLET
Deprecated.A constant used to indicate only shared portlets will be included from portlet searches -
UNSHARED_PORTLET
Deprecated.A constant used to indicate only unshared portlets will be included from portlet searches -
ACTIVE_AND_DEACTIVATED_PORTLET
Deprecated.A constant used to indicate both activated and deactivated portlets will be included from portlet searches -
ACTIVE_PORTLET
Deprecated.A constant used to indicate only activated portlets will be included from portlet searches -
DEACTIVATED_PORTLET
Deprecated.A constant used to indicate only deactivated portlets will be included from portlet searches -
PORTLET_LIST_CODE_INVALID
Deprecated.A constant used to indicate that the requested portlet id was not valid. -
PORTLET_LIST_CODE_NO_PERMISSIONS
Deprecated.A constant used to indicate that the user does not have adequate privileges to retrieve the requested portlet. -
PORTLET_LIST_CODE_VIEWER
Deprecated.A constant used to indicate that the user can view the requested portlet. -
PORTLET_LIST_CODE_EDITOR
Deprecated.A constant used to indicate that the user can edit the requested portlet. -
PORTLET_LIST_CODE_ADMIN
Deprecated.A constant used to indicate that the user can administer the requested portlet. -
getAccessLevelForPortlet$UPDATES
static final boolean getAccessLevelForPortlet$UPDATESDeprecated.- See Also:
-
getAccessLevelForPortlets$UPDATES
static final boolean getAccessLevelForPortlets$UPDATESDeprecated.- See Also:
-
createPortlet$UPDATES
static final boolean createPortlet$UPDATESDeprecated.- See Also:
-
createPortlets$UPDATES
static final boolean createPortlets$UPDATESDeprecated.- See Also:
-
getPortlet$UPDATES
static final boolean getPortlet$UPDATESDeprecated.- See Also:
-
getPortletsPaging$UPDATES
static final boolean getPortletsPaging$UPDATESDeprecated.- See Also:
-
getPortletsList$UPDATES
static final boolean getPortletsList$UPDATESDeprecated.- See Also:
-
getPortlets$UPDATES
static final boolean getPortlets$UPDATESDeprecated.- See Also:
-
findPortletsPaging$UPDATES
static final boolean findPortletsPaging$UPDATESDeprecated.- See Also:
-
findPortlets$UPDATES
static final boolean findPortlets$UPDATESDeprecated.- See Also:
-
updatePortlet$UPDATES
static final boolean updatePortlet$UPDATESDeprecated.- See Also:
-
updatePortlets$UPDATES
static final boolean updatePortlets$UPDATESDeprecated.- See Also:
-
updatePortletParameters$UPDATES
static final boolean updatePortletParameters$UPDATESDeprecated.- See Also:
-
updatePortletsParameters$UPDATES
static final boolean updatePortletsParameters$UPDATESDeprecated.- See Also:
-
getRoleMapForPortlet$UPDATES
static final boolean getRoleMapForPortlet$UPDATESDeprecated.- See Also:
-
setRoleMapForPortlet$UPDATES
static final boolean setRoleMapForPortlet$UPDATESDeprecated.- See Also:
-
getInheritedRoleMapForPortlet$UPDATES
static final boolean getInheritedRoleMapForPortlet$UPDATESDeprecated.- See Also:
-
-
Method Details
-
getAccessLevelForPortlet
int getAccessLevelForPortlet(Long portletId_) throws InvalidAnonymousUserException, InvalidUserException, InvalidPortletException Deprecated.Gets the current user's access level for the specified portlet.- Parameters:
portletId_
- The id of the portlet for which the user's access level is to be determined.- Returns:
- The access level. This is one of the
PORTLET_ACCESS_LEVEL_XXX
constants inPortlet
- Throws:
InvalidAnonymousUserException
- if the user is anonymous, but anonymous access has not been enabledInvalidUserException
- if the user calling this method is invalidInvalidPortletException
- if the specified portlet does not existServiceException
- if any system-level error occurs
-
getAccessLevelForPortlets
int[] getAccessLevelForPortlets(Long[] portletIds_) throws InvalidAnonymousUserException, InvalidUserException, InvalidPortletException Deprecated.Gets the current user's access level for the specified portlets.- Parameters:
portletIds_
- The ids of the portlets for which the user's access level is to be determined.- Returns:
- The access levels. Each access level is one of the
PORTLET_ACCESS_LEVEL_XXX
constants inPortlet
- Throws:
InvalidAnonymousUserException
- if the user is anonymous, but anonymous access has not been enabledInvalidUserException
- if the user calling this method is invalidInvalidPortletException
- if any of the the specified portlets do not existServiceException
- if any system-level error occurs
-
createPortlet
Long createPortlet(Portlet p_) throws IllegalArgumentException, PortletSharingException, InvalidPortletTypeException, DuplicateUuidException Deprecated.Creates a portlet. In order to create a portlet the fields following fields must be populated:shareable
,inheritsSecurity
,portletType
,name
,frame
,public
. Portlet types can be retrieved fromAdministrationService.getPortletTypes()
- Parameters:
p_
- the new portlet- Returns:
- the id of the newly created portlet
- Throws:
PortletSharingException
- if portlet to be created would be sharable and would also inherit securityInvalidPortletTypeException
- if the portlet type specified is invalidIllegalArgumentException
- if theparameters
map of the portlet is notnull
, but does not meet the requirements specified byPortlet.getParameters()
ServiceException
- if any system-level error occursDuplicateUuidException
- if the UUID of the portlet already exists
-
createPortlets
Long[] createPortlets(Portlet[] ps_) throws IllegalArgumentException, PortletSharingException, InvalidPortletTypeException, DuplicateUuidException Deprecated.Creates portlets in bulk. SeecreatePortlet(Portlet)
.- Parameters:
ps_
- the new portlets- Returns:
- the ids of the newly created portlets
- Throws:
PortletSharingException
- if any portlet to be created would be sharable and would also inherit securityInvalidPortletTypeException
- if any portlet type specified is invalidIllegalArgumentException
- if theparameters
map of any of the portlets is notnull
, but does not meet the requirements specified byPortlet.getParameters()
DuplicateUuidException
- if the UUID of any of the portlets already exists or if the same UUID is passed in for several portletsServiceException
- if any system-level error occurs
-
getPortlet
Portlet getPortlet(Long portletId_) throws InvalidAnonymousUserException, InvalidUserException, InvalidPortletException, PrivilegeException Deprecated.Gets a portlet- Parameters:
portletId_
- the id of the portlet- Returns:
- the portlet
- Throws:
InvalidAnonymousUserException
- if the user is anonymous, but anonymous access has not been enabledInvalidUserException
- if the user calling this method is invalidPrivilegeException
- if the current user is anonymous, and portlets of this portlet type are denied to anonymous users. The portlet types that anonymous users cannot see are configurable. See application documentation for further details.InvalidPortletException
- if the portlet is invalidServiceException
- if any system-level error occurs
-
getPortletsPaging
ResultPage getPortletsPaging(Long[] portletIds_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) throws InvalidAnonymousUserException, InvalidUserException, InvalidPortletException, PrivilegeException Deprecated.Gets a ResultPage containing a list of portlets as specified by the portlet ids- Parameters:
portletIds_
- the list of portlet idsstartIndex_
- the index into the collection of total results at which to start. Negative numbers are treated as zeros.batchSize_
- the number of results to return. UseConstants.COUNT_ALL
to return the entire collection, but this is STRONGLY discouraged.sortProperty_
- the property by which the results will be sortedsortOrder_
- The order in which to sort the results. This is eitherConstants.SORT_ORDER_ASCENDING
orConstants.SORT_ORDER_DESCENDING
- Returns:
- a ResultPage containing a list of
Portlet
objects - Throws:
InvalidAnonymousUserException
- if the user is anonymous, but anonymous access has not been enabledInvalidUserException
- if the user calling this method is invalidPrivilegeException
- if the current user is anonymous, and any of the portlets is of a type that is denied to anonymous users. The portlet types that anonymous users cannot see are configurable. See application documentation for further details.InvalidPortletException
- if the portlet is invalidServiceException
- if any system-level error occurs
-
getPortletsList
Deprecated.Returns a ResultList containingPortlet
instances for valid ids and result codes for all ids. The result codes will be one of thePORTLET_LIST_CODE_
constants on this interface.- Parameters:
portletIds_
- the ids of the portlets to retrieve- Returns:
ResultList
containingPortlet
objects- Throws:
ServiceException
- if any system-level error occurs
-
getPortlets
@Deprecated Portlet[] getPortlets(Long[] portletIds_) throws InvalidAnonymousUserException, InvalidUserException, InvalidPortletException, PrivilegeException Deprecated.Gets a list of portlets as specified by the portlet ids- Parameters:
portletIds_
- the list of portlet ids- Returns:
- an array of portlets
- Throws:
InvalidAnonymousUserException
- if the user is anonymous, but anonymous access has not been enabledInvalidUserException
- if the user calling this method is invalidPrivilegeException
- if the current user is anonymous, and any of the portlets is of a type that is denied to anonymous users. The portlet types that anonymous users cannot see are configurable. See application documentation for further details.InvalidPortletException
- if any of the portlets is invalidServiceException
- if any system-level error occurs
-
findPortletsPaging
ResultPage findPortletsPaging(String type_, String searchTerms_, Long p_, Integer sharedType_, Integer state_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) throws InvalidAnonymousUserException, InvalidUserException, InvalidPageException, InvalidPortletTypeException Deprecated.Gets a ResultPage containing a list of portlets of the given type obtained by searching for a string in name/description. Only returns portlets that can be seen by the user calling the function. Portlets that are on pagep_
are excluded from the results returned (p_
can be used to avoid returning portlets that could not be added to pagep
- since you can't put the same portlet on the same page twice). Ifp_
isNO_PAGE
, results are not excluded.- Parameters:
type_
- the type of the portletsearchTerms_
- the search stringp_
- exclude portlets that are on this page, unless the page isNO_PAGE
sharedType_
- whether portlet is shared or not. Valid values are:- SHARED_AND_UNSHARED_PORTLET
- SHARED_PORTLET
- UNSHARED_PORTLET
state_
- state of portlets being searched. Valid values are:- ACTIVE_AND_DEACTIVATED_PORTLET
- ACTIVE_PORTLET
- DEACTIVATED_PORTLET
startIndex_
- the index into the collection of total results at which to start. Negative numbers are treated as zeros.batchSize_
- the number of results to return. Negative numbers will result in the entire collection being returned, but this is STRONGLY discouraged.sortProperty_
- the property by which the results will be sorted. This is one of theSORT_BY_XXX
constants inPortlet
sortOrder_
- The order in which to sort the results. This is eitherConstants.SORT_ORDER_ASCENDING
orConstants.SORT_ORDER_DESCENDING
- Returns:
- a ResultPage containing a list of
Portlet
beans - Throws:
InvalidAnonymousUserException
- if the user is anonymous, but anonymous access has not been enabledInvalidUserException
- if the user calling this method is invalidInvalidPageException
- if pagep_
does not exist andp_
is notNO_PAGE
InvalidPortletTypeException
- if portlet type does not existServiceException
- if any system-level error occurs
-
findPortlets
@Deprecated Portlet[] findPortlets(String type_, String searchTerms_, Long p_, Integer sharedType_, Integer state_) throws InvalidAnonymousUserException, InvalidUserException, InvalidPageException, InvalidPortletTypeException Deprecated.Gets a list of shared portlets obtained by searching for a string in name/description. Only returns portlets that can be seen by the user calling the function. Portlets that are on pagep_
are excluded from the results returned (p_
can be used to avoid returning portlets that could not be added to pagep
- since you can't put the same portlet on the same page twice). Ifp_
isNO_PAGE
, results are not excluded.- Parameters:
type_
- the type of the portletsearchTerms_
- the search stringp_
- exclude portlets that are on this page, unless the page isNO_PAGE
sharedType_
- whether portlet is shared or not. Valid values are:- SHARED_AND_UNSHARED_PORTLET
- SHARED_PORTLET
- UNSHARED_PORTLET
state_
- state of portlets being searched. Valid values are:- ACTIVE_AND_DEACTIVATED_PORTLET
- ACTIVE_PORTLET
- DEACTIVATED_PORTLET
- Returns:
- a list of portlet beans
- Throws:
InvalidAnonymousUserException
- if the user is anonymous, but anonymous access has not been enabledInvalidUserException
- if the user calling this method is invalidInvalidPageException
- if pagep_
does not exist andp_
is notNO_PAGE
InvalidPortletTypeException
- if portlet type does not existServiceException
- if any system-level error occurs
-
updatePortlet
void updatePortlet(Portlet portlet_) throws IllegalArgumentException, InvalidAnonymousUserException, InvalidUserException, PrivilegeException, PortletSharingException, InvalidPortletException, InvalidPortletTypeException Deprecated.Update a portlet In order to update a portlet the fields following fields must be populated:id
,shareable
,inheritsSecurity
,portletType
,name
,frame
,public
. Portlet types can be retrieved fromAdministrationService.getPortletTypes()
- Parameters:
portlet_
- the portlet to update- Throws:
InvalidAnonymousUserException
- if the user is anonymous, but anonymous access has not been enabledInvalidUserException
- if the user calling this method is invalidPrivilegeException
- if the current user does not have editor privileges or greater for the portletPortletSharingException
- if portlet to be updated would be sharable and would also inherit securityIllegalArgumentException
- if one attempts to unshare a sharable portlet from this method (useunsharePortlet(java.lang.Long, java.lang.Long, boolean)
for this purpose) or if theparameters
map of the portlet is notnull
, but does not meet the requirements specified byPortlet.getParameters()
InvalidPortletException
- if the portlet is invalidInvalidPortletTypeException
- if the portlet type is invalidServiceException
- if any system-level error occurs
-
updatePortlets
void updatePortlets(Portlet[] portlets_) throws IllegalArgumentException, InvalidAnonymousUserException, InvalidUserException, PrivilegeException, PortletSharingException, InvalidPortletException, InvalidPortletTypeException Deprecated.Update portlets in bulk. SeeupdatePortlet(Portlet)
- Parameters:
portlets_
- the portlets to update- Throws:
InvalidAnonymousUserException
- if the user is anonymous, but anonymous access has not been enabledInvalidUserException
- if the user calling this method is invalidPrivilegeException
- if the current user does not have editor privileges or greater for the portletPortletSharingException
- if any portlet to be updated would be sharable and would also inherit securityIllegalArgumentException
- if one attempts to unshare a sharable portlet from this method (useunsharePortlet(java.lang.Long, java.lang.Long, boolean)
for this purpose) or if theparameters
map of any portlet is notnull
, but does not meet the requirements specified byPortlet.getParameters()
InvalidPortletException
- if any portlet is invalidInvalidPortletTypeException
- if any portlet type is invalidServiceException
- if any system-level error occurs
-
updatePortletParameters
void updatePortletParameters(Long portletId_, Map parameterValueMap_) throws IllegalArgumentException, InvalidUserException, PrivilegeException, InvalidPortletException Deprecated.Update the portlet's name/value pairs of its parameters- Parameters:
portletId_
- the id of the portletparameterValueMap_
- a map containing name/value pairs. Names must be single words, starting with a letter and containing only _, numbers and letters in the basic US character set. Values should be of typeString
, though future implementations (and experimentally, the current one) may allow other datatypes.- Throws:
InvalidAnonymousUserException
- if the user is anonymous, but anonymous access has not been enabledInvalidUserException
- if the user calling this method is invalidPrivilegeException
- if the current user does not have editor privileges or greater for the portletInvalidPortletException
- if portlet does not existIllegalArgumentException
- if theparameters
map of the portlet is notnull
, but does not meet the requirements specified byPortlet.getParameters()
ServiceException
- if any system-level error occurs
-
updatePortletsParameters
void updatePortletsParameters(Long[] portletIds_, Map[] parameterValueMaps_) throws IllegalArgumentException, InvalidUserException, PrivilegeException, InvalidPortletException Deprecated.Update the portlets' name/value pairs of their parameters- Parameters:
portletIds_
- the ids of the portletsparameterValueMaps_
- maps containing name/value pairs. Names must be single words, starting with a letter and containing only _, numbers and letters in the basic US character set. Values should be of typeString
, though future implementations (and experimentally, the current one) may allow other datatypes.- Throws:
InvalidAnonymousUserException
- if the user is anonymous, but anonymous access has not been enabledInvalidUserException
- if the user calling this method is invalidPrivilegeException
- if the current user does not have editor privileges or greater for the portletInvalidPortletException
- if any portlet does not existIllegalArgumentException
- if theparameters
map of any portlet is notnull
, but does not meet the requirements specified byPortlet.getParameters()
ServiceException
- if any system-level error occurs
-
getRoleMapForPortlet
Deprecated.Get the role map for a portlet NOTE: This should not be used to verify the access level that the current user has on the portlet because the access level can depend on other properties of the portlet such asinheritsSecurity
andshareable
.- Parameters:
portletId_
- the id of the portlet- Returns:
- rolemap for the portlet
- Throws:
InvalidPortletException
- if portlet does not existServiceException
- if any system-level error occurs
-
setRoleMapForPortlet
void setRoleMapForPortlet(Long portletId_, PortalRoleMap map_) throws InvalidAnonymousUserException, InvalidUserException, InvalidPortletException, PrivilegeException Deprecated.Set the role map for a portlet- Parameters:
portletId_
- the id of the portletmap_
- the new rolemap of the portlet- Throws:
InvalidAnonymousUserException
- if the user is anonymous, but anonymous access has not been enabledInvalidUserException
- if the user calling this method is invalid privileges or greater for the portletInvalidPortletException
- if portlet does not existPrivilegeException
- if the current user does not have admin privileges or greater for the portletServiceException
- if any system-level error occurs
-
getInheritedRoleMapForPortlet
PortalRoleMap getInheritedRoleMapForPortlet(Long portletId_, Long pageId_) throws InvalidPortletException Deprecated.Returns the role map that the portlet inherits from its page. If the portlet does not inherit security from its page, an empty role map is returned.- Parameters:
portletId_
- the id of the portletpageId_
- the id of the page- Returns:
- The role map for the portlet specified by the given id
- Throws:
InvalidPortletException
- if portlet does not existServiceException
- if any system-level error occurs
-