public class MacroHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ALPHABET |
static int |
CALENDAR_LONG |
static int |
CALENDAR_SHORT |
static String |
MACRO_DATE_KEY |
Constructor and Description |
---|
MacroHelper() |
Modifier and Type | Method and Description |
---|---|
static String |
addContent(String lg,
MenuElement page,
String parentCompId,
String contentType,
String style,
String area,
String value,
boolean inList,
User authors) |
static String |
addContent(String lg,
MenuElement page,
String parentCompId,
String contentType,
String style,
String area,
String renderer,
String value,
User authors)
add content to a page
|
static String |
addContent(String lg,
MenuElement page,
String parentCompId,
String contentType,
String style,
String area,
String value,
User authors)
add content to a page
|
static String |
addContent(String lg,
MenuElement page,
String parentCompId,
String contentType,
String style,
String value,
User authors)
add content to a page
|
static String |
addContent(String lg,
MenuElement page,
String parentCompId,
String contentType,
String value,
User authors)
add content to a page
|
static String |
addContentIfNotExist(ContentContext ctx,
MenuElement page,
String parentCompId,
String contentType,
String value)
add content to a page
|
static String |
addContentIfNotExist(ContentContext ctx,
MenuElement page,
String parentCompId,
String contentType,
String value,
String style)
add content to a page
|
static void |
addContentInPage(ContentContext ctx,
MenuElement newPage,
String pageStructureName) |
static void |
addContentInPage(ContentContext ctx,
MenuElement newPage,
String pageStructureName,
Date date,
Collection<String> tags) |
static MenuElement |
addPage(ContentContext ctx,
MenuElement parentPage,
String pageName,
boolean top,
boolean store) |
static MenuElement |
addPage(ContentContext ctx,
String parentName,
String pagePrefix,
boolean top)
insert a page in the navigation.
|
static MenuElement |
addPageIfNotExist(ContentContext ctx,
MenuElement parentPage,
String pageName,
boolean top,
boolean store) |
static MenuElement |
addPageIfNotExist(ContentContext ctx,
String parentName,
String pageName,
boolean top)
insert a page in the navigation if she does'nt exist.
|
static MenuElement |
addPageIfNotExistWithoutMessage(ContentContext ctx,
MenuElement parentPage,
MenuElement subPage,
boolean top,
boolean store)
insert the page in the navigation if she does not exist and add not
existing parent page too.
|
static MenuElement |
addPageIfNotExistWithoutMessage(ContentContext ctx,
MenuElement parentPage,
String pageName,
boolean top)
insert a page in the navigation if she does'nt exist.
|
static String |
copyChildren(ContentContext ctx,
MenuElement source,
MenuElement target,
String sourcePattern,
String targetPattern) |
static void |
copyLanguageStructure(MenuElement currentPage,
ContentContext ctx,
List<ContentContext> otherLanguageContexts,
boolean withContent,
boolean translate)
Copy all component in the current language to the otherLanguageContexts
BUT with an empty value.
|
static void |
copyLocalContent(MenuElement fromPage,
ContentContext fromCtx,
MenuElement toPage,
ContentContext toCtx)
Copy the local content of the current language to
toPage . |
static void |
createAlphabeticChildren(ContentContext ctx,
MenuElement parentPage) |
static MenuElement |
createArticlePage(ContentContext ctx,
MenuElement rootPage,
Date date) |
static MenuElement |
createArticlePageName(ContentContext ctx,
MenuElement monthPage) |
static void |
createMonthStructure(ContentContext ctx,
MenuElement yearPage) |
static void |
createPageStructure(ContentContext ctx,
MenuElement page,
Map componentsType,
boolean fakeContent) |
static void |
createPageStructure(ContentContext ctx,
MenuElement page,
Map componentsType,
boolean fakeContent,
Date date,
Collection<String> tags) |
static MenuElement |
createPathIfNotExist(ContentContext ctx,
String path)
create all pages of a path or return the existing page.
|
static void |
deleteContentByLanguage(ContentContext ctx,
MenuElement page,
String lg) |
static void |
deleteLocalContent(MenuElement currentPage,
ContentContext ctx)
Delete local content of the current language for the page specified.
|
static MenuElement |
duplicatePage(ContentContext ctx,
MenuElement page,
String newname,
boolean mirror) |
static String |
getAlphabeticChildrenName(MenuElement parentPage,
Character letter) |
static Date |
getCurrentMacroDate(javax.servlet.http.HttpSession session) |
static String |
getDisplayName(Calendar cal,
int field,
int style,
Locale locale)
code from JDK 1.7 for compatibility to for JDK < 1.6
|
static String |
getLaunchMacroXHTML(ContentContext ctx,
String macro,
String label,
String css) |
static String |
getMonthPageName(ContentContext ctx,
String yearPageName,
Date date) |
static String |
getXHTMLMacroSelection(ContentContext ctx) |
static String |
getXHTMLMacroSelection(ContentContext ctx,
boolean adminMode,
boolean preview) |
static void |
insertContent(ContentContext ctx,
MenuElement page,
String content)
add content to a page.
|
static boolean |
isMacro(ContentContext ctx) |
static void |
main(String[] args) |
static boolean |
removeContent(ContentContext ctx,
String id) |
static List<MenuElement> |
searchArticleRoot(ContentContext ctx)
return a list of page with only year as children.
|
static void |
setCurrentMacroDate(javax.servlet.http.HttpSession session,
Date date) |
public static final String ALPHABET
public static String MACRO_DATE_KEY
public static final int CALENDAR_SHORT
public static final int CALENDAR_LONG
public static final String addContent(String lg, MenuElement page, String parentCompId, String contentType, String value, User authors) throws Exception
ctx
- the current content contextpage
- the page when the content must be inseredparentComp
- the parent componentcontentType
- the type of the componentvalue
- the value of the componentException
public static final String addContent(String lg, MenuElement page, String parentCompId, String contentType, String style, String value, User authors) throws Exception
page
- the page when the content must be inseredparentCompId
- the parent component idcontentType
- the type of the componentstyle
- the style of the componentvalue
- the value of the componentException
public static final String addContent(String lg, MenuElement page, String parentCompId, String contentType, String style, String area, String value, User authors) throws Exception
lg
- page
- the page when the content must be inseredparentCompId
- the parent component idcontentType
- the type of the componentstyle
- the style of the componentarea
- the area of the componentvalue
- the value of the componentException
public static final String addContent(String lg, MenuElement page, String parentCompId, String contentType, String style, String area, String renderer, String value, User authors) throws Exception
lg
- page
- the page when the content must be inseredparentCompId
- the parent component idcontentType
- the type of the componentstyle
- the style of the componentrenderer
- the renderer selection of the componentarea
- the area of the componentvalue
- the value of the componentException
public static final String addContent(String lg, MenuElement page, String parentCompId, String contentType, String style, String area, String value, boolean inList, User authors) throws Exception
Exception
public static final String addContentIfNotExist(ContentContext ctx, MenuElement page, String parentCompId, String contentType, String value) throws Exception
ctx
- the current content contextpage
- the page when the content must be inseredparentComp
- the parent componentcontentType
- the type of the componentvalue
- the value of the componentException
public static final String addContentIfNotExist(ContentContext ctx, MenuElement page, String parentCompId, String contentType, String value, String style) throws Exception
ctx
- the current content contextpage
- the page when the content must be inseredparentComp
- the parent componentcontentType
- the type of the componentvalue
- the value of the componentException
public static final MenuElement addPage(ContentContext ctx, String parentName, String pagePrefix, boolean top) throws Exception
parentName
- the name of the parent pagepagePrefix
- the prefix of the new page (suffix in the number). sp. :
prefix : news- page name : news-12Exception
public static final MenuElement addPageIfNotExist(ContentContext ctx, MenuElement parentPage, String pageName, boolean top, boolean store) throws Exception
Exception
public static final MenuElement addPage(ContentContext ctx, MenuElement parentPage, String pageName, boolean top, boolean store) throws Exception
Exception
public static final MenuElement addPageIfNotExist(ContentContext ctx, String parentName, String pageName, boolean top) throws Exception
parentName
- the name of the parent pagepageName
- the name of the new pageException
public static final MenuElement addPageIfNotExistWithoutMessage(ContentContext ctx, MenuElement parentPage, MenuElement subPage, boolean top, boolean store) throws Exception
ctx
- parentPage
- subPage
- top
- Exception
public static final MenuElement addPageIfNotExistWithoutMessage(ContentContext ctx, MenuElement parentPage, String pageName, boolean top) throws Exception
parentName
- the name of the parent pagepageName
- the name of the new pageException
public static void copyLanguageStructure(MenuElement currentPage, ContentContext ctx, List<ContentContext> otherLanguageContexts, boolean withContent, boolean translate) throws Exception
currentPage
- ctx
- otherLanguageContexts
- Exception
public static void copyLocalContent(MenuElement fromPage, ContentContext fromCtx, MenuElement toPage, ContentContext toCtx) throws Exception
toPage
.
Create the page or the parent page if they don't exists.fromPage
- fromCtx
- toPage
- toCtx
- Exception
public static MenuElement createPathIfNotExist(ContentContext ctx, String path) throws Exception
ctx
- current contentpath
- the new path.Exception
public static void deleteLocalContent(MenuElement currentPage, ContentContext ctx) throws Exception
currentPage
- ctx
- Exception
public static boolean removeContent(ContentContext ctx, String id) throws Exception
Exception
public static Date getCurrentMacroDate(javax.servlet.http.HttpSession session)
public static String getDisplayName(Calendar cal, int field, int style, Locale locale)
public static final String getXHTMLMacroSelection(ContentContext ctx) throws FileNotFoundException, IOException
FileNotFoundException
IOException
public static void insertContent(ContentContext ctx, MenuElement page, String content) throws Exception
ctx
- Current Contextpage
- page with new contentcontent
- the content formated in a string.Exception
public static final String getXHTMLMacroSelection(ContentContext ctx, boolean adminMode, boolean preview) throws FileNotFoundException, IOException
FileNotFoundException
IOException
public static final boolean isMacro(ContentContext ctx)
public static void setCurrentMacroDate(javax.servlet.http.HttpSession session, Date date)
public static MenuElement createArticlePageName(ContentContext ctx, MenuElement monthPage) throws Exception
Exception
public static List<MenuElement> searchArticleRoot(ContentContext ctx) throws Exception
ctx
- Exception
public static void createPageStructure(ContentContext ctx, MenuElement page, Map componentsType, boolean fakeContent) throws Exception
Exception
public static void createPageStructure(ContentContext ctx, MenuElement page, Map componentsType, boolean fakeContent, Date date, Collection<String> tags) throws Exception
Exception
public static void addContentInPage(ContentContext ctx, MenuElement newPage, String pageStructureName) throws IOException, Exception
IOException
Exception
public static void addContentInPage(ContentContext ctx, MenuElement newPage, String pageStructureName, Date date, Collection<String> tags) throws IOException, Exception
IOException
Exception
public static String getMonthPageName(ContentContext ctx, String yearPageName, Date date)
public static void createMonthStructure(ContentContext ctx, MenuElement yearPage) throws Exception
Exception
public static MenuElement createArticlePage(ContentContext ctx, MenuElement rootPage, Date date) throws IOException, Exception
IOException
Exception
public static String getAlphabeticChildrenName(MenuElement parentPage, Character letter)
public static void createAlphabeticChildren(ContentContext ctx, MenuElement parentPage) throws Exception
Exception
public static void deleteContentByLanguage(ContentContext ctx, MenuElement page, String lg)
public static String getLaunchMacroXHTML(ContentContext ctx, String macro, String label, String css)
public static MenuElement duplicatePage(ContentContext ctx, MenuElement page, String newname, boolean mirror) throws SecurityException, IllegalArgumentException, IllegalAccessException, InvocationTargetException
public static String copyChildren(ContentContext ctx, MenuElement source, MenuElement target, String sourcePattern, String targetPattern) throws SecurityException, IllegalArgumentException, IllegalAccessException, InvocationTargetException
public static void main(String[] args)
Copyright © 2012-2018. All Rights Reserved.