Interface LayoutService
public interface LayoutService
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidThis method should create or update the given page object
Then broasdcast PAGE_CREATED eventvoidcreate(PortalConfig config) Create a PortalConfig in database
Then broadcast PORTAL_CONFIG_CREATED event<T> org.exoplatform.commons.utils.LazyPageList<T> find(Query<T> q, Comparator<T> sortComparator) Return LazyPageList of object (sorted) which type and other info determined in Query object<T> org.exoplatform.commons.utils.ListAccess<T> find2(Query<T> q, Comparator<T> sortComparator) Return ListAccess, we can retrieved array of object (sorted) in database through this.findPages(int offset, int limit, SiteType siteType, String siteName, String pageName, String pageTitle) Search for pages using some criteria and pagination optionsRetrieves the list of pages in a give sitegetApplicationModel(String applicationStorageId) RetrievedApplicationmodel switch its storage identifierdefault InputStreamgetDefaultSiteBannerStream(String siteName) Retrieve default site banner as streamgetId(ApplicationState state) Return contentId according to each state (transient, persistent, clone)default StatusgetPage(long id) This method should load the Page object from the database according to the technical identifier of the pageThis method should load the Page object from the database according to the pageIdRetrieves Page designated by its keygetPageContext(PageKey pageKey) retrievesPageContextswitch its keygetPortalConfig(long siteId) This method should load the PortalConfig object from db according to the siteIdgetPortalConfig(String portalName) This method should load the PortalConfig object from db according to the portalNamegetPortalConfig(String ownerType, String portalName) This method should load the PortalConfig object from db according to the portalName and ownerTypegetPortalConfig(SiteKey siteKey) RetrievesPortalConfigof designatedSiteKeygetSharedLayout(String siteName) Return shared layout containing common layout of all sites (user, group and sites).default InputStreamgetSiteBannerStream(String siteName) Retrieve site banner as streamgetSiteNames(SiteType siteType, int offset, int limit) Retrieves all site type names with pagination.default List<PortalConfig> getSites(SiteFilter siteFilter) Retrieves sites according to the given site filterload(ApplicationState state) Return content state.voidRemoves a given page from storevoidremove(PortalConfig config) Remove the PortalConfig from the database
Then broadcast PORTAL_CONFIG_REMOVED eventvoidRemoves a page from store designated by itsPageKeyvoidremovePages(SiteKey siteKey) Removes all pages of a given sitedefault voidremoveSiteBanner(String siteName) remove site bannersave(ApplicationState state, Portlet preferences) Save content stateSaves a page.voidsave(PortalConfig config) This method should update the PortalConfig object
Then broadcast PORTAL_CONFIG_UPDATED eventvoidsave(PageContext pageContext) Saves aPageContextwith itsPageStatevoidsave(PageContext pageContext, Page page) default voidsaveImportStatus(Status status) default voidsavePageFromTemplate(PageKey sourcePageTemplateKey, SiteKey targetSiteKey, String permission) default voidsavePagesFromTemplate(SiteKey sourceSiteTemplate, SiteKey targetSiteKey, String permission) default voidsavePortalFromTemplate(SiteKey sourceSiteTemplate, SiteKey targetSiteKey) default voidsavePortalFromTemplate(SiteKey sourceSiteTemplate, SiteKey targetSiteKey, String permission)
-
Field Details
-
PAGE_CREATED
-
PAGE_REMOVED
-
PAGE_UPDATED
-
PORTAL_CONFIG_CREATED
-
PORTAL_CONFIG_REMOVED
-
PORTAL_CONFIG_UPDATED
-
-
Method Details
-
create
Create a PortalConfig in database
Then broadcast PORTAL_CONFIG_CREATED event- Parameters:
config-PortalConfig
-
save
This method should update the PortalConfig object
Then broadcast PORTAL_CONFIG_UPDATED event- Parameters:
config-PortalConfig
-
getPortalConfig
This method should load the PortalConfig object from db according to the portalName- Parameters:
portalName-- Returns:
PortalConfig
-
getPortalConfig
This method should load the PortalConfig object from db according to the portalName and ownerType- Parameters:
ownerType-portalName-- Returns:
PortalConfig
-
getPortalConfig
RetrievesPortalConfigof designatedSiteKey- Parameters:
siteKey-SiteKey- Returns:
- null if not found, else
PortalConfig
-
getPortalConfig
This method should load the PortalConfig object from db according to the siteId- Parameters:
siteId-- Returns:
PortalConfig
-
remove
Remove the PortalConfig from the database
Then broadcast PORTAL_CONFIG_REMOVED event- Parameters:
config-PortalConfig
-
removePages
Removes all pages of a given site- Parameters:
siteKey-SiteKey
-
getPage
This method should load the Page object from the database according to the pageId- Parameters:
pageId- - String represent id of page, it must be valid pageId (3 parts saparate by :: )- Returns:
Page
-
getPage
This method should load the Page object from the database according to the technical identifier of the page- Parameters:
id- - UUID of page- Returns:
Page
-
getPage
Retrieves Page designated by its key -
getPageContext
retrievesPageContextswitch its key- Parameters:
pageKey-PageKey- Returns:
PageContext
-
findPages
Retrieves the list of pages in a give site- Parameters:
siteKey-SiteKey- Returns:
Listof typePageContext
-
findPages
QueryResult<PageContext> findPages(int offset, int limit, SiteType siteType, String siteName, String pageName, String pageTitle) Search for pages using some criteria and pagination options- Parameters:
offset- pagination offsetlimit- pagination limitsiteType-SiteTypesiteName- site namepageName- page name search termpageTitle- page title search term- Returns:
QueryResultcontaining list of pages
-
remove
Removes a given page from store- Parameters:
page-Page
-
remove
Removes a page from store designated by itsPageKey- Parameters:
pageKey-PageKey
-
create
This method should create or update the given page object
Then broasdcast PAGE_CREATED event- Parameters:
page-
-
save
Saves a page. If a page with the same id already exists then a merge operation will occur, otherwise it throwsIllegalStateException
The operation returns a list of the change object that describes the changes that occured during the save operation.
Then broadcast PAGE_UPDATED event- Parameters:
page- the page to save- Returns:
- the list of model changes that occurred during the save
-
save
- Parameters:
pageContext-PageContextwith title, description and permissionspage-Pageto save page layout and structure
-
save
Saves aPageContextwith itsPageState- Parameters:
pageContext-PageContextwith title, description and permissions
-
getApplicationModel
RetrievedApplicationmodel switch its storage identifier- Parameters:
applicationStorageId-- Returns:
Application
-
getId
Return contentId according to each state (transient, persistent, clone)- Parameters:
state-- Returns:
ApplicationStateof typePortlet
-
load
Return content state. If can't find, return null- Parameters:
state- - ApplicationState object- Returns:
Portlet
-
save
Save content state- Parameters:
state- - ApplicationState object. It must be CloneApplicationState or PersistentApplicationState objectpreferences- - object to be saved- Returns:
ApplicationStatetyped withPortlet
-
find
Return LazyPageList of object (sorted) which type and other info determined in Query object- Type Parameters:
T- could be of typePageorPortalConfig- Parameters:
q- - Query objectsortComparator-Comparatorused for sorting results- Returns:
LazyPageList
-
find2
Return ListAccess, we can retrieved array of object (sorted) in database through this.- Type Parameters:
T- could be of typePageorPortalConfig- Parameters:
q- - Query objectsortComparator- - Comparator object, used to sort the result list- Returns:
LazyPageList
-
getSiteNames
Retrieves all site type names with pagination. -
getImportStatus
-
saveImportStatus
-
getSites
Retrieves sites according to the given site filter- Parameters:
siteFilter-SiteFiltersite filter for results filtering- Returns:
Listof sites portal config
-
getSiteBannerStream
default InputStream getSiteBannerStream(String siteName) throws org.exoplatform.commons.exception.ObjectNotFoundException, IOException Retrieve site banner as stream- Parameters:
siteName- name of the portal site- Returns:
- found
InputStream - Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- When site not found or file attachmentIOException
-
getDefaultSiteBannerStream
Retrieve default site banner as stream- Parameters:
siteName- name of the portal site- Returns:
- found
InputStream
-
removeSiteBanner
default void removeSiteBanner(String siteName) throws org.exoplatform.commons.exception.ObjectNotFoundException remove site banner- Parameters:
siteName- name of the portal site- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- When site not found or file attachment
-
savePortalFromTemplate
-
savePortalFromTemplate
-
savePagesFromTemplate
-
savePageFromTemplate
default void savePageFromTemplate(PageKey sourcePageTemplateKey, SiteKey targetSiteKey, String permission) throws org.exoplatform.commons.exception.ObjectNotFoundException - Parameters:
sourcePageTemplateKey- Site template's Page KeytargetSiteKey- destination Site Keypermission- Permission to use to change pattern "@owenr@" if existing in pages and portal layouts- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException
-