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
FieldsModifier and TypeFieldDescriptionstatic final IntegerDeprecated.A constant used to indicate both activated and deactivated portlets will be included from portlet searchesstatic final IntegerDeprecated.A constant used to indicate only activated portlets will be included from portlet searchesstatic final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final IntegerDeprecated.A constant used to indicate only deactivated portlets will be included from portlet searchesstatic final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final LongDeprecated.A constant used to indicate that no pages will be excluded from portlet searchesstatic final IntegerDeprecated.A constant used to indicate that the user can administer the requested portlet.static final IntegerDeprecated.A constant used to indicate that the user can edit the requested portlet.static final IntegerDeprecated.A constant used to indicate that the requested portlet id was not valid.static final IntegerDeprecated.A constant used to indicate that the user does not have adequate privileges to retrieve the requested portlet.static final IntegerDeprecated.A constant used to indicate that the user can view the requested portlet.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final IntegerDeprecated.A constant used to indicate both shared and unshared portlets will be included from portlet searchesstatic final IntegerDeprecated.A constant used to indicate only shared portlets will be included from portlet searchesstatic final IntegerDeprecated.A constant used to indicate only unshared portlets will be included from portlet searchesstatic final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.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.intgetAccessLevelForPortlet(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 containingPortletinstances 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 asinheritsSecurityandshareable.voidsetRoleMapForPortlet(Long portletId_, PortalRoleMap map_) Deprecated.Set the role map for a portletvoidunsharePortlet(Long portletId_, Long pageId_, boolean force_) Deprecated.Make a shared portlet non-shareable and clear it's uuid if it has one.voidupdatePortlet(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.voidupdatePortletParameters(Long portletId_, Map parameterValueMap_) Deprecated.Update the portlet's name/value pairs of its parametersvoidupdatePortlets(Portlet[] portlets_) Deprecated.Update portlets in bulk.voidupdatePortletsParameters(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
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getAccessLevelForPortlets$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
createPortlet$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
createPortlets$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getPortlet$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getPortletsPaging$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getPortletsList$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getPortlets$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
findPortletsPaging$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
findPortlets$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
updatePortlet$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
updatePortlets$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
updatePortletParameters$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
updatePortletsParameters$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getRoleMapForPortlet$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
setRoleMapForPortlet$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getInheritedRoleMapForPortlet$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
-
Method Details
-
getAccessLevelForPortlet
@Read(K_PORTAL) 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_XXXconstants 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 exist
-
getAccessLevelForPortlets
@Read(K_PORTAL) 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_XXXconstants 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 exist
-
createPortlet
@Write(K_PORTAL) 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 theparametersmap of the portlet is notnull, but does not meet the requirements specified byPortlet.getParameters()DuplicateUuidException- if the UUID of the portlet already exists
-
createPortlets
@Write(K_PORTAL) 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 theparametersmap 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 portlets
-
getPortlet
@Read(K_PORTAL) 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 invalid
-
getPortletsPaging
@Read(K_PORTAL) 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_ALLto 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_ASCENDINGorConstants.SORT_ORDER_DESCENDING- Returns:
- a ResultPage containing a list of
Portletobjects - 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 invalid
-
getPortletsList
Deprecated.Returns a ResultList containingPortletinstances 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:
ResultListcontainingPortletobjects
-
getPortlets
@Deprecated @Read(K_PORTAL) 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 invalid
-
findPortletsPaging
@Read(K_PORTAL) 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_PAGEsharedType_- 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_XXXconstants inPortletsortOrder_- The order in which to sort the results. This is eitherConstants.SORT_ORDER_ASCENDINGorConstants.SORT_ORDER_DESCENDING- Returns:
- a ResultPage containing a list of
Portletbeans - 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_PAGEInvalidPortletTypeException- if portlet type does not exist
-
findPortlets
@Deprecated @Read(K_PORTAL) 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_PAGEsharedType_- 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_PAGEInvalidPortletTypeException- if portlet type does not exist
-
updatePortlet
@Write(K_PORTAL) 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 theparametersmap 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 invalid
-
updatePortlets
@Write(K_PORTAL) 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 theparametersmap 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 invalid
-
updatePortletParameters
@Write(K_PORTAL) 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 theparametersmap of the portlet is notnull, but does not meet the requirements specified byPortlet.getParameters()
-
updatePortletsParameters
@Write(K_PORTAL) 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 theparametersmap of any portlet is notnull, but does not meet the requirements specified byPortlet.getParameters()
-
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 asinheritsSecurityandshareable.- Parameters:
portletId_- the id of the portlet- Returns:
- rolemap for the portlet
- Throws:
InvalidPortletException- if portlet does not exist
-
setRoleMapForPortlet
@Write(K_PORTAL) 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 portlet
-
getInheritedRoleMapForPortlet
@Read(K_PORTAL) 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 exist
-