Interface LayoutService
- All Superinterfaces:
DataStorage
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface org.exoplatform.portal.config.DataStorage
DEFAULT_LIMIT -
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 site<S> Application<S> getApplicationModel(String applicationStorageId) RetrievedApplicationmodel switch its storage identifierdefault InputStreamgetDefaultSiteBannerStream(String siteName) Retrieve default site banner as stream<S> StringgetId(ApplicationState<S> 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 filter<S> Sload(ApplicationState<S> state, ApplicationType<S> type) 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 banner<S> ApplicationState<S> save(ApplicationState<S> state, S 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) Methods inherited from interface org.exoplatform.portal.config.DataStorage
getAllGroupNames, getAllPortalNames
-
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- Specified by:
createin interfaceDataStorage- Parameters:
config-PortalConfig
-
save
This method should update the PortalConfig object
Then broadcast PORTAL_CONFIG_UPDATED event- Specified by:
savein interfaceDataStorage- Parameters:
config-PortalConfig
-
getPortalConfig
This method should load the PortalConfig object from db according to the portalName- Specified by:
getPortalConfigin interfaceDataStorage- Parameters:
portalName-- Returns:
PortalConfig
-
getPortalConfig
This method should load the PortalConfig object from db according to the portalName and ownerType- Specified by:
getPortalConfigin interfaceDataStorage- Parameters:
ownerType-portalName-- Returns:
PortalConfig
-
getPortalConfig
RetrievesPortalConfigof designatedSiteKey- Specified by:
getPortalConfigin interfaceDataStorage- 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- Specified by:
removein interfaceDataStorage- 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- Specified by:
getPagein interfaceDataStorage- 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- Specified by:
getPagein interfaceDataStorage- Parameters:
pageKey-PageKey- Returns:
Page
-
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- Specified by:
removein interfaceDataStorage- Parameters:
page-Page
-
remove
Removes a page from store designated by itsPageKey- Specified by:
removein interfaceDataStorage- Parameters:
pageKey-PageKey
-
create
This method should create or update the given page object
Then broasdcast PAGE_CREATED event- Specified by:
createin interfaceDataStorage- 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- Specified by:
savein interfaceDataStorage- 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- Specified by:
getApplicationModelin interfaceDataStorage- Type Parameters:
S- can be of typePortletonly, seeApplicationType- Parameters:
applicationStorageId-- Returns:
Application
-
getId
Return contentId according to each state (transient, persistent, clone)- Specified by:
getIdin interfaceDataStorage- Type Parameters:
S- can be of typePortletonly, seeApplicationType- Parameters:
state-- Returns:
ApplicationStateof typePortlet
-
load
Return content state. If can't find, return null- Specified by:
loadin interfaceDataStorage- Type Parameters:
S- can be of typePortletonly, seeApplicationType- Parameters:
state- - ApplicationState objecttype- - ApplicationType object- Returns:
Portlet
-
save
Save content state- Specified by:
savein interfaceDataStorage- Type Parameters:
S- can be of typePortletonly, seeApplicationType- 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- Specified by:
findin interfaceDataStorage- 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.- Specified by:
find2in interfaceDataStorage- 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.- Specified by:
getSiteNamesin interfaceDataStorage- Parameters:
siteType-SiteTypeoffset- offset of the querylimit- limit of the list to fetch- Returns:
Listof corresponding site names, else empty list if not found
-
getImportStatus
- Specified by:
getImportStatusin interfaceDataStorage
-
saveImportStatus
- Specified by:
saveImportStatusin interfaceDataStorage
-
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
-