Package org.javlo.service
Class ContentService
- java.lang.Object
-
- org.javlo.service.ContentService
-
- All Implemented Interfaces:
IPrintInfo
public class ContentService extends Object implements IPrintInfo
- Author:
- pvanderm represent a content
-
-
Field Summary
Fields Modifier and Type Field Description protected static Logger
logger
create a static logger.static String
TRASH_PAGE_NAME
-
Method Summary
-
-
-
Field Detail
-
TRASH_PAGE_NAME
public static final String TRASH_PAGE_NAME
- See Also:
- Constant Field Values
-
logger
protected static Logger logger
create a static logger.
-
-
Method Detail
-
clearAllContextCache
public static void clearAllContextCache(ContentContext ctx) throws Exception
- Throws:
Exception
-
clearCache
public static void clearCache(ContentContext ctx, GlobalContext globalContext) throws Exception
- Throws:
Exception
-
clearAllCache
public static void clearAllCache(ContentContext ctx, GlobalContext globalContext) throws Exception
- Throws:
Exception
-
getInstance
public static ContentService getInstance(javax.servlet.http.HttpServletRequest request)
-
getViewNav
protected MenuElement getViewNav()
-
setViewNav
protected void setViewNav(MenuElement nav)
-
getInstance
public static ContentService getInstance(GlobalContext globalContext)
-
clearComponentCache
public void clearComponentCache()
-
contentExistForContext
public boolean contentExistForContext(ContentContext ctx) throws Exception
check if the content exist for this context.- Parameters:
ctx
- the current context.- Returns:
- true if content exist for this language false else.
- Throws:
DAOException
Exception
-
createContentMirrorIfNeeded
public String createContentMirrorIfNeeded(ContentContext ctx, MenuElement newPage, IContentVisualComponent comp, String parentId, boolean b) throws Exception
- Throws:
Exception
-
createContent
public String createContent(ContentContext ctx, MenuElement page, ComponentBean inBean, String parentId, boolean releaseCache) throws Exception
- Throws:
Exception
-
createContent
public String createContent(ContentContext ctx, MenuElement page, ComponentBean inBean, String parentId, boolean releaseCache, MenuElement sourcePage, Map<String,Collection<MirrorComponent>> mirrorNeedMoving) throws Exception
- Throws:
Exception
-
createContent
public String createContent(ContentContext ctx, ComponentBean inBean, String parentId, boolean releaseCache) throws Exception
- Throws:
Exception
-
createContentAtEnd
public String createContentAtEnd(ContentContext ctx, ComponentBean inBean, boolean releaseCache) throws Exception
- Throws:
Exception
-
createContent
public String createContent(ContentContext ctx, MenuElement page, Iterable<ComponentBean> inBean, String parentId, boolean releaseCache) throws Exception
- Throws:
Exception
-
createContent
public String createContent(ContentContext ctx, Collection<ComponentBean> inBean, String parentId, boolean releaseCache) throws Exception
- Throws:
Exception
-
createContent
public String createContent(ContentContext ctx, MenuElement page, String area, String parentId, String type, String content, boolean releaseCache) throws Exception
- Throws:
Exception
-
createContent
public String createContent(ContentContext ctx, MenuElement page, String area, String parentId, ComponentBean inBean, boolean releaseCache) throws Exception
- Throws:
Exception
-
createContentWidthId
public String createContentWidthId(ContentContext ctx, MenuElement page, String area, String parentId, ComponentBean inBean, boolean releaseCache) throws Exception
- Throws:
Exception
-
createContent
public String createContent(ContentContext ctx, String parentId, String type, String content, boolean releaseCache) throws Exception
- Throws:
Exception
-
createContent
public String createContent(ContentContext ctx, String parentId, String type, String content, boolean repeat, String renderer) throws Exception
- Throws:
Exception
-
deleteKeys
public void deleteKeys(String prefix)
-
removePreviewAttributes
public void removePreviewAttributes(Collection<Object> keys)
-
cleanAttribute
public int cleanAttribute(ContentContext ctx, String keySuffix)
-
getAttribute
public String getAttribute(ContentContext ctx, String key)
-
getAttribute
public String getAttribute(ContentContext ctx, String key, String defaultValue)
-
getCachedComponent
public IContentVisualComponent getCachedComponent(ContentContext ctx, String id) throws Exception
- Throws:
Exception
-
getComponentNoRealContentType
public IContentVisualComponent getComponentNoRealContentType(ContentContext ctx, String id) throws Exception
- Throws:
Exception
-
getComponent
public IContentVisualComponent getComponent(ContentContext ctx, String id) throws Exception
- Throws:
Exception
-
getComponentByType
public List<IContentVisualComponent> getComponentByType(ContentContext ctx, String type) throws Exception
- Throws:
Exception
-
getComponentAllLanguage
public IContentVisualComponent getComponentAllLanguage(ContentContext ctx, String id) throws Exception
- Throws:
Exception
-
getGlobalMap
public Map<String,String> getGlobalMap(ContentContext ctx)
return the globalmap in readonly mode.- Returns:
-
getNavigation
public MenuElement getNavigation(ContentContext ctx)
return all the content.
-
getTrashPage
public MenuElement getTrashPage(ContentContext ctx) throws Exception
- Throws:
Exception
-
isNavigationLoaded
public boolean isNavigationLoaded(ContentContext ctx)
check if navigation was allready loaded for a specific render mode.
-
getTimeTravelerNav
public MenuElement getTimeTravelerNav()
-
getWordCount
public int getWordCount(ContentContext ctx) throws Exception
- Throws:
Exception
-
isModified
public boolean isModified()
return true if the production site is different than the edit site.- Returns:
- true if modified false else.
-
releaseAll
public void releaseAll(ContentContext ctx, GlobalContext globalContext) throws Exception
- Throws:
Exception
-
releasePreviewNav
public void releasePreviewNav(ContentContext ctx) throws Exception
release the preview nav.- Parameters:
ctx
- if null context will not be updated (and content not reloaded now).- Throws:
Exception
-
releaseTimeTravelerNav
public void releaseTimeTravelerNav(ContentContext ctx) throws Exception
- Throws:
Exception
-
releaseViewNav
public void releaseViewNav(GlobalContext globalContext) throws Exception
- Throws:
Exception
-
releaseShortUrlMap
public void releaseShortUrlMap(GlobalContext globalContext) throws Exception
- Throws:
Exception
-
removeAttributeRAWKey
public void removeAttributeRAWKey(ContentContext ctx, String key)
-
removeAttribute
public void removeAttribute(ContentContext ctx, String key)
-
setAttribute
public void setAttribute(ContentContext ctx, String key, String value)
-
getPreviewKeys
public Collection<String> getPreviewKeys()
-
setCachedComponent
public void setCachedComponent(ContentContext ctx, IContentVisualComponent comp) throws Exception
- Throws:
Exception
-
getAllContent
public List<IContentVisualComponent> getAllContent(ContentContext ctx) throws Exception
- Throws:
Exception
-
setPreviewNav
public void setPreviewNav(MenuElement previewNav)
-
setTimeTravelerNav
public void setTimeTravelerNav(MenuElement timeTravelerNav)
-
isViewNav
public boolean isViewNav()
-
isPreviewNav
public boolean isPreviewNav()
-
getPageWithShortURL
public MenuElement getPageWithShortURL(ContentContext ctx, String shortURL) throws Exception
- Throws:
Exception
-
main
public static void main(String[] args)
-
getRegistrationPage
public MenuElement getRegistrationPage(ContentContext ctx) throws Exception
- Throws:
Exception
-
getDefaultValue
public String getDefaultValue(ContentContext ctx, String type) throws Exception
- Throws:
Exception
-
printInfo
public void printInfo(ContentContext ctx, PrintStream out)
- Specified by:
printInfo
in interfaceIPrintInfo
-
-