Skip navigation links


com.fatwire.services
Interface SiteService

All Superinterfaces:
Service

public interface SiteService
extends Service

The Site Service is the interface providing site, user, role and start menu related services.

Although the user and role entities can exist independently, they make sense only when they are related in the context of a site. A user can gain access to a site only once roles are assigned to the user for that site. The roles assigned to the "site-user" in a site governs the aspects of the application which that user will have access to within the site.

A start menu item establishes the relationship between roles and asset types that have been enabled in a site. A site-user will be able to use a start menu only when it has at least one of those roles which apply to that start menu.

For the methods in this service which accept a site id, if the value of the site id is less than or equal to 0, then that method throws an IllegalArgumentException.


Method Summary
 boolean addUserPreference(java.lang.String userid, java.lang.String siteid, java.lang.String name, java.lang.String value)
          add / update user preferences for login user
 boolean canPlacePage(long siteId)
          Checks if the logged in user is able to place pages in the specified site.
 java.util.List<RoleBean> getAllRoles()
          Returns a list of all roles in the system.
 java.util.List<java.lang.String> getEnabledTypes(long siteId)
          Returns the list of asset types enabled in the specified site.
 java.util.List<java.lang.String> getLocales(long siteId)
          Get available Locales for a given site.
 java.util.List<UserBean> getSiteUsers(long siteId)
          Returns the list of those users who have access to the specified site through one or more roles.
 java.util.List<StartMenuBean> getStartMenus(java.util.List<StartMenuBean.Type> types, long siteId)
           Returns the list of start menu items for the specified user in the specified site.
 java.lang.String getUserPreference(java.lang.String userid, java.lang.String siteid, java.lang.String name)
          fetch user preference value for login user in specific site
 java.util.Map<java.lang.String,java.lang.String> getUserPreferences(java.lang.String userid, java.lang.String siteid)
          retrieve user preferences for login user in the specified site.
 java.util.List<RoleBean> getUserRoles(long siteId)
          Returns a list of all roles for the logged in user in the specified site.
 boolean isPreviewEnabled(long siteId)
          Checks whether preview is enabled for assets in the specified site.
 boolean placePagesSPN(SitePlanNodeBean child, SitePlanNodeBean target, java.util.List<AssetId> children, SitePlanNodeBean previous)
           Places a Page asset under the specified parent Page asset at the specified index.
 boolean removeUserPreference(java.lang.String userid, java.lang.String siteid, java.lang.String name)
          add / update user preferences for login user
 java.lang.Boolean unPlacePagesSPN(SitePlanNodeBean child, SitePlanNodeBean previous, SitePlanNodeBean target, java.util.List<AssetId> children)
           Unplaces placed pages from a parent.

 

Methods inherited from interface com.fatwire.services.Service
getManager, getResponse, setManager

 

Method Detail

isPreviewEnabled

boolean isPreviewEnabled(long siteId)
                         throws ServiceException
Checks whether preview is enabled for assets in the specified site.
Returns:
true if preview is enabled in the specified site.
Throws:
ServiceException - wraps any exception underlying the service call.

getEnabledTypes

java.util.List<java.lang.String> getEnabledTypes(long siteId)
                                                 throws ServiceException
Returns the list of asset types enabled in the specified site.
Parameters:
siteId - id of the site in which the asset types are enabled.
Returns:
list of asset types.
Throws:
ServiceException - wraps any exception underlying the service call.

getSiteUsers

java.util.List<UserBean> getSiteUsers(long siteId)
                                      throws ServiceException
Returns the list of those users who have access to the specified site through one or more roles.
Parameters:
siteId - id of the site in which the users have access.
Returns:
list of users.
Throws:
ServiceException - wraps any exception underlying the service call.

getAllRoles

java.util.List<RoleBean> getAllRoles()
                                     throws ServiceException
Returns a list of all roles in the system.
Returns:
list of roles.
Throws:
ServiceException - wraps any exception underlying the service call.

getUserRoles

java.util.List<RoleBean> getUserRoles(long siteId)
                                      throws ServiceException
Returns a list of all roles for the logged in user in the specified site. If the logged in user does not have any roles in the specified site, the list returned is empty.
Returns:
list of roles.
Throws:
ServiceException - wraps any exception underlying the service call.

getStartMenus

java.util.List<StartMenuBean> getStartMenus(java.util.List<StartMenuBean.Type> types,
                                            long siteId)
                                            throws ServiceException

Returns the list of start menu items for the specified user in the specified site.

