You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@cocoon.apache.org by do...@cocoon.apache.org on 2005/01/28 11:43:33 UTC
[Cocoon Wiki] New: PortalToolsCopletManagement
Date: 2005-01-28T02:43:33
Editor: JensMaukisch
Wiki: Cocoon Wiki
Page: PortalToolsCopletManagement
URL: http://wiki.apache.org/cocoon/PortalToolsCopletManagement
no comment
New Page:
= PortalToolsCopletManagement =
The Coplet-Management-Plugin provides functions to modify the Layout of the portal. One function of the plugin is a skin-selector
and the other a function to modífy the layout itself. You can move/create/delete/configure Tabs, Columns, Rows and Coplets.
== Components ==
=== XMLProfileGenerator + CreateIndex.xsl ===
The XMLProfileGenerator generates a basic XML-Representation of the portal-layout.
A CreateIndex.xsl adds unique ids to every element. With a layout-stylesheet it
is used to display a reduced representaion of the original protal to the user
(the portal without content).
==== Sample ====
Flow:
{{{
function showXml() {
var toolManager = getPTM();
var portalObjects = toolManager.getPortalObjects();
var portalLayout = portalObjects.getPortalLayout();
cocoon.sendPage("layoutProfile",
{"layout" : portalLayout });
toolManager.releasePortalObjects(portalObjects);
relPTM(toolManager);
}
}}}
Sitemap:
{{{
<map:match pattern="layoutProfile">
<map:generate type="xmlprofile"/>
<map:transform src="styles/createIndex.xsl/>
<map:serialize type="xml"/>
</map:match>
}}}
Result:
{{{
<composite-layout name="tab" id="maintab">
<named-item id="1.1" name="Main">
<coplet-layout id="Portal-Demo-1" name="coplet">
<coplet-instance-data id="1.1.1.1">Portal-Demo-1</coplet-instance-data>
</coplet-layout>
</named-item>
<named-item id="1.2" name="News">
<composite-layout id="1.2.1" name="column">
<parameter name="border" value="0"/>
<parameter name="border-color" value="#225599"/>
<item id="1.2.1.1">
<parameter name="width" value="50%"/>
<composite-layout id="1.2.1.1.1" name="row">
<parameter name="border" value="0"/>
<parameter name="border-color" value="#AACCFF"/>
<item id="1.2.1.1.1.1">
<coplet-layout id="Newsweek-1" name="coplet">
<parameter name="border" value="0"/>
<parameter name="border-color" value="#AA0000"/>
<coplet-instance-data id="1.2.1.1.1.1.1.1">Newsweek-1</coplet-instance-data>
</coplet-layout>
</item>
<item id="1.2.1.1.1.2">
<coplet-layout id="NYTBusiness-1" name="coplet">
<parameter name="border" value="0"/>
...
}}}
=== LayoutActions ===
The layout-actions are a class which has some basic functions to modify the portal-layout.
Have a look at the java source for a list of all functions.
==== Usage Example ====
Flow:
{{{
function showTab(showId) {
var toolManager = getPTM();
// get the other objects
var layoutActions = new Packages.org.apache.cocoon.portal.tools.copletManagement.LayoutActions(
portalLayout,
componentManager.getLayoutFactory(),
componentManager.getCopletFactory(),
profileManager);
var id = cocoon.request.id;
var action = cocoon.request.action;
var actionitem = cocoon.request.actionitem;
if(action == "addCol") {
layoutActions.add(actionitem, "column");
}
cocoon.sendPage("page/showTab/" + id, {"layout" : portalLayout });
toolManager.releasePortalObjects(portalObjects);
relPTM(toolManager);
}
}}}