Package org.javlo.helper
Class ComponentHelper
- java.lang.Object
-
- org.javlo.helper.ComponentHelper
-
public class ComponentHelper extends Object
- Author:
- pvandermaesen some method for help create component.
-
-
Constructor Summary
Constructors Constructor Description ComponentHelper()
-
Method Summary
-
-
-
Method Detail
-
createDynamicPage
public static String createDynamicPage(ContentContext ctx, String path, String content) throws Exception
create a dynamic paragraph with a specific content on a page with a DynamicParagraph- Throws:
Exception
-
getComponentFromRequest
public static IContentVisualComponent getComponentFromRequest(ContentContext ctx) throws Exception
- Throws:
Exception
-
getComponentFromRequest
public static IContentVisualComponent getComponentFromRequest(ContentContext ctx, String paramName) throws Exception
get a component with the id in the request.- Parameters:
ctx
-paramName
- the name of the parameter it contains the id.- Returns:
- Throws:
Exception
-
getInternalLinkEdition
public static String getInternalLinkEdition(ContentContext ctx, String linkName, String linkIdStr)
-
getInternalLinkFromId
public static String getInternalLinkFromId(ContentContext ctx, String linkId, String label) throws Exception
create a XHTML link with a id of a MenuElement- Parameters:
ctx
- the current dc contextlinkId
- the unic identifier of the pagelabel
- the set label of the link- Returns:
- a XHTML code
- Throws:
Exception
-
moveComponent
public static void moveComponent(ContentContext ctx, IContentVisualComponent comp, IContentVisualComponent newPrevious, MenuElement targetPage, String area) throws Exception
- Throws:
Exception
-
smartMoveComponent
public static void smartMoveComponent(ContentContext ctx, IContentVisualComponent comp, IContentVisualComponent newPrevious, MenuElement targetPage, String area) throws Exception
- Throws:
Exception
-
changeAllArea
public static void changeAllArea(Iterable<ComponentBean> beans, String newArea)
change all area of a componentBean list.- Parameters:
beans
- list of content.newArea
- new area, can be null.
-
getPreviousComponentId
public static String getPreviousComponentId(IContentVisualComponent inComp, ContentContext ctx) throws Exception
- Throws:
Exception
-
getPreviousComponent
public static IContentVisualComponent getPreviousComponent(IContentVisualComponent inComp, ContentContext ctx) throws Exception
- Throws:
Exception
-
getNextComponent
public static IContentVisualComponent getNextComponent(IContentVisualComponent inComp, ContentContext ctx) throws Exception
- Throws:
Exception
-
getComponentPosition
public static int getComponentPosition(ContentContext ctx, IContentVisualComponent comp) throws Exception
get the position of the component in the list of component with same type with current ContentContext return -1 if component is not found.- Throws:
Exception
-
getComponentWidthPosition
public static IContentVisualComponent getComponentWidthPosition(ContentContext ctx, MenuElement page, String area, String type, int position) throws Exception
get the the component with the position in the list of component with same type with current ContentContext return null if position is to big- Throws:
Exception
-
updateNextAndPrevious
public static void updateNextAndPrevious(ContentContext ctx, Iterable<IContentVisualComponent> comps) throws Exception
- Throws:
Exception
-
updateNextAndPrevious
public static void updateNextAndPrevious(ContentContext ctx, MenuElement page, String area) throws Exception
- Throws:
Exception
-
componentsToArray
public static Cell[][] componentsToArray(ContentContext ctx, Collection<IContentVisualComponent> components, String type) throws Exception
- Throws:
Exception
-
getFinalType
public static final String getFinalType(ContentContext ctx, IContentVisualComponent comp) throws Exception
- Throws:
Exception
-
getRealComponent
public static final IContentVisualComponent getRealComponent(ContentContext ctx, IContentVisualComponent comp) throws Exception
return the component wrapped in the mirrror, or the component it self- Parameters:
comp
-- Returns:
- Throws:
Exception
-
renderArea
public static String renderArea(ContentContext ctx, String areaKey) throws Exception
- Throws:
Exception
-
-