The start menu items available to a user in a site are based on the roles assigned to the user in that site. The returned list will contain a union of start menu items for each start menu type specified.
Parameters:
types - the list of start menu types.
site - the site for which the start menu is to be retrieved.
Returns:
the start menu which is a list containing start menu items for each start menu type specified.
Throws:
ServiceException - wraps any exception underlying the service call.
See Also:
StartMenuBean.Type

getLocales

java.util.List<java.lang.String> getLocales(long siteId)
                                            throws ServiceException
Get available Locales for a given site.
Parameters:
siteId - the site for which the locales are to be retrieved.
Returns:
a list of names of the available locales.
Throws:
ServiceException - wraps any exception underlying the service call.

canPlacePage

boolean canPlacePage(long siteId)
                     throws ServiceException
Checks if the logged in user is able to place pages in the specified site.
Parameters:
siteId - the site in which the pages are to be placed.
Returns:
true if the current user can place pages in the specified site.
Throws:
ServiceException - wraps any exception underlying the service call.

placePagesSPN

boolean placePagesSPN(SitePlanNodeBean child,
                      SitePlanNodeBean target,
                      java.util.List<AssetId> children,
                      SitePlanNodeBean previous)
                      throws ServiceException

Places a Page asset under the specified parent Page asset at the specified index.

If the parent page is null, the service places the page asset as a top level page in the site. If the specified page is already placed, this method moves it according to the specified parent and index. In this process, it may modify the index of the other placed pages under the source and target parents which it has been moved.

For example, if P1 (top-level, rank=1) has child pages P11 (rank=1) and P12 (rank=2), and P2 has child pages P21 (rank=1), P22 (rank=2) and P23 (rank=3), then moving P23 to index 2 under P2 should change the rank of P22 to 3 and that of P23 to 2.

Now, if P21 is moved under P1 and index 2, then rank of P11 is not modified, but P21 has P1 as parent and rank 2, while P12 has rank 3. Also, P23 (which had moved to rank 2 with the prior operation) will now will now have rank 2.

Parameters:
page - the Page asset to place
parentPage - the parent Page asset under which to place page, or null if page should be a top-level page.
Returns:
true if the page could be successfully placed, false otherwise.
Throws:
ServiceException - wraps any exception underlying the service call.

unPlacePagesSPN

java.lang.Boolean unPlacePagesSPN(SitePlanNodeBean child,
                                  SitePlanNodeBean previous,
                                  SitePlanNodeBean target,
                                  java.util.List<AssetId> children)
                                  throws ServiceException

Unplaces placed pages from a parent.

This method quietly ignores the unplace operation if the specified pages is already unplaced. If it is a placed page, this method will unplace the page and re-index the ranks of the other siblings from the location where it is unplaced.

For example, if P1 (top-level, rank=1) has child pages P11 (rank=1), P12 (rank=2) and P13 (rank=3), then unplacing P12 should change the rank of P13 to 2.

Parameters:
parent - the id of the parent from which pages are being unplaced.
parentPage - the parent Page asset under which to place page, or null if page should be a top-level page.
Returns:
true if the operation is successful, false otherwise
Throws:
ServiceException - wraps any exception underlying the service call.

getUserPreferences

java.util.Map<java.lang.String,java.lang.String> getUserPreferences(java.lang.String userid,
                                                                    java.lang.String siteid)
                                                                    throws ServiceException
retrieve user preferences for login user in the specified site.
Returns:
a Map where:
  • the key is a String representing the attribute name
  • the value is a String representing the tab id
Throws:
ServiceException - wraps any exception underlying the service call.

addUserPreference

boolean addUserPreference(java.lang.String userid,
                          java.lang.String siteid,
                          java.lang.String name,
                          java.lang.String value)
                          throws ServiceException
add / update user preferences for login user
Returns:
a Map where:
  • the key is a String representing the attribute name
  • the value is a String representing the tab id
Throws:
ServiceException - wraps any exception underlying the service call.

getUserPreference

java.lang.String getUserPreference(java.lang.String userid,
                                   java.lang.String siteid,
                                   java.lang.String name)
                                   throws ServiceException
fetch user preference value for login user in specific site
Returns:
a Map where:
  • the key is a String representing the attribute name
  • the value is a String representing the tab id
Throws:
ServiceException - wraps any exception underlying the service call.

removeUserPreference

boolean removeUserPreference(java.lang.String userid,
                             java.lang.String siteid,
                             java.lang.String name)
                             throws ServiceException
add / update user preferences for login user
Returns:
a Map where:
  • the key is a String representing the attribute name
  • the value is a String representing the tab id
Throws:
ServiceException - wraps any exception underlying the service call.

Skip navigation links


Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.