JBoss Portal SVN: r12298 - branches/JBoss_Portal_Branch_2_7/core-cms.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-11-17 09:06:49 -0500 (Mon, 17 Nov 2008)
New Revision: 12298
Modified:
branches/JBoss_Portal_Branch_2_7/core-cms/.classpath
Log:
Eclipse classpath
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/.classpath
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/.classpath 2008-11-14 21:07:02 UTC (rev 12297)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/.classpath 2008-11-17 14:06:49 UTC (rev 12298)
@@ -26,6 +26,6 @@
<classpathentry kind="lib" path="/thirdparty/portlet/lib/portlet-api.jar"/>
<classpathentry kind="lib" path="/thirdparty/sun-jsf/lib/jsf-api.jar"/>
<classpathentry kind="lib" path="/thirdparty/jbpm/jpdl/lib/jbpm-jpdl.jar"/>
- <classpathentry kind="lib" path="/thirdparty/jboss-portal/modules/cms/lib/cms-jackrabbit-trunk-SNAPSHOT.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss-portal/modules/cms/lib/cms-jackrabbit.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
15 years, 6 months
JBoss Portal SVN: r12297 - in modules/authorization/trunk/PAP: src/main/java/org/jboss/security/authz/pap/service and 1 other directories.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2008-11-14 16:07:02 -0500 (Fri, 14 Nov 2008)
New Revision: 12297
Added:
modules/authorization/trunk/PAP/src/main/java/org/jboss/security/authz/pap/service/FileSystemPortalObjectPolicyManager.java
modules/authorization/trunk/PAP/src/test/java/org/jboss/security/authz/pap/service/TestPortalObjectPolicyManager.java
Modified:
modules/authorization/trunk/PAP/pom.xml
Log:
backing up some code
Modified: modules/authorization/trunk/PAP/pom.xml
===================================================================
--- modules/authorization/trunk/PAP/pom.xml 2008-11-14 15:29:48 UTC (rev 12296)
+++ modules/authorization/trunk/PAP/pom.xml 2008-11-14 21:07:02 UTC (rev 12297)
@@ -59,7 +59,7 @@
<version>2.3.1</version>
<configuration>
<includes>
- <include>**/TestWebTierPolicyManager.java</include>
+ <include>**/TestPortalObjectPolicyManager.java</include>
</includes>
</configuration>
</plugin>
Added: modules/authorization/trunk/PAP/src/main/java/org/jboss/security/authz/pap/service/FileSystemPortalObjectPolicyManager.java
===================================================================
--- modules/authorization/trunk/PAP/src/main/java/org/jboss/security/authz/pap/service/FileSystemPortalObjectPolicyManager.java (rev 0)
+++ modules/authorization/trunk/PAP/src/main/java/org/jboss/security/authz/pap/service/FileSystemPortalObjectPolicyManager.java 2008-11-14 21:07:02 UTC (rev 12297)
@@ -0,0 +1,239 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.security.authz.pap.service;
+
+import java.io.InputStream;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.util.Set;
+import java.util.HashSet;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.DocumentBuilder;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import org.jboss.security.authz.model.Attribute;
+import org.jboss.security.authz.model.AttributeExpression;
+import org.jboss.security.authz.model.Effect;
+import org.jboss.security.authz.model.PolicyException;
+import org.jboss.security.authz.model.Policy;
+import org.jboss.security.authz.model.Target;
+import org.jboss.security.authz.model.Rule;
+import org.jboss.security.authz.pap.hierarchial.HierarchialPolicy;
+import org.jboss.security.xacml.interfaces.XACMLConstants;
+import org.jboss.security.xacml.interfaces.XMLSchemaConstants;
+
+/**
+ * The PolicyManager provides implementation for the Configuration related services of the PolicyManager. It extends the FileSystemPolicyManager in order to store the managed Policies
+ * on the local file system. This PolicyManager process configuration provided for securing Resources within Portal Object Container.
+ * It uses the HierarchialPolicy implementation to represent the Portal Object Policies
+ *
+ * The Policies allow for features such as "Implied Access" and "Recursive Access"
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class FileSystemPortalObjectPolicyManager extends FileSystemPolicyManager
+{
+ /**
+ *
+ *
+ */
+ public FileSystemPortalObjectPolicyManager()
+ {
+ }
+ //------Configuration service of the PolicyManager implementation----------------------------------------------------------------------------------------------------------------
+ /**
+ * Generates a Policy that can be represented in system level XACML format. The xmlConfiguration is a user friendly XML configuration that is within the context
+ * of the Portal Object Container. For instance, to apply Access Control at the Portal Object Container, the XML configuration consists of Portal Resources such as
+ * Page, Portal, and Window and Actions in the context of the Portal Object Container such as Render Portal Object, Render a particular Window State, Render a particular
+ * Portlet Mode etc
+ *
+ * @param xmlConfiguration User Friendly XML configuration within the context of the Portal Object Container
+ * @return a Policy that can be represented in system level XACML format
+ */
+ public Policy generatePolicy(String xmlConfiguration) throws PolicyException
+ {
+ InputStream xmlStream = null;
+ try
+ {
+ Policy policy = null;
+
+ xmlStream = new ByteArrayInputStream(xmlConfiguration.getBytes());
+ DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ Document document = builder.parse(xmlStream);
+
+ Element portalAclElem = (Element)document.getElementsByTagName("portal-acl").item(0);
+ Element pageElem = (Element)portalAclElem.getElementsByTagName("page").item(0);
+
+ Target target = this.parseTarget(pageElem);
+
+ Set<Rule> rules = this.parseRules(pageElem);
+
+ policy = new HierarchialPolicy(String.valueOf(this.getUniqueId()), target, rules);
+
+ return policy;
+ }
+ catch(Exception e)
+ {
+ throw new PolicyException(e);
+ }
+ finally
+ {
+ if(xmlStream != null)
+ {
+ try{xmlStream.close();}catch(IOException ioe){}
+ }
+ }
+ }
+ //XMLParsing----------------------------------------------------------------------------------------------------------------------------------------------------
+ private Target parseTarget(Element portalObjectElem) throws Exception
+ {
+ Target target = new Target();
+
+ //Add uniqueUri as a Resource To Match
+ Element uniqueUriElem = (Element)portalObjectElem.getElementsByTagName("unique-uri").item(0);
+ String uniqueUri = uniqueUriElem.getTextContent();
+ AttributeExpression pageUriMatch = new AttributeExpression();
+ pageUriMatch.setFunctionId(XACMLConstants.FUNCTION_STRING_EQUAL);
+ Attribute attribute = new Attribute("unique-uri",
+ XMLSchemaConstants.DATATYPE_STRING, uniqueUri);
+ pageUriMatch.setAttribute(attribute);
+ target.addResourceMatch(pageUriMatch);
+
+ return target;
+ }
+
+ private Set<Rule> parseRules(Element portalObjectElem) throws Exception
+ {
+ Set<Rule> rules = new HashSet<Rule>();
+
+ NodeList actionNodes = portalObjectElem.getElementsByTagName("action");
+ for(int actionIndex=0; actionIndex<actionNodes.getLength(); actionIndex++)
+ {
+ Element actionElem = (Element)actionNodes.item(actionIndex);
+ String actionName = ((Element)actionElem.getElementsByTagName("name").item(0)).getTextContent();
+
+ NodeList conditionNodes = actionElem.getElementsByTagName("condition");
+ for(int i=0; i<conditionNodes.getLength(); i++)
+ {
+ Element conditionElement = (Element)conditionNodes.item(i);
+
+ //Process Roles related conditions
+ NodeList roleNodes = conditionElement.getElementsByTagName("role-name");
+ if(roleNodes.getLength() >0)
+ {
+ rules.addAll(this.parseRoleRules(actionName, roleNodes));
+ }
+
+ //Process IP Ranges
+ NodeList ipNodes = conditionElement.getElementsByTagName("ip-range");
+ if(ipNodes.getLength() >0)
+ {
+ rules.addAll(this.parseIpRules(actionName, ipNodes));
+ }
+ }
+ }
+ return rules;
+ }
+
+ private Set<Rule> parseRoleRules(String actionName, NodeList roleNodes)
+ {
+ Set<Rule> roleRules = new HashSet<Rule>();
+
+ for(int j=0; j<roleNodes.getLength(); j++)
+ {
+ Element roleNameElem = (Element)roleNodes.item(j);
+ String roleName = roleNameElem.getTextContent();
+
+ Rule roleRule = new Rule();
+ roleRule.setRuleId(String.valueOf(this.getUniqueId()));
+ roleRule.setEffect(Effect.PERMIT);
+
+ AttributeExpression roleExpression = new AttributeExpression();
+ roleExpression.setFunctionId(XACMLConstants.FUNCTION_STRING_EQUAL);
+ Attribute roleAttribute = new Attribute(XACMLConstants.ATTRIBUTEID_ROLE,
+ XMLSchemaConstants.DATATYPE_STRING, roleName);
+ roleExpression.setAttribute(roleAttribute);
+
+ Target ruleTarget = new Target();
+ AttributeExpression actionMatch = new AttributeExpression();
+ actionMatch.setFunctionId(XACMLConstants.FUNCTION_STRING_EQUAL);
+ Attribute actionAttribute = new Attribute(XACMLConstants.ATTRIBUTEID_ACTION_ID,
+ XMLSchemaConstants.DATATYPE_STRING, actionName);
+ actionMatch.setAttribute(actionAttribute);
+ ruleTarget.addActionMatch(actionMatch);
+
+ roleRule.setTarget(ruleTarget);
+ roleRule.setExpression(roleExpression);
+
+ roleRules.add(roleRule);
+ }
+
+ return roleRules;
+ }
+
+ private Set<Rule> parseIpRules(String actionName, NodeList ipNodes)
+ {
+ Set<Rule> ipRules = new HashSet<Rule>();
+
+ for(int j=0; j<ipNodes.getLength(); j++)
+ {
+ Element ipElem = (Element)ipNodes.item(j);
+ String ipRange = ipElem.getTextContent();
+
+ Rule rule = new Rule();
+ rule.setRuleId(String.valueOf(this.getUniqueId()));
+ rule.setEffect(Effect.PERMIT);
+
+ AttributeExpression expression = new AttributeExpression();
+ expression.setFunctionId(XACMLConstants.FUNCTION_REGEXP_IPADDRESS_MATCH);
+ Attribute attribute = new Attribute(XACMLConstants.ATTRIBUTEID_IP_ADDRESS,
+ XMLSchemaConstants.DATATYPE_IPADDRESS, ipRange);
+ expression.setAttribute(attribute);
+
+ Target ruleTarget = new Target();
+ AttributeExpression actionMatch = new AttributeExpression();
+ actionMatch.setFunctionId(XACMLConstants.FUNCTION_STRING_EQUAL);
+ Attribute actionAttribute = new Attribute(XACMLConstants.ATTRIBUTEID_ACTION_ID,
+ XMLSchemaConstants.DATATYPE_STRING, actionName);
+ actionMatch.setAttribute(actionAttribute);
+ ruleTarget.addActionMatch(actionMatch);
+
+ rule.setTarget(ruleTarget);
+ rule.setExpression(expression);
+
+ ipRules.add(rule);
+ }
+
+ return ipRules;
+ }
+
+ private synchronized long getUniqueId()
+ {
+ return System.currentTimeMillis();
+ }
+}
Added: modules/authorization/trunk/PAP/src/test/java/org/jboss/security/authz/pap/service/TestPortalObjectPolicyManager.java
===================================================================
--- modules/authorization/trunk/PAP/src/test/java/org/jboss/security/authz/pap/service/TestPortalObjectPolicyManager.java (rev 0)
+++ modules/authorization/trunk/PAP/src/test/java/org/jboss/security/authz/pap/service/TestPortalObjectPolicyManager.java 2008-11-14 21:07:02 UTC (rev 12297)
@@ -0,0 +1,97 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.security.authz.pap.service;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+
+import org.jboss.security.authz.model.Policy;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class TestPortalObjectPolicyManager extends TestCase
+{
+ /**
+ *
+ */
+ private static Logger log = Logger.getLogger(TestPortalObjectPolicyManager.class);
+
+ /**
+ * A simple developer-friendly Portal Page policy that specifies:
+ *
+ * This Policy suggests that the 'View Action on the specified Portal Page is accessibly if the following conditions are met:
+ *
+ * a) The Logged in User Belongs to the specified 'Root-Admin' and 'Marketing Team' roles AND
+ * b) The User Logged in From the Internal Network only via a "Internal IP Address"
+ *
+ * Notice: This configuration is not muddled by the vast low-level details of XACML Policy representation. That part is automated by the
+ * PAP (Policy Administration Point) Component of the Authorization System
+ */
+ private static String simplePortalPagePolicy = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+
+ "<portal-acl>"+
+ "<page>"+
+ "<unique-uri>/{portal-name}/{portal-page}/{portal-sub-page}</unique-uri>"+
+ "<action>"+
+ "<name>View</name>"+
+ "<description>Ability to Render this Page</description>"+
+ "<conditions>"+
+ "<condition>"+
+ "<role-name>Root-Admin</role-name>"+
+ "<role-name>Marketing Team</role-name>"+
+ "</condition>"+
+ "<condition>"+
+ "<ip-range>192.168.xxx.xxx</ip-range>"+
+ "</condition>"+
+ "</conditions>"+
+ "</action>"+
+ "</page>"+
+ "</portal-acl>";
+
+ /**
+ *
+ */
+ protected void setUp() throws Exception
+ {
+ }
+
+
+ protected void tearDown() throws Exception
+ {
+ }
+
+
+ public void testSimplePortalPagePolicy() throws Exception
+ {
+ PolicyManager policyManager = new FileSystemPortalObjectPolicyManager();
+ Policy policy = policyManager.generatePolicy(simplePortalPagePolicy);
+
+ assertNotNull(policy);
+
+ log.info("------------------------------------------------------");
+ log.info(policy.generateXACMLPolicy());
+ log.info("------------------------------------------------------");
+ }
+}
15 years, 6 months
JBoss Portal SVN: r12296 - branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2008-11-14 10:29:48 -0500 (Fri, 14 Nov 2008)
New Revision: 12296
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
Log:
timeout fix
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2008-11-14 15:03:45 UTC (rev 12295)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2008-11-14 15:29:48 UTC (rev 12296)
@@ -32,8 +32,9 @@
String browser = System.getProperty("browser");
selenium = new DefaultSelenium("127.0.0.1", 44444, browser, "http://localhost:8080/portal/");
+
+ selenium.start();
selenium.setTimeout(PAGE_LOAD);
- selenium.start();
}
@AfterClass
15 years, 6 months
JBoss Portal SVN: r12295 - branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2008-11-14 10:03:45 -0500 (Fri, 14 Nov 2008)
New Revision: 12295
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
Log:
longer timeout
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2008-11-14 09:51:59 UTC (rev 12294)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2008-11-14 15:03:45 UTC (rev 12295)
@@ -32,6 +32,7 @@
String browser = System.getProperty("browser");
selenium = new DefaultSelenium("127.0.0.1", 44444, browser, "http://localhost:8080/portal/");
+ selenium.setTimeout(PAGE_LOAD);
selenium.start();
}
15 years, 6 months
JBoss Portal SVN: r12294 - in branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests: src/org/jboss/portal/test/selenium and 1 other directory.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2008-11-14 04:51:59 -0500 (Fri, 14 Nov 2008)
New Revision: 12294
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/lib/selenium-java-client-driver.jar
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java
Log:
new selenium version
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/lib/selenium-java-client-driver.jar
===================================================================
(Binary files differ)
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java 2008-11-13 22:35:54 UTC (rev 12293)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java 2008-11-14 09:51:59 UTC (rev 12294)
@@ -13,6 +13,8 @@
private static final String SEL_CONTENT_TYPE = "//select[contains(@id,'contentTypesForm:instanceId')]";
private static final String SUB_DEL_FROM_CENTER_REGION = "//input[contains(@id,'layoutForm:l_center')]";
+ private static final String SUB_DOWN_CENTER_REGION = "//input[contains(@id,'layoutForm:d_center')]";
+ private static final String SUB_UP_CENTER_REGION = "//input[contains(@id,'layoutForm:u_center')]";
private static final String SEL_CENTER_REGION = "//select[contains(@id,'layoutForm:selectMany_center')]";
private static final String SUB_ADDCENTER = "//input[contains(@id,'layoutForm:a_center')]";
private static final String SUB_ADDLEFT = "//input[contains(@id,'layoutForm:a_left')]";
@@ -205,6 +207,29 @@
}
+ @Test(enabled = true, dependsOnMethods = { "testCreatePage" , "testMovePortlet"})
+ public void testReorder() {
+ final String pageName = "DashMovePage";
+
+ selenium.click(LNK_DASHBOARD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(LNK_CONFIGURE_DASHBOARD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selectIfNotSelected(SEL_PAGE,pageName);
+
+ selenium.addSelection(SEL_CENTER_REGION, "label=ExceptionPortletWindow");
+ selenium.click(SUB_DOWN_CENTER_REGION);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click(LNK_DASHBOARD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link="+pageName);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(assertTextOrder("Current;Exception"));
+ Assert.assertFalse(assertTextOrder("Exception;Current"));
+ }
+
@Test(enabled = true, dependsOnMethods = { "testAddPortlet" })
public void testDeletePortlet() {
@@ -328,13 +353,6 @@
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Alexandria"), "Previously selected portlet settings were changes after renaming of portal page.");
-
}
- // TODO write an extension for checking of ordering of elements
- @Test(enabled = false, dependsOnMethods = { "testCreatePage" })
- public void testReorder() {
-
- }
-
}
15 years, 6 months
JBoss Portal SVN: r12291 - in docs/enterprise/trunk/Reference_Guide: tmp/en-US/xml and 1 other directories.
by portal-commits@lists.jboss.org
Author: skittoli(a)redhat.com
Date: 2008-11-13 16:49:37 -0500 (Thu, 13 Nov 2008)
New Revision: 12291
Removed:
docs/enterprise/trunk/Reference_Guide/en-US/resolved.xml
Modified:
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Ajax.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Authentication.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Author_Group.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Book_Info.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/CMS_Portlet.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Clustering.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Common_Content/Conventions.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Common_Content/Feedback.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Common_Content/Legal_Notice.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Configuration.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Content_Integration.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Coordination.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Error_Handling.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Identity.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Identity_Portlets.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Installation.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/JBoss_Portal_Reference_Guide.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Jboss_Portlet_DTD.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Ldap.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Migration.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Nav_Tabs.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Portal_API.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Portal_Objects_DTD.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Portlet_Instances_DTD.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Portlet_Modes.xml
Log:
removed resolved.xml
Deleted: docs/enterprise/trunk/Reference_Guide/en-US/resolved.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/resolved.xml 2008-11-13 08:10:07 UTC (rev 12290)
+++ docs/enterprise/trunk/Reference_Guide/en-US/resolved.xml 2008-11-13 21:49:37 UTC (rev 12291)
@@ -1,17450 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.docbook.org/xml/4.5/docbookx.dtd" [
-<!ENTITY uArr "⇑">
-<!ENTITY hcirc "ĥ">
-<!ENTITY icirc "î">
-<!ENTITY equals "=">
-<!ENTITY cong "≅">
-<!ENTITY icy "и">
-<!ENTITY HARDcy "Ъ">
-<!ENTITY Ecaron "Ě">
-<!ENTITY clubs "♣">
-<!ENTITY phmmat "ℳ">
-<!ENTITY sqcap "⊓">
-<!ENTITY thorn "þ">
-<!ENTITY Lcedil "Ļ">
-<!ENTITY verbar "|">
-<!ENTITY rarr "→">
-<!ENTITY cire "≗">
-<!ENTITY DZcy "Џ">
-<!ENTITY b.delta "δ">
-<!ENTITY Gcirc "Ĝ">
-<!ENTITY ocir "⊚">
-<!ENTITY circ "^">
-<!ENTITY Igr "Ι">
-<!ENTITY udigr "ϋ">
-<!ENTITY prime "′">
-<!ENTITY npr "⊀">
-<!ENTITY b.pi "π">
-<!ENTITY frac58 "⅝">
-<!ENTITY ldquor "„">
-<!ENTITY sqsup "⊐">
-<!ENTITY boxDR "╒">
-<!ENTITY kcedil "ķ">
-<!ENTITY vDash "⊨">
-<!ENTITY Scedil "Ş">
-<!ENTITY perp "⊥">
-<!ENTITY b.Gamma "Γ">
-<!ENTITY b.kappa "κ">
-<!ENTITY Uuml "Ü">
-<!ENTITY mnplus "∓">
-<!ENTITY nearr "↗">
-<!ENTITY nrtri "⋫">
-<!ENTITY cupre "≼">
-<!ENTITY boxV "║">
-<!ENTITY Zdot "Ż">
-<!ENTITY pound "£">
-<!ENTITY lharu "↼">
-<!ENTITY boxdr "┌">
-<!ENTITY ocy "о">
-<!ENTITY xgr "ξ">
-<!ENTITY b.xi "ξ">
-<!ENTITY middot "·">
-<!ENTITY larr "←">
-<!ENTITY xrArr "⇒">
-<!ENTITY Ncy "Н">
-<!ENTITY acute "´">
-<!ENTITY phis "φ">
-<!ENTITY ncedil "ņ">
-<!ENTITY lAarr "⇚">
-<!ENTITY sqsube "⊑">
-<!ENTITY quot '"'>
-<!ENTITY TSHcy "Ћ">
-<!ENTITY amacr "ā">
-<!ENTITY otimes "⊗">
-<!ENTITY inodot "ı">
-<!ENTITY gsdot "⋗">
-<!ENTITY LJcy "Љ">
-<!ENTITY phiv "ϕ">
-<!ENTITY odblac "ő">
-<!ENTITY filig "fi">
-<!ENTITY amalg "∐">
-<!ENTITY sdotb "⊡">
-<!ENTITY boxDL "╕">
-<!ENTITY Theta "Θ">
-<!ENTITY cdot "ċ">
-<!ENTITY ordm "º">
-<!ENTITY atilde "ã">
-<!ENTITY squf "▪">
-<!ENTITY notin "∉">
-<!ENTITY nmid "∤">
-<!ENTITY shchcy "щ">
-<!ENTITY lfloor "⌊">
-<!ENTITY Xi "Ξ">
-<!ENTITY Hstrok "Ħ">
-<!ENTITY period ".">
-<!ENTITY numsp " ">
-<!ENTITY nldr "‥">
-<!ENTITY boxdl "┐">
-<!ENTITY Fcy "Ф">
-<!ENTITY tscy "ц">
-<!ENTITY Iukcy "І">
-<!ENTITY cross "✗">
-<!ENTITY ohgr "ω">
-<!ENTITY nbsp " ">
-<!ENTITY ni "∍">
-<!ENTITY comp "∁">
-<!ENTITY boxH "═">
-<!ENTITY b.Delta "Δ">
-<!ENTITY Oslash "Ø">
-<!ENTITY ndash "–">
-<!ENTITY marker "▮">
-<!ENTITY ordf "ª">
-<!ENTITY nsce "⋡">
-<!ENTITY vrtri "⊳">
-<!ENTITY ubrcy "ў">
-<!ENTITY Ccirc "Ĉ">
-<!ENTITY quest "?">
-<!ENTITY ne "≠">
-<!ENTITY gap "≳">
-<!ENTITY efDot "≒">
-<!ENTITY rcy "р">
-<!ENTITY bsim "∽">
-<!ENTITY bgr "β">
-<!ENTITY omacr "ō">
-<!ENTITY umacr "ū">
-<!ENTITY lpar "(">
-<!ENTITY uharl "↿">
-<!ENTITY Gcy "Г">
-<!ENTITY ast "*">
-<!ENTITY acy "а">
-<!ENTITY thetas "θ">
-<!ENTITY uring "ů">
-<!ENTITY Zcaron "Ž">
-<!ENTITY horbar "―">
-<!ENTITY star "⋆">
-<!ENTITY timesb "⊠">
-<!ENTITY npre "⋠">
-<!ENTITY real "ℜ">
-<!ENTITY nrArr "⇏">
-<!ENTITY dlarr "↙">
-<!ENTITY oplus "⊕">
-<!ENTITY Xgr "Ξ">
-<!ENTITY ucy "у">
-<!ENTITY thetav "ϑ">
-<!ENTITY jcirc "ĵ">
-<!ENTITY uharr "↾">
-<!ENTITY mgr "μ">
-<!ENTITY hearts "♥">
-<!ENTITY nvDash "⊭">
-<!ENTITY yicy "ї">
-<!ENTITY dot "˙">
-<!ENTITY alpha "α">
-<!ENTITY wedgeq "≙">
-<!ENTITY bowtie "⋈">
-<!ENTITY boxDr "╓">
-<!ENTITY b.upsi "υ">
-<!ENTITY euml "ë">
-<!ENTITY vArr "⇕">
-<!ENTITY lgr "λ">
-<!ENTITY b.rhov "ϱ">
-<!ENTITY ubreve "ŭ">
-<!ENTITY copysr "℗">
-<!ENTITY cap "∩">
-<!ENTITY aogon "ą">
-<!ENTITY racute "ŕ">
-<!ENTITY rthree "⋌">
-<!ENTITY Sgr "Σ">
-<!ENTITY uacute "ú">
-<!ENTITY Tcaron "Ť">
-<!ENTITY dagger "†">
-<!ENTITY oast "⊛">
-<!ENTITY prnE "">
-<!ENTITY thkap "≈">
-<!ENTITY boxdR "╔">
-<!ENTITY dgr "δ">
-<!ENTITY nacute "ń">
-<!ENTITY hardcy "ъ">
-<!ENTITY sqsupe "⊒">
-<!ENTITY TScy "Ц">
-<!ENTITY reg "®">
-<!ENTITY cir "○">
-<!ENTITY lsquor "‚">
-<!ENTITY ycy "ы">
-<!ENTITY Sigma "Σ">
-<!ENTITY Gbreve "Ğ">
-<!ENTITY order "ℴ">
-<!ENTITY nlarr "↚">
-<!ENTITY eng "ŋ">
-<!ENTITY sacute "ś">
-<!ENTITY ensp " ">
-<!ENTITY rarr2 "⇉">
-<!ENTITY coprod "∐">
-<!ENTITY iacgr "ί">
-<!ENTITY b.piv "ϖ">
-<!ENTITY rlhar2 "⇌">
-<!ENTITY boxDl "╗">
-<!ENTITY Pcy "П">
-<!ENTITY Dagger "‡">
-<!ENTITY khcy "х">
-<!ENTITY sigma "σ">
-<!ENTITY nltrie "⋬">
-<!ENTITY gjcy "ѓ">
-<!ENTITY b.alpha "α">
-<!ENTITY plusmn "±">
-<!ENTITY scnap "⋩">
-<!ENTITY vprime "′">
-<!ENTITY iota "ι">
-<!ENTITY Dcaron "Ď">
-<!ENTITY emsp " ">
-<!ENTITY trie "≜">
-<!ENTITY boxdL "╖">
-<!ENTITY cacute "ć">
-<!ENTITY rcedil "ŗ">
-<!ENTITY lhblk "▄">
-<!ENTITY lnsim "⋦">
-<!ENTITY bsime "⋍">
-<!ENTITY Vvdash "⊪">
-<!ENTITY zgr "ζ">
-<!ENTITY Ncaron "Ň">
-<!ENTITY rcaron "ř">
-<!ENTITY radic "√">
-<!ENTITY colone "≔">
-<!ENTITY Ucy "У">
-<!ENTITY lcub "{">
-<!ENTITY mdash "—">
-<!ENTITY ogon "˛">
-<!ENTITY Lgr "Λ">
-<!ENTITY b.chi "χ">
-<!ENTITY Barwed "⌆">
-<!ENTITY odot "⊙">
-<!ENTITY softcy "ь">
-<!ENTITY yucy "ю">
-<!ENTITY Ogr "Ο">
-<!ENTITY ecirc "ê">
-<!ENTITY Uacute "Ú">
-<!ENTITY jcy "й">
-<!ENTITY Oacgr "Ό">
-<!ENTITY ntilde "ñ">
-<!ENTITY Uring "Ů">
-<!ENTITY Udigr "Ϋ">
-<!ENTITY squ "□">
-<!ENTITY image "ℑ">
-<!ENTITY Uacgr "Ύ">
-<!ENTITY uarr "↑">
-<!ENTITY sim "∼">
-<!ENTITY egr "ε">
-<!ENTITY aleph "ℵ">
-<!ENTITY nharr "↮">
-<!ENTITY kcy "к">
-<!ENTITY Rgr "Ρ">
-<!ENTITY ffilig "ffi">
-<!ENTITY boxvl "┤">
-<!ENTITY Iacgr "Ί">
-<!ENTITY ang90 "∟">
-<!ENTITY nrarr "↛">
-<!ENTITY nges "≱">
-<!ENTITY nsube "⊈">
-<!ENTITY nsup "⊅">
-<!ENTITY egs "⋝">
-<!ENTITY acirc "â">
-<!ENTITY Yuml "Ÿ">
-<!ENTITY ltrif "◂">
-<!ENTITY lagran "ℒ">
-<!ENTITY npar "∦">
-<!ENTITY scsim "≿">
-<!ENTITY boxvr "├">
-<!ENTITY Acirc "Â">
-<!ENTITY Ucirc "Û">
-<!ENTITY zcaron "ž">
-<!ENTITY shy "">
-<!ENTITY ominus "⊖">
-<!ENTITY frac38 "⅜">
-<!ENTITY incare "℅">
-<!ENTITY uhblk "▀">
-<!ENTITY lEg "⋚">
-<!ENTITY gcy "г">
-<!ENTITY b.eta "η">
-<!ENTITY lnap "">
-<!ENTITY Iacute "Í">
-<!ENTITY yacute "ý">
-<!ENTITY dstrok "đ">
-<!ENTITY Imacr "Ī">
-<!ENTITY orarr "↻">
-<!ENTITY Eacgr "Έ">
-<!ENTITY apos "'">
-<!ENTITY b.epsiv "ε">
-<!ENTITY gcirc "ĝ">
-<!ENTITY udblac "ű">
-<!ENTITY planck "ℏ">
-<!ENTITY upsi "υ">
-<!ENTITY b.Lambda "Λ">
-<!ENTITY Bgr "Β">
-<!ENTITY scedil "ş">
-<!ENTITY Rarr "↠">
-<!ENTITY nrtrie "⋭">
-<!ENTITY nsub "⊄">
-<!ENTITY vcy "в">
-<!ENTITY b.epsis "ε">
-<!ENTITY Eacute "É">
-<!ENTITY boxvh "┼">
-<!ENTITY dcy "д">
-<!ENTITY Aring "Å">
-<!ENTITY Igrave "Ì">
-<!ENTITY utilde "ũ">
-<!ENTITY divonx "⋇">
-<!ENTITY lne "≨">
-<!ENTITY scnE "">
-<!ENTITY ccedil "ç">
-<!ENTITY supne "⊋">
-<!ENTITY empty "∅">
-<!ENTITY b.nu "ν">
-<!ENTITY top "⊤">
-<!ENTITY lcy "л">
-<!ENTITY b.gamma "γ">
-<!ENTITY aelig "æ">
-<!ENTITY iuml "ï">
-<!ENTITY Lcaron "Ľ">
-<!ENTITY bottom "⊥">
-<!ENTITY rarrhk "↪">
-<!ENTITY DScy "Ѕ">
-<!ENTITY idiagr "ΐ">
-<!ENTITY imacr "ī">
-<!ENTITY ltri "◃">
-<!ENTITY infin "∞">
-<!ENTITY le "≤">
-<!ENTITY sime "≃">
-<!ENTITY kappa "κ">
-<!ENTITY kappav "ϰ">
-<!ENTITY OElig "Œ">
-<!ENTITY urcrop "⌎">
-<!ENTITY darr2 "⇊">
-<!ENTITY lg "≶">
-<!ENTITY spar "∥">
-<!ENTITY Mgr "Μ">
-<!ENTITY rtri "▹">
-<!ENTITY daleth "ℸ">
-<!ENTITY sfrown "⌢">
-<!ENTITY epsiv "ε">
-<!ENTITY Omega "Ω">
-<!ENTITY colon ":">
-<!ENTITY prop "∝">
-<!ENTITY lArr "⇐">
-<!ENTITY Upsi "ϒ">
-<!ENTITY oslash "ø">
-<!ENTITY ap "≈">
-<!ENTITY Sup "⋑">
-<!ENTITY epsis "∊">
-<!ENTITY b.omega "ω">
-<!ENTITY rpar ")">
-<!ENTITY Abreve "Ă">
-<!ENTITY mldr "…">
-<!ENTITY ltrie "⊴">
-<!ENTITY Psi "Ψ">
-<!ENTITY Agrave "À">
-<!ENTITY Tcedil "Ţ">
-<!ENTITY auml "ä">
-<!ENTITY lcedil "ļ">
-<!ENTITY scirc "ŝ">
-<!ENTITY larrhk "↩">
-<!ENTITY varr "↕">
-<!ENTITY ncong "≇">
-<!ENTITY subE "⊆">
-<!ENTITY kjcy "ќ">
-<!ENTITY larr2 "⇇">
-<!ENTITY rsh "↱">
-<!ENTITY sdot "⋅">
-<!ENTITY wreath "≀">
-<!ENTITY cuepr "⋞">
-<!ENTITY frown "⌢">
-<!ENTITY Agr "Α">
-<!ENTITY uacgr "ύ">
-<!ENTITY rcub "}">
-<!ENTITY dharl "⇃">
-<!ENTITY bcy "б">
-<!ENTITY Tgr "Τ">
-<!ENTITY diam "⋄">
-<!ENTITY eacute "é">
-<!ENTITY xlArr "⇐">
-<!ENTITY leg "⋚">
-<!ENTITY boxvL "╡">
-<!ENTITY Kcy "К">
-<!ENTITY ncy "н">
-<!ENTITY sgr "σ">
-<!ENTITY beta "β">
-<!ENTITY exist "∃">
-<!ENTITY bprime "‵">
-<!ENTITY boxul "┘">
-<!ENTITY Zcy "З">
-<!ENTITY Iuml "Ï">
-<!ENTITY Scaron "Š">
-<!ENTITY sol "/">
-<!ENTITY boxvR "╞">
-<!ENTITY fcy "ф">
-<!ENTITY Egrave "È">
-<!ENTITY Utilde "Ũ">
-<!ENTITY lthree "⋋">
-<!ENTITY boxur "└">
-<!ENTITY dharr "⇂">
-<!ENTITY uarr2 "⇈">
-<!ENTITY lacute "ĺ">
-<!ENTITY spades "♠">
-<!ENTITY int "∫">
-<!ENTITY rect "▭">
-<!ENTITY compfn "∘">
-<!ENTITY b.sigma "σ">
-<!ENTITY Amacr "Ā">
-<!ENTITY prod "∏">
-<!ENTITY rpargt "">
-<!ENTITY b.sigmav "ς">
-<!ENTITY excl "!">
-<!ENTITY fnof "ƒ">
-<!ENTITY beth "ℶ">
-<!ENTITY yuml "ÿ">
-<!ENTITY rsquo "’">
-<!ENTITY pr "≺">
-<!ENTITY ccaron "č">
-<!ENTITY hyphen "-">
-<!ENTITY weierp "℘">
-<!ENTITY smile "⌣">
-<!ENTITY Egr "Ε">
-<!ENTITY eeacgr "ή">
-<!ENTITY nsc "⊁">
-<!ENTITY les "≤">
-<!ENTITY boxvH "╪">
-<!ENTITY KHcy "Х">
-<!ENTITY bernou "ℬ">
-<!ENTITY tgr "τ">
-<!ENTITY zacute "ź">
-<!ENTITY amp "&">
-<!ENTITY lnE "≨">
-<!ENTITY nlE "≰">
-<!ENTITY sbsol "﹨">
-<!ENTITY Pi "Π">
-<!ENTITY b.beta "β">
-<!ENTITY b.mu "μ">
-<!ENTITY Ograve "Ò">
-<!ENTITY phone "☎">
-<!ENTITY iff "⇔">
-<!ENTITY gsim "≳">
-<!ENTITY rx "℞">
-<!ENTITY there4 "∴">
-<!ENTITY harrw "↭">
-<!ENTITY udiagr "ΰ">
-<!ENTITY otilde "õ">
-<!ENTITY DotDot "⃜">
-<!ENTITY lrhar2 "⇋">
-<!ENTITY lE "≦">
-<!ENTITY hstrok "ħ">
-<!ENTITY Racute "Ŕ">
-<!ENTITY rarrw "↝">
-<!ENTITY angmsd "∡">
-<!ENTITY tshcy "ћ">
-<!ENTITY szlig "ß">
-<!ENTITY nequiv "≢">
-<!ENTITY pcy "п">
-<!ENTITY darr "↓">
-<!ENTITY female "♀">
-<!ENTITY curarr "↷">
-<!ENTITY minusb "⊟">
-<!ENTITY aacute "á">
-<!ENTITY Dcy "Д">
-<!ENTITY THORN "Þ">
-<!ENTITY ucirc "û">
-<!ENTITY asymp "≍">
-<!ENTITY bcong "≌">
-<!ENTITY die "¨">
-<!ENTITY ograve "ò">
-<!ENTITY iexcl "¡">
-<!ENTITY frac56 "⅚">
-<!ENTITY rArr "⇒">
-<!ENTITY tprime "‴">
-<!ENTITY osol "⊘">
-<!ENTITY sqsub "⊏">
-<!ENTITY rho "ρ">
-<!ENTITY b.psi "ψ">
-<!ENTITY aring "å">
-<!ENTITY Edot "Ė">
-<!ENTITY lcaron "ľ">
-<!ENTITY rlarr2 "⇄">
-<!ENTITY EEacgr "Ή">
-<!ENTITY pi "π">
-<!ENTITY sect "§">
-<!ENTITY bepsi "∍">
-<!ENTITY ffllig "ffl">
-<!ENTITY lsh "↰">
-<!ENTITY dscy "ѕ">
-<!ENTITY macr "¯">
-<!ENTITY b.kappav "ϰ">
-<!ENTITY scaron "š">
-<!ENTITY dollar "$">
-<!ENTITY commat "@">
-<!ENTITY angsph "∢">
-<!ENTITY Udblac "Ű">
-<!ENTITY copy "©">
-<!ENTITY comma ",">
-<!ENTITY diams "♦">
-<!ENTITY sube "⊆">
-<!ENTITY Dot "¨">
-<!ENTITY Cap "⋒">
-<!ENTITY nsmid "">
-<!ENTITY SOFTcy "Ь">
-<!ENTITY eegr "η">
-<!ENTITY lsim "≲">
-<!ENTITY ssmile "⌣">
-<!ENTITY nlt "≮">
-<!ENTITY boxHU "╨">
-<!ENTITY ZHcy "Ж">
-<!ENTITY abreve "ă">
-<!ENTITY lmidot "ŀ">
-<!ENTITY angst "Å">
-<!ENTITY b.lambda "λ">
-<!ENTITY uuml "ü">
-<!ENTITY IJlig "IJ">
-<!ENTITY ENG "Ŋ">
-<!ENTITY brvbar "¦">
-<!ENTITY esdot "≐">
-<!ENTITY boxuL "╝">
-<!ENTITY blk14 "░">
-<!ENTITY YAcy "Я">
-<!ENTITY caron "ˇ">
-<!ENTITY ohacgr "ώ">
-<!ENTITY sup3 "³">
-<!ENTITY flat "♭">
-<!ENTITY minus "−">
-<!ENTITY olarr "↺">
-<!ENTITY dlcorn "⌞">
-<!ENTITY boxuR "╙">
-<!ENTITY iukcy "і">
-<!ENTITY b.tau "τ">
-<!ENTITY Otilde "Õ">
-<!ENTITY ldquo "“">
-<!ENTITY lang "〈">
-<!ENTITY Verbar "‖">
-<!ENTITY ges "≥">
-<!ENTITY prap "≾">
-<!ENTITY thksim "∼">
-<!ENTITY Vcy "В">
-<!ENTITY yacy "я">
-<!ENTITY drcrop "⌌">
-<!ENTITY omega "ω">
-<!ENTITY Hcirc "Ĥ">
-<!ENTITY tstrok "ŧ">
-<!ENTITY ang "∠">
-<!ENTITY khgr "χ">
-<!ENTITY b.thetas "θ">
-<!ENTITY ecaron "ě">
-<!ENTITY Odblac "Ő">
-<!ENTITY fflig "ff">
-<!ENTITY lowast "∗">
-<!ENTITY nvdash "⊬">
-<!ENTITY frac18 "⅛">
-<!ENTITY sup1 "¹">
-<!ENTITY njcy "њ">
-<!ENTITY b.thetav "ϑ">
-<!ENTITY sup2 "²">
-<!ENTITY gimel "ℷ">
-<!ENTITY ldot "⋖">
-<!ENTITY Ccedil "Ç">
-<!ENTITY rdquo "”">
-<!ENTITY rhard "⇁">
-<!ENTITY nsime "≄">
-<!ENTITY boxhu "┴">
-<!ENTITY intcal "⊺">
-<!ENTITY nsupe "⊉">
-<!ENTITY Gt "≫">
-<!ENTITY igr "ι">
-<!ENTITY nabla "∇">
-<!ENTITY urcorn "⌝">
-<!ENTITY nle "≰">
-<!ENTITY Icy "И">
-<!ENTITY DJcy "Ђ">
-<!ENTITY jukcy "є">
-<!ENTITY lceil "⌈">
-<!ENTITY oS "Ⓢ">
-<!ENTITY malt "✠">
-<!ENTITY ccirc "ĉ">
-<!ENTITY ycirc "ŷ">
-<!ENTITY Aacgr "Ά">
-<!ENTITY Ntilde "Ñ">
-<!ENTITY vsupnE "⊋">
-<!ENTITY ogr "ο">
-<!ENTITY and "∧">
-<!ENTITY gvnE "≩">
-<!ENTITY dashv "⊣">
-<!ENTITY supE "⊇">
-<!ENTITY mu "μ">
-<!ENTITY vsubnE "">
-<!ENTITY gE "≧">
-<!ENTITY smid "">
-<!ENTITY delta "δ">
-<!ENTITY tcaron "ť">
-<!ENTITY rsqb "]">
-<!ENTITY bull "•">
-<!ENTITY cuwed "⋏">
-<!ENTITY raquo "»">
-<!ENTITY frac45 "⅘">
-<!ENTITY part "∂">
-<!ENTITY Vdash "⊩">
-<!ENTITY boxhd "┬">
-<!ENTITY psi "ψ">
-<!ENTITY b.Omega "Ω">
-<!ENTITY iquest "¿">
-<!ENTITY sqcup "⊔">
-<!ENTITY YUcy "Ю">
-<!ENTITY psgr "ψ">
-<!ENTITY conint "∮">
-<!ENTITY gel "⋛">
-<!ENTITY Icirc "Î">
-<!ENTITY twixt "≬">
-<!ENTITY boxHD "╥">
-<!ENTITY male "♂">
-<!ENTITY euro "€">
-<!ENTITY epsi "∊">
-<!ENTITY Rcaron "Ř">
-<!ENTITY SHCHcy "Щ">
-<!ENTITY ugr "υ">
-<!ENTITY Phi "Φ">
-<!ENTITY b.Xi "Ξ">
-<!ENTITY lt "<">
-<!ENTITY scnsim "⋩">
-<!ENTITY models "⊧">
-<!ENTITY boxHu "╩">
-<!ENTITY Lcy "Л">
-<!ENTITY Sacute "Ś">
-<!ENTITY nwarr "↖">
-<!ENTITY drcorn "⌟">
-<!ENTITY NJcy "Њ">
-<!ENTITY mumap "⊸">
-<!ENTITY rAarr "⇛">
-<!ENTITY nsubE "⊈">
-<!ENTITY b.rho "ρ">
-<!ENTITY oelig "œ">
-<!ENTITY utrif "▴">
-<!ENTITY subne "⊊">
-<!ENTITY para "¶">
-<!ENTITY ocirc "ô">
-<!ENTITY ouml "ö">
-<!ENTITY num "#">
-<!ENTITY boxUL "╛">
-<!ENTITY IEcy "Е">
-<!ENTITY Ocy "О">
-<!ENTITY Ugrave "Ù">
-<!ENTITY eogon "ę">
-<!ENTITY sum "∑">
-<!ENTITY mcy "м">
-<!ENTITY YIcy "Ї">
-<!ENTITY Gamma "Γ">
-<!ENTITY isin "∊">
-<!ENTITY cuesc "⋟">
-<!ENTITY b.Pi "Π">
-<!ENTITY Ubreve "Ŭ">
-<!ENTITY starf "★">
-<!ENTITY gne "≩">
-<!ENTITY gammad "Ϝ">
-<!ENTITY napos "ʼn">
-<!ENTITY sup "⊃">
-<!ENTITY dArr "⇓">
-<!ENTITY Larr "↞">
-<!ENTITY nVDash "⊯">
-<!ENTITY boxhU "╧">
-<!ENTITY Ggr "Γ">
-<!ENTITY Idigr "Ϊ">
-<!ENTITY AElig "Æ">
-<!ENTITY Idot "İ">
-<!ENTITY Lacute "Ĺ">
-<!ENTITY sharp "♯">
-<!ENTITY Ubrcy "Ў">
-<!ENTITY lsqb "[">
-<!ENTITY micro "µ">
-<!ENTITY Sub "⋐">
-<!ENTITY agr "α">
-<!ENTITY nap "≉">
-<!ENTITY sfgr "ς">
-<!ENTITY block "█">
-<!ENTITY nspar "∦">
-<!ENTITY supnE "⊋">
-<!ENTITY prsim "≾">
-<!ENTITY shcy "ш">
-<!ENTITY dblac "˝">
-<!ENTITY xhArr "↔">
-<!ENTITY dtri "▿">
-<!ENTITY barwed "⊼">
-<!ENTITY zcy "з">
-<!ENTITY agrave "à">
-<!ENTITY par "∥">
-<!ENTITY vsupne "⊋">
-<!ENTITY Scy "С">
-<!ENTITY zdot "ż">
-<!ENTITY rsquor "‘">
-<!ENTITY Delta "Δ">
-<!ENTITY nVdash "⊮">
-<!ENTITY Pgr "Π">
-<!ENTITY gamma "γ">
-<!ENTITY tau "τ">
-<!ENTITY Ecirc "Ê">
-<!ENTITY sung "♩">
-<!ENTITY natur "♮">
-<!ENTITY or "∨">
-<!ENTITY vsubne "⊊">
-<!ENTITY Jcy "Й">
-<!ENTITY square "□">
-<!ENTITY b.zeta "ζ">
-<!ENTITY b.Psi "Ψ">
-<!ENTITY gbreve "ğ">
-<!ENTITY Kcedil "Ķ">
-<!ENTITY ohm "Ω">
-<!ENTITY frac35 "⅗">
-<!ENTITY ssetmn "∖">
-<!ENTITY boxUR "╘">
-<!ENTITY frac34 "¾">
-<!ENTITY target "⌖">
-<!ENTITY cularr "↶">
-<!ENTITY xcirc "○">
-<!ENTITY boxhD "╤">
-<!ENTITY iecy "е">
-<!ENTITY Euml "Ë">
-<!ENTITY half "½">
-<!ENTITY rang "〉">
-<!ENTITY numero "№">
-<!ENTITY Ugr "Υ">
-<!ENTITY times "×">
-<!ENTITY semi ";">
-<!ENTITY rharu "⇀">
-<!ENTITY iocy "ё">
-<!ENTITY b.gammad "Ϝ">
-<!ENTITY thinsp " ">
-<!ENTITY lozf "✦">
-<!ENTITY plusb "⊞">
-<!ENTITY tilde "˜">
-<!ENTITY Aogon "Ą">
-<!ENTITY Eogon "Ę">
-<!ENTITY blk12 "▒">
-<!ENTITY pre "≼">
-<!ENTITY boxHd "╦">
-<!ENTITY piv "ϖ">
-<!ENTITY ncaron "ň">
-<!ENTITY wcirc "ŵ">
-<!ENTITY utri "▵">
-<!ENTITY Prime "″">
-<!ENTITY cedil "¸">
-<!ENTITY idigr "ϊ">
-<!ENTITY curren "¤">
-<!ENTITY laquo "«">
-<!ENTITY ulcrop "⌏">
-<!ENTITY ring "˚">
-<!ENTITY oacute "ó">
-<!ENTITY Nacute "Ń">
-<!ENTITY permil "‰">
-<!ENTITY oacgr "ό">
-<!ENTITY b.phis "φ">
-<!ENTITY frac78 "⅞">
-<!ENTITY blk34 "▓">
-<!ENTITY gnsim "⋧">
-<!ENTITY boxVH "╫">
-<!ENTITY zhcy "ж">
-<!ENTITY b.phiv "ϕ">
-<!ENTITY loz "◊">
-<!ENTITY Ngr "Ν">
-<!ENTITY phgr "φ">
-<!ENTITY b.iota "ι">
-<!ENTITY ETH "Ð">
-<!ENTITY trade "™">
-<!ENTITY Cup "⋓">
-<!ENTITY subnE "⊊">
-<!ENTITY PHgr "Φ">
-<!ENTITY xi "ξ">
-<!ENTITY Rcy "Р">
-<!ENTITY ggr "γ">
-<!ENTITY Lmidot "Ŀ">
-<!ENTITY Scirc "Ŝ">
-<!ENTITY rtrif "▸">
-<!ENTITY larrtl "↢">
-<!ENTITY eDot "≑">
-<!ENTITY boxVL "╢">
-<!ENTITY THgr "Θ">
-<!ENTITY Dstrok "Đ">
-<!ENTITY cent "¢">
-<!ENTITY odash "⊝">
-<!ENTITY boxUl "╜">
-<!ENTITY ape "≊">
-<!ENTITY gEl "⋛">
-<!ENTITY nltri "⋪">
-<!ENTITY Aacute "Á">
-<!ENTITY cuvee "⋎">
-<!ENTITY gnE "≩">
-<!ENTITY kgr "κ">
-<!ENTITY iogon "į">
-<!ENTITY rarrtl "↣">
-<!ENTITY sccue "≽">
-<!ENTITY IOcy "Ё">
-<!ENTITY sext "✶">
-<!ENTITY uplus "⊎">
-<!ENTITY ecolon "≕">
-<!ENTITY nlArr "⇍">
-<!ENTITY scap "≿">
-<!ENTITY rarrlp "↬">
-<!ENTITY ngE "≱">
-<!ENTITY nsim "≁">
-<!ENTITY Acy "А">
-<!ENTITY emacr "ē">
-<!ENTITY Jcirc "Ĵ">
-<!ENTITY ltimes "⋉">
-<!ENTITY Bcy "Б">
-<!ENTITY b.Sigma "Σ">
-<!ENTITY cup "∪">
-<!ENTITY fork "⋔">
-<!ENTITY frac25 "⅖">
-<!ENTITY setmn "∖">
-<!ENTITY bsol "\">
-<!ENTITY Ycy "Ы">
-<!ENTITY b.Phi "Φ">
-<!ENTITY Gcedil "Ģ">
-<!ENTITY frac23 "⅔">
-<!ENTITY Iogon "Į">
-<!ENTITY blank "␣">
-<!ENTITY vprop "∝">
-<!ENTITY boxVR "╟">
-<!ENTITY ecy "э">
-<!ENTITY OHacgr "Ώ">
-<!ENTITY yen "¥">
-<!ENTITY hairsp " ">
-<!ENTITY plusdo "∔">
-<!ENTITY lvnE "≨">
-<!ENTITY boxUr "╚">
-<!ENTITY breve "˘">
-<!ENTITY rtimes "⋊">
-<!ENTITY gnap "">
-<!ENTITY rtrie "⊵">
-<!ENTITY Mcy "М">
-<!ENTITY chi "χ">
-<!ENTITY tdot "⃛">
-<!ENTITY PSgr "Ψ">
-<!ENTITY Umacr "Ū">
-<!ENTITY caret "⁁">
-<!ENTITY xutri "△">
-<!ENTITY CHcy "Ч">
-<!ENTITY djcy "ђ">
-<!ENTITY lambda "λ">
-<!ENTITY Tstrok "Ŧ">
-<!ENTITY puncsp " ">
-<!ENTITY Ll "⋘">
-<!ENTITY aacgr "ά">
-<!ENTITY xdtri "▽">
-<!ENTITY GJcy "Ѓ">
-<!ENTITY gdot "ġ">
-<!ENTITY sub "⊂">
-<!ENTITY mid "∣">
-<!ENTITY dzcy "џ">
-<!ENTITY igrave "ì">
-<!ENTITY Emacr "Ē">
-<!ENTITY Rcedil "Ŗ">
-<!ENTITY gt ">">
-<!ENTITY larrlp "↫">
-<!ENTITY harr "↔">
-<!ENTITY thgr "θ">
-<!ENTITY map "↦">
-<!ENTITY drarr "↘">
-<!ENTITY boxVh "╬">
-<!ENTITY ijlig "ij">
-<!ENTITY tcedil "ţ">
-<!ENTITY dlcrop "⌍">
-<!ENTITY prnsim "⋨">
-<!ENTITY ecir "≖">
-<!ENTITY rgr "ρ">
-<!ENTITY deg "°">
-<!ENTITY lap "≲">
-<!ENTITY KJcy "Ќ">
-<!ENTITY Cdot "Ċ">
-<!ENTITY Uogon "Ų">
-<!ENTITY not "¬">
-<!ENTITY dash "‐">
-<!ENTITY nexist "∄">
-<!ENTITY Lt "≪">
-<!ENTITY b.Upsi "ϒ">
-<!ENTITY Atilde "Ã">
-<!ENTITY edot "ė">
-<!ENTITY Ncedil "Ņ">
-<!ENTITY els "⋜">
-<!ENTITY erDot "≓">
-<!ENTITY boxVl "╣">
-<!ENTITY scy "с">
-<!ENTITY ulcorn "⌜">
-<!ENTITY eacgr "έ">
-<!ENTITY Itilde "Ĩ">
-<!ENTITY Zacute "Ź">
-<!ENTITY xharr "↔">
-<!ENTITY gl "≷">
-<!ENTITY chcy "ч">
-<!ENTITY Oacute "Ó">
-<!ENTITY itilde "ĩ">
-<!ENTITY Ycirc "Ŷ">
-<!ENTITY nhArr "⇎">
-<!ENTITY Lstrok "Ł">
-<!ENTITY divide "÷">
-<!ENTITY Tcy "Т">
-<!ENTITY Jukcy "Є">
-<!ENTITY Yacute "Ý">
-<!ENTITY boxv "│">
-<!ENTITY hamilt "ℋ">
-<!ENTITY nu "ν">
-<!ENTITY ngt "≯">
-<!ENTITY jsercy "ј">
-<!ENTITY uml "¨">
-<!ENTITY KHgr "Χ">
-<!ENTITY lstrok "ł">
-<!ENTITY nsupE "⊉">
-<!ENTITY dtrif "▾">
-<!ENTITY vellip "⋮">
-<!ENTITY rceil "⌉">
-<!ENTITY ell "ℓ">
-<!ENTITY Ecy "Э">
-<!ENTITY Jsercy "Ј">
-<!ENTITY ljcy "љ">
-<!ENTITY Kgr "Κ">
-<!ENTITY ngr "ν">
-<!ENTITY sigmav "ς">
-<!ENTITY Gdot "Ġ">
-<!ENTITY rdquor "“">
-<!ENTITY prnap "⋨">
-<!ENTITY tcy "т">
-<!ENTITY frac12 "½">
-<!ENTITY telrec "⌕">
-<!ENTITY vdash "⊢">
-<!ENTITY Zgr "Ζ">
-<!ENTITY Auml "Ä">
-<!ENTITY Ocirc "Ô">
-<!ENTITY uogon "ų">
-<!ENTITY hArr "⇔">
-<!ENTITY nge "≱">
-<!ENTITY iacute "í">
-<!ENTITY Cacute "Ć">
-<!ENTITY Omacr "Ō">
-<!ENTITY equiv "≡">
-<!ENTITY vltri "⊲">
-<!ENTITY eta "η">
-<!ENTITY SHcy "Ш">
-<!ENTITY percnt "%">
-<!ENTITY lowbar "_">
-<!ENTITY frac16 "⅙">
-<!ENTITY lrarr2 "⇆">
-<!ENTITY nles "≰">
-<!ENTITY bump "≎">
-<!ENTITY veebar "⊻">
-<!ENTITY Wcirc "Ŵ">
-<!ENTITY frac15 "⅕">
-<!ENTITY bumpe "≏">
-<!ENTITY egrave "è">
-<!ENTITY frac14 "¼">
-<!ENTITY supe "⊇">
-<!ENTITY rfloor "⌋">
-<!ENTITY Dgr "Δ">
-<!ENTITY frac13 "⅓">
-<!ENTITY ge "≥">
-<!ENTITY boxVr "╠">
-<!ENTITY pgr "π">
-<!ENTITY kgreen "ĸ">
-<!ENTITY boxh "─">
-<!ENTITY Lambda "Λ">
-<!ENTITY ugrave "ù">
-<!ENTITY emsp13 " ">
-<!ENTITY becaus "∵">
-<!ENTITY sce "≽">
-<!ENTITY grave "`">
-<!ENTITY zeta "ζ">
-<!ENTITY b.Theta "Θ">
-<!ENTITY eth "ð">
-<!ENTITY Ouml "Ö">
-<!ENTITY check "✓">
-<!ENTITY hybull "⁃">
-<!ENTITY Gg "⋙">
-<!ENTITY Ccaron "Č">
-<!ENTITY plus "+">
-<!ENTITY fllig "fl">
-<!ENTITY forall "∀">
-<!ENTITY dcaron "ď">
-<!ENTITY gacute "ǵ">
-<!ENTITY sc "≻">
-<!ENTITY OHgr "Ω">
-<!ENTITY emsp14 " ">
-<!ENTITY hellip "…">
-<!ENTITY lhard "↽">
-<!ENTITY sstarf "⋆">
-<!ENTITY samalg "∐">
-<!ENTITY EEgr "Η">
-<!ENTITY rhov "ϱ">
-<!ENTITY b.epsi "ε">
-<!ENTITY lsquo "‘">
-]>
-<book id="jboss_portal_reference_guide">
-<!--<book lang="en">
- <bookinfo>
- <title>JBoss Portal Reference Guide</title>
- <subtitle>JBoss Portal Reference Guide</subtitle>
- <edition>2.7.0</edition>
- <pubsnumber>1</pubsnumber>
- <productname>JBoss Portal</productname>
- <productnumber>2.7</productnumber>
- <pubdate>Nov, 2007</pubdate>
- <isbn>N/A</isbn>
-
-
- <abstract><para>This document is an outline of the information plan for JBoss AS 5 GA project's documentation.</para></abstract>
-
-
-
-
-
-
-
- <xi:include href="Author_Group.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- </bookinfo>
- -->
- <!--<toc/>-->
- <bookinfo id="JBoss_Portal_Reference_Guide">
- <title>JBoss Portal Reference Guide</title>
- <subtitle>JBoss Portal 2.7 Reference Guide</subtitle>
- <edition>2</edition>
- <pubsnumber>7</pubsnumber>
- <productname>JBoss Portal</productname>
- <productnumber>2.7</productnumber>
- <pubdate>Oct, 2007</pubdate>
- <isbn>N/A</isbn>
- <issuenum>1</issuenum>
-
-
- <abstract><para>This book is a JBoss Portal 2.7 Reference Guide.</para>
- </abstract>
- <corpauthor>
- <inlinemediaobject>
- <imageobject>
- <imagedata fileref="Common_Content/images/redhat-logo.svg"/>
- </imageobject>
- </inlinemediaobject>
- </corpauthor>
-
- <copyright>
- <year>&YEAR;</year>
- <holder>&HOLDER;</holder>
- </copyright>
- <legalnotice xml:base="Common_Content/Legal_Notice.xml">
- <para>
- Copyright <trademark class="copyright"/> &YEAR; &HOLDER;. This material may only be distributed subject to the terms and conditions set forth in the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License (which is presently available at <ulink url="http://creativecommons.org/licenses/by-nc-sa/3.0/">http://creativecommons.org/licenses/by-nc-sa/3.0/</ulink>).
- </para>
- <para>
- Red Hat and the Red Hat "Shadow Man" logo are registered trademarks of Red Hat, Inc. in the United States and other countries.
- </para>
- <para>
- All other trademarks referenced herein are the property of their respective owners.
- </para>
- <para>
- The GPG fingerprint of the security(a)redhat.com key is:
- </para>
- <para>
- CA 20 86 86 2B D6 9D FC 65 F6 EC C4 21 91 80 CD DB 42 A6 0E
- </para>
- <para>
- <address>
- <street>1801 Varsity Drive</street>
- <city>Raleigh</city>, <state>NC</state> <postcode>27606-2072</postcode><country>USA</country><phone>Phone: +1 919 754 3700</phone>
- <phone>Phone: 888 733 4281</phone>
- <fax>Fax: +1 919 754 3701</fax>
- <pob>PO Box 13588</pob><city>Research Triangle Park</city>, <state>NC</state> <postcode>27709</postcode><country>USA</country>
- </address>
- </para>
-</legalnotice>
- <authorgroup><corpauthor> JBoss Portal Team </corpauthor>
-
-
-<author>
- <firstname>Thomas</firstname>
- <surname>Heute</surname>
- <email>theute(a)jboss.org</email>
- </author>
- <author>
- <firstname>Julien</firstname>
- <surname>Viet</surname>
- <email>julien(a)jboss.org</email>
- </author>
- <author>
- <firstname>Roy</firstname>
- <surname>Russo</surname>
- </author>
- <author>
- <firstname>Boleslaw</firstname>
- <surname>Dawidowicz</surname>
- <email>boleslaw dot dawidowicz at redhat dot com</email>
- </author>
- <author>
- <firstname>Chris</firstname>
- <surname>Laprun</surname>
- <email>chris.laprun(a)jboss.com</email>
- </author>
- <author>
- <firstname>Murray</firstname>
- <surname>McAllister</surname>
- <email>mmcallis(a)redhat.com</email>
- </author>
-
-
-
-</authorgroup>
-</bookinfo>
-
- <preface id="trademarks">
- <title>Please Read: Important Trademark Information</title>
- <para>
- Sun, JavaServer, JSP, Java, JMX, JDK, Java runtime environment, J2EE, JVM, Javadoc, 100% Pure Java, JDBC, and JavaScript are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.
- </para>
- <para>
- JBoss is a registered trademark of Red Hat, Inc. in the U.S. and other countries.
- </para>
- <para>
- Red Hat is a registered trademark of Red Hat, Inc. in the United States and other countries.
- </para>
- <para>
- Oracle is a registered trademark of Oracle International Corporation.
- </para>
- <para>
- Microsoft, Windows, Active Directory, and SQL Server are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.
- </para>
- <para>
- Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.
- </para>
- <para>
- UNIX is a registered trademark of The Open Group.
- </para>
- <para>
- MySQL is a trademark or registered trademark of MySQL AB in the U.S. and other countries.
- </para>
- <para>
- Apache is a trademark of The Apache Software Foundation.
- </para>
- <para>
- Mac and Mac OS are trademarks of Apple Inc., registered in the U.S. and other countries.
- </para>
- <para>
- All other trademarks referenced herein are the property of their respective owners.
- </para>
-</preface><!--To do:
-
-Apache?
-
-Linux?
-
-
-All the sun stuff
-
-
-
-Microsoft?
-
-
-Mail them first (see Apache Jackrabbit)
-
-
-
-
-
-'Apache is a trademark of The Apache Software Foundation, and is used with permission.' This is not necessary in the case of all-inclusive attribution language such as, 'All marks are the properties of their respective owners.' Contact the ASF Public Relations Committee <prc(a)apache.org> with all inquiries regarding trademark issues -->
-<!-- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Overview.xml" />-->
-<!-- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Featurelist.xml" />-->
- <preface id="target" revision="1">
- <title>Target Audience</title>
- <para>
- This guide is aimed towards portlet developers, portal administrators, and those wishing to
- implement and extend the JBoss Portal framework. For end-user documentation, please refer to the JBoss Portal User Manual from the <ulink url="http://labs.jboss.com/portal/jbossportal/docs/index.html">JBoss Portal Documentation Library</ulink>
- .</para>
-</preface>
-<!-- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Acknowledgements.xml" />-->
- <chapter id="supportedversions">
- <!-- <chapterinfo>
- <author>
- <firstname>Thomas</firstname>
- <surname>Heute</surname>
- </author>
- <author>
- <firstname>Roy</firstname>
- <surname>Russo</surname>
- </author>
- </chapterinfo>-->
- <title>System Requirements</title>
- <para>
- The following chapter details hardware and software versions that are compatible with JBoss Portal. The hardware and software listed has either been tested, or reported as working by users. Before reporting a problem, make sure you are using compatible hardware and software.
- </para>
- <para>
- If you successfully installed JBoss Portal on versions not listed here, please let us know so it can be added to this section.
- </para>
- <section>
- <title>Minimum System Requirements</title>
- <para>
- <itemizedlist>
- <listitem><para>JDK 5 (JDK 6 is not part of the test platform)</para></listitem>
- <listitem><para>512 MB RAM</para></listitem>
- <listitem><para>100 MB hard disk space</para></listitem>
- <listitem><para>400 MHz CPU</para></listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>Supported Operating Systems</title>
- <para>JBoss Portal is <trademark class="trade">100% Pure Java</trademark>, and therefore it is interoperable with most operating systems
- capable of running a Java Virtual Machine (<trademark class="trade">JVM</trademark>), including <trademark class="registered">Linux</trademark>, <trademark class="registered">Windows</trademark>, <trademark class="registered">UNIX</trademark> operating systems, and Mac OS X.
- </para>
- </section>
- <section>
- <title>JBoss Application Server</title>
- <para>JBoss Portal 2.7.0 is tested with JBoss Application Server (AS) JBoss AS 4.2.3, JBoss Enterprise Application Platform (EAP) 4.2 and JBoss EAP 4.3. It is highly recommended that customers who have access to the <ulink url="https://support.redhat.com/portal/login.html">JBoss Customer Support Portal (CSP)</ulink> use JBoss EAP 4.3. Customers who do not have access to the JBoss CSP should use <ulink url="http://labs.jboss.com/jbossas/">JBoss AS</ulink>.
- </para>
- <warning>
- <para>JBoss AS versions 4.0.<replaceable>x</replaceable> are not supported.</para>
- </warning>
- </section>
- <section id="supportedversions-db">
- <title>Databases</title>
- <para>JBoss Portal is database-agnostic. The following list outlines known-to-be-working database vendor and version combinations:</para>
- <itemizedlist>
- <listitem><para><trademark class="registered">MySQL</trademark> 4 (use <ulink url="http://dev.mysql.com/downloads/connector/j/3.1.html">Connector/J 3.1</ulink>) and 5 (<ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=AvoidMySQL5DataTruncationErrors">known issue</ulink>)</para></listitem>
- <listitem><para>PostgreSQL 8.<replaceable>x</replaceable></para></listitem>
- <listitem><para>Hypersonic SQL</para></listitem>
- <listitem><para>Apache Derby</para></listitem>
- <listitem><para><trademark class="registered">Oracle</trademark> Database 9 and 10g (use the <ulink url="http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html">latest driver from the Oracle 10 branch</ulink> even if you are running Oracle 9)</para></listitem>
- <listitem><para><trademark class="registered">Microsoft</trademark><trademark class="registered"> SQL Server</trademark></para></listitem>
- <listitem><para>MaxDB</para></listitem>
- </itemizedlist>
- <para>JBoss Portal employs Hibernate as an interface to a Relational Database Management System (RDBMS). Most Relational Database Management Systems supported by Hibernate will work with JBoss Portal.</para>
- </section>
- <section>
- <title>Source Building</title>
- <para>The source building mechanism works on Linux, Windows, Mac OS X, and UNIX operating systems.</para>
- </section>
-</chapter>
- <chapter id="installation">
- <title>Installation</title>
- <para>
- Depending on your needs, there are several different methods to install JBoss
- Portal. Pre-configured clustered versions (
- <computeroutput>JBoss Portal Binary (Clustered)</computeroutput>
- ) are available from the
- <ulink url="http://labs.jboss.com/portal/jbossportal/download/index.html">
- JBoss Portal Downloads
- </ulink>
- page. Clustered versions of JBoss Portal must be deployed in the
- <filename>JBOSS_INSTALLATION_DIRECTORY/server/all/deploy/</filename>
- directory. All JBoss AS instances must reference the same datasource. Refer to
- <xref linkend="install_source_env"/>
- for details on how to configure JBoss Portal for clustering.
- </para>
- <para>
- An environment variable,
- <computeroutput>JBOSS_HOME</computeroutput>
- , is configured in
- <xref linkend="install_source_env"/>
- . References to
- <computeroutput>$JBOSS_HOME</computeroutput>
- assume this to be your
- <replaceable>JBOSS_INSTALLATION_DIRECTORY</replaceable>
- .
- </para>
- <section id="install_bundle">
- <title>The JBoss Portal and JBoss AS Bundle</title>
- <para>
- This is the easiest and fastest way to get JBoss Portal installed and running.
- The JBoss Portal and JBoss AS bundle contains JBoss AS, JBoss Portal, and the
- embedded Hypersonic SQL database. To install the JBoss Portal and JBoss AS
- bundle:
- </para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- <emphasis role="bold">Get the bundle:</emphasis>
- the bundle is available from the
- <ulink url="http://labs.jboss.com/portal/jbossportal/download/index.html">
- JBoss Portal Downloads
- </ulink>
- page. Bundles use the
- <computeroutput>JBoss Portal + JBoss AS</computeroutput>
- naming convention.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">Extract the bundle:</emphasis>
- extract the ZIP archive. It does not matter which directory is used. On
- Windows, the recommended directory is
- <filename>
- C:\jboss-
- <replaceable>version-number</replaceable>
- </filename>
- .
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">Start the server:</emphasis>
- change into the
- <filename>JBOSS_PORTAL_INSTALLATION_DIRECTORY/bin/</filename>
- directory. On Windows, execute
- <command>run.bat</command>
- . On Linux, run the
- <command>sh run.sh</command>
- command. To specify a configuration to use, for example, the default
- configuration, append the
- <command>-c default</command>
- option to the
- <command>run.bat</command>
- or
- <command>sh run.sh</command>
- commands.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">Log in to JBoss Portal:</emphasis>
- using a Web browser, navigate to
- <ulink url="http://localhost:8080/portal"/>
- to open the JBoss Portal homepage. Log in using one of the two default
- accounts: username
- <emphasis>user</emphasis>
- , password
- <emphasis>user</emphasis>
- , or username
- <emphasis>admin</emphasis>
- , password
- <emphasis>admin</emphasis>
- :
- </para>
- </listitem>
- </orderedlist>
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/common/frontpage.png" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <formalpara>
- <title>SQL Errors</title>
- <para>
- Tables are automatically created the first time JBoss Portal starts. When
- deployed for the first time, JBoss Portal checks for the existence of the
- initial tables, which have not been created yet. This causes errors such as
- the following, which can safely be ignored:
- </para>
- </formalpara>
- <para>
- <programlisting><![CDATA[
-WARN [JDBCExceptionReporter] SQL Error: -22, SQLState: S0002
-ERROR [JDBCExceptionReporter] Table not found in statement ...
-WARN [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
-ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_repositoryentry' doesn't exist
-WARN [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
-ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_version_refs' doesn't exist]]></programlisting>
- </para>
- </section>
- <section id="install_binary">
- <title>Installing the Binary Download</title>
- <para>
- The binary package typically consists of the
- <filename>jboss-portal.sar/</filename>
- directory, documentation such as the JBoss Portal User Guide and the JBoss Portal
- Reference Guide, and a set of pre-configured Datasource descriptors that allow
- JBoss Portal to communicate with an external database. This installation method
- is recommended for users who already have JBoss EAP or JBoss AS installed, or
- those who need to install JBoss Portal in a clustered environment.
- </para>
- <section>
- <title>Setting up your Environment</title>
- <section id="install_binarydownload">
- <title>Getting the Binary</title>
- <para>
- The binary download is available from the
- <ulink url="http://labs.jboss.com/portal/jbossportal/download/index.html">
- JBoss Portal Downloads
- </ulink>
- page. Look for the
- <computeroutput>JBoss Portal Binary</computeroutput>
- package. Once the binary ZIP file has been downloaded and extracted, the
- folder hierarchy will look similar to the following:
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/setup/package.png"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- Files contained in this download are used in later sections. Download and
- extract the JBoss Portal binary ZIP file before proceeding.
- </para>
- </section>
- <section>
- <title>JBoss EAP and JBoss AS Setup</title>
- <para>
- Before deploying JBoss Portal, make sure you have JBoss EAP or JBoss AS
- installed. Customers who have access to the
- <ulink url="https://support.redhat.com/portal/login.html">
- JBoss Customer Support Portal (CSP)
- </ulink>
- are advised to download and install JBoss EAP 4.3. Customers who do not
- have access to the JBoss CSP are advised to use
- <ulink url="http://labs.jboss.com/jbossas/downloads/">JBoss AS</ulink>
- . For JBoss AS installation instructions, please refer to the
- <ulink url="http://labs.jboss.com/jbossas/docs/index.html">
- JBoss AS Installation Guide
- </ulink>
- .
- </para>
- <warning>
- <title>Use the JBoss EAP and JBoss AS ZIP file</title>
- <para>
- Only use the JBoss EAP and JBoss AS ZIP file versions.
- <emphasis role="bold">
- DO NOT ATTEMPT to deploy JBoss Portal on the installer version of
- JBoss EAP or JBoss AS.
- </emphasis>
- </para>
- </warning>
- </section>
- <section id="install_source_env_0">
- <title>Operating System Environment Settings</title>
- <para>
- For JBoss EAP, JBoss AS, and build targets to work, you must configure a
- <filename>JBOSS_HOME</filename>
- environment variable. This environment variable must point to the root
- directory of the JBoss EAP or JBoss AS installation directory, which is the
- directory where the JBoss EAP or JBoss AS files were extracted to.
- </para>
- <para>
- On Windows, this is accomplished by going to
- <emphasis>
- Start > Settings > Control Panel > System > Advanced > Environment
- Variables
- </emphasis>
- . Under the
- <emphasis>System Variables</emphasis>
- section, click
- <emphasis>New</emphasis>
- . Set the
- <filename>JBOSS_HOME</filename>
- environment variable to the location of your JBoss EAP or JBoss AS
- installation directory:
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/setup/win_envsetup.gif"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- To configure the
- <filename>JBOSS_HOME</filename>
- environment variable on Linux:
- </para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- Add the following line to the
- <filename>~/.bashrc</filename>
- file. Note: this must be configured while logged in as the user
- who runs JBoss EAP or JBoss AS:
- </para>
- <para>
- <programlisting>
- export JBOSS_HOME=/path/to/jboss/installation/
- </programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- Run the following command to enable the
- <filename>JBOSS_HOME</filename>
- environment variable:
- </para>
- <para>
- <programlisting>source ~/.bashrc</programlisting>
- </para>
- </listitem>
- </orderedlist>
- </para>
- <note>
- <title>
- JBoss EAP
- <filename>JBOSS_HOME</filename>
- Environment Variable
- </title>
- <para>
- If you are running JBoss EAP, configure the
- <filename>JBOSS_HOME</filename>
- environment variable to point to the
- <filename>
- /path/to/jboss-eap-
- <replaceable>version</replaceable>
- /jboss-as/
- </filename>
- directory.
- </para>
- </note>
- </section>
- <section>
- <title>Database Setup</title>
- <para>
- A database is required for JBoss Portal to run. JBoss EAP and JBoss AS
- include an embedded Hypersonic SQL database that JBoss Portal can use;
- however, this is only recommended for developer use. The following
- databases are recommended for production use, and have had test suites run
- against them:
- <trademark class="registered">MySQL</trademark>
- 4 and 5,
- <trademark class="registered">Microsoft</trademark>
- <trademark class="registered">SQL Server</trademark>
- , PostgreSQL 8, and
- <trademark class="registered">Oracle</trademark>
- Database 9 and 10. JBoss Portal can use any database that is supported by
- Hibernate.
- </para>
- <para>To configure a database to use with JBoss Portal:</para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- <emphasis role="bold">Create a new database:</emphasis>
- this guide assumes that the new database is called
- <emphasis>jbossportal</emphasis>
- .
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- Grant access rights for a user to the
- <emphasis>jbossportal</emphasis>
- database:
- </emphasis>
- JBoss Portal needs to create tables and modify table data. Grant
- access rights to a desired user to the
- <emphasis>jbossportal</emphasis>
- database. Configure the same username and password in the
- Datasource descriptor.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- Deploy an RDBMS
- <trademark class="trade">JDBC</trademark>
- connector:
- </emphasis>
- an RDBMS JDBC connector is required for JBoss Portal to
- communicate with a database. Copy the connector into the
- <filename>$JBOSS_HOME/server/default/lib/</filename>
- directory. For example, an RDBMS JDBC connector for MySQL can be
- download from
- <ulink url="http://www.mysql.com/products/connector/j/"/>
- . For the correct RDMBS JDBC connector, please refer to the
- database documentation.
- </para>
- </listitem>
- </orderedlist>
- </para>
- </section>
- <section>
- <title>Datasource Descriptors</title>
- <para>
- The JBoss Portal binary download that was extracted in
- <xref linkend="install_binarydownload"/>
- , contains pre-configured Datasource descriptors for the more popular
- databases. Datasource descriptors are provided for the MySQL 4 and 5,
- PostgreSQL, Microsoft SQL Server, and Oracle databases, and can be found in
- the
- <filename>setup</filename>
- subdirectory where the JBoss Portal binary was extracted to:
- </para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/setup/dsfiles.png"/>
- </imageobject>
- </mediaobject>
- <para>
- Copy the Datasource descriptor that matches your database into the
- <filename>
- $JBOSS_HOME/server/
- <replaceable>configuration</replaceable>
- /deploy/
- </filename>
- directory, where
- <replaceable>configuration</replaceable>
- is either all, default, minimal or production. The production configuration
- only exists on JBoss EAP, and not JBoss AS. For example, if you are using
- the all configuration, copy the Datasource descriptor into the
- <filename>$JBOSS_HOME/server/all/deploy/</filename>
- directory.
- </para>
- <para>
- After the Datasource descriptor has been copied into the
- <filename>deploy</filename>
- directory, make sure the
- <computeroutput>user-name</computeroutput>
- ,
- <computeroutput>password</computeroutput>
- ,
- <computeroutput>connection-url</computeroutput>
- , and
- <computeroutput>driver-class</computeroutput>
- , are correct for your chosen database. Datasource descriptor files can be
- deployed to test before being used in production. The following is an
- example Datasource descriptor for a PostgreSQL database:
- </para>
- <programlisting role="XML">
- <![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<datasources>
- <local-tx-datasource>
- <jndi-name>PortalDS</jndi-name>
- <connection-url>jdbc:postgresql:jbossportal</connection-url>
- <driver-class>org.postgresql.Driver</driver-class>
- <user-name>portal</user-name>
- <password>portalpassword</password>
- </local-tx-datasource>
-</datasources>]]></programlisting>
- <para>
- For further details about Datasource descriptors, please refer to the
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=CreateAJDBCDataSource">
- JBoss JDBC Datasource Wiki page
- </ulink>
- .
- </para>
- </section>
- </section>
- <section>
- <title>Deploying JBoss Portal</title>
- <para>To start JBoss EAP or JBoss AS and deploy JBoss Portal:</para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- <emphasis role="bold">Datasource descriptor:</emphasis>
- if you have not done so already, change into the
- <filename>setup</filename>
- subdirectory where the JBoss Portal binary was extracted to. Copy the
- correct Datasource descriptor file (
- <filename>*-ds.xml</filename>
- ) you modified in the previous steps into the
- <filename>
- $JBOSS_HOME/server/
- <replaceable>configuration</replaceable>
- /deploy/
- </filename>
- directory.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">Start the server:</emphasis>
- change into the
- <filename>$JBOSS_HOME/bin/</filename>
- directory. On Windows, execute
- <command>run.bat</command>
- . On Linux, run the
- <command>sh run.sh</command>
- command. To specify a configuration to use, for example, the default
- configuration, append the
- <command>-c default</command>
- option to the
- <command>run.bat</command>
- or
- <command>sh run.sh</command>
- commands.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">Log in to JBoss Portal:</emphasis>
- using a Web browser, navigate to
- <ulink url="http://localhost:8080/portal"/>
- to open the JBoss Portal homepage. Log in using one of the two
- default accounts: username
- <emphasis>user</emphasis>
- , password
- <emphasis>user</emphasis>
- , or username
- <emphasis>admin</emphasis>
- , password
- <emphasis>admin</emphasis>
- .
- </para>
- </listitem>
- </orderedlist>
- </para>
- <formalpara>
- <title>SQL Errors</title>
- <para>
- Tables are automatically created the first time JBoss Portal starts. When
- deployed for the first time, JBoss Portal checks for the existence of the
- initial tables, which have not been created yet. This causes errors such as
- the following, which can safely be ignored:
- </para>
- </formalpara>
- <para>
- <programlisting><![CDATA[
-WARN [JDBCExceptionReporter] SQL Error: -22, SQLState: S0002
-ERROR [JDBCExceptionReporter] Table not found in statement ...
-WARN [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
-ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_repositoryentry' doesn't exist
-WARN [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
-ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_version_refs' doesn't exist
-]]></programlisting>
- </para>
- </section>
- </section>
- <section id="install_source">
- <title>Installing from the Sources</title>
- <section>
- <title>Getting the Sources</title>
- <para>
- The JBoss Portal source files can be obtained from the
- <ulink url="http://labs.jboss.com/portal/jbossportal/download/index.html">
- JBoss Portal Downloads
- </ulink>
- page. The source files download uses a
- <filename>JBoss Portal Source Code</filename>
- naming convention. As well, the sources can be obtained from SVN. The latest
- sources for the 2.7.
- <replaceable>x</replaceable>
- versions are located at
- <ulink url="http://anonsvn.jboss.org/repos/portal/branches/JBoss_Portal_Branch_2_7"/>
- .
- </para>
- <para>
- Several modules have been extracted from the JBoss Portal SVN repository.
- These modules have a different lifecycle and a different version scheme. The
- following is a list of modules used in JBoss Portal 2.7.0, and the locations
- of their source code:
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- JBoss Portal Common 1.2.1:
- <emphasis>
- http://anonsvn.jboss.org/repos/portal/modules/common/tags/JBP_COMMON_1_2_1
- </emphasis>
- </para>
- </listitem>
- <listitem>
- <para>
- JBoss Portal Web 1.2.1:
- <emphasis>
- http://anonsvn.jboss.org/repos/portal/modules/web/tags/JBP_WEB_1_2_1
- </emphasis>
- </para>
- </listitem>
- <listitem>
- <para>
- JBoss Portal Test 1.0.3:
- <emphasis>
- http://anonsvn.jboss.org/repos/portal/modules/test/tags/JBP_TEST_1_0_3
- </emphasis>
- </para>
- </listitem>
- <listitem>
- <para>
- JBoss Portal Portlet 2.0.3:
- <emphasis>
- http://anonsvn.jboss.org/repos/portal/modules/portlet/tags/JBP_PORTLET_2_0_3
- </emphasis>
- </para>
- </listitem>
- <listitem>
- <para>
- JBoss Portal Identity 1.0.4:
- <emphasis>
- http://anonsvn.jboss.org/repos/portal/modules/identity/tags/JBP_IDENTITY_...
- </emphasis>
- </para>
- </listitem>
- <listitem>
- <para>
- JBoss Portal CMS 1.2.0:
- <emphasis>
- http://anonsvn.jboss.org/repos/portal/modules/cms/tags/JBP_CMS_1_2_0
- </emphasis>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- After checking out the source from SVN, or after extracting the
- <filename>JBoss Portal Source Code</filename>
- ZIP file, a directory structure similar to the following will be created:
- </para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/setup/svncodir.png"/>
- </imageobject>
- </mediaobject>
- <para>
- If the source files were obtained from SVN, change into the
- <filename>trunk/src/</filename>
- directory to see the directories from the above image. As well, there is an
- empty
- <filename>thirdparty</filename>
- directory. This directory contains files after building the JBoss Portal
- source code (refer to
- <xref linkend="building_deploying_from_source"/>
- ). For more information about the JBoss Portal SVN repository, and accessing
- different versions of the JBoss Portal codebase, refer to the
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=PortalSVNRepo">
- JBoss Portal SVN Repo
- </ulink>
- page on the JBoss Wiki.
- </para>
- </section>
- <section>
- <title>JBoss EAP and JBoss AS Setup</title>
- <section>
- <title>JBoss Application Server Setup</title>
- <para>
- Before deploying JBoss Portal, make sure you have JBoss EAP or JBoss AS
- installed. Customers who have access to the
- <ulink url="https://support.redhat.com/portal/login.html">
- JBoss Customer Support Portal (CSP)
- </ulink>
- are advised to download and install JBoss EAP 4.3. Customers who do not
- have access to the JBoss CSP are advised to use
- <ulink url="http://labs.jboss.com/jbossas/downloads/">JBoss AS</ulink>
- . For JBoss AS installation instructions, please refer to the
- <ulink url="http://labs.jboss.com/jbossas/docs/index.html">
- JBoss AS Installation Guide
- </ulink>
- .
- </para>
- <warning>
- <title>Use the JBoss EAP and JBoss AS ZIP file</title>
- <para>
- Only use the JBoss EAP and JBoss AS ZIP file versions.
- <emphasis role="bold">
- DO NOT ATTEMPT to deploy JBoss Portal on the installer version of
- JBoss EAP or JBoss AS.
- </emphasis>
- We are currently working on aligning the Application installer with
- JBoss Portal.
- </para>
- </warning>
- </section>
- <section id="install_source_env">
- <title>Operating System Environment Settings</title>
- <para>
- For JBoss EAP, JBoss AS, and build targets to work, you must configure a
- <filename>JBOSS_HOME</filename>
- environment variable. This environment variable must point to the root
- directory of the JBoss EAP or JBoss AS installation directory, which is the
- directory where the JBoss EAP or JBoss AS files were extracted to.
- </para>
- <para>
- On Windows, this is accomplished by going to
- <emphasis>
- Start > Settings > Control Panel > System > Advanced > Environment
- Variables
- </emphasis>
- . Under the
- <emphasis>System Variables</emphasis>
- section, click
- <emphasis>New</emphasis>
- . Set the
- <filename>JBOSS_HOME</filename>
- environment variable to the location of your JBoss EAP or JBoss AS
- installation directory:
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/setup/win_envsetup.gif"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- To configure the
- <filename>JBOSS_HOME</filename>
- environment variable on Linux:
- </para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- Add the following line to the
- <filename>~/.bashrc</filename>
- file. Note: this must be configured while logged in as the user
- who runs JBoss EAP or JBoss AS:
- </para>
- <para>
- <programlisting>
- export JBOSS_HOME=/path/to/jboss/installation/
- </programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- Run the following command to enable the
- <filename>JBOSS_HOME</filename>
- environment variable:
- </para>
- <para>
- <programlisting>source ~/.bashrc</programlisting>
- </para>
- </listitem>
- </orderedlist>
- </para>
- <note>
- <title>
- JBoss EAP
- <filename>JBOSS_HOME</filename>
- Environment Variable
- </title>
- <para>
- If you are running JBoss EAP, configure the
- <filename>JBOSS_HOME</filename>
- environment variable to point to the
- <filename>
- /path/to/jboss-eap-
- <replaceable>version</replaceable>
- /jboss-as/
- </filename>
- directory.
- </para>
- </note>
- </section>
- </section>
- <section id="building_deploying_from_source">
- <title>Building and Deploying from the Sources</title>
- <para>
- During the first build, third-party libraries are obtained from an online
- repository, so you must be connected to the Internet, and if you are behind a
- proxy server, you need to define your proxy server address and proxy server
- port number. To define a proxy server, add the following line to the
- <filename>$JBOSS_HOME/bin/run.conf</filename>
- file:
- </para>
-
-<!--<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="extras/runconf_javaops.xmlt"/>-->
-<programlisting>JAVA_OPTS=-Dhttp.proxyHost=<proxy-hostname> -Dhttp.proxyPort=<proxy-port></programlisting>
-
- <para>
- Replace
- <replaceable>proxy-hostname</replaceable>
- with the proxy server's hostname, and
- <replaceable>proxy-port</replaceable>
- with the correct proxy server port number.
- </para>
- <para>
- To build and deploy JBoss Portal from the sources, change into the
- <filename>JBOSS_PORTAL_SOURCE_DIRECTORY/build/</filename>
- directory, where
- <filename>JBOSS_PORTAL_SOURCE_DIRECTORY</filename>
- is the directory where the JBoss Portal source code was downloaded to. Then,
- Windows users need to run the
- <command>build.bat deploy</command>
- command, and Linux users need to run the
- <command>sh build.sh deploy</command>
- command.
- </para>
- <para>
- At the end of the build process, the
- <filename>jboss-portal.sar</filename>
- file is copied into the
- <filename>$JBOSS_HOME/server/default/deploy/</filename>
- directory:
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/setup/build_deploy.png" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- <note>
- <title>Portal Modules</title>
- <para>
- The previous steps install a bare version of JBoss Portal. In previous
- versions, several additional modules were deployed as well, but this has
- since been modularized to provide greater flexibility. To deploy
- additional modules, refer to the
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=PortalModules">
- Portal's module list
- </ulink>
- for more information. To deploy all modules at once, change into the
- <filename>build</filename>
- directory. If you are running Linux, run the
- <command>sh build.sh deploy-all</command>
- command. On Windows, run the
- <command>build.bat deploy-all</command>
- command.
- </para>
- </note>
- </para>
- <para>To build the clustered version on Linux operating systems:</para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- Change into the
- <filename>JBOSS_PORTAL_SOURCE_DIRECTORY/build/</filename>
- directory, and run the following command:
- </para>
- <para>
- <programlisting>sh build.sh main</programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- Change into the
- <filename>JBOSS_PORTAL_SOURCE_DIRECTORY/core/</filename>
- directory, and run the following command:
- </para>
- <para>
- <programlisting>sh build.sh deploy-ha</programlisting>
- </para>
- <para>
- After the
- <command>sh build.sh deploy-ha</command>
- command completes, the
- <filename>jboss-portal-ha.sar</filename>
- file is copied into the
- <filename>$JBOSS_HOME/server/all/deploy/</filename>
- directory.
- </para>
- </listitem>
- </orderedlist>
- </para>
- <para>
- To build the clustered version on Windows, repeat the previous steps,
- replacing
- <command>sh build.sh</command>
- with
- <command>build.bat</command>
- .
- </para>
- </section>
- <section>
- <title>Database Setup</title>
- <para>
- A database is required for JBoss Portal to run. JBoss EAP and JBoss AS include
- an embedded Hypersonic SQL database that JBoss Portal can use; however, this
- is only recommended for developer use. The following databases are recommended
- for production use, and have had test suites run against them: MySQL 4 and 5,
- Microsoft SQL Server, PostgreSQL 8, and Oracle Database 9 and 10. JBoss Portal
- can use any database that is supported by Hibernate.
- </para>
- <para>To configure a database to use with JBoss Portal:</para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- <emphasis role="bold">Create a new database:</emphasis>
- this guide assumes that the new database is called
- <emphasis>jbossportal</emphasis>
- .
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- Grant access rights for a user to the
- <emphasis>jbossportal</emphasis>
- database:
- </emphasis>
- JBoss Portal needs to create tables and modify table data. Grant
- access rights to a desired user to the
- <emphasis>jbossportal</emphasis>
- database. Configure the same username and password in the Datasource
- descriptor.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">Deploy an RDBMS JDBC connector:</emphasis>
- an RDBMS JDBC connector is required for JBoss Portal to communicate
- with a database. Copy the connector into the
- <filename>$JBOSS_HOME/server/default/lib/</filename>
- directory. For example, an RDBMS JDBC connector for MySQL can be
- download from
- <ulink url="http://www.mysql.com/products/connector/j/"/>
- . For the correct RDMBS JDBC connector, please refer to the database
- documentation.
- </para>
- </listitem>
- </orderedlist>
- </para>
- </section>
- <section>
- <title>Datasource Configuration</title>
- <para>
- The JBoss Portal binary download that was extracted in
- <xref linkend="install_binarydownload"/>
- , contains pre-configured Datasource descriptors for the more popular
- databases. Datasource descriptors are provided for the MySQL 4 and 5,
- PostgreSQL, Microsoft SQL Server, and Oracle databases, and can be found in
- the
- <filename>setup</filename>
- subdirectory where the JBoss Portal binary was extracted to:
- </para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/setup/dsfiles.png"/>
- </imageobject>
- </mediaobject>
- <para>
- Copy the Datasource descriptor that matches your database into the
- <filename>
- $JBOSS_HOME/server/
- <replaceable>configuration</replaceable>
- /deploy/
- </filename>
- directory, where
- <replaceable>configuration</replaceable>
- is either all, default, minimal, or production. For example, if you are using
- the production configuration, copy the Datasource descriptor into the
- <filename>$JBOSS_HOME/server/production/deploy/</filename>
- directory. The production configuration only exists on JBoss EAP
- installations, and not JBoss AS.
- </para>
- <para>
- After the Datasource descriptor has been copied into the
- <filename>deploy</filename>
- directory, make sure the
- <computeroutput>user-name</computeroutput>
- ,
- <computeroutput>password</computeroutput>
- ,
- <computeroutput>connection-url</computeroutput>
- , and
- <computeroutput>driver-class</computeroutput>
- , are correct for your chosen database. Datasource descriptor files can be
- deployed to test before being used in production. The following is an example
- Datasource descriptor for a PostgreSQL database:
- </para>
- <programlisting role="XML"><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<datasources>
- <local-tx-datasource>
- <jndi-name>PortalDS</jndi-name>
- <connection-url>jdbc:postgresql:jbossportal</connection-url>
- <driver-class>org.postgresql.Driver</driver-class>
- <user-name>portal</user-name>
- <password>portalpassword</password>
- </local-tx-datasource>
-</datasources>
- ]]></programlisting>
- <para>
- For further details about Datasource descriptors, please refer to the
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=CreateAJDBCDataSource">
- JBoss JDBC Datasource Wiki page
- </ulink>
- .
- </para>
- </section>
- </section>
- <section>
- <title>Deploying JBoss Portal</title>
- <para>To start JBoss EAP or JBoss AS and deploy JBoss Portal:</para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- <emphasis role="bold">Datasource descriptor:</emphasis>
- if you have not done so already, change into the
- <filename>setup</filename>
- subdirectory where the JBoss Portal binary was extracted to. Copy the
- correct Datasource descriptor file (
- <filename>*-ds.xml</filename>
- ) you modified in the previous steps into the
- <filename>
- $JBOSS_HOME/server/
- <replaceable>configuration</replaceable>
- /deploy/
- </filename>
- directory.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">Start the server:</emphasis>
- change into the
- <filename>$JBOSS_HOME/bin/</filename>
- directory. On Windows, execute
- <command>run.bat</command>
- . On Linux, run the
- <command>sh run.sh</command>
- command. To specify a configuration to use, for example, the default
- configuration, append the
- <command>-c default</command>
- option to the
- <command>run.bat</command>
- or
- <command>sh run.sh</command>
- commands.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">Log in to JBoss Portal:</emphasis>
- using a Web browser, navigate to
- <ulink url="http://localhost:8080/portal"/>
- to open the JBoss Portal homepage. Log in using one of the two default
- accounts: username
- <emphasis>user</emphasis>
- , password
- <emphasis>user</emphasis>
- , or username
- <emphasis>admin</emphasis>
- , password
- <emphasis>admin</emphasis>
- .
- </para>
- </listitem>
- </orderedlist>
- </para>
- <formalpara>
- <title>SQL Errors</title>
- <para>
- Tables are automatically created the first time JBoss Portal starts. When
- deployed for the first time, JBoss Portal checks for the existence of the
- initial tables, which have not been created yet. This causes errors such as
- the following, which can safely be ignored:
- </para>
- </formalpara>
- <para>
- <programlisting><![CDATA[
-WARN [JDBCExceptionReporter] SQL Error: -22, SQLState: S0002
-ERROR [JDBCExceptionReporter] Table not found in statement ...
-WARN [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
-ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_repositoryentry' doesn't exist
-WARN [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
-ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_version_refs' doesn't exist
-]]></programlisting>
- </para>
- </section>
-
-</chapter>
- <chapter id="configuration">
- <!-- <chapterinfo>
- <author>
- <firstname>Thomas</firstname>
- <surname>Heute</surname>
- </author>
- <author>
- <firstname>Roy</firstname>
- <surname>Russo</surname>
- </author>
- </chapterinfo>-->
- <title>Customizing your Installation</title>
- <para>
- This chapter describes how to customize the default installation. This includes the JBoss EAP or JBoss AS listening port, email and proxy settings, and database dialect settings. For further configuration details, refer to <xref linkend="portaldescriptors"/> and <xref linkend="troubleshooting"/>.
- </para>
- <section>
- <title>Changing the Port</title>
- <para>
- It is common for web services to run on port 80. By default, JBoss EAP and JBoss AS use port 8080. If you can not use <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingPortForwardingWithJBoss">port forwarding</ulink>, it is recommended to change the port JBoss EAP or JBoss AS listens on. To change the default port, open the <filename>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml</filename> file, and edit the <computeroutput>Connector port</computeroutput> value for the <computeroutput>jboss.web</computeroutput> service; however, this configuration only applies to Apache Tomcat:
- </para>
-<programlisting role="XML">
-<Service name="jboss.web">
-<Connector port="8088" address="${jboss.bind.address}"
-</programlisting>
- <para>
- This example changes the default port to port 8088. The JBoss EAP or JBoss AS server must be restarted before the new port settings take affect.
- </para>
- <para>
- The default SSL port is 8843. To enable HTTPS support, refer to the <ulink url="http://docs.jboss.org/jbossas/jboss4guide/r4/html/ch9.chapt.html#d0e21962">JBoss AS Guide</ulink>. For further information, refer to the <ulink url="http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html">Apache Tomcat SSL configuration how-to</ulink>.
- </para>
- <para>
- Please refer to <xref linkend="wsrp-ports"/> to update the WSRP service after having changed the port.
- </para>
- <para>
- <warning>
- <title>Root User Privileges</title>
- <para>
- Linux operating systems require root user privileges to run a service on a port less than 1024. Starting JBoss EAP or JBoss AS on port 80 as a non-privileged user will not work. Running JBoss EAP or JBoss AS as the root user could lead to security breaches.
- </para>
- </warning>
- </para>
- </section>
- <section id="configuration-contextroot">
- <title>Changing the Context Path</title>
- <para>By default, the main JBoss Portal page is accessible by navigating to <emphasis>http://localhost:8080/portal/index.html</emphasis>. This
-can be changed to a different path, for example,
-<emphasis>http://localhost:8080/index.html</emphasis>. The context path can be changed when using the deployed <filename>jboss-portal.sar/</filename>, or before building from source. To change the context path when using the JBoss Portal binary package:
-</para>
-<para>
- <orderedlist>
- <listitem>
- <para>Open the <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/portal-server.war/WEB-INF/jboss-web.xml</emphasis> file. If this file does not exist, copy and save the following example:
- </para>
-<programlisting><![CDATA[
-<?xml version="1.0"?>
-<jboss-web>
- <security-domain>java:jaas/portal</security-domain>
- <context-root>/portal</context-root>
- <replication-config>
- <replication-trigger>SET</replication-trigger>
- </replication-config>
- <resource-ref>
- <res-ref-name>jdbc/PortalDS</res-ref-name>
- <jndi-name>java:PortalDS</jndi-name>
- </resource-ref>
-</jboss-web>]]></programlisting>
- </listitem>
- <listitem>
- <para>Edit the
- <computeroutput><context-root></computeroutput> element with the desired context path:
- </para>
-<programlisting>
-<![CDATA[<context-root>/testing</context-root>]]>
-</programlisting>
- <para>
- Using this example, the main JBoss Portal page would be reached by navigating to <emphasis>http://localhost:8080/testing</emphasis>.
- </para>
- </listitem>
- </orderedlist>
- </para>
- <para>
- To change the context path when building from source:
- </para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- Change into the directory where the <filename>JBoss Portal Source Code</filename> ZIP file was extracted to, or where the source from SVN was checked out to. Copy the <filename>build/etc/local.properties-example</filename> file and save it as <filename>build/local.properties</filename>.
- </para>
- </listitem>
- <listitem>
- <para>
- Open the <filename>build/local.properties</filename> file and edit the <computeroutput>portal.web.context-root</computeroutput> option with the desired context path:
- </para>
-<programlisting>
-# Context root for the portal main servlet
-portal.web.context-root=/testing
-</programlisting>
- <para>
- Using this example, the main JBoss Portal page would be reached by navigating to <emphasis>http://localhost:8080/testing</emphasis>.
- </para>
- </listitem>
- <listitem>
-
- <para>
- To clean the project, make sure you are connected to the Internet, and change into the <filename>build/</filename> directory. Run the <command>ant clean</command> command.
- </para>
- </listitem>
- <listitem>
- <para>
- Rebuild and redeploy JBoss Portal. Refer to <xref linkend="install_source"/> for build instructions.
- </para>
- </listitem>
- </orderedlist>
-</para>
-<section>
- <title>Changing the context-root</title>
- <para>
- By default, Apache Tomcat holds on to the root context, <emphasis>/</emphasis>. You may need to remove the <filename>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/ROOT.war/</filename> directory,
- or add a <filename>jboss-web.xml</filename> file, which declares another
- context-root other than <emphasis>/</emphasis>, under the <filename>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/ROOT.war/WEB-INF/</filename> directory, for the above changes to take affect. The following is an example <filename>jboss-web.xml</filename> file, which changes the Apache Tomcat context path to <computeroutput>/tomcat-root</computeroutput>:
- </para>
-<programlisting role="XML"><![CDATA[
-<?xml version="1.0"?>
-<jboss-web>
- <context-root>/tomcat-root</context-root>
-</jboss-web>]]></programlisting>
-</section>
- </section>
- <section id="configuration-hibdialect">
- <title>Forcing the Database Dialect</title>
- <para>
- This sections describes how to override the Database (DB) dialect settings. Under most circumstances, the auto-detect feature works. If the Hibernate dialect is not working correctly, override the default behavior by following the instructions in this section.
- </para>
- <section>
- <title>Database Dialect Settings for JBoss Portal</title>
- <para>
- All <filename>hibernate.cfg.xml</filename> files in all JBoss Portal modules you intend to use need to be modified. The <filename>hibernate.cfg.xml</filename> files are found in the <filename>jboss-portal.sar/<replaceable>module</replaceable>/conf/hibernate/<replaceable>directory</replaceable>/</filename> directory, where <replaceable>module</replaceable> is the module name, and <replaceable>directory</replaceable> is a directory that, depending on the module, may or may not exist.
- </para>
- <para>
- To modify these files to force the DB dialect, un-comment the following line from each <filename>hibernate.cfg.xml</filename> file in each JBoss Portal module you intend to use, so that it looks like the following:
- </para>
-<programlisting role="XML"><![CDATA[
-<!-- Force the dialect instead of using autodetection -->
-<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
-]]></programlisting>
- <para>
- Note: this example is for a PostgreSQL database. If you use another database, you need to modify <computeroutput>org.hibernate.dialect.PostgreSQLDialect</computeroutput> to reflect the correct database. For a list of supported dialects, refer to the <ulink url="http://www.hibernate.org/hib_docs/v3/reference/en/html/session-configurat...">dialects list on the Hibernate website</ulink>.
- </para>
- </section>
- <section>
- <title>DB Dialect Settings for the CMS Component</title>
- <para>
- To modify the DB dialect setting for the JBoss Portal CMS component:
- </para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- Open the <filename>jboss-portal.sar/portal-cms.sar/conf/hibernate/cms/hibernate.cfg.xml</filename> file.
- </para>
- </listitem>
- <listitem>
- <para>
- Un-comment the following line, so that it looks as follows:
-
-<programlisting><![CDATA[
-<!-- Force the dialect instead of using autodetection -->
-<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
-]]></programlisting>
-</para>
- </listitem>
- </orderedlist>
- </para>
- <para>
- Note: this example is for a PostgreSQL database. If you use another database, you need to modify <computeroutput>org.hibernate.dialect.PostgreSQLDialect</computeroutput> to reflect the correct database. For a list of supported dialects, refer to the <ulink url="http://www.hibernate.org/hib_docs/v3/reference/en/html/session-configurat...">dialects list on the Hibernate website</ulink>.
- </para>
- </section>
- </section>
- <section id="emailConfiguration">
- <title>Configuring the Email Service</title>
- <para>
- If you have a standard setup and a mail server installed, the email service should work without any extra configuration. Most Linux distributions have a mail server installed by default. The email service, for example, can be used to verify a user's email address when a user subscribes, or for CMS workflow notifications.
- </para>
- <para>
- The email service is configured using the <filename>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/META-INF/jboss-service.xml</filename> file. The following is an example of the section which is used to configure the email service:
- </para>
-<programlisting role="XML"><![CDATA[
-<mbean
-code="org.jboss.portal.core.impl.mail.MailModuleImpl"
-name="portal:service=Module,type=Mail"
-xmbean-dd=""
-xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
-<xmbean/>
-<depends>jboss:service=Mail</depends>
-<depends>portal:service=Module,type=IdentityServiceController</depends>
-<attribute name="QueueCapacity">-1</attribute>
-<attribute name="Gateway">localhost</attribute>
-<attribute name="SmtpUser"></attribute>
-<attribute name="SmtpPassword"></attribute>
-<attribute name="JavaMailDebugEnabled">false</attribute>
-<attribute name="SMTPConnectionTimeout">100000</attribute>
-<attribute name="SMTPTimeout">10000</attribute>
-<attribute name="JNDIName">java:portal/MailModule</attribute>
-</mbean>]]>
-</programlisting>
-
- <para>
- A different SMTP server (other than localhost) can be configured, along with a SMTP username and an SMTP password. The following is an example configuration that uses the Gmail SMTP server:
- </para>
-<programlisting role="XML"><![CDATA[
-<mbean
-code="org.jboss.portal.core.impl.mail.MailModuleImpl"
-name="portal:service=Module,type=Mail"
-xmbean-dd=""
-xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
-<xmbean/>
-<depends>jboss:service=Mail</depends>
-<depends>portal:service=Module,type=IdentityServiceController</depends>
-<attribute name="QueueCapacity">-1</attribute>
-<attribute name="Gateway">smtp.gmail.com</attribute>
-<attribute name="SmtpUser">username(a)gmail.com</attribute>
-<attribute name="SmtpPassword">myPassword</attribute>
-<attribute name="JavaMailDebugEnabled">false</attribute>
-<attribute name="SMTPConnectionTimeout">100000</attribute>
-<attribute name="SMTPTimeout">10000</attribute>
-<attribute name="JNDIName">java:portal/MailModule</attribute>
-</mbean>]]>
-</programlisting>
- <para>
- Using this example, replace <computeroutput>username(a)gmail.com</computeroutput> and <computeroutput>myPassword</computeroutput> with your correct Gmail username and password.
- </para>
-</section>
- <section>
- <title>Configuring proxy settings</title>
- <para>There are a couple of scenarios where you need your proxy to be correctly defined at the <trademark class="trade">JVM</trademark> level so that you can access documents from Internet. It could be to get the thirdparty libraries if you decided to build JBoss Portal from the sources, to access RSS feeds or weather information in the samples portlet we provide or for your own needs.</para>
- <para>To configure the proxy settings, you need to know the proxy host and the port to use. Then,
- add them when starting Java.</para>
- <para>Usually setting up JAVA_OPTS environment variable to <literal>-Dhttp.proxyHost=YOUR_PROXY_HOST -Dhttp.proxyPort=YOUR_PROXY_PORT</literal>
- is enough.</para>
- </section>
- <section>
- <title>Disabling Dynamic Proxy Un-wrapping</title>
- <para>JBoss Portal uses the JBoss Microkernel for the service infrastructure. The JBoss Microkernel provides injection of services into other services, otherwise known as wiring. Due to the Microkernel being <trademark class="trade">JMX</trademark> based, it is only possible to inject dynamic proxies that talk to the MBeanServer. The overhead at runtime is minimal since the Microkernel implementation is highly optimized; however, when it is used with Java 5, a noticeable bottleneck occurs due to the fact that the implementation of the JMX API classes, <emphasis>javax.management.*</emphasis>, provided by the Java Platform, perform synchronization. This does not occur under <trademark class="trade">JDK</trademark> 1.4, since those classes are implemented by JBoss MX.
- </para>
- <para>
- JBoss Portal services use a special kind of Model MBean called <emphasis>JBossServiceModelMBean</emphasis>, which allows the un-wrapping of injected dynamic proxies, and replaces them with Plain Old Java Object (POJO) services. This removes the bottleneck when using Java 5, and also provides a performance boost on JDK 1.4. By default this feature is enabled, but it is possible to disable. To do this on Linux operating systems, change into the <filename>$JBOSS_HOME/bin/</filename> directory and run the following command:
- </para>
- <para>
-<programlisting>
-sh run.sh -Dportal.kernel.no_proxies=false
-</programlisting>
-</para>
-<para>
- On Windows, run the following command:
-</para>
-<para>
-<programlisting>
-run.bat -Dportal.kernel.no_proxies=false
-</programlisting>
-</para>
- </section>
-</chapter>
- <chapter id="changelog">
- <!-- <chapterinfo>
- <author>
- <firstname>Thomas</firstname>
- <surname>Heute</surname>
- </author>
- </chapterinfo>-->
- <title>Upgrading JBoss Portal 2.6 to 2.7</title>
- <para>
- <warning>
- <para>
- Before performing any instructions or operations in this chapter, back up your database and the entire JBoss EAP or JBoss AS directory!
- </para>
- </warning>
- </para>
- <para>
- JBoss Portal 2.7 compatibility with JBoss Portal 2.6 is very high. The main differences are the use of JSR-286 features to replace
- JBoss Portal specific features. The database schema hasn't changed.
- </para>
-
- <section id="manual_migration">
- <title>Usage of JBossActionRequest</title>
- <para>Usage of JBossActionRequest is not available directly anymore. From now on it is only accessible if the
- <emphasis>org.jboss.portlet.filter.JBossPortletFilter</emphasis> is applied on the portlet.
- To do so, first you will need to change the <emphasis>portlet.xml</emphasis> descriptor in order to declare
- the new portlet as a JSR-286 portlet so that the filter can be applied. For a portlet named <emphasis>MyFooPortlet</emphasis>
- it would now look like this:
- </para>
-<programlisting role="XML"><![CDATA[
-<portlet-app
- xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
- version="2.0">
-
- <filter>
- <filter-name>JBoss Portlet Filter</filter-name>
- <filter-class>org.jboss.portlet.filter.JBossPortletFilter</filter-class>
- <lifecycle>ACTION_PHASE</lifecycle>
- <lifecycle>RENDER_PHASE</lifecycle>
- </filter>
-
- <filter-mapping>
- <filter-name>JBoss Portlet Filter</filter-name>
- <portlet-name>MyFooPortlet</portlet-name>
- </filter-mapping>
-
-
- <portlet>
- <description>My foo portlet</description>
- <portlet-name>MyFooPortlet</portlet-name>
- ...
- </portlet>
-</portlet-app>
-
-]]></programlisting>
- <para>By not adding this filter on a portlet using JBossActionRequest/JBossActionResponse, an error message such as:
- <emphasis>The request isn't a JBossRenderRequest, you probably need to activate the JBoss Portlet Filter: org.jboss.portlet.filter.JBossPortletFilter on MyFooPortlet</emphasis>
- </para>
- </section>
-
-</chapter>
- <chapter id="tutorials">
- <!-- <chapterinfo>
- <author>
- <firstname>Chris</firstname>
- <surname>Laprun</surname>
- </author>
- <author>
- <firstname>Thomas</firstname>
- <surname>Heute</surname>
- </author>
- </chapterinfo>-->
- <title>Portlet Primer</title>
- <section id="portlet_primer">
- <title>JSR-168 and JSR-286 overview</title>
- <para>
- The Portlet Specifications aims at defining portlets that can be used by any
- <ulink url="http://www.jcp.org/en/jsr/detail?id=168">
- JSR-168 (Portlet 1.0)
- </ulink>
- or
- <ulink url="http://www.jcp.org/en/jsr/detail?id=286">
- JSR-286 (Portlet 2.0)
- </ulink>
- portlet container. Most Java EE portals include one, it is obviously the case for
- JBoss Portal which includes the JBoss Portlet container supporting the two
- versions. This chapter gives a brief overview of the Portlet Specifications but
- portlet developers are strongly encouraged to read the
- <ulink url="http://www.jcp.org/en/jsr/detail?id=286">
- JSR-286 Portlet Specification
- </ulink>
- .
- </para>
- <para>
- JBoss Portal is fully JSR-286 compliant, which means any JSR-168 or JSR-286
- portlet behaves as it is mandated by the respective specifications inside the
- portal.
- </para>
- <section>
- <title>Portal Pages</title>
- <para>
- A portal can be seen as pages with different areas, and inside areas,
- different windows, and each window having one portlet:
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/tutorials/SpecPortalDef.png" format="PNG" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- </section>
- <section>
- <title>Rendering Modes</title>
- <para>
- A portlet can have different view modes. Three modes are defined by the
- JSR-286 specification:
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- <emphasis>view</emphasis>
- - generates markup reflecting the current state of the portlet.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>edit</emphasis>
- - allows a user to customize the behavior of the portlet.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>help</emphasis>
- - provides information to the user as to how to use the portlet.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>Window States</title>
- <para>
- Window states are an indicator of how much page real-estate a portlet consumes
- on any given page. The three states defined by the JSR-168 specification are:
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- <emphasis>normal</emphasis>
- - a portlet shares this page with other portlets.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>minimized</emphasis>
- -a portlet may show very little information, or none at all.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>maximized</emphasis>
- - a portlet may be the only portlet displayed on this page.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- </section>
- <section id="tutorials_tutorials">
- <title>Tutorials</title>
- <para>
- The tutorials contained in this chapter are targeted toward portlet developers.
- Although they are a good starting and reference point, it is highly recommend
- that portlet developers read and understand the
- <ulink url="http://www.jcp.org/en/jsr/detail?id=286">
- JSR-286 Portlet Specification
- </ulink>
- . Feel free to use the
- <ulink url="http://jboss.org/index.html?module=bb&op=viewforum&f=215">
- JBoss Portal User Forums
- </ulink>
- for user-to-user help.
- </para>
- <section>
- <title>Deploying your first Portlet</title>
- <section>
- <title>Introduction</title>
- <para>
- This section describes how to deploy a portlet in JBoss Portal. You will
- find the
- <emphasis>SimplestHelloWorld</emphasis>
- portlet in the
- <literal>examples</literal>
- directory at the root of your JBoss Portal binary package.
- </para>
- </section>
- <section>
- <title>Compiling</title>
- <para>
- This example is using Maven to compile and build the web archive. If you
- don't have Maven already installed, you will find a version for your
- operating system
- <ulink url="http://maven.apache.org/download.html">here</ulink>
- </para>
- <para>
- To compile and package the application, go to the SimplestHelloWorld
- directory and type
- <literal>mvn package</literal>
- .
- </para>
- <para>
- Once successfully packaged, the result should be available in:
- <literal>SimplestHelloWorld/target/SimplestHelloWorld-0.0.1.war</literal>
- . Simply copy that file into
- <literal>JBOSS_HOME/server/default/deploy</literal>
- , then start JBoss Application Server if it was not already started.
- </para>
- <para>
- You should now see a new page called
- <literal>SimplestHelloWorld</literal>
- , with a window inside containing the portlet instance we have created, as
- seen below.
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/tutorials/first_portlet/deployed.png"/>
- </imageobject>
- </mediaobject>
-
- SimplestHelloWorldPortlet deployed on a new page.
-
- </para>
- </section>
- <section>
- <title>Package Structure</title>
- <para>
- Now that we have seen how to deploy an existing web application, let's have
- a look inside.
- </para>
- <para>
- Like other Java Platform, Enterprise Edition (Java EE) applications,
- portlets are packaged in WAR files. A typical portlet WAR file can include
- servlets, resource bundles, images, HTML,
- <trademark class="trade">JavaServer</trademark>
- Pages (
- <trademark class="trade">JSP</trademark>
- ), and other static or dynamic files. The following is an example of the
- directory structure of the HelloWorldPortlet portlet:
- </para>
- <programlistingco>
- <areaspec>
- <area id="tutorials.simplest.javaclass" coords="9"/>
- <area id="tutorials.simplest.defaultobject" coords="10"/>
- <area id="tutorials.simplest.portletinstances" coords="11"/>
- <area id="tutorials.simplest.portlet" coords="12"/>
- <area id="tutorials.simplest.web" coords="13"/>
- </areaspec>
- <programlisting><![CDATA[|-- SimplestHelloWorld-0.0.1.war
-| `-- WEB-INF
-| |-- classes
-| | `-- org
-| | `-- jboss
-| | `-- portal
-| | `-- portlet
-| | `-- samples
-| | `-- SimplestHelloWorldPortlet.class
-| |-- default-object.xml
-| |-- portlet-instances.xml
-| |-- portlet.xml
-| `-- web.xml]]>
- </programlisting>
- <calloutlist>
- <callout arearefs="tutorials.simplest.javaclass">
- <para>
- The compiled Java class implementing
- <emphasis>javax.portlet.Portlet</emphasis>
- (through
- <emphasis>javax.portlet.GenericPortlet</emphasis>
- )
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.defaultobject">
- <para>
- <emphasis>default-object.xml</emphasis>
- is an optional file, it is used to define the layout of the
- portal. It can be used to define the different portals, pages and
- windows. The same result can be obtained through the
- administration portal. Note that the definition of the layout is
- stored in database, this file is then used to populate the
- database during deployment which can be very useful during
- development.
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.portletinstances">
- <para>
- <emphasis>portlet-instances.xml</emphasis>
- is also optional, it allows to create a portlet instance from the
- SimpleHelloWorld portlet definition. Creating instances can also
- be done through the administration portal. Note that the
- definition of instances is stored in database, this file is then
- used to populate the database during deployment which can be very
- useful during development. Having portlet-instances.xml and
- default-object.xml included in this package ensures that the
- portlet will appear directly on the portal by just deploying the
- web application.
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.portlet">
- <para>
- This is the mandatory descriptor files for portlets. It is used
- during deployment..
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.web">
- <para>This is the mandatory descriptor for web applications.</para>
- </callout>
- </calloutlist>
- </programlistingco>
- </section>
-
- <section>
- <title>Portlet Class</title>
- <para>Let us study the Java class in detail.</para>
- <para>
- The following file is the
- <filename>
- SimplestHelloWorldPortlet/src/main/java/org/jboss/portal/portlet/samples/SimplestHelloWorldPortlet.java
- </filename>
- Java source.
- </para>
- <programlistingco>
- <areaspec>
- <area id="tutorials.simplest.extends" coords="10"/>
- <area id="tutorials.simplest.doview" coords="13"/>
- <area id="tutorials.simplest.writer" coords="15"/>
- <area id="tutorials.simplest.write" coords="16"/>
- <area id="tutorials.simplest.close" coords="17"/>
- </areaspec>
- <programlisting role="JAVA"><![CDATA[package org.jboss.portal.portlet.samples;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-
-import javax.portlet.GenericPortlet;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-
-public class SimplestHelloWorldPortlet extends GenericPortlet
-{
- public void doView(RenderRequest request,
- RenderResponse response) throws IOException
- {
- PrintWriter writer = response.getWriter();
- writer.write("Hello World !");
- writer.close();
- }
-}]]>
- </programlisting>
- <calloutlist>
- <callout arearefs="tutorials.simplest.extends">
- <para>
- All portlets must implement the
- <literal>javax.portlet.Portlet</literal>
- interface. The portlet API provides a convenient implementation of
- this interface, in the form of the
- <literal>javax.portlet.GenericPortlet</literal>
- class, which among other things, implements the
- <literal>Portlet render</literal>
- method to dispatch to abstract mode-specific methods to make it
- easier to support the standard portlet modes. As well, it provides
- a default implementation for the
- <literal>processAction</literal>
- ,
- <literal>init</literal>
- and
- <literal>destroy</literal>
- methods. It is recommended to extend
- <literal>GenericPortlet</literal>
- for most cases.
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.doview">
- <para>
- As we extend from
- <literal>GenericPortlet</literal>
- , and are only interested in supporting the
- <literal>view</literal>
- mode, only the
- <literal>doView</literal>
- method needs to be implemented, and the
- <literal>GenericPortlet</literal>
- <literal>render</literal>
- implemention calls our implementation when the
- <literal>view</literal>
- mode is requested.
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.writer">
- <para>
- Use the
- <emphasis>RenderResponse</emphasis>
- to obtain a writer to be used to produce content.
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.write">
- <para>Write the markup to display.</para>
- </callout>
- <callout arearefs="tutorials.simplest.close">
- <para>Closing the writer.</para>
- </callout>
- </calloutlist>
- </programlistingco>
- <para>
- <note>
- <title>Markup Fragments</title>
- <para>
- Portlets are responsible for generating markup fragments, as they are
- included on a page and are surrounded by other portlets. In
- particular, this means that a portlet outputting HTML must not output
- any markup that cannot be found in a
- <literal><body></literal>
- element.
- </para>
- </note>
- </para>
- </section>
- <section id="first_portlet_descriptors">
- <title>Application Descriptors</title>
- <para>
- JBoss Portal requires certain descriptors to be included in a portlet WAR
- file. Some of these descriptors are defined by the Portlet Specification,
- and others are specific to JBoss Portal.
- </para>
- <para>
- The following is an example of the
- <filename>SimplestHelloWorldPortlet/WEB-INF/portlet.xml</filename>
- file. This file must adhere to its definition in the JSR-286 Portlet
- Specification. You may define more than one portlet application in this
- file:
- </para>
- <programlistingco>
- <areaspec>
- <area id="tutorials.simplest.portletname" coords="8"/>
- <area id="tutorials.simplest.portletclass" coords="9"/>
- <area id="tutorials.simplest.supports" coords="12"/>
- <area id="tutorials.simplest.portletinfo" coords="15"/>
- </areaspec>
- <programlisting><![CDATA[
-<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
- http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
- version="2.0">
- <portlet>
- <portlet-name>SimplestHelloWorldPortlet</portlet-name>
- <portlet-class>
- org.jboss.portal.portlet.samples.SimplestHelloWorldPortlet
- </portlet-class>
- <supports>
- <mime-type>text/html</mime-type>
- </supports>
- <portlet-info>
- <title>Simplest Hello World Portlet</title>
- </portlet-info>
- </portlet>
-</portlet-app>]]>
- </programlisting>
- <calloutlist>
- <callout arearefs="tutorials.simplest.portletname">
- <para>
- Define the portlet name. It does not have to be the class name.
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.portletclass">
- <para>
- The Fully Qualified Name (FQN) of your portlet class must be
- declared here.
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.supports">
- <para>
- The
- <computeroutput><supports></computeroutput>
- element declares all of the markup types that a portlet supports
- in the
- <literal>render</literal>
- method. This is accomplished via the
- <computeroutput><mime-type></computeroutput>
- element, which is required for every portlet. The declared MIME
- types must match the capability of the portlet. As well, it allows
- you to pair which modes and window states are supported for each
- markup type. All portlets must support the
- <computeroutput>view</computeroutput>
- portlet mode, so this does not have to be declared. Use the
- <computeroutput><mime-type></computeroutput>
- element to define which markup type your portlet supports, which
- in this example, is
- <computeroutput>text/html</computeroutput>
- . This section tells the portal that it only outputs HTML.
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.portletinfo">
- <para>
- When rendered, the portlet's title is displayed as the header in
- the portlet window, unless it is overridden programmatically. In
- this example, the title would be
- <computeroutput>Simplest Hello World Portlet</computeroutput>
- .
- </para>
- </callout>
- </calloutlist>
- </programlistingco>
- <para>
- The
- <filename>
- SimplestHelloWorldPortlet/WEB-INF/portlet-instances.xml
- </filename>
- file is a JBoss Portal specific descriptor, that allows you to create
- instances of portlets. The
- <computeroutput><portlet-ref></computeroutput>
- value must match the
- <computeroutput><portlet-name></computeroutput>
- value given in the
- <filename>SimplestHelloWorldPortlet/WEB-INF/portlet.xml</filename>
- file. The
- <computeroutput><instance-id></computeroutput>
- value can be named anything, but it must match the
- <computeroutput><instance-ref></computeroutput>
- value given in the
- <filename>*-object.xml</filename>
- file, which in this example, would be the
- <filename>SimplestHelloWorldPortlet/WEB-INF/default-object.xml</filename>
- file.
- </para>
- <para>
- The following is an example of the
- <filename>
- SimplestHelloWorldPortlet/WEB-INF/portlet-instances.xml
- </filename>
- file:
- </para>
- <programlisting role="XML"><![CDATA[<?xml version="1.0" standalone="yes"?>
-<!DOCTYPE deployments PUBLIC
- "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
- "http://www.jboss.org/portlet/dtd/portlet-instances_2_6.dtd">
-<deployments>
- <deployment>
- <instance>
- <instance-id>SimplestHelloWorldInstance</instance-id>
- <portlet-ref>SimplestHelloWorldPortlet</portlet-ref>
- </instance>
- </deployment>
-</deployments>]]>
- </programlisting>
- <para>
- The
- <filename>*-object.xml</filename>
- file is a JBoss Portal specific descriptor that allow users to define the
- structure of their portal instances, and create and configure their windows
- and pages. In the following example:
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>a portlet window is created.</para>
- </listitem>
- <listitem>
- <para>
- specifies that the window displays the markup generated by the
- <computeroutput>SimplestHelloWorldInstance</computeroutput>
- portlet instance.
- </para>
- </listitem>
- <listitem>
- <para>
- the window is assigned to the page that we are creating and called
- <computeroutput>SimplestHelloWorld</computeroutput>
- page.
- </para>
- </listitem>
- <listitem>
- <para>
- the
- <computeroutput><region></computeroutput>
- element specifies where the window appears on the page.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- The following is an example
- <filename>SimplestHelloWorldPortlet/WEB-INF/default-object.xml</filename>
- file:
- </para>
- <programlistingco>
- <areaspec>
- <area id="tutorials.simplest.parentref" coords="7"/>
- <area id="tutorials.simplest.ifexists" coords="8"/>
- <area id="tutorials.simplest.pagename" coords="12"/>
- <area id="tutorials.simplest.windowname" coords="12"/>
- <area id="tutorials.simplest.instanceref" coords="13"/>
- <area id="tutorials.simplest.region" coords="14"/>
- <area id="tutorials.simplest.height" coords="15"/>
- </areaspec>
- <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE deployments PUBLIC
- "-//JBoss Portal//DTD Portal Object 2.6//EN"
- "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
-<deployments>
- <deployment>
- <parent-ref>default</parent-ref>
- <if-exists>overwrite</if-exists>
- <page>
- <page-name>SimplestHelloWorld</page-name>
- <window>
- <window-name>SimplestHelloWorldWindow</window-name>
- <instance-ref>SimplestHelloWorldInstance</instance-ref>
- <region>center</region>
- <height>0</height>
- </window>
- </page>
- </deployment>
-</deployments>]]>
- </programlisting>
- <calloutlist>
- <callout arearefs="tutorials.simplest.parentref">
- <para>
- Tells the portal where this portlet appears. In this case,
- <computeroutput>default.default</computeroutput>
- specifies that the portlet appears in the portal instance named
- <computeroutput>default</computeroutput>
- , and on the page named
- <computeroutput>default</computeroutput>
- .
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.ifexists">
- <para>
- Instructs the portal to overwrite or keep this object if it
- already exists. Accepted values are
- <computeroutput>overwrite</computeroutput>
- and
- <computeroutput>keep</computeroutput>
- . The
- <computeroutput>overwrite</computeroutput>
- option destroys the existing object, and creates a new one based
- on the content of the deployment. The
- <computeroutput>keep</computeroutput>
- option maintains the existing object deployment, or creates a new
- one if it does not exist.
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.pagename">
- <para>
- Here we are creating a new page to put the new window on. We give
- that new page a name that will be by default used on the tab of
- the default theme.
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.windowname">
- <para>
- A
- <emphasis role="bold">unique name</emphasis>
- given to the portlet window. This can be named anything.
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.instanceref">
- <para>
- The value of
- <computeroutput><instance-ref></computeroutput>
- must match the value of one of the
- <computeroutput><instance-id></computeroutput>
- elements found in the
- <filename>
- HelloWorldPortlet/WEB-INF/portlet-instances.xml
- </filename>
- file.
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.region">
- <para>
- Specifies where the window appears within the page layout.
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.height">
- <para>
- Specifies where the window appears within the page layout.
- </para>
- </callout>
- </calloutlist>
- </programlistingco>
- <para>
- The following diagram illustrates the relationship between the
- <filename>portlet.xml</filename>
- ,
- <filename>portlet-instances.xml</filename>
- , and
- <filename>default-object.xml</filename>
- descriptors:
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/tutorials/first_portlet/desc_relationship.png" align="center" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
-
- <para>
- JBoss Portal 2.6 introduced the notion of
- <emphasis>content-type</emphasis>
- , which is a generic mechanism to specify what content displayed by a given
- portlet window. The
- <computeroutput>window</computeroutput>
- section of the previous example,
- <filename>SimplestHelloWorldPortlet/WEB-INF/default-object.xml</filename>
- , can be re-written to take advantage of the new content framework. The
- following is an example deployment descriptor that uses the new content
- framework:
- </para>
- <programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE deployments PUBLIC
- "-//JBoss Portal//DTD Portal Object 2.6//EN"
- "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
-<deployments>
- <deployment>
- <parent-ref>default.default</parent-ref>
- <if-exists>overwrite</if-exists>
- <window>
- <window-name>SimplestHelloWorldWindow</window-name>
- <content>
- <content-type>portlet</content-type>
- <content-uri>SimplestHelloWorldInstance</content-uri>
- </content>
- <region>center</region>
- <height>1</height>
- </window>
- </deployment>
-</deployments>]]>
- </programlisting>
- <para>
-
- This declaration is equivalent to the previous
- <filename>SimplestHelloWorldPortlet/WEB-INF/default-object.xml</filename>
- example. Use
- <computeroutput><content-type></computeroutput>
- to specify the content to display. In this example, the content being
- displayed by the
- <computeroutput>SimplestHelloWorldWindow</computeroutput>
- is a
- <computeroutput>portlet</computeroutput>
- . The
- <computeroutput><content-uri></computeroutput>
- element specifies which content to display, which in this example, is the
- <computeroutput>SimplestHelloWorldInstance</computeroutput>
- :
- </para>
- <programlisting role="XML"><![CDATA[<content>
- <content-type>portlet</content-type>
- <content-uri>SimplestHelloWorldInstance</content-uri>
-</content>]]>
- </programlisting>
- <para>
- To display certain content or a file, use the
- <computeroutput>cms</computeroutput>
- content-type, with the
- <computeroutput><content-uri></computeroutput>
- element being the path to the file in the CMS. This behavior is pluggable:
- you can plug in almost any type of content.
- </para>
- <formalpara>
- <title>Beware of context-path change</title>
- <para>
- If the context-path change the portal may not be able to find a
- reference on your portlets anymore. For that reason it's recommended to
- add the following descriptor
- <filename>WEB-INF/jboss-portlet.xml</filename>
- which is not mandatory:
- </para>
- </formalpara>
-<programlisting role="XML"><![CDATA[
-<!DOCTYPE portlet-app PUBLIC
- "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
-
-<portlet-app>
- <app-id>SimplestHelloWorld</app-id>
-</portlet-app>]]></programlisting>
- </section>
- </section>
- <section>
- <title>
- <trademark class="trade">JavaServer</trademark>
- Pages Portlet Example
- </title>
- <section>
- <title>Introduction</title>
- <para>
- Now we will add more features to the previous example and also use a JSP
- page to render the markup. We will use the portlet tag library to generate
- links to our portlet in different ways and use the other standard portlet
- modes. This example can be found in the directory
- <literal>JSPHelloUser</literal>.
- Use <literal>mvn package</literal> then copy <filename>JSPHelloUser/target/JSPHelloUser-0.0.1.war</filename>
- in the <literal>deploy</literal> directory of JBoss Application Server.
- Point your brwoser to <literal/>, you should see the following:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/tutorials/jsp_portlet/output.png" align="center" scalefit="1"/>
- </imageobject>
- </mediaobject>
- <note>
- <para>The <literal>EDIT</literal> button only appears with logged-in users, which is not the case
- on the screenshot</para>
- </note>
- </para>
- </section>
- <section>
- <title>Package Structure</title>
- <para>
- The structure doesn't change much at the exception of adding some JSP files
- detailed later.
- </para>
- <para>
- The JSPHelloUser portlet contains the traditional portlet and JBoss Portal
- specific application descriptors. The following is an example of the
- directory structure of the JSPHelloUser portlet:
- </para>
- <programlisting><![CDATA[JSPHelloUser-0.0.1.war
- |-- META-INF
- | |-- MANIFEST.MF
- | `-- maven
- | `-- org.jboss.portal.example
- | `-- JSPHelloUser
- | |-- pom.properties
- | `-- pom.xml
- |-- WEB-INF
- | |-- classes
- | | `-- org
- | | `-- jboss
- | | `-- portal
- | | `-- portlet
- | | `-- samples
- | | `-- JSPHelloUserPortlet.class
- | |-- default-object.xml
- | |-- jboss-portlet.xml
- | |-- portlet-instances.xml
- | |-- portlet.xml
- | `-- web.xml
- `-- jsp
- |-- edit.jsp
- |-- hello.jsp
- |-- help.jsp
- `-- welcome.jsp]]>
- </programlisting>
- </section>
- <section>
- <title>Portlet Class</title>
- <para>Let's study the Java class in detail.</para>
- <para>
- The following file is the
- <filename>
- JSPHelloUser/src/main/java/org/jboss/portal/portlet/samples/JSPHelloUserPortlet.java
- </filename>
- Java source. It is split in different pieces.
- </para>
- <programlistingco>
- <areaspec>
- <area id="tutorials.jsphello.doView" coords="18"/>
- <area id="tutorials.jsphello.renderParameter" coords="21"/>
- <area id="tutorials.jsphello.requestDispatcher" coords="25"/>
- <area id="tutorials.jsphello.include" coords="26"/>
- </areaspec>
- <programlisting role="JAVA"><![CDATA[package org.jboss.portal.portlet.samples;
-package org.jboss.portal.portlet.samples;
-
-import java.io.IOException;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.GenericPortlet;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.UnavailableException;
-
-public class JSPHelloUserPortlet extends GenericPortlet
-{
-
- public void doView(RenderRequest request, RenderResponse response)
- throws PortletException, IOException
- {
- String sYourName = (String) request.getParameter("yourname");
- if (sYourName != null)
- {
- request.setAttribute("yourname", sYourName);
- PortletRequestDispatcher prd =
- getPortletContext().getRequestDispatcher("/jsp/hello.jsp");
- prd.include(request, response);
- }
- else
- {
- PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/welcome.jsp");
- prd.include(request, response);
- }
- }
-...]]></programlisting>
- <calloutlist>
- <callout arearefs="tutorials.jsphello.doView">
- <para>
- As in the first portlet, we override the
- <emphasis>doView</emphasis>
- method.
- </para>
- </callout>
- <callout arearefs="tutorials.jsphello.renderParameter">
- <para>
- Here we try to obtain the value of the render parameter names
- <literal>yourname</literal>
- . If defined we want to redirect to the
- <filename>hello.jsp</filename>
- JSP page, otherwise to the
- <filename>welcome.jsp</filename>
- JSP page.
- </para>
- </callout>
- <callout arearefs="tutorials.jsphello.requestDispatcher">
- <para>
- Very similar to the Servlet way, we get a request dispatcher on a
- file located within the web archive.
- </para>
- </callout>
- <callout arearefs="tutorials.jsphello.include">
- <para>
- The last step is to perform the inclusion of the markup obtained
- from the JSP.
- </para>
- </callout>
- </calloutlist>
- </programlistingco>
- <para>
- We have seen the
- <literal>VIEW</literal>
- portlet mode, the spec defines two other modes that can be used called
- <literal>EDIT</literal>
- and
- <literal>HELP</literal>
- . In order to enable those modes, they will need to be defined in the
- <filename>portlet.xml</filename>
- descriptor as we will see later. Having those modes defined will enable the
- corresponding buttons on the portlet's window.
- </para>
- <para>
- The generic portlet that is inherited dispatches the different views to
- methods named:
- <literal>doView</literal>
- ,
- <literal>doHelp</literal>
- and
- <literal>doEdit</literal>
- . Let's watch the code for those two last portlet modes.
- </para>
- <programlisting role="JAVA"><![CDATA[...
- protected void doHelp(RenderRequest rRequest, RenderResponse rResponse) throws PortletException, IOException,
- UnavailableException
- {
- rResponse.setContentType("text/html");
- PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/help.jsp");
- prd.include(rRequest, rResponse);
- }
-
- protected void doEdit(RenderRequest rRequest, RenderResponse rResponse) throws PortletException, IOException,
- UnavailableException
- {
- rResponse.setContentType("text/html");
- PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/edit.jsp");
- prd.include(rRequest, rResponse);
- }
-...]]></programlisting>
-
- <para>
- If you have read the portlet specification carefully you should have notice
- that portlet calls happen in one or two phases. One when the portlet is
- just rendered, two when the portlet is actionned then rendered. An action
- phase is a phase where some state change. The render phase will have access
- to render parameters that will be passed each time the portlet is refreshed
- (with the exception of caching capabilities).
- </para>
- <para>
- The code to be executed during an action has to be implemented in the
- <emphasis>processAction</emphasis>
- method of the portlet.
- </para>
- <programlistingco>
- <areaspec>
- <area id="tutorials.jsphello.processAction" coords="2"/>
- <area id="tutorials.jsphello.getActionParameter" coords="5"/>
- <area id="tutorials.jsphello.setRenderParameter" coords="6"/>
- </areaspec>
- <programlisting role="JAVA"><![CDATA[...
- public void processAction(ActionRequest aRequest, ActionResponse aResponse) throws PortletException, IOException,
- UnavailableException
- {
- String sYourname = (String) aRequest.getParameter("yourname");
- aResponse.setRenderParameter("yourname", sYourname);
- }
-...]]></programlisting>
- <calloutlist>
- <callout arearefs="tutorials.jsphello.processAction">
- <para>
- <literal>processAction</literal>
- is the method from GernericPorlet to override for the
- <emphasis>action</emphasis>
- phase.
- </para>
- </callout>
- <callout arearefs="tutorials.jsphello.getActionParameter">
- <para>
- Here we retrieve the parameter obtained through an
- <emphasis>action URL</emphasis>
- .
- </para>
- </callout>
- <callout arearefs="tutorials.jsphello.setRenderParameter">
- <para>
- Here we need to keep the value of
- <literal>yourname</literal>
- to make it available in the rendering phase. With the previous
- line, we are simply copying an action parameter to a render
- parameter for the sake of this example.
- </para>
- </callout>
- </calloutlist>
- </programlistingco>
- </section>
- <section>
- <title>
- <trademark class="trade">JSP</trademark>
- files and the Portlet Tag Library
- </title>
- <para>Let's have a look inside the JSP pages.</para>
- <para>
- The
- <filename>help.jsp</filename>
- and
- <filename>edit.jsp</filename>
- files are very simple, they simply display some text. Note that we used CSS
- styles as defined in the portlet specification. It ensures that the portlet
- will look "good" within the theme and accross portal vendors.
- </para>
- <programlisting role="XHTML"><![CDATA[<div class="portlet-section-header">Help mode</div>
-<div class="portlet-section-body">This is the help mode, a convenient place to give the user some help information.</div>]]></programlisting>
- <programlisting role="XHTML"><![CDATA[<div class="portlet-section-header">Edit mode</div>
-<div class="portlet-section-body">This is the edit mode, a convenient place to let the user change his portlet preferences.</div>]]></programlisting>
- <para>
- Now let's have a look at the landing page, it contains the links and form
- to call our portlet:
- </para>
- <programlistingco>
- <areaspec>
- <area id="tutorials.jsphello.taglib" coords="1"/>
- <area id="tutorials.jsphello.method1" coords="13"/>
- <area id="tutorials.jsphello.method2.1" coords="20"/>
- <area id="tutorials.jsphello.method2.2" coords="24"/>
- <area id="tutorials.jsphello.method3.1" coords="30"/>
- <area id="tutorials.jsphello.method3.2" coords="31"/>
- </areaspec>
-
- <programlisting><![CDATA[<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
-
-<div class="portlet-section-header">Welcome !</div>
-
-<br/>
-
-<div class="portlet-font">Welcome on the JSP Hello User portlet,
-my name is JBoss Portal. What's yours ?</div>
-
-<br/>
-
-<div class="portlet-font">Method 1: We simply pass the parameter to the render phase:<br/>
-<a href="<portlet:renderURL><portlet:param name="yourname" value="John Doe"/>
- </portlet:renderURL>">John Doe</a></div>
-
-<br/>
-
-<div class="portlet-font">Method 2: We pass the parameter to the render phase, using valid XML:
-Please check the source code to see the difference with Method 1.
-<portlet:renderURL var="myRenderURL">
- <portlet:param name="yourname" value='John Doe'/>
-</portlet:renderURL>
-<br/>
-<a href="<%= myRenderURL %>">John Doe</a></div>
-
-<br/>
-
-<div class="portlet-font">Method 3: We use a form:<br/>
-
-<portlet:actionURL var="myActionURL"/>
-<form action="<%= myActionURL %>" method="POST">
- <span class="portlet-form-field-label">Name:</span>
- <input class="portlet-form-input-field" type="text" name="yourname"/>
- <input class="portlet-form-button" type="Submit"/>
-</form>
-</div>]]></programlisting>
- <calloutlist>
- <callout arearefs="tutorials.jsphello.taglib">
- <para>
- Since we will use the portlet taglib, we first need to declare it.
- </para>
- </callout>
- <callout arearefs="tutorials.jsphello.method1">
- <para>
- The first method showed here is the simplest one,
- <literal>portlet:renderURL</literal>
- will create a URL that will call the render phase of the current
- portlet and append the result at the place of the markup (Here
- within a tag...). We also added a parameter directly on the URL.
- </para>
- </callout>
- <callout arearefs="tutorials.jsphello.method2.1">
- <para>
- In this method instead of having a tag within another tag, which
- is not XML valid, we use the
- <literal>var</literal>
- attribute. Instead of printing the url the
- <literal>portlet:renderURL</literal>
- tag will store the result in the referenced variable (
- <literal>myRenderURL</literal>
- in our case).
- </para>
- </callout>
- <callout arearefs="tutorials.jsphello.method2.2">
- <para>
- The variable
- <literal>myRenderURL</literal>
- is used like any other JSP variable.
- </para>
- </callout>
- <callout arearefs="tutorials.jsphello.method3.1">
- <para>
- The third method mixes form submission and action request. Like in
- the second method, we used a temporary variable to put the created
- URL into.
- </para>
- </callout>
- <callout arearefs="tutorials.jsphello.method3.2">
- <para>The action URL is used in the HTML form.</para>
- </callout>
- </calloutlist>
- </programlistingco>
-
- <para>
- On the third method, first the action phase is triggered then later in the request, the render
- phase is triggered, which output some content back to the web browser based on the
- available render parameters.
- <mediaobject>
- <imageobject>
- <imagedata format="PNG" fileref="images/tutorials/jsp_portlet/process.png" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- </section>
- <section>
- <title>
- <trademark class="trade">JSF</trademark>
- example using the JBoss Portlet Bridge
- </title>
- <para>In order to write a portlet using JSF we need a piece of software called 'bridge' that
- lets us write a portlet application as if it was a JSF application, the bridge takes care of the
- interactions between the two layers.</para>
- <para>Such an example is available in examples/JSFHelloUser, it uses the JBoss Portlet Bridge.
- The configuration is slightly different from a JSP application, since it is a bit tricky it is usally a good
- idea to copy an existing application that starting from scratch.</para>
- <para>First, as any JSF application, the file <literal>faces-config.xml</literal> is required. It includes
- the following required information in it:
- <programlisting role="XML"><![CDATA[<faces-config>
-...
- <application>
- <view-handler>org.jboss.portletbridge.application.PortletViewHandler</view-handler>
- <state-manager>org.jboss.portletbridge.application.PortletStateManager</state-manager>
- </application>
-...
-</faces-config> ]]></programlisting>
- The portlet bridge libraries must be available and are usually bundled with the <literal>WEB-INF/lib</literal>
- directory of the web archive.</para>
- <para>The other difference compare to a regular portlet application, can be found in the portlet
- descriptor. All details about it can be found in the JSR-301 specification that the JBoss Portlet Bridge
- implements.
- <programlistingco>
- <areaspec>
- <area id="tutorials.jsf.portlet" coords="9"/>
- <area id="tutorials.jsf.view" coords="21"/>
- <area id="tutorials.jsf.edit" coords="26"/>
- <area id="tutorials.jsf.help" coords="31"/>
- </areaspec>
- <programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
- http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
- version="2.0">
- <portlet>
- <portlet-name>JSFHelloUserPortlet</portlet-name>
- <portlet-class>javax.portlet.faces.GenericFacesPortlet</portlet-class>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>view</portlet-mode>
- <portlet-mode>edit</portlet-mode>
- <portlet-mode>help</portlet-mode>
- </supports>
- <portlet-info>
- <title>JSF Hello User Portlet</title>
- </portlet-info>
-
- <init-param>
- <name>javax.portlet.faces.defaultViewId.view</name>
- <value>/jsf/welcome.jsp</value>
- </init-param>
-
- <init-param>
- <name>javax.portlet.faces.defaultViewId.edit</name>
- <value>/jsf/edit.jsp</value>
- </init-param>
-
- <init-param>
- <name>javax.portlet.faces.defaultViewId.help</name>
- <value>/jsf/help.jsp</value>
- </init-param>
-
- </portlet>
-</portlet-app>]]></programlisting>
- <calloutlist>
- <callout arearefs="tutorials.jsf.portlet"><para>All JSF portlets define <literal>javax.portlet.faces.GenericFacesPortlet</literal>
- as portlet class. This class is part of the JBoss Portlet Bridge</para></callout>
- <callout arearefs="tutorials.jsf.view"><para>This is a mandatory parameter to define what's the default page to display.</para></callout>
- <callout arearefs="tutorials.jsf.edit"><para>This parameter defines which page to display on the 'edit' mode.</para></callout>
- <callout arearefs="tutorials.jsf.help"><para>This parameter defines which page to display on the 'help' mode.</para></callout>
- </calloutlist>
- </programlistingco>
- </para>
- </section>
- </section>
- </section>
-</chapter>
- <chapter id="xmldescriptors">
- <!-- <chapterinfo>
- <author>
- <firstname>Thomas</firstname>
- <surname>Heute</surname>
- </author>
- <author>
- <firstname>Roy</firstname>
- <surname>Russo</surname>
- </author>
- </chapterinfo>-->
- <title>XML Descriptors</title>
- <section>
- <title>DTDs</title>
- <para>
- To use a DTD, add the following declaration to the start of the desired descriptors:
- </para>
-<programlisting role="XML"><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE deployments PUBLIC
-"-//JBoss Portal//DTD Portal Object 2.6//EN"
-"http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">]]>
-</programlisting>
- <para>
- If you do not use the DTD declaration, the previous mechanism for XML validation is used. The DTD is more strict, specifically with the order of XML elements. The following is an example from a <filename>*-object.xml</filename> descriptor, which is valid if you are not using the DTD, but is rejected if you are:
- </para>
- <programlisting role="XML"><![CDATA[
-<if-exists>overwrite</if-exists>
-<parent-ref>default.default</parent-ref>]]>
-</programlisting>
- <para>
- The correct element order, and one which is valid against the DTD, is as follows:
- </para>
-<programlisting role="XML"><![CDATA[
-<parent-ref>default.default</parent-ref>
-<if-exists>overwrite</if-exists>]]>
-</programlisting>
- <para>
- The following DTDs are available:
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- for <filename>-object.xml</filename> descriptors: <userinput>"-//JBoss Portal//DTD Portal Object 2.6//EN"</userinput>
- </para>
- </listitem>
- <listitem>
- <para>
- for <filename>jboss-app.xml</filename> descriptors: <userinput>"-//JBoss Portal//DTD JBoss Web Application 2.6//EN"</userinput>
- </para>
- </listitem>
- <listitem>
- <para>
- for <filename>jboss-portlet.xml</filename> descriptors: <userinput>"-//JBoss Portal//DTD JBoss Portlet 2.6//EN"</userinput>
- </para>
- </listitem>
- <listitem>
- <para>
- for <filename>portlet-instances.xml</filename> descriptors: <userinput>"-//JBoss Portal//DTD Portlet Instances 2.6//EN"</userinput>
- </para>
- </listitem>
- </itemizedlist>
-</para>
-<para>
- The DTDs are located in the <filename>$JBOSS_HOME/server/<replaceable>configuration</replaceable>/deploy/jboss-portal.sar/dtd/</filename> directory.
-</para>
- <section>
- <title>The JBoss Portlet DTD</title>
- <para>
- The following items refer to elements found in the JBoss Portlet DTD, <filename>$JBOSS_HOME/server/<replaceable>configuration</replaceable>/deploy/jboss-portal.sar/dtd/jboss-portlet_<replaceable>version_number</replaceable>.dtd</filename>:
- </para>
-<programlisting><![CDATA[
-<!ELEMENT portlet-app (remotable?,portlet*,service*)>]]>
-</programlisting>
- <para>
- Use the <computeroutput><remotable></computeroutput> element to configure the default behavior of portlets with respect to WSRP exposure: if no value is given, the value is either the value globally defined at the portlet application level, or <computeroutput>false</computeroutput>. Accepted values are <computeroutput>true</computeroutput> and <computeroutput>false</computeroutput>.
- </para>
- <para>
- You can configure specific settings of the portlet container for each portlet defined in the <filename>WEB-INF/portlet.xml</filename> file. Use the <computeroutput><service></computeroutput> element to inject services into the portlet context of applications.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT portlet (portlet-name,remotable?,ajax?,session-config?,transaction?,
-header-content?,portlet-info?)>]]>
-</programlisting>
- <para>
- Additional configuration of the portlet. The <computeroutput><portlet-name></computeroutput> element defines the portlet name. It must match a portlet defined in the <filename>WEB-INF/portlet.xml</filename> file for that application.
- </para>
- <para>
- Use the <computeroutput><remotable></computeroutput> element to configure the default behavior of portlets with respect to WSRP exposure: if no value is given, the value is either the value globally defined at the portlet application level, or <computeroutput>false</computeroutput>.
- </para>
- <para>
- The <computeroutput><trans-attribute></computeroutput> element specifies the behavior of the portlet when it is invoked at runtime with respect to the transactional context. Depending on how the portlet is
- invoked, a transaction may or may not exist before the portlet is invoked. The portal transaction is usually present in the local context. The default value is <computeroutput>NotSupported</computeroutput>, which means that the portal transaction is suspended for the duration of the portlet's invocation. Accepted values are <computeroutput>Required</computeroutput>, <computeroutput>Mandatory</computeroutput>, <computeroutput>Never</computeroutput>, <computeroutput>Supports</computeroutput>, <computeroutput>NotSupported</computeroutput>, and <computeroutput>RequiresNew</computeroutput>.
- </para>
- <para>
- The following is an example section from a <filename>WEB-INF/portlet.xml</filename> file, which uses the <computeroutput><portlet-name></computeroutput>, <computeroutput><remotable></computeroutput>, and <computeroutput><trans-attribute></computeroutput> elements:
- </para>
-<programlisting role="XML"><![CDATA[
-<portlet>
- <portlet-name>MyPortlet</portlet-name>
- <remotable>true</remotable>
- <trans-attribute>Required</trans-attribute>
-</portlet>]]>
-</programlisting>
-<programlisting><![CDATA[
-<!ELEMENT portlet-name (#PCDATA)>]]>
-</programlisting><para>
- The portlet name.
- </para>
- <programlisting><![CDATA[
-<!ELEMENT remotable (#PCDATA)>]]>
-</programlisting>
- <para>
- Accepted values are <computeroutput>true</computeroutput> and <computeroutput>false</computeroutput>.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT ajax (partial-refresh)>]]>
-</programlisting>
- <para>
- Use the <computeroutput>ajax</computeroutput> element to configure the Asynchronous JavaScript and XML (AJAX) capabilities of the portlet.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT partial-refresh (#PCDATA)>]]>
-</programlisting>
- <para>
- If a portlet uses the <computeroutput>true</computeroutput> value for the <computeroutput><partial-refresh></computeroutput> element, the portal uses partial-page refreshing and only renders that portlet. If the <computeroutput><partial-refresh></computeroutput> element uses a <computeroutput>false</computeroutput> value, the portal uses a full-page refresh when the portlet is refreshed.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT session-config (distributed)>]]>
-</programlisting>
- <para>
- The <computeroutput><session-config></computeroutput> element configures the portlet session for the portlet. The <computeroutput><distributed></computeroutput> element instructs the container to distribute the session attributes using portal session replication. This only applies to local portlets, not remote portlets.
- </para>
- <para>
- The following is an example of the <computeroutput><session-config></computeroutput> and <computeroutput><distributed></computeroutput> elements:
- </para>
-<programlisting role="XML"><![CDATA[
-<session-config>
- <distributed>true</distributed>
-</session-config>]]>
-</programlisting>
-<programlisting><![CDATA[
-<!ELEMENT distributed (#PCDATA)>]]>
-</programlisting>
- <para>
- Accepted values are <computeroutput>true</computeroutput> and <computeroutput>false</computeroutput>. The default value is <computeroutput>false</computeroutput>.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT transaction (trans-attribute)>]]>
-</programlisting>
- <para>
- The <computeroutput><transaction></computeroutput> element defines how the portlet behaves with regards to the transactional context. The <computeroutput><trans-attribute></computeroutput> element specifies the behavior of the portlet when it is invoked at runtime, with respect to the transactional context. Depending on how the portlet is invoked, a transaction may or may not exist before the portlet is invoked. The portal transaction is usually present in the local context.
- </para>
- <para>
- The following is an example of the <computeroutput><transaction></computeroutput> and <computeroutput><trans-attribute></computeroutput> elements:
- </para>
-<programlisting role="XML"><![CDATA[
-<transaction>
- <trans-attribute>Required</transaction>
-<transaction>]]>
-</programlisting>
-<programlisting><![CDATA[
-<!ELEMENT trans-attribute (#PCDATA)>]]>
-</programlisting>
- <para>
- The default value is <computeroutput>NotSupported</computeroutput>, which means that the portal transaction is suspended for the duration of the portlet's invocation. Accepted values are <computeroutput>Required</computeroutput>, <computeroutput>Mandatory</computeroutput>, <computeroutput>Never</computeroutput>, <computeroutput>Supports</computeroutput>, <computeroutput>NotSupported</computeroutput>, and <computeroutput>RequiresNew</computeroutput>.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT header-content (link|script|meta)*>]]>
-</programlisting>
- <para>
- Specify the content to be included in the portal aggregated page when the portlet is present on that page. This setting only applies when the portlet is used in the local mode.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT link EMPTY>]]>
-</programlisting>
- <para>
- No content is allowed inside a link element.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT script (#PCDATA)>]]>
-</programlisting>
- <para>
- Use the <computeroutput><script></computeroutput> element for inline script definitions.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT meta EMPTY>]]>
-</programlisting>
- <para>
- No content is allowed for the <computeroutput><meta></computeroutput> element.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT service (service-name,service-class,service-ref)>]]>
-</programlisting>
- <para>
- Declare a service that will be injected by the portlet container as an attribute of the portlet context.
- </para>
- <para>
- The following is an example of the <computeroutput><service></computeroutput> element:
- </para>
-<programlisting role="XML"><![CDATA[
-<service>
- <service-name>UserModule</service-name>
- <service-class>org.jboss.portal.identity.UserModule</service-class>
- <service-ref>:service=Module,type=User</service-ref>
-</service>]]>
-</programlisting>
- <para>
- To use an injected service in a portlet, perform a lookup of the <computeroutput><service-name></computeroutput>, for example, using the <computeroutput>init()</computeroutput> lifecycle method:
- </para>
-<programlisting role="JAVA"><![CDATA[
-public void init()
-{
- UserModule userModule = (UserModule)getPortletContext().getAttribute("UserModule");
-}]]>
-</programlisting>
-<programlisting><![CDATA[
-<!ELEMENT service-name (#PCDATA)>]]>
-</programlisting>
- <para>
- The <computeroutput><service-name></computeroutput> element defines the name that binds the service as a portlet context attribute.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT service-class (#PCDATA)>]]>
-</programlisting>
- <para>
- The <computeroutput><service-class></computeroutput> element defines the fully qualified name of the interface that the service implements.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT service-ref (#PCDATA)>]]>
-</programlisting>
- <para>
- The <computeroutput><service-ref></computeroutput> element defines the reference to the service. In the JMX Microkernel environment, this consist of the JMX name of the service MBean. For an MBean reference, if the domain is left out, the current domain of the portal is used.
- </para>
- </section>
- <section>
- <title>The JBoss Portlet Instance DTD</title>
- <para>
- The following items refer to elements found in the JBoss Portlet Instance DTD, <filename>$JBOSS_HOME/server/<replaceable>configuration</replaceable>/deploy/jboss-portal.sar/dtd/portlet-instances_<replaceable>version_number</replaceable>.dtd</filename>:
- </para>
-<programlisting><![CDATA[
-<!ELEMENT deployments (deployment*)>]]>
-</programlisting>
- <para>
- The <computeroutput><deployments></computeroutput> element is a container for <computeroutput><deployment></computeroutput> elements.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT deployment (if-exists?,instance)>]]>
-</programlisting>
- <para>
- The <computeroutput><deployment></computeroutput> element is a container for the <computeroutput><instance></computeroutput> element.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT if-exists (#PCDATA)>]]>
-</programlisting>
- <para>
- The <computeroutput><if-exists></computeroutput> element defines the action to take if an instance with the same name already exists. Accepted values are <computeroutput>overwrite</computeroutput> and <computeroutput>keep</computeroutput>. The <computeroutput>overwrite</computeroutput> option destroys the existing object, and creates a new one based on the content of the deployment. The <computeroutput>keep</computeroutput> option maintains the existing object deployment, or creates a new one if it does not exist.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT instance (instance-id,portlet-ref,display-name*,preferences?,
-security-constraint?, (display-name* | (resource-bundle, supported-locale+)))>]]>
-</programlisting>
- <para>
- The <computeroutput><instance></computeroutput> element is used in the <filename>WEB-INF/portlet-instances.xml</filename> file, which creates instances of portlets. The portlet will only be created and configured if the portlet is present, and if an instance with the same name does not already exist.
- </para>
- <para>
- The following is an example of the <computeroutput><instance></computeroutput> element, which also contains the <computeroutput><security-constraint></computeroutput> element. Descriptions of each element follow afterwards:
- </para>
-<programlisting role="XML"><![CDATA[
-<instance>
- <instance-id>MyPortletInstance</instance-id>
- <portlet-ref>MyPortlet</portlet-ref>
- <preferences>
- <preference>
- <name>abc</name>
- <value>def</value>
- </preference>
- </preferences>
- <security-constraint>
- <policy-permission>
- <role-name>User</role-name>
- <action-name>view</action-name>
- </policy-permission>
- </security-constraint>
-</instance>]]>
-</programlisting>
-<programlisting><![CDATA[
-<!ELEMENT instance-id (#PCDATA)>]]>
-</programlisting>
- <para>
- The instance identifier. The <computeroutput><instance-id></computeroutput> value can be named anything, but it must match the <computeroutput><instance-ref></computeroutput>value given in the <filename>*-object.xml</filename> file.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT portlet-ref (#PCDATA)>]]>
-</programlisting>
- <para>
- The <computeroutput><portlet-ref></computeroutput> element defines the portlet that an instance represents. The <computeroutput><portlet-ref></computeroutput> value must match the <computeroutput><portlet-name></computeroutput> given in the <filename>WEB-INF/portlet.xml</filename> file.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT preferences (preference+)>]]>
-</programlisting>
- <para>
- The <computeroutput><preferences></computeroutput> element configures an instance with a set of preferences.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT preference (name,value)>]]>
-</programlisting>
- <para>
- The <computeroutput><preference></computeroutput> element configures one preference, which is part of a set of preferences. Use the <computeroutput><preferences></computeroutput> element to define a set of preferences.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT name (#PCDATA)>]]>
-</programlisting>
- <para>
- A name.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT value (#PCDATA)>]]>
-</programlisting>
- <para>
- A string value.
- </para>
- <programlisting><![CDATA[
-<!ELEMENT security-constraint (policy-permission*)>]]>
-</programlisting>
- <para>
- The <computeroutput><security-constraint></computeroutput> element is a container for <computeroutput><policy-permission></computeroutput> elements. The following is an example of the <computeroutput><security-constraint></computeroutput> and <computeroutput><policy-permission></computeroutput> elements:
- </para>
-<programlisting role="XML"><![CDATA[
-<security-constraint>
- <policy-permission>
- <role-name>User</role-name>
- <action-name>view</action-name>
- </policy-permission>
-</security-constraint>
-
-<security-constraint>
- <policy-permission>
- <unchecked/>
- <action-name>view</action-name>
- </policy-permission>
-</security-constraint>]]>
-</programlisting>
-<programlisting><![CDATA[
-<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>]]>
-</programlisting>
- <para>
- The <computeroutput><policy-permission></computeroutput> element secures a specific portlet instance based on a user's role.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT action-name (#PCDATA)>]]>
-</programlisting>
- <para>
- The <computeroutput><action-name></computeroutput> element defines the access rights given to the role defined. Accepted values are:
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- <computeroutput>view</computeroutput>: users can view the page.
- </para>
- </listitem>
- <listitem>
- <para>
- <computeroutput>viewrecursive</computeroutput>: users can view the page and child pages.
- </para>
- </listitem>
- <listitem>
- <para>
- <computeroutput>personalize</computeroutput>: users are able personalize the page's theme.
- </para>
- </listitem>
- <listitem>
- <para>
- <computeroutput>personalizerecursive</computeroutput>: users are able personalize the page and child pages themes.
- </para>
- </listitem>
- </itemizedlist>
- </para>
-<programlisting><![CDATA[
-<!ELEMENT unchecked EMPTY>]]>
-</programlisting>
- <para>
- If present, the <computeroutput><unchecked></computeroutput> element defines anyone can view the instance.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT role-name (#PCDATA)>]]>
-</programlisting>
- <para>
- The <computeroutput><role-name></computeroutput> element defines a role that the security constraint will apply to. The following example only allows users that are part of the <computeroutput>EXAMPLEROLE</computeroutput> role to access the instance:
- </para>
-<programlisting role="XML"><![CDATA[
-<role-name>EXAMPLEROLE</role-name>]]>
-</programlisting>
- </section>
- <section>
- <title>The JBoss Portal Object DTD</title>
- <para>
- The following items refer to elements found in the JBoss Portal Object DTD, <filename>$JBOSS_HOME/server/<replaceable>configuration</replaceable>/deploy/jboss-portal.sar/dtd/portal-object_<replaceable>version_number</replaceable>.dtd</filename>:
- </para>
-<programlisting><![CDATA[
-<!ELEMENT deployments (deployment*)>]]>
-</programlisting>
- <para>
- The <computeroutput><deployments></computeroutput> element is a container for <computeroutput><deployment></computeroutput> elements.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT deployment (parent-ref?,if-exists?,(context|portal|page|window))>]]>
-</programlisting>
- <para>
- The <computeroutput><deployment></computeroutput> element is a generic container for portal object elements. The <computeroutput><parent-ref></computeroutput> child element gives the name of the parent object that the current object will use as parent. The optional <computeroutput><if-exists></computeroutput> element defines the action to take if an instance with the same name already exists. The default behavior of the <computeroutput><if-exists></computeroutput> element is to keep the existing object, and not to create a new object.
- </para>
- <para>
- The following is an example of the <computeroutput><deployment></computeroutput> and <computeroutput><parent-ref></computeroutput> elements:
- </para>
-<programlisting role="XML"><![CDATA[
-<deployment>
- <parent-ref>default</parent-ref>
- <page>
- ...
- </page>
-</deployment>]]>
-</programlisting>
- <para>
- All portal objects have a common configuration which can include:
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- a listener: specifies the ID of a listener in the listener registry. A listener object is able to listen to portal events, which apply to the portal node hierarchy.
- </para>
- </listitem>
- <listitem>
- <para>
- properties: a set of generic properties owned by the portal object. Certain properties drive the behavior of the portal object.
- </para>
- </listitem>
- <listitem>
- <para>
- security-constraint: defines the security configuration for the portal object.
- </para>
- </listitem>
- </itemizedlist>
- </para>
-<programlisting><![CDATA[
-<!ELEMENT parent-ref (#PCDATA)>]]>
-</programlisting>
- <para>
- The <computeroutput><parent-ref></computeroutput> element contains a reference to the parent object. The naming convention for naming objects is to concatenate the names of the path to the object, and separate the names using a period. If the path is empty, the empty string must be used. The <computeroutput><parent-ref></computeroutput> element tells the portal where the portlet appears. The syntax for the <computeroutput><parent-ref></computeroutput> element is <computeroutput><replaceable>portal-instance</replaceable>.<replaceable>portal-page</replaceable></computeroutput>.
- </para>
- <para>
- The following is an example of the root having an empty path:
- </para>
-<programlisting role="XML">
-<parent-ref />
-</programlisting>
- <para>
- The following specifies that the portlet appears in the portal instance named <computeroutput>default</computeroutput>:
- </para>
-<programlisting role="XML">
-<parent-ref>default</parent-ref>
-</programlisting>
- <para>
- The following specifies that the portlet appear in the portal instance named <computeroutput>default</computeroutput>, and on the page named <computeroutput>default</computeroutput>:
- </para>
-<programlisting role="XML">
-<parent-ref>default.default</parent-ref>
-</programlisting>
-<programlisting><![CDATA[
-<!ELEMENT if-exists (#PCDATA)>]]>
-</programlisting>
- <para>
- The <computeroutput><if-exists></computeroutput> element defines the action to take if an instance with the same name already exists. Accepted values are <computeroutput>overwrite</computeroutput> and <computeroutput>keep</computeroutput>. The <computeroutput>overwrite</computeroutput> option destroys the existing object, and creates a new one based on the content of the deployment. The <computeroutput>keep</computeroutput> option matains the existing object deployment, or creates a new one if it does not exist.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT context (context-name,properties?,listener?,security-constraint?,portal*,
-(display-name* | (resource-bundle, supported-locale+)))>]]>
-</programlisting>
- <para>
- The context type of the portal object. A context type represent a node in a tree, which does not have a visual representation, and only exists under the root. A context can only have children that use the <emphasis>portal</emphasis> type.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT context-name (#PCDATA)>]]>
-</programlisting>
- <para>
- The context name.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT portal (portal-name,supported-modes,supported-window-states?,properties?,listener?,
-security-constraint?,page*, (display-name* | (resource-bundle, supported-locale+)))>]]>
-</programlisting>
- <para>
- A portal object that uses the <emphasis>portal</emphasis> type. A portal type represents a virtual portal, and can only have children that use the <emphasis>page</emphasis> type. In addition to the common portal object elements, it also allows you to declare modes and window states that are supported.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT portal-name (#PCDATA)>]]>
-</programlisting>
- <para>
- The portal name.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT supported-modes (mode*)>]]>
-</programlisting>
- <para>
- The <computeroutput><supported-modes></computeroutput> elements defines the supported modes of the portal. Accepted values are <computeroutput>view</computeroutput>, <computeroutput>edit</computeroutput>, and <computeroutput>help</computeroutput>.
- </para>
- <para>
- The following is an example of the <computeroutput><supported-mode></computeroutput> and <computeroutput><mode></computeroutput> elements:
- </para>
-<programlisting role="XML"><![CDATA[
-<supported-mode>
- <mode>view</mode>
- <mode>edit</mode>
- <mode>help</mode>
-</supported-mode>]]>
-</programlisting>
-<programlisting><![CDATA[
-<!ELEMENT mode (#PCDATA)>]]>
-</programlisting>
- <para>
- The portlet mode value. If there are no declarations of modes or window states, the default values are <computeroutput>view</computeroutput>, <computeroutput>edit</computeroutput>, <computeroutput>help</computeroutput>, and <computeroutput>normal</computeroutput>, <computeroutput>minimized</computeroutput>, <computeroutput>maximized</computeroutput>, respectively.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT supported-window-states (window-state*)>]]>
-</programlisting>
- <para>
- Use the <computeroutput><supported-window-states></computeroutput> element to define the supported window states of the portal. The following is an example of the <computeroutput><supported-window-states></computeroutput> and <computeroutput><window-state></computeroutput> elements:
- </para>
-<programlisting role="XML"><![CDATA[
-<supported-window-states>
- <window-state>normal</window-state>
- <window-state>minimized</window-state>
- <window-state>maximized</window-state>
-</supported-window-states>]]>
-</programlisting>
-<programlisting><![CDATA[
-<!ELEMENT window-state (#PCDATA)>]]>
-</programlisting>
- <para>
- Use the <computeroutput><window-state></computeroutput> element to define a window states. Accepted values are <computeroutput>normal</computeroutput>, <computeroutput>minimized</computeroutput>, and <computeroutput>maximized</computeroutput>.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT page (page-name,properties?,listener?,security-constraint?,(page | window)*,
-(display-name* | (resource-bundle, supported-locale+)))>]]>
-</programlisting>
- <para>
- A portal object that uses the <emphasis>page</emphasis> type. A page type represents a page, and can only have children that use the <emphasis>page</emphasis> and <emphasis>window</emphasis> types. The children windows are the windows of the page, and the children pages are the subpages of the page.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT page-name (#PCDATA)>]]>
-</programlisting>
- <para>
- The page name.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT window (window-name,(instance-ref|content),region,height,initial-window-state?,
-initial-mode?,properties?,listener?, (display-name* | (resource-bundle, supported-locale+)))>]]>
-</programlisting>
- <para>
- A portal object that uses the <emphasis>window</emphasis> type. A window type represents a window. Besides the common properties, a window has content, and belongs to a region on the page.
- </para>
- <para>
- The <computeroutput><instance-ref></computeroutput> and <computeroutput><content></computeroutput> elements, configured in the <filename>WEB-INF/*-object.xml</filename> files, define the content of a window. The <computeroutput><content></computeroutput> element is generic, and describes any kind of content. The <computeroutput><instance-ref></computeroutput> element is a shortcut to define the content-type of the portlet, which points to a portlet instance. The value of <computeroutput><instance-ref></computeroutput> must match the value of one of the <computeroutput><instance-id></computeroutput> elements in the <filename>WEB-INF/portlet-instances.xml</filename> file.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT window-name (#PCDATA)>]]>
-</programlisting>
- <para>
- The window name value.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT instance-ref (#PCDATA)>]]>
-</programlisting>
- <para>
- Define the content of the window as a reference to a portlet instance. This value is the ID of a portlet instance, and must much the value of one of the <computeroutput><instance-id></computeroutput> elements in the <filename>WEB-INF/portlet-instances.xml</filename> file. The following is an example of the <computeroutput><instance-ref></computeroutput> element:
- </para>
-<programlisting role="XML">
-<instance-ref>MyPortletInstance</instance-ref>
-</programlisting>
-<programlisting><![CDATA[
-<!ELEMENT region (#PCDATA)>]]>
-</programlisting>
- <para>
- The region the window belongs to. The <computeroutput><region></computeroutput> element specifies where the window appears on the page.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT height (#PCDATA)>]]>
-</programlisting>
- <para>
- The height of the window in a particular region.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT listener (#PCDATA)>]]>
-</programlisting>
- <para>
- Define a listener for a portal object. This value is the ID of the listener.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT content (content-type,content-uri)>]]>
-</programlisting>
- <para>
- Define the content of a window in a generic manner. The content is defined by the type of content, and a URI, which acts as an identifier for the content. The following is an example of the <computeroutput><content></computeroutput> element, which is configured in the <filename>WEB-INF/*-object.xml</filename> files:
- </para>
-<programlisting role="XML"><![CDATA[
-<content>
- <content-type>portlet</content-type>
- <content-uri>MyPortletInstance</content-uri>
-</content>
-
-<content>
- <content-type>cms</content-type>
- <content-uri>/default/index.html</content-uri>
-</content>]]>
-</programlisting>
-<programlisting><![CDATA[
-<!ELEMENT content-type (#PCDATA)>]]>
-</programlisting>
- <para>
- The content type of the window. The <computeroutput><content-type></computeroutput> element specifies the content to display, for example, a <computeroutput>portlet</computeroutput>.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT content-uri (#PCDATA)>]]>
-</programlisting>
- <para>
- The content URI of the window. The <computeroutput><content-uri></computeroutput> element specifies which content to display, for example, a portlet instance. To display a file from the CMS, use the <computeroutput><content-uri></computeroutput> element to define the full path to that file in the CMS.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT properties (property*)>]]>
-</programlisting>
- <para>
- A set of generic properties for the portal object. The <computeroutput><properties></computeroutput> elements contain definitions specific to a portal object.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT property (name,value)>]]>
-</programlisting>
- <para>
- A generic string property. The following table lists accepted values. This table is not exhaustive:
- <table>
- <title>Properties</title>
- <tgroup cols="2" align="left" colsep="1" rowsep="1">
- <colspec colname="name"/>
- <colspec colname="description"/>
- <thead>
- <row>
- <entry>Name</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><computeroutput>layout.id</computeroutput></entry>
- <entry>Defines the layout to use for the portal object and sub-objects if they do not override the value.</entry>
- </row>
- <row>
- <entry><computeroutput>theme.id</computeroutput></entry>
- <entry>Defines the theme used for the portal object and sub-objects if they do not override the value.</entry>
- </row>
- <row id="xml.default.objectname.property">
- <entry><computeroutput>portal.defaultObjectName</computeroutput></entry>
- <entry>Defines the default child object. If applied to a <literal>context</literal>, it defines the default portal. If applied to a <literal>portal</literal>, it defines the default portal page.</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </para>
-<programlisting><![CDATA[
-<!ELEMENT name (#PCDATA)>]]>
-</programlisting>
- <para>
- A name value.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT value (#PCDATA)>]]>
-</programlisting>
- <para>
- A value.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT security-constraint (policy-permission*)>]]>
-</programlisting>
- <para>
- The <computeroutput><security-constraint></computeroutput> element is a container for <computeroutput><policy-permission></computeroutput> elements. The following is an example of the <computeroutput><security-constraint></computeroutput> and <computeroutput><policy-permission></computeroutput> elements:
- </para>
-<programlisting role="XML"><![CDATA[
-<security-constraint>
- <policy-permission>
- <role-name>User</role-name>
- <action-name>view</action-name>
- </policy-permission>
-</security-constraint>
-
-<security-constraint>
- <policy-permission>
- <unchecked/>
- <action-name>view</action-name>
- </policy-permission>
-</security-constraint>]]>
-</programlisting>
-<programlisting><![CDATA[
-<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>]]>
-</programlisting>
- <para>
- The <computeroutput><policy-permission></computeroutput> element is secures a specific portlet instance based on a user's role.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT action-name (#PCDATA)>]]>
-</programlisting>
- <para>
- The <computeroutput><action-name></computeroutput> element defines the access rights given to the role defined. Accepted values are:
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- <computeroutput>view</computeroutput>: users can view the page.
- </para>
- </listitem>
- <listitem>
- <para>
- <computeroutput>viewrecursive</computeroutput>: users can view the page and child pages.
- </para>
- </listitem>
- <listitem>
- <para>
- <computeroutput>personalize</computeroutput>: users are able personalize the page's theme.
- </para>
- </listitem>
- <listitem>
- <para>
- <computeroutput>personalizerecursive</computeroutput>: users are able personalize the page and child pages themes.
- </para>
- </listitem>
- </itemizedlist>
- </para>
-<programlisting><![CDATA[
-<!ELEMENT unchecked EMPTY>]]>
-</programlisting>
- <para>
- If present, the <computeroutput><unchecked></computeroutput> element defines that anyone can view the instance.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT role-name (#PCDATA)>]]>
-</programlisting>
- <para>
- The <computeroutput><role-name></computeroutput> element defines a role that the security constraint applies to. The following example only allows users that are part of the <computeroutput>EXAMPLEROLE</computeroutput> role to access the instance:
- </para>
-<programlisting><![CDATA[
-<role-name>EXAMPLEROLE</role-name>]]>
-</programlisting>
- </section>
- <section>
- <title>The JBoss Portal App DTD</title>
- <para>
- The following items refer to elements found in the JBoss Portal App DTD, <filename>$JBOSS_HOME/server/<replaceable>configuration</replaceable>/jboss-portal.sar/dtd/jboss-app_<replaceable>version_number</replaceable>.dtd</filename>:
- </para>
-<programlisting><![CDATA[
-<Element <![CDATA[<!ELEMENT jboss-app (app-name?)>]]>
-</programlisting>
-<programlisting><![CDATA[
-<!DOCTYPE jboss-app PUBLIC
- "-//JBoss Portal//DTD JBoss Web Application 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-app_2_6.dtd">]]>
-</programlisting>
-<programlisting><![CDATA[
-<!ELEMENT app-name (#PCDATA)>]]>
-</programlisting>
- <para>
- When a web application is deployed, the context path under which it is deployed
- is taken as the application name. The application name value in the <computeroutput><app-name></computeroutput> element overrides it. When a component references a portlet, it needs to reference the application too, and if the portlet application WAR file is renamed,
- the reference is no longer valid; therefore, the <computeroutput><app-name></computeroutput> element is used to have an application name that does not depend upon the context path, under which the application is deployed.
- </para>
- </section>
- </section>
- <section id="descriptors_portlet">
- <title>Portlet Descriptors</title>
- <para>
- The following sections describe the descriptors that define portal objects, such as portals, pages, portlet instances, windows, and portlets. Refer to <xref linkend="tutorials_tutorials"/> and <xref linkend="desc_examples"/> for examples on using these descriptors within a portlet application.
- </para>
- <section id="desc_objectxml">
- <title><filename>*-object.xml</filename> Descriptors</title>
- <para>
- The <filename>*-object.xml</filename> descriptors define portal instances, pages, windows, and the window layout. As well, themes and layouts for specific portal instances, pages, and windows, can be defined. The following example defines a portlet window being added to the <computeroutput>default</computeroutput> page, in the <computeroutput>default</computeroutput> portal. For advanced functionality using these descriptors, refer to <xref linkend="desc_examples"/>:
- </para>
- <programlisting role="XML"><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE deployments PUBLIC
- "-//JBoss Portal//DTD Portal Object 2.6//EN"
- "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
-<deployments>
- <deployment>
- <parent-ref>default.default</parent-ref>
- <if-exists>overwrite</if-exists>
- <window>
- <window-name>HelloWorldJSPPortletWindow</window-name>
- <instance-ref>HelloWorldJSPPortletInstance</instance-ref>
- <region>center</region>
- <height>1</height>
- </window>
- </deployment>
-</deployments>]]></programlisting>
- <itemizedlist>
- <listitem>
- <para>
- <programlisting><![CDATA[<deployments>...</deployments>]]></programlisting>
- </para>
- <para>
- The <computeroutput><deployments></computeroutput> element encapsulates the entire document, and is a container for <computeroutput><deployment></computeroutput> elements. Multiple deployments can be specified within the <computeroutput><deployments></computeroutput> element.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<deployment>...</deployment>]]></programlisting>
- </para>
- <para>
- The <computeroutput><deployment></computeroutput> element specifies object deployments, such as portals, pages, windows, and so on.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<if-exists>...</if-exists>]]></programlisting>
- </para>
- <para>
- The <computeroutput><if-exists></computeroutput> element defines the action to take if an instance with the same name already exists. Accepted values are <computeroutput>overwrite</computeroutput> and <computeroutput>keep</computeroutput>. The <computeroutput>overwrite</computeroutput> option destroys the existing object, and creates a new one based on the content of the deployment. The <computeroutput>keep</computeroutput> option maintains the existing object deployment, or creates a new one if it does not exist.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<parent-ref>...</parent-ref>]]></programlisting>
- </para>
- <para>
- The <computeroutput><parent-ref></computeroutput> element contains a reference to the parent object. The naming convention for naming objects is to concatenate the names of the path to the object, and separate the names using a period. If the path is empty, the empty string must be used. The <computeroutput><parent-ref></computeroutput> element tells the portal where the portlet appears. The syntax for the <computeroutput><parent-ref></computeroutput> element is <computeroutput><replaceable>portal-instance</replaceable>.<replaceable>portal-page</replaceable></computeroutput>.
- </para>
- <para>
- In the example above, a window is defined, and assigned to <computeroutput>default.default</computeroutput>. This means the window appears on the <computeroutput>default</computeroutput> page, in the <computeroutput>default</computeroutput> portal.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<window>...</window>]]></programlisting>
- </para>
- <para>
- The <computeroutput><window></computeroutput> element defines a portlet window. The <computeroutput><window></computeroutput> element requires an <computeroutput><instance-ref></computeroutput> element, which assigns a portal instance to a window.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<window-name>...</window-name>]]></programlisting>
- </para>
- <para>
- The <computeroutput><window-name></computeroutput> element defines the <emphasis role="bold">unique name</emphasis> given to a portlet window. This can be named anything.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<instance-ref>...</instance-ref>]]></programlisting>
- </para>
- <para>
- The <computeroutput><instance-ref></computeroutput> elements define the portlet instances that windows represent. This value is the ID of a portlet instance, and must match the value of one of the <computeroutput><instance-id></computeroutput> elements in the <filename>WEB-INF/portlet-instances.xml</filename> file.
- </para>
- </listitem>
- <listitem>
- <para>
-<programlisting><![CDATA[
-<region>...</region>
-<height>...</height>]]></programlisting>
- </para>
- <para>
- The <computeroutput><region></computeroutput> and <computeroutput><height></computeroutput> elements define where the window appears within the page layout. The <computeroutput><region></computeroutput> element specifies where the window appears on the page. The <computeroutput><region></computeroutput> element often depends on other regions defined in the portal layout. The <computeroutput><height></computeroutput> element can be assigned a value between one and <replaceable>X</replaceable>.
- </para>
- </listitem>
- </itemizedlist>
- <para>The previous <filename>*-object.xml</filename> example makes reference to items found in other descriptor files. The following diagram illustrates the relationship between the <filename>portlet.xml</filename>, <filename>portlet-instances.xml</filename>, and <filename>*-object.xml</filename> descriptors:
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/tutorials/first_portlet/desc_relationship.png" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- <note>
- <title>Are <filename>*-object.xml</filename> descriptors required?</title>
- <para>
- Technically, they are not. The portal object hierarchy, such as creating portals, pages, instances, and organizing them on the page, can be defined using the management portlet, which is accessible to JBoss Portal administrators.
- </para>
- </note>
- </para>
- </section>
- <section id="desc_instancesxml">
- <title>The <filename>portlet-instances.xml</filename> Descriptor</title>
- <para>
- The <filename>portlet-instances.xml</filename> descriptor is JBoss Portal specific, and allows developers to instantiate one-or-many instances of one-or-many portlets. The benefit of this allows one portlet to be instantiated several times, with different preference parameters. The following example instantiates two separate instances of the <computeroutput>NewsPortlet</computeroutput>, both using different parameters. One instance draws feeds from Red Hat announcements, and the other from McDonalds announcements:
- </para>
- <para>
-<programlisting><![CDATA[
-<?xml version="1.0" standalone="yes"?>
-<!DOCTYPE deployments PUBLIC
- "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
- "http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
-<deployments>
- <deployment>
- <instance>
- <instance-id>NewsPortletInstance1</instance-id>
- <portlet-ref>NewsPortlet</portlet-ref>
- <preferences>
- <preference>
- <name>expires</name>
- <value>180</value>
- </preference>
- <preference>
- <name>RssXml</name>
- <value>http://finance.yahoo.com/rss/headline?s=rhat</value>
- </preference>
- </preferences>
- <security-constraint>
- <policy-permission>
- <action-name>view</action-name>
- <unchecked/>
- </policy-permission>
- </security-constraint>
- </instance>
- </deployment>
- <deployment>
- <instance>
- <instance-id>NewsPortletInstance2</instance-id>
- <portlet-ref>NewsPortlet</portlet-ref>
- <preferences>
- <preference>
- <name>expires</name>
- <value>180</value>
- </preference>
- <preference>
- <name>RssXml</name>
- <value>http://finance.yahoo.com/rss/headline?s=mcd</value>
- </preference>
- </preferences>
- <security-constraint>
- <policy-permission>
- <action-name>view</action-name>
- <unchecked/>
- </policy-permission>
- </security-constraint>
- </instance>
- </deployment>
-</deployments>
-]]></programlisting>
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- <programlisting><![CDATA[<deployments>...</deployments>]]></programlisting>
- </para>
- <para>
- The <computeroutput><deployments></computeroutput> element encapsulates the entire document, and is a container for <computeroutput><deployment></computeroutput> elements. Multiple deployments can be specified within the <computeroutput><deployments></computeroutput> element.
- </para>
- </listitem>
- <listitem>
- <para>
-<programlisting><![CDATA[
-<deployment>
- <instance>...</instance>
-</deployment>]]></programlisting>
- </para>
- <para>
- The <computeroutput><deployment></computeroutput> element, and the embedded <computeroutput><instance></computeroutput> element, specify a portlet instance. The <computeroutput><deployment></computeroutput> element specifies object deployments, such as portals, pages, windows, and so on. The <computeroutput><instance></computeroutput> element creates instances of portlets. The portlet will only be created and configured if the portlet is present, and if an instance with the same name does not already exist.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<instance-id>...</instance-id>]]></programlisting>
- </para>
- <para>
- The <computeroutput><instance-id></computeroutput> elements defines a <emphasis role="bold">unique name</emphasis> given to an instance of a portlet. The <computeroutput><instance-id></computeroutput> value can be named anything, but it must match the value of one of the <computeroutput><instance-ref></computeroutput> elements in the <filename>WEB-INF/*-object.xml</filename> file.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<portlet-ref>...</portlet-ref>]]></programlisting>
- </para>
- <para>
- The <computeroutput><portlet-ref></computeroutput> element defines the portlet that an instance represents. The <computeroutput><portlet-ref></computeroutput> value must match the <computeroutput><portlet-name></computeroutput> given in the <filename>WEB-INF/portlet.xml</filename> file.
- </para>
- </listitem>
- <listitem>
- <para>
-<programlisting><![CDATA[
-<preferences>
- <preference>...</preference>
-</preferences>]]></programlisting>
- </para>
- <para>
- The <computeroutput><preference></computeroutput> element configures a preference as a key-value pair. This value can be composed of a single string value, for example, the preference <emphasis>fruit</emphasis> can have the <emphasis>apple</emphasis> value. As well, this value can be composed of multiple strings, for example, the preference <emphasis>fruits</emphasis> can have values of <emphasis>apple</emphasis>, <emphasis>orange</emphasis>, and <emphasis>kiwi</emphasis>:
- </para>
- <para>
-<programlisting><![CDATA[
-<preferences>
- <preference>
- <name>fruits</name>
- <value>apple</value>
- <value>orange</value>
- <value>kiwi</value>
- </preference>
-</preferences>
-]]></programlisting>
- </para>
- <para>
- The <computeroutput><preference></computeroutput> element configures one preference, which is part of a set of preferences. Use the <computeroutput><preferences></computeroutput> element to define a set of preferences.
- </para>
- </listitem>
- <listitem>
- <para>
-<programlisting><![CDATA[<security-constraint>
- <policy-permission>
- <action-name>viewrecursive</action-name>
- <unchecked/>
- </policy-permission>
-</security-constraint>]]></programlisting>
- </para>
- <para>
- The <computeroutput><security-constraint></computeroutput> element is a container for <computeroutput><policy-permission></computeroutput> elements. This example demonstrates the <computeroutput><security-constraint></computeroutput> and <computeroutput><policy-permission></computeroutput> elements.
- </para>
- <para>
- The <computeroutput><action-name></computeroutput> element defines the access rights given to the role defined. Accepted values are:
- </para>
- <para>
- <itemizedlist>
- <listitem override="bullet">
- <para>
- <computeroutput>view</computeroutput>: users can view the page.
- </para>
- </listitem>
- <listitem override="bullet">
- <para>
- <computeroutput>viewrecursive</computeroutput>: users can view the page and child pages.
- </para>
- </listitem>
- <listitem override="bullet">
- <para>
- <computeroutput>personalize</computeroutput>: users are able personalize the page's theme.
- </para>
- </listitem>
- <listitem override="bullet">
- <para>
- <computeroutput>personalizerecursive</computeroutput>: users are able personalize the page and child pages themes.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- You must define a role that the security constraint will apply to:
- </para>
- <para>
- <itemizedlist>
- <listitem override="bullet">
- <para>
- <computeroutput>unchecked</computeroutput>: anyone can view the page.
- </para>
- </listitem>
- <listitem override="bullet">
- <para>
- <computeroutput><role-name>EXAMPLEROLE</role-name></computeroutput>: only allow users that are part of the <computeroutput>EXAMPLEROLE</computeroutput> role to access the instance.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
-</itemizedlist>
-</para>
- <para>
- The previous <filename>portlet-instances.xml</filename> example makes reference to items found in other descriptor files. The following diagram illustrates the relationship between the <filename>portlet.xml</filename>, <filename>portlet-instances.xml</filename>, and <filename>*-object.xml</filename> descriptors:
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/tutorials/first_portlet/desc_relationship.png" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <note>
- <title>Is the <filename>portlet-instances.xml</filename> descriptor required?</title>
- <para>
- Technically, it is not. The portal object hierarchy, such as creating portals, pages, instances, and organizing them on the page, can be defined using the management portlet, which is accessible to JBoss Portal administrators.
- </para>
- </note>
- </section>
- <section>
- <title>The <filename>jboss-portlet.xml</filename> Descriptor</title>
- <para>
- The <filename>jboss-portlet.xml</filename> descriptor allows you to use JBoss-specific functionality within your portlet application. This descriptor is covered by the <ulink url="http://www.jcp.org/en/jsr/detail?id=168">JSR-168 Portlet Specification</ulink>, and is normally packaged inside your portlet WAR file, alongside the other descriptors in these sections.
- </para>
- <section>
- <title>Injecting Header Content</title>
- <para>
- The following example injects a specific style sheet, <computeroutput>/images/management/management.css</computeroutput>, allowing the portlet to leverage a specific style:
- </para>
- <para>
-<programlisting><![CDATA[
-<?xml version="1.0" standalone="yes"?>
-<!DOCTYPE portlet-app PUBLIC
- "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
-<portlet-app>
- <portlet>
- <portlet-name>ManagementPortlet</portlet-name>
- <header-content>
- <link rel="stylesheet" type="text/css" href="/images/management/management.css"
- media="screen"/>
- </header-content>
- </portlet>
-</portlet-app>]]>
-</programlisting>
- </para>
- <para>
- Use the <computeroutput><header-content></computeroutput> and <computeroutput><link></computeroutput> elements to specify a style sheet.
- </para>
- </section>
- <section>
- <title>Injecting Services in the portlet Context</title>
- <para>
- The following example injects the <computeroutput>UserModule</computeroutput> service as an attribute to the portlet context:
- </para>
- <para>
-<programlisting><![CDATA[
-<?xml version="1.0" standalone="yes"?>
-<!DOCTYPE portlet-app PUBLIC
- "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
-<portlet-app>
- <service>
- <service-name>UserModule</service-name>
- <service-class>org.jboss.portal.identity.UserModule</service-class>
- <service-ref>:service=Module,type=User</service-ref>
- </service>
-</portlet-app>]]>
-</programlisting>
- </para>
- <para>
- This allows the portlet to leverage the service, for example:
- </para>
- <para>
-<programlisting><![CDATA[
-UserModule userModule = (UserModule) getPortletContext().getAttribute("UserModule");
-String userId = request.getParameters().getParameter("userid");
-User user = userModule.findUserById(userId);]]>
-</programlisting>
- </para>
- </section>
- <section>
- <title>Defining extra portlet Information</title>
- <para>
- As of JBoss Portal 2.6.3, icons can be defined for a portlet by using the <computeroutput><icon></computeroutput>, <computeroutput><small-icon></computeroutput>, and <computeroutput><large-icon></computeroutput> elements:
- </para>
- <para>
-<programlisting><![CDATA[
-<?xml version="1.0" standalone="yes"?>
-<!DOCTYPE portlet-app PUBLIC
- "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
-<portlet-app>
- <portlet>
- <portlet-name>ManagementPortlet</portlet-name>
- <portlet-info>
- <icon>
- <small-icon>/images/smallIcon.png</small-icon>
- <large-icon>/images/largeIcon.png</small-icon>
- </icon>
- </portlet-info>
- </portlet>
-</portlet-app>]]>
-</programlisting>
- </para>
- <para>
- References to icons can be absolute, for example, <emphasis>http://www.example.com/images/smallIcon.png</emphasis>, or relative to the web application context, for example, <computeroutput>/images/smallIcon.png</computeroutput>. Icons can be used by different parts of the portlet user interface.
- </para>
- </section>
- <section>
- <title>Portlet Session Replication in a Clustered Environment</title>
-
- <para>
- For information about portlet session replication in clustered environments, refer to <xref linkend="portlet_session_replication"/>.
- </para>
- <para>
- <note>
- <title>Is the <filename>jboss-portlet.xml</filename> descriptor required?</title>
- <para>
- Technically, it is not; however, it may be required to access JBoss-specific functionality that is not covered by the Portlet specification.
- </para>
- </note>
- </para>
- </section>
- </section>
- <section>
- <title>The <filename>portlet.xml</filename> Descriptor</title>
- <para>
- The <filename>portlet.xml</filename> descriptor is the standard portlet descriptor covered by the <ulink url="http://www.jcp.org/en/jsr/detail?id=168">JSR-168 Portlet Specification</ulink>. Developers are strongly encouraged to read the <ulink url="http://www.jcp.org/en/jsr/detail?id=168">JSR-168 Portlet Specification</ulink> items covering the correct use of this descriptor, as it is only covered briefly in these sections. Normally the <filename>portlet.xml</filename> descriptor is packaged inside your portlet WAR file, alongside the other descriptors in these sections. The following example is a modified version of the JBoss Portal UserPortlet definition:
- </para>
- <para>
-<programlisting><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<portlet-app
- xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
- http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
- version="1.0">
- <portlet>
- <description>Portlet providing user login/logout and profile management</description>
- <portlet-name>UserPortlet</portlet-name>
- <display-name>User Portlet</display-name>
- <portlet-class>org.jboss.portal.core.portlet.user.UserPortlet</portlet-class>
- <init-param>
- <description>Initialize the portlet with a default page to render</description>
- <name>>default-view</name>
- <value>/WEB-INF/jsf/objects.xhtml</value>
- </init-param>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>VIEW</portlet-mode>
- </supports>
- <supported-locale>en</supported-locale>
- <supported-locale>fr</supported-locale>
- <supported-locale>es</supported-locale>
- <resource-bundle>Resource</resource-bundle>
- <portlet-info>
- <title>User portlet</title>
- </portlet-info>
- </portlet>
-</portlet-app>]]>
-</programlisting>
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- <programlisting><![CDATA[<portlet-app>...</portlet-app>]]></programlisting>
- </para>
- <para>
- The <computeroutput><portlet-app></computeroutput> element encapsulates the entire document. Multiple portlets can be specified using the <computeroutput><portlet-app></computeroutput> element.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<portlet>...</portlet>]]></programlisting>
- </para>
- <para>
- The <computeroutput><portlet></computeroutput> element defines one portlet that is deployed within this archive.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<description>...</description>]]></programlisting>
- </para>
- <para>
- The <computeroutput><description></computeroutput> element is a verbal description of the portlet's function.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<portlet-name>...</portlet-name>]]></programlisting>
- </para>
- <para>
- The <computeroutput><portlet-name></computeroutput> element defines the portlet name. It does not have to be the class name.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<portlet-class>...</portlet-class>]]></programlisting>
- </para>
- <para>
- The <computeroutput><portlet-class></computeroutput> element defines the Fully Qualified Name (FQN) of the portlet class.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[
-<init-param>
- <name>...</name>
- <value>...</value>
-</init-param>]]></programlisting>
- </para>
- <para>
- The <computeroutput><init-param></computeroutput> element specifies initialization parameters to create an initial state inside your portlet class. This is usually used in the portlet's <emphasis>init()</emphasis> method, but not necessarily. Unlike a preference, an init-parameter is data that does not change at runtime and does not go into a database. If the value is changed in the descriptor, the change takes immediate effect after re-deploying the portlet. Multiple <computeroutput><init-param></computeroutput> elements can be used.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<supports>...</supports>]]></programlisting>
- </para>
- <para>
- The <computeroutput><supports></computeroutput> element declares all of the markup types that a portlet supports. Use the <computeroutput><mime-type></computeroutput> element to declare supported capabilities, for example, if the only outputs are text and HTML, use <computeroutput><mime-type>text/html</mime-type></computeroutput>. Use the <computeroutput><portlet-mode></computeroutput> element to define the supported portlet modes for the portlet. For example, all portlets must support the <computeroutput>view</computeroutput> portlet mode, which is defined using <computeroutput><portlet-mode>view</portlet-mode></computeroutput>.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<supported-locale>...</supported-locale>]]></programlisting>
- </para>
- <para>
- The <computeroutput><supported-locale></computeroutput> elements advertise the supported locales for the portlet. Use multiple <computeroutput><supported-locale></computeroutput> elements to specify multiple locales.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<resource-bundle>...</resource-bundle>]]></programlisting>
- </para>
- <para>
- The <computeroutput><resource-bundle></computeroutput> element specifies the resource bundle that contains the localized information for the specified locales.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[
-<portlet-info>
- <title>...</title>
-</portlet-info>]]></programlisting>
- </para>
- <para>
- The <computeroutput><title></computeroutput> element defines the portlet's title, which is displayed in the portlet window's title bar.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- <warning>
- <title>The <filename>portlet.xml</filename> Example</title>
- <para>
- This <filename>portlet.xml</filename> example is not a replacement for what is covered in the <ulink url="http://www.jcp.org/en/jsr/detail?id=168">JSR-168 Portlet Specification</ulink>.
- </para>
- </warning>
- </para>
- </section>
- </section>
- <section id="portaldescriptors">
- <title>JBoss Portal Descriptors</title>
- <para>
- This section describes Datasource descriptors, which are required for JBoss Portal to communicate with a database, and briefly covers the <filename>jboss-portal.sar/conf/config.xml</filename> descriptor, which can be used for configuring logging, and configuring which page a user goes to when they log in.
- </para>
- <section id="descriptor_ds">
- <title>Datasource Descriptors (<filename>portal-*-ds.xml</filename>)</title>
- <para>
- JBoss Portal requires a Datasource descriptor to be deployed alongside the <filename>jboss-portal.sar</filename>, in order to communicate with a database. This section explains where to obtain template Datasource descriptors, how to compile them from source, and how to configure them for your installation. For an in-depth introduction to datasources, refer to the JBoss AS documentation online on the <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfigDataSources">JBoss Datasource Wiki page</ulink>.
- </para>
- <section>
- <title>Datasource Descriptors included in Binary releases</title>
- <para>
- Several template Datasource descriptors are included in the binary and bundled distributions of JBoss Portal. They are commonly located in the <filename>jboss-portal-<replaceable>version</replaceable>/setup/</filename> directory:
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/setup/package.png" valign="middle"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- The <filename>jboss-portal-<replaceable>version</replaceable>/setup/</filename> directory contains sample Datasource descriptors for the MySQL, Microsoft SQL Server, PostgreSQL, and Oracle databases, which can be customized for your own database:
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/setup/dsfiles.png" valign="middle"/>
- </imageobject>
- </mediaobject>
- </para>
- </section>
- <section>
- <title>Building Datasource Descriptors from Source</title>
- <para>
- To build the Datasource descriptors from source:
- </para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- Obtain the JBoss Portal source code: <xref linkend="install_source"/>.
- </para>
- </listitem>
- <listitem>
- <para>
- Configure the <computeroutput>JBOSS_HOME</computeroutput> environment variable: <xref linkend="install_source_env"/>.
- </para>
- </listitem>
- <listitem>
- <para>
- Change into the <filename>JBOSS_PORTAL_SOURCE_DIRECTORY/build/</filename> directory. To build the JBoss Portal source code on Linux, run the <command>sh build.sh deploy</command> command, or, if you are running Windows, run the <command>build.bat deploy</command> command. If this is the first build, third-party libraries are obtained from an online repository, so you must be connected to the Internet. After building, if the <filename>JBOSS_PORTAL_SOURCE_DIRECTORY/thirdparty/</filename> directory does not exist, it is created, and populated with the files required for later steps. For further details, refer to <xref linkend="building_deploying_from_source"/>.
- </para>
- </listitem>
- <listitem>
- <para>
- Change into the <filename>JBOSS_PORTAL_SOURCE_DIRECTORY/core/</filename> directory, and run the <command>sh build.sh datasource</command> command, or, if you are running Windows, run the <command>build.bat datasource</command> command:
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/setup/build_ds.png" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- </listitem>
- </orderedlist>
- </para>
- <para>
- Note: if the JBoss Portal source was not built as per step 3, the <command>sh build.sh datasource</command> and <command>build.bat datasource</command> commands fail with an error, such as the following:
- </para>
- <para>
-<programlisting><![CDATA[
-BUILD FAILED
-java.io.FileNotFoundException: /jboss-portal-2.6.3.GA-src/core/../thirdparty/libraries.ent
-(No such file or directory)]]>
-</programlisting>
- </para>
- <para>
- The datasource build process produces the following directory and file structure, with the Datasource descriptors in the <filename>JBOSS_PORTAL_SOURCE_DIRECTORY/core/output/resources/setup</filename> directory:
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/setup/build_ds_dir.png"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- The following is an example Datasource descriptor for a PostgreSQL database:
- </para>
- <para>
-<programlisting><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<datasources>
- <local-tx-datasource>
- <jndi-name>PortalDS</jndi-name>
- <connection-url>jdbc:postgresql:jbossportal</connection-url>
- <driver-class>org.postgresql.Driver</driver-class>
- <user-name>portal</user-name>
- <password>portalpassword</password>
- </local-tx-datasource>
-</datasources>]]>
-</programlisting>
- </para>
- <para>
- Make sure the <computeroutput>user-name</computeroutput>, <computeroutput>password</computeroutput>, <computeroutput>connection-url</computeroutput>, and <computeroutput>driver-class</computeroutput>, are correct for your chosen database.
- </para>
- </section>
- </section>
- <section id="descriptor_debug">
- <title>Portlet Debugging (<filename>jboss-portal.sar/conf/config.xml</filename>)</title>
- <para>
- By default, JBoss Portal is configured to display all errors. This behavior can be configured by modifying the <filename>jboss-portal.sar/conf/config.xml</filename> file:
- </para>
- <para>
-<programlisting><![CDATA[
-<!-- When a window has restrictedaccess : show or hide values are permitted -->
-<entry key="core.render.window_access_denied">show</entry>
-<!-- When a window is unavailable : show or hide values are permitted -->
-<entry key="core.render.window_unavailable">show</entry>
-<!-- When a window produces an error : show, hide or message_only values are permitted -->
-<entry key="core.render.window_error">message_only</entry>
-<!-- When a window produces an internal error : show, hide are permitted -->
-<entry key="core.render.window_internal_error">show</entry>
-<!-- When a window is not found : show or hide values are permitted -->
-<entry key="core.render.window_not_found">show</entry>]]>
-</programlisting>
- </para>
- <para>
- For these parameters, accepted values are <computeroutput>show</computeroutput> and <computeroutput>hide</computeroutput>. Depending on the setting, and the actual error, either an error message is displayed, or a full stack trace within the portlet window occurs. Additionally, the <computeroutput>core.render.window_error</computeroutput> property supports the <computeroutput>message_only</computeroutput> value. The <computeroutput>message_only</computeroutput> value will only display an error message, whereas the <computeroutput>show</computeroutput> value will, if available, display the full stack trace.
- </para>
- </section>
- <section>
- <title>Log in to Dashboard</title>
- <para>
- By default, when a user logs in they are forwarded to the default page of the default portal. In order to
- forward a user to their Dashboard, set the <computeroutput>core.login.namespace</computeroutput> value to <computeroutput>dashboard</computeroutput> in the <filename>jboss-portal.sar/conf/config.xml</filename> file:
- </para>
- <para>
-<programlisting><![CDATA[
-<!-- Namespace to use when logging-in, use "dashboard" to directly
-log-in the dashboard otherwise use "default" -->
-<entry key="core.login.namespace">dashboard</entry>
-]]></programlisting>
- </para>
- </section>
- </section>
- <section id="desc_examples">
- <title>Descriptor Examples</title>
- <section id="desc_example_page">
- <title>Defining a new Portal Page</title>
- <para>
- The sample application descriptor in this section creates a new page, <computeroutput>MyPage</computeroutput>, in a portal. To illustrate this example, download the <ulink url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles/HelloWorl...">HelloWorldPortalPage</ulink> portlet. To use the HelloWorldPortalPage portlet:
- </para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- Download the <ulink url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles/HelloWorl...">HelloWorldPortalPage</ulink> portlet.
- </para>
- </listitem>
- <listitem>
- <para>
- Unzip the <filename>HelloWorldPortalPage</filename> ZIP file.
- </para>
- </listitem>
- <listitem>
- <para>
- To expand the WAR file, which gives you access to the XML descriptors, change into the <filename>HelloWorldPortalPage/</filename> directory, and run the <command>ant explode</command> command.
- </para>
- </listitem>
- <listitem>
- <para>
- If you did not expand the <filename>helloworldportalpage.war</filename> file, copy the <filename>helloworldportalpage.war</filename> file into the correct JBoss AS or JBoss EAP <filename>deploy/</filename> directory. If you expanded the <filename>helloworldportalpage.war</filename> file, copy the <filename>HelloWorldPortalPage/output/lib/exploded/helloworldportalpage.war/</filename> directory into the correct JBoss AS or JBoss EAP <filename>deploy/</filename> directory. For example, if you are using the <computeroutput>default</computeroutput> JBoss AS profile, copy the WAR file or the expanded directory into the <filename>$JBOSS_HOME/server/default/deploy/</filename> directory.
- </para>
- </listitem>
- </orderedlist>
- </para>
- <para>
- The HelloWorldPortalPage portlet is hot-deployable, so the JBoss EAP or JBoss AS server does not have to be restarted after deploying the HelloWorldPortalPage portlet. The following is an example of the <filename>HelloWorldPortalPage/WEB-INF/helloworld-object.xml</filename> descriptor:
- </para>
- <para>
-<programlisting><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE deployments PUBLIC
- "-//JBoss Portal//DTD Portal Object 2.6//EN"
- "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
-<deployments>
- <deployment>
- <if-exists>overwrite</if-exists>
- <parent-ref>default</parent-ref>
- <properties/>
- <page>
- <page-name>MyPage</page-name>
- <window>
- <window-name>HelloWorldPortletPageWindow</window-name>
- <instance-ref>HelloWorldPortletPageInstance</instance-ref>
- <region>center</region>
- <height>0</height>
- </window>
- <security-constraint>
- <policy-permission>
- <unchecked/>
- <action-name>viewrecursive</action-name>
- </policy-permission>
- </security-constraint>
- </page>
- </deployment>
-</deployments>]]>
-</programlisting>
- </para>
- <para>
- A depoloyment is composed of a <computeroutput><deployments></computeroutput> element, which is a container for <computeroutput><deployment></computeroutput> elements. In the previous example, a page is defined, the portlet is placed as a window on a page, and an instance of the portlet is created. The Mangement portlet (bundled with JBoss Portal) can modify portal instances, page position, and so on.
- </para>
- <para>
- The following list describes elements in a <filename>*-object.xml</filename> file:
- </para>
- <para>
- <itemizedlist>
- <listitem>
-<programlisting>
-<if-exists>
-</programlisting>
- <para>
- The <computeroutput><if-exists></computeroutput> element defines the action to take if an instance with the same name already exists. Accepted values are <computeroutput>overwrite</computeroutput> and <computeroutput>keep</computeroutput>. The <computeroutput>overwrite</computeroutput> option destroys the existing object, and creates a new one based on the content of the deployment. The <computeroutput>keep</computeroutput> option matains the existing object deployment, or creates a new one if it does not exist.
- </para>
- </listitem>
- <listitem>
-<programlisting>
-<parent-ref>
-</programlisting>
- <para>
- The <computeroutput><parent-ref></computeroutput> element contains a reference to the parent object. The naming convention for naming objects is to concatenate the names of the path to the object, and separate the names using a period. If the path is empty, the empty string must be used. The <computeroutput><parent-ref></computeroutput> element tells the portal where the portlet appears. The syntax for the <computeroutput><parent-ref></computeroutput> element is <computeroutput><replaceable>portal-instance</replaceable>.<replaceable>portal-page</replaceable></computeroutput>.
- </para>
- </listitem>
- <listitem>
-<programlisting>
-<properties>
-</programlisting>
- <para>
- A set of generic properties for the portal object. The <computeroutput><properties></computeroutput> elements contains definitions specific to a page. This is commonly used to define the specific theme and layout to use. If not defined, the default portal theme and layout are used.
- </para>
- </listitem>
- <listitem>
-<programlisting>
-<page>
-</programlisting>
- <para>
- The start of a page definition. Among others, the <computeroutput><page></computeroutput> element is a container for the <computeroutput><page-name></computeroutput>, <computeroutput><window></computeroutput>, and <computeroutput><security-constraint></computeroutput> elements.
- </para>
- </listitem>
- <listitem>
-<programlisting>
-<page-name>
-</programlisting>
- <para>
- The page name.
- </para>
- </listitem>
- <listitem>
-<programlisting>
-<window>
-</programlisting>
- <para>
- The <computeroutput><window></computeroutput> element defines a portlet window. The <computeroutput><window></computeroutput> element requires an <computeroutput><instance-ref></computeroutput> element, which assigns a portal instance to a window.
- </para>
- </listitem>
- <listitem>
-<programlisting>
-<window-name>
-</programlisting>
- <para>
- The <computeroutput><window-name></computeroutput> element defines the <emphasis role="bold">unique name</emphasis> given to a portlet window. This can be named anything.
- </para>
- </listitem>
- <listitem>
-<programlisting>
-<instance-ref>
-</programlisting>
- <para>
- The <computeroutput><instance-ref></computeroutput> elements define the portlet instances that windows represent. This value is the ID of a portlet instance, and must match the value of one of the <computeroutput><instance-id></computeroutput> elements in the <filename>WEB-INF/portlet-instances.xml</filename> file.
- </para>
- </listitem>
- <listitem>
-<programlisting>
-<region>...</region>
-<height>...</height>
-</programlisting>
- <para>
- The <computeroutput><region></computeroutput> and <computeroutput><height></computeroutput> elements define where the window appears within the page layout. The <computeroutput><region></computeroutput> element specifies where the window appears on the page. The <computeroutput><region></computeroutput> element often depends on other regions defined in the portal layout. The <computeroutput><height></computeroutput> element can be assigned a value between one and <replaceable>X</replaceable>.
- </para>
- </listitem>
- <listitem>
-<programlisting>
-<instance>
-</programlisting>
- <para>
- The <computeroutput><instance></computeroutput> element creates instances of portlets. The portlet will only be created and configured if the portlet is present, and if an instance with the same name does not already exist.
- </para>
- </listitem>
- <listitem>
-<programlisting>
-<instance-name>
-</programlisting>
- <para>
- The <computeroutput><instance-name></computeroutput> element maps to the <computeroutput><instance-ref></computeroutput> element.
- </para>
- </listitem>
- <listitem>
-<programlisting>
-<component-ref>
-</programlisting>
- <para>
- The <computeroutput><component-ref></computeroutput> element takes the name of the application, followed by the name of the portlet, as defined in the <filename>WEB-INF/portlet.xml</filename> file.
- </para>
- </listitem>
- </itemizedlist>
-</para>
-<para>
- The <computeroutput><security-constraint></computeroutput> element is a container for <computeroutput><policy-permission></computeroutput> elements. The following is an example of the <computeroutput><security-constraint></computeroutput> and <computeroutput><policy-permission></computeroutput> elements:
-</para>
-<para>
-<programlisting><![CDATA[
-<security-constraint>
- <policy-permission>
- <role-name>User</role-name>
- <action-name>view</action-name>
- </policy-permission>
-</security-constraint>
-
-<security-constraint>
- <policy-permission>
- <unchecked/>
- <action-name>view</action-name>
- </policy-permission>
-</security-constraint>]]>
-</programlisting>
-</para>
-<para>
-<programlisting>
-<action-name>
-</programlisting>
- </para>
- <para>
- The <computeroutput><action-name></computeroutput> element defines the access rights given to the role defined. Accepted values are:
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- <computeroutput>view</computeroutput>: users can view the page.
- </para>
- </listitem>
- <listitem>
- <para>
- <computeroutput>viewrecursive</computeroutput>: users can view the page and child pages.
- </para>
- </listitem>
- <listitem>
- <para>
- <computeroutput>personalize</computeroutput>: users are able personalize the page's theme.
- </para>
- </listitem>
- <listitem>
- <para>
- <computeroutput>personalizerecursive</computeroutput>: users are able personalize the page and child pages themes.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
-<programlisting>
-<unchecked/>
-</programlisting>
- </para>
- <para>
- If present, the <computeroutput><unchecked></computeroutput> element defines that anyone can view the instance.
- </para>
- <para>
-<programlisting>
-<role-name>
-</programlisting>
- </para>
- <para>
- The <computeroutput><role-name></computeroutput> element defines a role that the security constraint will apply to. The following example only allows users that are part of the <computeroutput>EXAMPLEROLE</computeroutput> role to access the instance:
- </para>
- <para>
-<programlisting>
-<role-name>EXAMPLEROLE</role-name>
-</programlisting>
- </para>
- </section>
- <section id="desc_example_portal">
- <title>Defining a new Portal Instance</title>
- <para>
- The sample application descriptor in this section creates a new portal instance, <computeroutput>HelloPortal</computeroutput>, that contains two pages. To illustrate this example, download the <ulink url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles/HelloWorl...">HelloWorldPortal</ulink> portlet. To use the HelloWorldPortal portlet:
- </para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- Download the <ulink url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles/HelloWorl...">HelloWorldPortal</ulink> portlet.
- </para>
- </listitem>
- <listitem>
- <para>
- Unzip the <filename>HelloWorldPortal</filename> ZIP file.
- </para>
- </listitem>
- <listitem>
- <para>
- To expand the WAR file, which gives you access to the XML descriptors, change into the <filename>HelloWorldPortal/</filename> directory, and run the <command>ant explode</command> command.
- </para>
- </listitem>
- <listitem>
- <para>
- If you did not expand the <filename>helloworldportal.war</filename> file, copy the <filename>helloworldportal.war</filename> file into the correct JBoss AS or JBoss EAP <filename>deploy/</filename> directory. If you expanded the <filename>helloworldportal.war</filename> file, copy the <filename>HelloWorldPortal/output/lib/exploded/helloworldportal.war/</filename> directory into the correct JBoss AS or JBoss EAP <filename>deploy/</filename> directory. For example, if you are using the <computeroutput>default</computeroutput> JBoss AS profile, copy the WAR file or the expanded directory into the <filename>$JBOSS_HOME/server/default/deploy/</filename> directory.
- </para>
- </listitem>
- </orderedlist>
- </para>
- <para>
- The HelloWorldPortal portlet is hot-deployable, so the JBoss EAP or JBoss AS server does not have to be restarted after deploying the HelloWorldPortal portlet. The following is an example of the <filename>HelloWorldPortal/WEB-INF/helloworld-object.xml</filename> descriptor:
- </para>
- <para>
-<programlisting><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE deployments PUBLIC
- "-//JBoss Portal//DTD Portal Object 2.6//EN"
- "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
-<deployments>
- <deployment>
- <parent-ref/>
- <if-exists>overwrite</if-exists>
- <portal>
- <portal-name>HelloPortal</portal-name>
- <supported-modes>
- <mode>view</mode>
- <mode>edit</mode>
- <mode>help</mode>
- </supported-modes>
- <supported-window-states>
- <window-state>normal</window-state>
- <window-state>minimized</window-state>
- <window-state>maximized</window-state>
- </supported-window-states>
- <properties>
- <!-- Set the layout for the default portal -->
- <!-- see also portal-layouts.xml -->
- <property>
- <name>layout.id</name>
- <value>generic</value>
- </property>
- <!-- Set the theme for the default portal -->
- <!-- see also portal-themes.xml -->
- <property>
- <name>theme.id</name>
- <value>renaissance</value>
- </property>
- <!-- set the default render set name (used by the render tag in layouts) -->
- <!-- see also portal-renderSet.xml -->
- <property>
- <name>theme.renderSetId</name>
- <value>divRenderer</value>
- </property>
- </properties>
- <security-constraint>
- <policy-permission>
- <action-name>personalizerecursive</action-name>
- <unchecked/>
- </policy-permission>
- </security-constraint>
- <page>
- <page-name>default</page-name>
- <security-constraint>
- <policy-permission>
- <action-name>viewrecursive</action-name>
- <unchecked/>
- </policy-permission>
- </security-constraint>
- <window>
- <window-name>MyPortletWindow</window-name>
- <instance-ref>MyPortletInstance</instance-ref>
- <region>center</region>
- <height>0</height>
- </window>
- </page>
- </portal>
- </deployment>
- <deployment>
- <parent-ref>HelloPortal</parent-ref>
- <if-exists>overwrite</if-exists>
- <page>
- <page-name>foobar</page-name>
- <security-constraint>
- <policy-permission>
- <action-name>viewrecursive</action-name>
- <unchecked/>
- </policy-permission>
- </security-constraint>
- <window>
- <window-name>MyPortletWindow</window-name>
- <instance-ref>MyPortletInstance</instance-ref>
- <region>center</region>
- <height>0</height>
- </window>
- </page>
- </deployment>
-</deployments>]]>
-</programlisting>
- </para>
- <para>
- When deployed, this example registers a new portal instance, <computeroutput>HelloPortal</computeroutput>, that contains two pages. To view the default page in the <computeroutput>HelloPortal</computeroutput> instance, navigate to <ulink url="http://localhost:8080/portal/portal/HelloPortal"/>, and for the second page, <ulink url="http://localhost:8080/portal/portal/HelloPortal/foobar"/>.
- </para>
- <para>
- <note>
- <title>Portal Instance <computeroutput>default</computeroutput> Page</title>
- <para>
- For a portal instance to be accessible via a Web browser, you must define a default page.
- </para>
- </note>
- </para>
- </section>
- </section>
-</chapter>
- <chapter id="urls">
- <!--<chapterinfo>
- <author>
- <firstname>Julien</firstname>
- <surname>Viet</surname>
- </author>
- <author>
- <firstname>Thomas</firstname>
- <surname>Heute</surname>
- </author>
- <author>
- <firstname>Roy</firstname>
- <surname>Russo</surname>
- </author>
- </chapterinfo>-->
- <title>Portal URLs</title>
- <section>
- <title>Introduction to Portals</title>
- <para>
- Portal URLs are often very complicated; however, it is possible to setup entry points in portals that follow simple patterns.
- </para>
- <para>
- Each portal container can contain multiple portals. Within a given portal, windows are organized into pages, with a page being a collection of windows associated to a name:
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/tutorials/SpecPortalDef.png" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- Before reading the following sections, be familiar with how to define pages and portal. Refer to <xref linkend="desc_example_page"/> for details.
- </para>
- </section>
- <section>
- <title>Accessing a Portal</title>
- <para>
- The <computeroutput>default</computeroutput> portal is used when no portal is specified. How selection is done:
- </para>
-
- <itemizedlist>
- <listitem>
- <para>
- <computeroutput>/portal/</computeroutput> points to the default page of the default portal.
- </para>
- </listitem>
- <listitem>
- <para>
- <computeroutput>/portal/<replaceable>portal-name</replaceable>/</computeroutput> points to the default page of the <replaceable>portal-name</replaceable> portal.
- </para>
- </listitem>
- </itemizedlist>
-
- <note><title>Note</title><para>The default page or portal can be specified either by using the admin portlet or by using the XML descriptors as explained in the <xref linkend="xml.default.objectname.property"/>.</para></note>
-
-
- </section>
- <section>
- <title>Accessing a Page</title>
- <para>
- Each portal can have multiple pages, with each portal having a default page. When a portal is selected, a page must be used, and all windows in that page are rendered. The page selection mechanism is as follows:
- </para>
- <para>
- <computeroutput>/portal/default/<replaceable>page-name</replaceable></computeroutput> renders the <replaceable>page-name</replaceable> page.
- </para>
- </section>
- <section>
- <title>Accessing CMS Content</title>
- <para>
- The <emphasis>CMSPortlet</emphasis> delivers content transparently, without modifying the displayed URL. It is desirable to display binary content, such as GIF, JPEG, PDF, ZIP, and so on, outside of the confines of the portal. For example, <computeroutput>/content/default/images/jboss_logo.gif</computeroutput> displays the <computeroutput>jboss_logo.gif</computeroutput> file outside of the portal.
- </para>
- <para>
- To display content outside of the portal, the portal interprets any path beginning with <computeroutput>/content</computeroutput> as a request for CMS content. As long as the <computeroutput><mime-type></computeroutput> is not <computeroutput>text/html</computeroutput>, or <computeroutput>text/text</computeroutput>, and the path to the content begins with <computeroutput>/content</computeroutput>, the content is rendered independently, outside of the portal.
- </para>
- </section>
- <!--
- <section>
- <title>Advanced portal urls</title>
- <para>JBoss Portal can consume and produce URLs in a very flexible manner. Consuming means
- that an URL is accepted by the portal, translated into some action and send a response to the
- browser. Producing means to create an URL for a particular action when the portal needs one.
- This part is an advanced topic explaining the internal mechanisms developped in JBoss Portal to
- produce and consumer URLs. It should be readen with care as it exposes internals of JBoss Portal
- that may change in later releases of the product.</para>
- <para>JBoss Portal url handling mechanism is based on several design patterns.</para>
- <section>
- <title>Portal Commands</title>
- <para></para>
- </section>
- <section>
- <title>Portal urls</title>
- <para>At runtime portal commands are converted back and forth into portal urls. Creation
- of urls and decoding of urls is now known at compile time, otherwise that would lead
- to a very inflexible portal since changing the behavior would imply to update the source
- code and recompile the portal, that would not be an acceptable solution. There is
- a well known design pattern which provides an elegant and powerful solution to this problem and
- is called Chain of Responsibility.</para>
- <para>Portal commands have a state which parameterizes them. For instance there is a command
- called <emphasis>ViewPageCommand</emphasis> which displays a portal page in the browser. The state
- of that command consist in the id of the page. There is a bidirectionnal mapping between portal urls
- and portal commands. Portal commands are created from URL using a service called <emphasis>CommandFactory</emphasis>,
- which takes a request object and provides a portal command. Conversely, portal urls are created from
- portal commands using a service called <emphasis>URLFactory</emphasis>.</para>
- <para>The task of decoding urls is performed by a set of command factories which are wired
- together in the configuration file. We can dist</para>
- </section>
- </section>
- -->
-</chapter>
- <chapter id="coordination">
- <!--<chapterinfo>
- <author>
- <firstname>Boleslaw</firstname>
- <surname>Dawidowicz</surname>
- </author>
- </chapterinfo>-->
- <title>JBoss Portal Explicit Coordination</title>
- <section>
- <title>Explicit vs implicit coordination</title>
- <para>
- Portlet 2.0 coordination features are mediated by the portal between several
- portlet windows, therefore the portal at runtime needs to be able to define
- relationships between windows. Relationship can be established from an implicit
- model (i.e a set of predicates applied on some state that will answer TRUE/FALSE
- to the question are the portlet windows foo and bar in a relationship) or from an
- explicit model (that states that foo and bar have a relationship). The implicit
- model is very good for defining default configuration as it does not require much
- configuration but is not able to cover the exceptional case, that's why we need
- to combine it with an explicit model that will take precedence over the implicit
- model, it is the well known principle of convention over configuration.
- </para>
- <para>
- Currently all explicit coordination happens only in the scope of the same page.
- </para>
- </section>
- <section>
- <title>Bindings and wirings</title>
-
- <section>
- <title>Event wiring</title>
-
- <para>
- Wires JSR-286 events. With implicit wirings the event producer and the
- consumer declares the same event namespace and local name to get event
- delivered in the scope of the same page. With explicit wiring any pairs of
- Window:Event can be connected.
- </para>
- </section>
- <section>
- <title>Parameter binding</title>
-
- <para>
- Binds JSR-286 shared parameters. With implicit binding parameters with the
- same public name are shared. With explicit binding any public parameters can
- share values. Windows for which such binding applies are explicitly defined.
- </para>
- </section>
- <section>
- <title>Alias binding</title>
-
- <para>
- Explicit alias binding define a name of page scoped parameter that will apply
- value to specified portlet windows public parameters.
- </para>
-
- <programlisting><![CDATA[http://localhost:8080/portal/portal/default/Coordination+Samples?aliasBinding1=someValue]]></programlisting>
- </section>
- </section>
- <section>
- <title>Coordination configuration</title>
-
- <para>
- Configuration takes place in -object.xml file. The <coordination> tag
- can be used in both <page> and <portal> tags. When used in
- <portal> tag only <implicit-mode> tag can be defined for wirings
- and bindings:
- </para>
-
- <programlisting role="XML"><![CDATA[<portal>
-
- ...
-
- <coordination>
- <bindings>
- <implicit-mode>TRUE</implicit-mode>
- </bindings>
- <wirings>
- <implicit-mode>FALSE</implicit-mode>
- </wirings>
- </coordination>
-
-</portal>]]></programlisting>
- <para>
- When used within the <page> tag coordination event wirings and bindings
- can be defined:</page></para>
-
- <programlisting role="XML"><![CDATA[<coordination>
-
- <wirings>
- <implicit-mode>TRUE</implicit-mode>
- <event-wiring>
- <name>eventWiring1</name>
- <sources>
- <window-coordination>
- <window-name>ShoppingCatalogPortletWindow1</window-name>
- <qname>{urn:jboss:portal:samples:event}CartEvent</qname>
- </window-coordination>
- </sources>
- <destinations>
- <window-coordination>
- <window-name>ShoppingCartPortletWindow2</window-name>
- <qname>{urn:jboss:portal:samples:event}CartEvent</qname>
- </window-coordination>
- <window-coordination>
- <window-name>ShoppingCartPortletWindow3</window-name>
- <qname>{urn:jboss:portal:samples:event}CartEvent</qname>
- </window-coordination>
- </destinations>
- </event-wiring>
- <event-wiring>
- <name>eventWiring2</name>
- <sources>
- <window-coordination>
- <window-name>ShoppingCatalogPortletWindow2</window-name>
- <qname>{urn:jboss:portal:samples:event}CartEvent</qname>
- </window-coordination>
- </sources>
- <destinations>
- <window-coordination>
- <window-name>ShoppingCartPortletWindow1</window-name>
- <qname>{urn:jboss:portal:samples:event}CartEvent</qname>
- </window-coordination>
- <window-coordination>
- <window-name>ShoppingCartPortletWindow4</window-name>
- <qname>{urn:jboss:portal:samples:event}CartEvent</qname>
- </window-coordination>
- </destinations>
- </event-wiring>
- </wirings>
-
-
- <bindings>
- <implicit-mode>FALSE</implicit-mode>
-
- <parameter-binding>
- <id>parameterBinding1</id>
- <window-coordination>
- <window-name>SomePortletWindow1</window-name>
- <qname>foo</qname>
- </window-coordination>
- <window-coordination>
- <window-name>SomePortletWindow2</window-name>
- <qname>foo</qname>
- </window-coordination>
- <window-coordination>
- <window-name>SomePortletWindow3</window-name>
- <qname>foo</qname>
- </window-coordination>
- </parameter-binding>
-
- <parameter-binding>
- <id>parameterBinding2</id>
- <window-coordination>
- <window-name>SomePortletWindow1</window-name>
- <qname>bar1</qname>
- </window-coordination>
- <window-coordination>
- <window-name>SomePortletWindow2</window-name>
- <qname>{urn:jboss:portal:samples:daa1}daa1</qname>
- </window-coordination>
- </parameter-binding>
-
- <alias-binding>
- <id>aliasBinding1</id>
- <qname>foo</qname>
- </alias-binding>
-
- <alias-binding>
- <id>aliasBinding2</id>
- <qname>bar1</qname>
- <qname>{urn:jboss:portal:samples:daa2}daa2</qname>
- </alias-binding>
-
- </bindings>
-</coordination>]]></programlisting>
-
- <section>
- <title><implicit-mode></title>
-
- <para>
- This tag can be applied for both <bindings> and <wirings>
- tags. It defines if implicit coordination is enabled or disabled for
- this given portal object. Value of this setting is cascaded to all
- children in portal object tree unless overwritten somewhere in the
- hierarchy. If no <implicit-mode> is defined in portal object tree
- default value is TRUE.
- </para>
- </section>
- </section>
- <section>
- <title>Coordination Samples</title>
- <para>
- JBoss Portal comes with several examples in 'Coordination Samples' page. Its good
- to follow them looking at the configuration file that can be found in
- portal-coordination-samples.war/WEB-INF/default-object.xml
- </para>
- </section>
-</chapter>
- <chapter id="errorhandling">
- <!-- <chapterinfo>
- <author>
- <firstname>Julien</firstname>
- <surname>Viet</surname>
- </author>
- </chapterinfo>-->
- <title>Error Handling Configuration</title>
- <para>
- The JBoss Portal request pipeline allows fine-grained, dynamic configuration of how JBoss Portal behaves when errors occur during runtime.
- </para>
- <section>
- <title>Error Types</title>
- <para>There are several types of errors that can occur during a request:
- <itemizedlist>
- <listitem>
- <para>
- <emphasis>Access denied</emphasis>: the user does not have the required permissions to access the resource.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>Error</emphasis>: an anticipated error, such as when a portlet throws an exception.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>Internal error</emphasis>: an unexpected error.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>Resource not found</emphasis>: the resource was not found.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>Resource unavailable</emphasis>: the resource was found, but was not serviceable.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>Control Policies</title>
- <para>If an error occurs, the request control-flow changes according to the configuration. This configuration is known as the <emphasis>control policy</emphasis>.
- </para>
- <section>
- <title>Policy Delegation and Cascading</title>
- <para>
- When a control policy is invoked, the response sent by the control flow can be changed. If the control policy ignores the error, the error is handled by the next policy. If the control policy provides a new response, the next policy is not invoked, since the new response is not an error.
- </para>
- <para>
- If a portlet in a page produces an exception, the following reactions are possible:
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- the error is displayed in the window.
- </para>
- </listitem>
- <listitem>
- <para>
- the window is removed from the aggregation.
- </para>
- </listitem>
- <listitem>
- <para>
- a portal error page is displayed.
- </para>
- </listitem>
- <listitem>
- <para>
- a HTTP 500 error response is sent to the Web browser.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>Default Policy</title>
- <para>The default policy applies when errors are not handled by another level. By default, errors are translated
- into the most appropriate HTTP response:
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- Access denied: <computeroutput>HTTP 403 Forbidden</computeroutput>
- </para>
- </listitem>
- <listitem>
- <para>
- Error: <computeroutput>HTTP 500 Internal Server Error</computeroutput>
- </para>
- </listitem>
- <listitem>
- <para>
- Internal error: <computeroutput>HTTP 500 Internal Server Error</computeroutput>
- </para>
- </listitem>
- <listitem>
- <para>
- Resource not found: <computeroutput>HTTP 404 Not Found</computeroutput>
- </para>
- </listitem>
- <listitem>
- <para>
- Resource unavailable: <computeroutput>HTTP 404 Not Found</computeroutput>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>Portal Policy</title>
- <para>
- The portal error-policy controls the response sent to the Web browser when an error occurs. A default error policy exists, which can be configured per portal. If an error occurs, the policy can either handle a redirect to a JSP page, or ignore it. If the error is ignored, it is handled by the default policy, otherwise a JSP page is invoked with the appropriate request attributes, allowing page customization.
- </para>
- </section>
- <section>
- <title>Page Policy</title>
- <para>
- The window error-policy controls how pages react to aggregation errors. Most of the time pages are an aggregation of several portlet windows, and the action to take when an error occurs differs from other policies. When an error occurs, the policy can either handle it, or ignore it. If the error is ignored, it is handled by the portal policy. Possible actions taken after such errors are:
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- remove the window from the aggregation.
- </para>
- </listitem>
- <listitem>
- <para>
- replace the markup of the window using a redirect to a JSP page.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- </section>
- <section>
- <title>Configuration using XML Descriptors</title>
- <para>
- Different policies are configured using portal object properties, allowing the error-handling policy for objects to be configured in XML descriptors -- the <filename>*-object.xml</filename> files -- for a portal deployment.
- </para>
- <section>
- <title>Portal Policy Properties</title>
- <para>
- A set of properties configure the the behavior of the portal policy. These properties are only taken into account for objects that use the <emphasis>portal</emphasis> type. The following table represents possible portal-policy properties:
- </para>
-
- <table frame="all"><title/>
- <tgroup cols="3" align="left" colsep="1">
- <colspec colname="c1"/>
- <colspec colname="c2"/>
- <colspec colname="c3"/>
- <thead>
- <row>
- <entry align="center">Property Name</entry>
- <entry align="center">Description</entry>
- <entry align="center">Possible Values</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry align="center"><computeroutput>control.portal.access_denied</computeroutput></entry>
- <entry align="center">when access is denied</entry>
- <entry align="center"><computeroutput>ignore</computeroutput> and <computeroutput>jsp</computeroutput></entry>
- </row>
- <row>
- <entry align="center"><computeroutput>control.portal.unavailable</computeroutput></entry>
- <entry align="center">when a resource is unavailable</entry>
- <entry align="center"><computeroutput>ignore</computeroutput> and <computeroutput>jsp</computeroutput></entry>
- </row>
- <row>
- <entry align="center"><computeroutput>control.portal.not_found</computeroutput></entry>
- <entry align="center">when a resource is not found</entry>
- <entry align="center"><computeroutput>ignore</computeroutput> and <computeroutput>jsp</computeroutput></entry>
- </row>
- <row>
- <entry align="center"><computeroutput>control.portal.internal_error</computeroutput></entry>
- <entry align="center">when an unexpected error occurs</entry>
- <entry align="center"><computeroutput>ignore</computeroutput> and <computeroutput>jsp</computeroutput></entry>
- </row>
- <row>
- <entry align="center"><computeroutput>control.portal.error</computeroutput></entry>
- <entry align="center">when an expected error occurs</entry>
- <entry align="center"><computeroutput>ignore</computeroutput> and <computeroutput>jsp</computeroutput></entry>
- </row>
- <row>
- <entry align="center"><computeroutput>control.portal.resource_uri</computeroutput></entry>
- <entry align="center">the path to the JSP used for redirections</entry>
- <entry align="center">a valid path to a JSP located in the <filename>portal-core.war/</filename> directory</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
-
- <para>
- The following portal configuration demonstrates the use of portal-policy properties:
- </para>
- <para>
-<programlisting><![CDATA[
-<portal>
- <portal-name>MyPortal</portal-name>
- ...
- <properties>
- <property>
- <name>control.portal.access_denied</name>
- <value>ignore</value>
- </property>
- <property>
- <name>control.portal.unavailable</name>
- <value>ignore</value>
- </property>
- <property>
- <name>control.portal.not_found</name>
- <value>ignore</value>
- </property>
- <property>
- <name>control.portal.internal_error</name>
- <value>jsp</value>
- </property>
- <property>
- <name>control.portal.error</name>
- <value>jsp</value>
- </property>
- <property>
- <name>control.portal.resource_uri</name>
- <value>/WEB-INF/jsp/error/portal.jsp</value>
- </property>
- ...
- </properties>
- ...
-</portal>
-]]></programlisting>
- </para>
- </section>
- <section>
- <title>Page Policy Properties</title>
- <para>
- A set of properties configure the behavior of the page policy. These properties are only taken into account for objects that use the <emphasis>portal</emphasis> type. The following table represents possible page-policy properties:
- </para>
- <para>
- <table frame="all"><title/>
- <tgroup cols="3" align="left" colsep="1">
- <colspec colname="c1"/>
- <colspec colname="c2"/>
- <colspec colname="c3"/>
- <thead>
- <row>
- <entry align="center">Property name</entry>
- <entry align="center">Description</entry>
- <entry align="center">Possible values</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry align="center"><computeroutput>control.page.access_denied</computeroutput></entry>
- <entry align="center">when access is denied</entry>
- <entry align="center"><computeroutput>ignore</computeroutput>, <computeroutput>jsp</computeroutput> and <computeroutput>hide</computeroutput></entry>
- </row>
- <row>
- <entry align="center"><computeroutput>control.page.unavailable</computeroutput></entry>
- <entry align="center">when a resource is unavailable</entry>
- <entry align="center"><computeroutput>ignore</computeroutput>, <computeroutput>jsp</computeroutput> and <computeroutput>hide</computeroutput></entry>
- </row>
- <row>
- <entry align="center"><computeroutput>control.page.not_found</computeroutput></entry>
- <entry align="center">when a resource is not found</entry>
- <entry align="center"><computeroutput>ignore</computeroutput>, <computeroutput>jsp</computeroutput> and <computeroutput>hide</computeroutput></entry>
- </row>
- <row>
- <entry align="center"><computeroutput>control.page.internal_error</computeroutput></entry>
- <entry align="center">when an unexpected error occurs</entry>
- <entry align="center"><computeroutput>ignore</computeroutput>, <computeroutput>jsp</computeroutput> and <computeroutput>hide</computeroutput></entry>
- </row>
- <row>
- <entry align="center"><computeroutput>control.page.error</computeroutput></entry>
- <entry align="center">when an expected error occurs</entry>
- <entry align="center"><computeroutput>ignore</computeroutput>, <computeroutput>jsp</computeroutput> and <computeroutput>hide</computeroutput></entry>
- </row>
- <row>
- <entry align="center"><computeroutput>control.page.resource_uri</computeroutput></entry>
- <entry align="center">the path to the JSP used for redirections</entry>
- <entry align="center"><computeroutput>ignore</computeroutput>, <computeroutput>jsp</computeroutput> and <computeroutput>hide</computeroutput></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </para>
- <para>
- The following page configuration demonstrates the use of page-policy properties:
- </para>
- <para>
-<programlisting><![CDATA[
-<page>
- <page-name>MyPortal</page-name>
- ...
- <properties>
- <property>
- <name>control.page.access_denied</name>
- <value>hide</value>
- </property>
- <property>
- <name>control.page.unavailable</name>
- <value>hide</value>
- </property>
- <property>
- <name>control.page.not_found</name>
- <value>hide</value>
- </property>
- <property>
- <name>control.page.internal_error</name>
- <value>jsp</value>
- </property>
- <property>
- <name>control.page.error</name>
- <value>jsp</value>
- </property>
- <property>
- <name>control.page.resource_uri</name>
- <value>/WEB-INF/jsp/error/page.jsp</value>
- </property>
- ...
- </properties>
- ...
-</page>
-]]></programlisting>
- </para>
- <para>
- <note>
- <title>Page Property Inheritance for Objects</title>
- <para>
- When page properties are configured for objects that use the <emphasis>portal</emphasis> type, the properties are inherited by pages in that portal.
- </para>
- </note>
- </para>
-</section>
- </section>
- <section>
- <title>Using <trademark class="trade">JSP</trademark> to Handle Errors</title>
- <para>
- As described in previous sections, error handling can be redirected to a <trademark class="trade">JSP</trademark> page. Two pages can be created to handle errors: one for the portal level, and the other for the page level. Portal level error-handling requires a page that produces a full page, and page-level handling requires a page that produces markup, but only for a window. When the page is invoked, a set of request attributes are passed. The following table represents possible request attributes:
- </para>
- <para>
- <table frame="all"><title/>
- <tgroup cols="3" align="left" colsep="1">
- <colspec colname="c1"/>
- <colspec colname="c2"/>
- <colspec colname="c3"/>
- <thead>
- <row>
- <entry align="center">Attribute Name</entry>
- <entry align="center">Attribute Description</entry>
- <entry align="center">Attribute Value</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry align="center"><computeroutput>org.jboss.portal.control.ERROR_TYPE</computeroutput></entry>
- <entry align="center">the error type</entry>
- <entry align="center">possible values are <computeroutput>ACCESS_DENIED</computeroutput>, <computeroutput>UNAVAILABLE</computeroutput>, <computeroutput>ERROR</computeroutput>, <computeroutput>INTERNAL_ERROR</computeroutput>, and <computeroutput>NOT_FOUND</computeroutput></entry>
- </row>
- <row>
- <entry align="center"><computeroutput>org.jboss.portal.control.CAUSE</computeroutput></entry>
- <entry align="center">a cause which is thrown, that can be null</entry>
- <entry align="center">the object is a subclass of <computeroutput>java.lang.Throwable</computeroutput></entry>
- </row>
- <row>
- <entry align="center"><computeroutput>org.jboss.portal.control.MESSAGE</computeroutput></entry>
- <entry align="center">an error message that can be null</entry>
- <entry align="center">text</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </para>
- <para>
- <note>
- <title><trademark class="trade">JSP</trademark> Location</title><para>
- The JavaServer Pages must be located in the <filename>jboss-portal.sar/portal-core.war/</filename> web application.</para>
- </note>
- </para>
- </section>
- <section>
- <title>Configuration using the Portal Management Application</title>
- <para>
- The error handling policy can be configured via the portal management application. To access the portal management application:
- </para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- Use a Web browser to navigate to <ulink url="http://localhost:8080/portal"/>.
- </para>
- </listitem>
- <listitem>
- <para>
- Click the <guibutton>Login</guibutton> button on the top right-hand of the welcome page, and log in as the <option>admin</option> user.
- </para>
- </listitem>
- <listitem>
- <para>
- Click the <guibutton>Admin</guibutton> tab on the top right-hand of the welcome page. Four tabs will appear on the left-hand side of the page.
- </para>
- </listitem>
- <listitem>
- <para>
- Click the <guibutton>Admin</guibutton> tab to open the portal management application, and then click the <guibutton>Portal Objects</guibutton> tab to display available portals.
- </para>
- </listitem>
- </orderedlist>
- </para>
- <para>
- Configuration options are available as part of the properties for each configuration level. You can specify the default error handling policy (at the root of the portal object hierarchy) for each portal, or each page, by clicking on the <guibutton>Properties</guibutton> button for each page or portal:
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/errorhandling/errorHandling_management.png" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- As well, you can specify how dashboards should behave with respect to error handling, by clicking on the <guibutton>Dashboards</guibutton> tab in the portal management application:
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/errorhandling/errorHandlingUI.png" align="center" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- The page specified with <computeroutput>On error redirect to this resource</computeroutput> is used when the <option>Redirect to the specified resource</option> action is selected for an error type, such as <computeroutput>When access to the page is denied</computeroutput>. After making changes, click the <guibutton>Update</guibutton> button for settings to take effect.
- </para>
- </section>
-</chapter>
- <chapter id="contentintegration">
-<!-- <chapterinfo>
- <author>
- <firstname>Julien</firstname>
- <surname>Viet</surname>
- </author>
- <author>
- <firstname>Thomas</firstname>
- <surname>Heute</surname>
- </author>
- </chapterinfo>-->
- <title>Content Integration</title>
- <para>Since JBoss Portal 2.6 it is possible to provide an easy integration of content within the portal. Up to the 2.4 version
- content integration had to be done by configuring a portlet to show some content from an URI and then place that
- portlet on a page. The new content integration capabilities allows to directly configure a page window with the content URI by
- removing the need to configure a portlet for that purpose.</para>
- <note><title>Note</title><para>We do not advocate to avoid the usage portlet preferences, we rather advocate that content configuration managed at the portal level
- simplifies the configuration: it helps to make content a first class citizen of the portal instead of having an intermediary
- portlet that holds the content for the portal. The portlet preferences can still be used to configure how content is displayed
- to the user.</para></note>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/content/before.png" scalefit="1"/>
- </imageobject>
-
- </mediaobject>
- <para>The portal uses portlets to configure content</para>
-
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/content/after.png" scalefit="1"/>
- </imageobject>
-
- </mediaobject>
- <para>The portal references directly the content and use portlet to interact with content</para>
-
- <section>
- <title>Window content</title>
- <para>The content of a window is defined by
- <itemizedlist>
- <listitem><para>The content URI which is the resource that the window is pointing to. It is an arbitrary string that
- the portal cannot interpret and is left up to the content provider to interpret.</para></listitem>
- <listitem><para>The window content type which defines how the portal interpret the window content
- <itemizedlist>
- <listitem><para>The default content type is for portlets and has the value <emphasis>portlet</emphasis>. In this
- case the content URI is the portlet instance id.</para></listitem>
- <listitem><para>The CMS content type allows to integrate content from the CMS at the page and it has the value
- <emphasis>cms</emphasis>. For that content type, the content URI is the CMS file path.</para></listitem>
- </itemizedlist></para>
- </listitem>
- <listitem><para>The content parameters which are a set of additional key/value string pairs holding state that is interpreted
- by the content provider.</para></listitem>
- </itemizedlist>
- </para>
- <para>At runtime when the portal needs to render a window it delegates the production of markup to a content provider.
- The portal comes with a preconfigured set of providers which handles the portlet and the cms content types. The most
- natural way to plug a content provider in the portal is to use a JSR 286 Portlet. Based on a few carefully chosen conventions
- it is possible to provide an efficient content integration with the benefit of using standards and without requiring
- the usage of a proprietary API.</para>
- </section>
- <section>
- <title>Content customization</title>
- <para>Content providers must be able to allow the user or administrator to chose content from the external resource
- it integrates in the portal in order to properly configure a portal window. A few interactions between the portal, the content
- provider and the portal user are necessary to achieve that goal. Here again it is possible to provide content
- customization using a JSR 286 Portlet. For that purpose two special portlet modes called
- <emphasis>edit_content</emphasis> and <emphasis>select_content</emphasis> has been introduced. It signals to the portlet
- that it is selecting or editing the content portion of the state of a portlet. <emphasis>select_content</emphasis> is
- used to select a new content to put in a window while <emphasis>edit_content</emphasis> is used to modify the previously
- defined content, often the two modes will display the same thing. The traditional edit mode is not used because the edit mode
- is more targeted to configure how the portlet shows content to the end user rather than what content it shows.</para>
-<mediaobject>
-<imageobject>
- <imagedata align="center" fileref="images/content/cms.png" scalefit="1"/>
- </imageobject>
-</mediaobject>
- <para>Example of content customization - CMS Portlet</para>
- </section>
- <section>
- <title>Content Driven Portlet</title>
- <para>Portlet components are used to integrate content into the portal. It relies on a few conventions which allow
- the portal and the portlet to communicate.
- </para>
- <section>
- <title>Displaying content</title>
- <para>At runtime the portal will call the portlet with the view mode when it displays content. It will send
- information about the content to display using the public render parameter <emphasis>urn:jboss:portal:content uri</emphasis> to the portlet. Therefore the portlet has
- just to read the render parameters and use them to properly display the content in the portlet. The public render parameters
- values are the key/value pairs that form the content properties and the resource URI of the content to display.</para>
- </section>
- <section>
- <title>Configuring content</title>
- <para>As explained before, the portal will call the portlet using the <emphasis>edit_content</emphasis> mode.
- In that mode the portlet and the portal will communicate using either action or render parameters. We have two use cases
- which are:
- <itemizedlist>
- <listitem><para>The portal needs to configure a new content item for a new window. In that use case the portal will not send special
- render parameters to the portlet and the initial set of render parameters will be empty. The portlet can
- then use render parameters in order to provide navigation in the content repository. For example the portlet
- can navigate the CMS tree and store the current CMS path in the render parameters. Whenever the portlet has decided
- to tell the portal that content has been selected by the user it needs to trigger a JSR-286 event with the uri and eventual parameters as payload.</para>
- </listitem>
- <listitem><para>The second use case happens when the portal needs to edit existing content. In such situation
- everything works as explained before except that the initial set of render parameters of the portlet
- will be prepopulated with the content uri URI and parameters.</para></listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>Step by step example of a content driven portlet</title>
- <para/>
- <section>
- <title>The Portlet skeleton</title>
- <para>Here is the base skeleton of the content portlet. The FSContentDrivenPortlet shows the files which are
- in the war file in which the portlet is deployed. The arbitrary name <emphasis>filesystem</emphasis>
- will be the content type interpreted by the portlet.
- </para>
- <programlisting><![CDATA[
-public class FSContentDrivenPortlet extends GenericPortlet
-{
-
- /** The edit_content mode. */
- public static final PortletMode EDIT_CONTENT_MODE = new PortletMode("edit_content");
-
- ...
-
-}
-]]></programlisting>
- </section>
- <section>
- <title>Overriding the dispatch method</title>
- <para>First the <emphasis>doDispatch(RenderRequest req, RenderResponse resp)</emphasis> is overridden in order
- to branch the request flow to a method that will take care of displaying the editor.</para>
- <programlisting><![CDATA[
-protected void doDispatch(RenderRequest req, RenderResponse resp)
- throws PortletException, PortletSecurityException, IOException
-{
- if (EDIT_CONTENT_MODE.equals(req.getPortletMode()))
- {
- doEditContent(req, resp);
- }
- else
- {
- super.doDispatch(req, resp);
- }
-}
-]]></programlisting>
- </section>
- <section>
- <title>Utilities methods</title>
- <para>The portlet also needs a few utilities methods which take care of converting content URI to a file
- back and forth. There is also an implementation of a file filter that keep only text files and avoid the
- WEB-INF directory of the war file for security reasons.</para>
- <programlisting><![CDATA[
-protected File getFile(String contentURI) throws IOException
-{
- String realPath = getPortletContext().getRealPath(contentURI);
- if (realPath == null)
- {
- throw new IOException("Cannot access war file content");
- }
- File file = new File(realPath);
- if (!file.exists())
- {
- throw new IOException("File " + contentURI + " does not exist");
- }
- return file;
-}
-]]></programlisting>
- <programlisting><![CDATA[
- protected String getContentURI(File file) throws IOException
- {
- String rootPath = getPortletContext().getRealPath("/");
- if (rootPath == null)
- {
- throw new IOException("Cannot access war file content");
- }
-
- // Make it canonical
- rootPath = new File(rootPath).getCanonicalPath();
-
- // Get the portion of the path that is significant for us
- String filePath = file.getCanonicalPath();
- return filePath.length() >=
- rootPath.length() ? filePath.substring(rootPath.length()) : null;
- }
-]]></programlisting>
- <programlisting><![CDATA[
- private final FileFilter filter = new FileFilter()
- {
- public boolean accept(File file)
- {
- String name = file.getName();
- if (file.isDirectory())
- {
- return !"WEB-INF".equals(name);
- }
- else if (file.isFile())
- {
- return name.endsWith(".txt");
- }
- else
- {
- return false;
- }
- }
- };
-]]></programlisting>
- </section>
- <section>
- <title>The editor</title>
- <para>The editor is probably the longest part of the portlet. It tries to stay simple though and goes directly
- to the point.</para>
- <mediaobject> <imageobject>
- <imagedata align="center" fileref="images/content/fs1.png" scalefit="1"/>
- </imageobject></mediaobject>
- <para>Content editor of FSContentDrivenPortlet in action</para>
- <programlisting><![CDATA[
-protected void doEditContent(RenderRequest req, RenderResponse resp)
- throws PortletException, PortletSecurityException, IOException
-{
- String uri = req.getParameter("current_uri");
- if (uri == null)
- {
- // Get the uri value optionally provided by the portal
- uri = req.getParameter("uri");
- }
-
- // Get the working directory directory
- File workingDir = null;
- String currentFileName = null;
- if (uri != null)
- {
- workingDir = getFile(uri).getParentFile();
- currentFileName = getFile(uri).getName();
- }
- else
- {
- // Otherwise try to get the current directory we are browsing,
- // if no current dir exist we use the root
- String currentDir = req.getParameter("current_dir");
- if (currentDir == null)
- {
- currentDir = "/";
- }
- workingDir = getFile(currentDir);
- }
-
- // Get the parent path
- String parentPath = getContentURI(workingDir.getParentFile());
-
- // Get the children of the selected file, we use a filter
- // to retain only text files and avoid WEB-INF dir
- File[] children = workingDir.listFiles(filter);
-
- // Configure the response
- resp.setContentType("text/html");
- PrintWriter writer = resp.getWriter();
-
- //
- writer.print("Directories:<br/>");
- writer.print("<ul>");
- PortletURL choseDirURL = resp.createRenderURL();
- if (parentPath != null)
- {
- choseDirURL.setParameter("current_dir", parentPath);
- writer.print("<li><a href=\"" + choseDirURL + "\">..</a></li>");
- }
- for (int i = 0;i < children.length;i++)
- {
- File child = children[i];
- if (child.isDirectory())
- {
- choseDirURL.setParameter("current_dir", getContentURI(child));
- writer.print("<li><a href=\"" + choseDirURL + "\">" + child.getName() +
- "</a></li>");
- }
- }
- writer.print("</ul><br/>");
-
- //
- writer.print("Files:<br/>");
- writer.print("<ul>");
- PortletURL selectFileURL = resp.createActionURL();
- selectFileURL.setParameter("content.action.select", "select");
- for (int i = 0;i < children.length;i++)
- {
- File child = children[i];
- if (child.isFile())
- {
- selectFileURL.setParameter("current_uri", getContentURI(child));
- if (child.getName().equals(currentFileName))
- {
- writer.print("<li><b>" + child.getName() + "</b></li>");
- }
- else
- {
- writer.print("<li><a href=\"" + selectFileURL + "\">" + child.getName() + "</a></li>");
- }
- }
- }
- writer.print("</ul><br/>");
-
- //
- writer.close();
-}
-]]></programlisting>
- </section>
- <section>
- <title>Viewing content at runtime</title>
- <para>Last but not least the portlet needs to implement the <emphasis>doView(RenderRequest req, RenderResponse resp)</emphasis>
- method in order to display the file that the portal window wants to show.</para>
- <programlisting><![CDATA[
-protected void doView(RenderRequest req, RenderResponse resp)
- throws PortletException, PortletSecurityException, IOException
-{
- // Get the URI provided by the portal
- String uri = req.getParameter("uri");
-
- // Configure the response
- resp.setContentType("text/html");
- PrintWriter writer = resp.getWriter();
-
- //
- if (uri == null)
- {
- writer.print("No selected file");
- }
- else
- {
- File file = getFile(uri);
- FileInputStream in = null;
- try
- {
- in = new FileInputStream(file);
- FileChannel channel = in.getChannel();
- byte[] bytes = new byte[(int)channel.size()];
- ByteBuffer buffer = ByteBuffer.wrap(bytes);
- channel.read(buffer);
- writer.write(new String(bytes, 0, bytes.length, "UTF8"));
- }
- catch (FileNotFoundException e)
- {
- writer.print("No such file " + uri);
- getPortletContext().log("Cannot find file " + uri, e);
- }
- finally
- {
- if (in != null)
- {
- in.close();
- }
- }
- }
-
- //
- writer.close();
-}
-]]></programlisting>
- </section>
- <section>
- <title>Hooking the portlet into the portal</title>
-
- <mediaobject><imageobject>
- <imagedata align="center" fileref="images/content/fs2.png" scalefit="1"/>
- </imageobject></mediaobject>
-
-<para>Management portlet with <emphasis>filesystem</emphasis> content type enabled</para>
-
- <para>Finally we need to make the portal aware of the fact that the portlet can edit and interpret content. For that
- we need a few descriptors. The <emphasis>portlet.xml</emphasis> descriptor will define our portlet, the
- <emphasis>portlet-instances.xml</emphasis> will create a single instance of our portlet. The
- <emphasis>web.xml</emphasis> descriptor will contain a servlet context listener that will hook the content
- type in the portal content type registry.</para>
- <para>First, we need to define the portlet's particular event and render parameters:</para>
- <programlisting><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
- version="2.0">
-
- <portlet>
- <description>File System Content Driven Portlet</description>
- <portlet-name>FSContentDrivenPortlet</portlet-name>
- <display-name>File System Content Driven Portlet</display-name>
- <portlet-class>org.jboss.portal.core.samples.basic.FSContentDrivenPortlet</portlet-class>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>VIEW</portlet-mode>
- <portlet-mode>EDIT_CONTENT</portlet-mode>
- </supports>
- <portlet-info>
- <title>File Portlet</title>
- <keywords>sample,test</keywords>
- </portlet-info>
- <supported-public-render-parameter>uri</supported-public-render-parameter>
- <supported-publishing-event xmlns:x="urn:jboss:portal:content">x:select</supported-publishing-event>
- </portlet>
-
- <public-render-parameter>
- <identifier>uri</identifier>
- <qname xmlns:c="urn:jboss:portal:content">c:uri</qname>
- </public-render-parameter>
-
- <event-definition>
- <qname xmlns:x="urn:jboss:portal:content">x:select</qname>
- <value-type>java.lang.String</value-type>
- </event-definition>
-
-</portlet-app>
-]]></programlisting>
- <para>Note that here we need to use a JSR-286 portlet, this portlet will use the event <emphasis>urn:jboss:portal:content select</emphasis> and have a payload of type
- <emphasis>java.lang.String</emphasis>. This event will be used to tell the portal the URI selected by the user. This same portlet will also be in charge of
- rendering the content based on that URI, it will then also need to access the public render parameter qualified with the name: <emphasis>urn:jboss:portal:content uri</emphasis>.
- </para>
- <para>The portlet.xml descriptor</para>
- <programlisting><![CDATA[
-<deployments>
- ...
- <deployment>
- <instance>
- <instance-id>FSContentDrivenPortletInstance</instance-id>
- <portlet-ref>FSContentDrivenPortlet</portlet-ref>
- </instance>
- </deployment>
- ...
-</deployments
-]]></programlisting>
- <para>The portlet-instances.xml descriptor</para>
- <programlisting><![CDATA[
-<web-app>
- ...
- <context-param>
- <param-name>org.jboss.portal.content_type</param-name>
- <param-value>filesystem</param-value>
- </context-param>
- <context-param>
- <param-name>org.jboss.portal.portlet_instance</param-name>
- <param-value>FSContentDrivenPortletInstance</param-value>
- </context-param>
- <listener>
- <listener-class>org.jboss.content.ContentTypeRegistration</listener-class>
- </listener>
- ...
-</web-app>
-]]></programlisting>
- <para>The web.xml descriptor</para>
- <warning><title>Caution</title><para>You don't need to add the listener class into your war file. As it is provided by the portal
- it will always be available.</para></warning>
- </section>
- </section>
- <!--
- <section>
- <title>Passing parameters along the URI</title>
- <para>In simple cases like in the example, it was enough to pass a URI, in some cases it can be helpful to pass
- other parameters, to do so, instead of having a payload of type <emphasis>java.lang.String</emphasis>,
- simply use the following class: <emphasis>org.jboss.portal.api.content.SelectedContent</emphasis>.
- </para>
- </para>
- </section>
- -->
- </section>
- <section>
- <title>Configuring window content in deployment descriptor</title>
- <para>How to create a portlet that will enable configuration of content at runtime has been covered above, however
- it is also possible to configure content in deployment descriptors. With our previous example it would give
- the following snippet placed in a <emphasis>*-portal.xml</emphasis> file:
- </para>
- <programlisting><![CDATA[
-<window>
-<window-name>MyWindow</window-name>
-<content>
- <content-type>filesystem</content-type>
- <content-uri>/dir1/foo.txt</content-uri>
-</content>
-<region>center</region>
-<height>1</height>
-</window>
-]]></programlisting>
- <mediaobject><imageobject>
- <imagedata align="center" fileref="images/content/fs3.png"/>
- </imageobject></mediaobject>
- <para>Final effect - portal window with FSContentDrivenPortlet</para>
- <note><title>Note</title><para>How to configure CMS file this way is covered in the CMS chapter: <xref linkend="configuration-cms_content"/></para></note>
- </section>
-</chapter>
- <chapter id="widgets">
- <!-- <chapterinfo>
- <author>
- <firstname>Emanuel</firstname>
- <surname>Muckenhuber</surname>
- </author>
- </chapterinfo>-->
- <title>Widget Integration</title>
- <section>
- <title>Introduction</title>
- <para>JBoss Portal supports the integration of Google gadgets and Netvibes (<ulink url="http://dev.netvibes.com/doc/uwa_specification">UWA</ulink> compatible)
- widgets out of the box. This integration allows you to display the content of the widget within a portlet.
- Both types can be added in the administration interface by editing the 'Page Layout' of a page or in the configuration of the users dashboard
- when selecting the appropriate 'Content type'.
- </para>
- </section>
- <section>
- <title>Widget portlet configuration</title>
- <para>It is possible to modify certain behavior of caching and fetching widgets by changing the init-param values of the portlet.</para>
- <para>
- <itemizedlist>
- <listitem>
- <para><emphasis role="bold">connectionTimeout</emphasis>.
-
- Connection timeout used for the directory lookup in milliseconds.
- </para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">widgetExpiration</emphasis>.
-
- Time in minutes for which a widget should be cached. After this time the cached widget information will be deleted and
- fetched again when the information are needed.
- </para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">queryExpiration</emphasis>.
-
- Times in minutes for which a directory query should be cached. After this time the cached query information will be deleted.
- </para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">fetchWidgetsOnDirectoryLookup</emphasis>.
-
- This parameter defines if all widgets from a directory lookup should be fetched at the time of the query or not.
- The default values is false. This means that widgets are only fetched on demand - when the information is really needed.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- The parameter for both widget types can be changed identically in either:
- <itemizedlist>
- <listitem><para><emphasis>jboss-portal.sar/portal-widget.war/WEB-INF/portlet.xml</emphasis> (for google gadgets)</para></listitem>
- <listitem><para>or <emphasis>jboss-portal.sar/portal-widget-netvibes.war/WEB-INF/portlet.xml</emphasis> (for netvibes widgets).</para></listitem>
- </itemizedlist>
- </para>
- <para>
- <programlisting><![CDATA[...
- <portlet>
- ...
- <init-param>
- <name>connectionTimeout</name>
- <value>5000</value>
- </init-param>
- <init-param>
- <name>widgetExpiration</name>
- <value>360</value>
- </init-param>
- <init-param>
- <name>queryExpiration</name>
- <value>60</value>
- </init-param>
- <init-param>
- <name>fetchWidgetsOnDirectoryLookup</name>
- <value>false</value>
- </init-param>
- ...
- </portlet>
-...]]></programlisting>
- </para>
- <para>
- For Netvibes widgets it is also possible to define a init-param called <emphasis role="bold">defaultHeight</emphasis> to set a specific
- default height if no height attribute is defined by the widget itself. The default value is 250.
- </para>
- </section>
-</chapter>
- <chapter id="portletmodes">
- <!-- <chapterinfo>
- <author>
- <firstname>Julien</firstname>
- <surname>Viet</surname>
- </author>
- </chapterinfo>-->
- <title>Portlet Modes</title>
- <para>JBoss Portal supports the standard portlet modes defined by the JSR-168 specification which are <emphasis>view</emphasis>,
- <emphasis>edit</emphasis> and <emphasis>help</emphasis>. In addition of that it also supports the <emphasis>admin</emphasis>
- portlet mode.
- </para>
- <section>
- <title>Admin Portlet Mode</title>
- <para>The admin mode defines a mode for the portlet which allows the administration of the portlet. Access to this mode
- is only granted to users having an appropriate role. In order to grant admin access to a portlet, the user must have a role which
- grants him the <emphasis>admin</emphasis> action permission on the portlet instance. This can be done in the
- instance deployment descriptor or using the administation portlet of the portal. </para>
- <section>
- <title>Portlet configuration</title>
- <para>In order to be able to use the admin mode, the portlet must declare it in the portlet deployment descriptor.</para>
- <programlisting><![CDATA[
-<portlet-app>
- ...
- <portlet>
- ...
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>admin</portlet-mode>
- </supports>
- ...
- </portlet>
- ...
- <custom-portlet-mode>
- <name>admin</name>
- </custom-portlet-mode>
- ...
-</portlet-app>
-]]></programlisting>
- </section>
- <section>
- <title>Declarative instance security configuration</title>
- <para>The following example shows the configuration of a portlet instance that grants the admin action permission
- to the <emphasis>Admin</emphasis> security role. It also grants the view action permission to all users.
- </para>
-<programlisting><![CDATA[
-...
-<instance>
- <instance-id>ModePortletInstance</instance-id>
- <portlet-ref>ModePortlet</portlet-ref>
- <security-constraint>
- <policy-permission>
- <action-name>admin</action-name>
- <role-name>Admin</role-name>
- </policy-permission>
- <policy-permission>
- <action-name>view</action-name>
- <unchecked/>
- </policy-permission>
- </security-constraint>
-</instance>
-...
-]]></programlisting>
- </section>
- <section>
- <title>Instance security configuration with the administration portlet</title>
- <para>At runtime the security configuration section of the administration portlet can be used to grant or revoke
- the admin access. It can be done by clicking the security action of the portlet instance and then use the
- security editor.</para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portletmodes/editor.png"/>
- </imageobject>
- </mediaobject>
- <para>Edit the security instance configuration</para>
-
- </section>
- </section>
-</chapter>
- <chapter id="portal_api">
-<!-- <chapterinfo>
- <author>
- <firstname>Julien</firstname>
- <surname>Viet</surname>
- </author>
- <author>
- <firstname>Thomas</firstname>
- <surname>Heute</surname>
- </author>
- </chapterinfo>-->
- <title>Portal API</title>
- <section>
- <title>Introduction</title>
-
- <para>JBoss Portal provides an Application Programming Interface (API) which allows to write code
- that interacts with the portal. The life time and validity of the API is tied to the major version which means
- that no changes should be required when code is written against the API provided by the JBoss Portal
- 2.x versions and used in a later version of JBoss Portal 2.x.</para>
-
- <para>The Portal API package prefix is <emphasis>org.jboss.portal.api</emphasis>. All of the classes that are part
- of this API are prefixed with this package name except for the <emphasis>org.jboss.portal.Mode</emphasis>
- and <emphasis>org.jboss.portal.WindowState</emphasis> classes. These two classes were defined before the official
- Portal API framework was created and so the names have been maintained for backward compatibility.</para>
- <para>The Portlet API defines two classes that represent a portion of the visual state of a Portlet which
- are <emphasis>javax.portlet.PortletMode</emphasis> and <emphasis>javax.portlet.WindowState</emphasis>. Likewise
- the Portal API defines similar classes named <emphasis>org.jboss.portal.Mode</emphasis> and
- <emphasis>org.jboss.portal.WindowState</emphasis> which offer comparable characteristics, the main differences are:</para>
-
- <itemizedlist>
- <listitem><para>Usage of factory methods to obtain instances.</para></listitem>
- <listitem><para>Classes implements the <emphasis>java.io.Serializable</emphasis> interface.</para></listitem>
- </itemizedlist>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/Mode.png"/>
- </imageobject>
- </mediaobject>
- <para>The Mode class</para>
-
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/WindowState.png"/>
- </imageobject>
-
- </mediaobject>
-
- <para>The WindowState class</para>
-
- <note><para>In the Portal API, the <emphasis>Mode</emphasis> interface is named like this because it does
- represent the mode of some visual object. The Portlet API names it <emphasis>PortletMode</emphasis> because
- it makes the assumption that the underlying object is of type Portlet.</para></note>
- </section>
- <section>
- <title>Portlet to Portal communication</title>
- <para>There are times when a portlet needs to signal the portal or share information with it. The portal is the only authority
- to decide if it will take into account that piece of information or ignore it. In JBoss Portal we use as much as possible the
- mechanisms offered by the portlet spec to achieve that communication.</para>
- <section>
- <title>Requesting a sign out</title>
- <para>
- If a portlet desires to sign out the user, it can let the portal know by triggering a JSR-286 portlet event.
- To do so, simply defines the event "signOut" in the namespace "urn:jboss:portal" as a publishing event.
- In the action phase of the portlet, trigger the event, as a payload you can specify a redirection URL. If the payload is null,
- it will redirect the user to the default page of the default portal.
- See the following snippet to use in the action phase, it will ask the portal to sign out the user and redirect him to the JBoss
- Portal blog:
- <programlisting role="java"><![CDATA[QName name = new QName("urn:jboss:portal", "signOut");
-response.setEvent(name, "http://blog.jboss-portal.org"); ]]></programlisting>
- </para>
- </section>
- <section>
- <title>Setting up the web browser title</title>
- <para>
- The JSR-286 specification introduced a new phase for setting up the HTML headers. It is commonly used to add stylesheets
- and javascript to the page. An extension of it for JBoss Portal lets you define the web browser title.
- To define the web browser title, a portlet simply needs to define a new header element "title". This could be done by a portlet overriding
- the method <literal>doHeaders(RenderRequest req, RenderResponse resp)</literal> to add such an element.
- <programlisting role="java"><![CDATA[public void doHeaders(RenderRequest req, RenderResponse resp)
-{
- Element element = resp.createElement("title");
- element.setTextContent("My new web browser title");
- resp.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, element);
-}]]></programlisting>
- <warning><para>It several portlets on a page defines a web browser title, only one of them will be displayed.
- We can consider that the title to be displayed will be randomly chosen.</para></warning>
- </para>
- </section>
- </section>
- <section>
- <title>Portal URL</title>
- <para>The Portal API defines the <emphasis>org.jboss.portal.api.PortalURL</emphasis> interface to represent
- URL managed by the portal.</para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/PortalURL.png"/>
- </imageobject>
- </mediaobject>
- <para>The PortalURL interface</para>
-
- <itemizedlist>
- <listitem><para>The <emphasis>setAuthenticated(Boolean wantAuthenticated)</emphasis> methods defines if the
- URL requires the authentication of the user. If the argument value is true then the user must be authenticated
- to access the URL, if the argument value is false then the user should not be authenticated. Finally if the argument value is
- null then it means that the URL authenticated mode should reuse the current mode.</para></listitem>
- <listitem><para>The <emphasis>setSecure(Boolean wantSecure)</emphasis> methods defines the same as above but for the
- transport guarantee offered by the underlying protocol which means most of the time the secure HTTP protocol (HTTPS).</para></listitem>
- <listitem><para>The <emphasis>setRelative(boolean relative)</emphasis> defines the output format of the URL and
- whether the created URL will be an URL relative to the same web server or will be the full URL.</para></listitem>
- <listitem><para>The <emphasis>toString()</emphasis> method will create the URL as a string.</para></listitem>
- </itemizedlist>
- </section>
- <section>
- <title>Portal session</title>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/PortalSession.png"/>
- </imageobject>
- </mediaobject>
- <para>The PortalSession interface</para>
-
- <para>It is possible to have access to a portion of the portal session to store objects. The <emphasis>org.jboss.portal.api.session.PortalSession</emphasis>
- interface defines its API and is similar to the <emphasis>javax.servlet.http.HttpSession</emphasis> except that it does
- not offer methods to invalidate the session as the session is managed by the portal.
- </para>
- </section>
-
- <section>
- <title>Portal runtime context</title>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/PortalRuntimeContext.png"/>
- </imageobject>
- </mediaobject>
- <para>The PortalRuntimeContext interface</para>
-
- <para>The <emphasis>org.jboss.portal.api.PortalRuntimeContext</emphasis> gives access to state or operations
- associated at runtime with the current user of the portal. The <emphasis>String getUserId()</emphasis> retrieve
- the user id and can return null if no user is associated with the context. It also gives access to the
- <emphasis>PortalSession</emphasis> instance associated with the current user. Finally it gives access to the
- <emphasis>NavigationalStateContext</emphasis> associated with the current user.</para>
- </section>
-
- <section>
- <title>Portal nodes</title>
- <para>The portal structure is a tree formed by nodes. It is possible to programmatically access the portal tree in order to
- </para>
- <itemizedlist>
- <listitem><para>discover the tree structure of the portal</para></listitem>
- <listitem><para>create URL that will render the different portal nodes</para></listitem>
- <listitem><para>access the properties of a specific node</para></listitem>
- </itemizedlist>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/PortalNode.png"/>
- </imageobject>
- </mediaobject>
- <para>The PortalNode interface</para>
-
- <para>As usual with tree structures, the main interface to study is the <emphasis>org.jboss.portal.api.node.PortalNode</emphasis>. That interface
- is intentionally intended for obtaining useful information from the tree. It is not possible to use it to modify
- the tree shape because it is not intended to be a management interface.</para>
- <programlisting><![CDATA[
-public interface PortalNode
-{
- int getType();
- String getName();
- String getDisplayName(Locale locale);
- Map getProperties();
- PortalNodeURL createURL(PortalRuntimeContext portalRuntimeContext);
- ...
-}
-]]></programlisting>
- <para>The interface offers methods to retrieve informations for a given node such as the node type, the node name
- or the properties of the node. The noticeable node types are:</para>
- <itemizedlist>
- <listitem><para>PortalNode.TYPE_PORTAL : the node represents a portal</para></listitem>
- <listitem><para>PortalNode.TYPE_PAGE : the node represents a portal page</para></listitem>
- <listitem><para>PortalNode.TYPE_WINDOW : the node represents a page window</para></listitem>
- </itemizedlist>
- <para>The <emphasis>org.jboss.portal.api.node.PortalNodeURL</emphasis> is an extension of the <emphasis>PortalURL</emphasis> interface
- which adds additional methods useful for setting parameters on the URL. There are no guarantees that the
- portal node will use the parameters. So far portal node URL parameters are only useful for nodes of type
- <emphasis>PortalNode.TYPE_WINDOW</emphasis> and they should be treated as portlet render parameters in the case of
- the portlet is a local portlet and is not a remote portlet. The method that creates portal node URL requires
- as parameter an instance of <emphasis>PortalRuntimeContext</emphasis>.</para>
- <para>The interface also offers methods to navigate the node hierarchy:</para>
- <programlisting><![CDATA[
-public interface PortalNode
-{
- ...
- PortalNode getChild(String name);
- Collection getChildren();
- PortalNode getRoot();
- PortalNode getParent();
- ...
-}
-]]></programlisting>
- </section>
- <section>
- <title>Portal navigational state</title>
- <para>The navigational state is a state managed by the portal that associates to each user the state triggered
- by its navigation. A well known part of the navigational state are the render parameters provided at runtime
- during the call of the method <emphasis>void render(RenderRequest req, RenderResponse resp)</emphasis>. The portal
- API offers an interface to query and update the navigational state of the portal. For now the API only exposes
- mode and window states of portal nodes of type window.</para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/NavigationalStateContext.png"/>
- </imageobject>
- </mediaobject>
- <para>The NavigationalStateContext interface</para>
-
- </section>
- <section>
- <title>Portal events</title>
- <para>Portal events are a powerful mechanism to be aware of what is happening in the portal at runtime. The base
- package for event is <emphasis>org.jboss.portal.api.event</emphasis> and it contains the common event classes
- and interfaces.
- </para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/PortalEvent.png"/>
- </imageobject>
- </mediaobject>
- <para>The PortalEvent class</para>
-
- <para>The <emphasis>org.jboss.portal.api.event.PortalEvent</emphasis> abstract class is the base class for
- all kind of portal events.
- </para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/PortalEventContext.png"/>
- </imageobject>
- </mediaobject>
- <para>The PortalEventContext interface</para>
-
- <para>
- The <emphasis>org.jboss.portal.api.event.PortalEventContext</emphasis> interface defines the context in which
- an event is created and propagated. It allows retrieval of the <emphasis>PortalRuntimeContext</emphasis> which
- can in turn be used to obtain the portal context.
- </para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/PortalEventListener.png"/>
- </imageobject>
- </mediaobject>
- <para>The PortalEventListener interface</para>
-
- <para>
- The <emphasis>org.jboss.portal.api.event.PortalEventListener</emphasis> interface defines the contract that
- class can implement in order to receive portal event notifications. It contains the method
- <emphasis>void onEvent(PortalEvent event)</emphasis> called by the portal framework.
- </para>
- <para>
- Listeners declaration requires a service to be deployed in JBoss that will instantiate the service implementation
- and register it with the service registry. We will see how to achieve that in the example section of this chapter.
- </para>
- <note>
- <para>The event propagation model uses one instance of a listener class to receive all portal events that
- may be routed to that class when appropriate. Therefore implementors needs to be aware of that model
- and must provide <emphasis role="bold">thread safe</emphasis> implementations.</para>
- </note>
- <section>
- <title>Portal node events</title>
- <para>Portal node events extend the abstract portal event framework in order to provide notifications
- about user interface events happening at runtime. For instance when the portal renders a page or a window,
- a corresponding event will be fired.</para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/PortalNodeEvent.png" scalefit="1"/>
- </imageobject>
- </mediaobject>
- <para>The portal node event class hierarchy</para>
-
- <para>The <emphasis>org.jboss.portal.api.node.event.PortalNodeEvent</emphasis> class extends the
- <emphasis>org.jboss.portal.api.node.PortalEvent</emphasis> class and is the base class for all events
- of portal nodes. It defines a single method <emphasis>PortalNode getNode()</emphasis> which can be
- used to retrieve the node targetted by the event.</para>
- <para>The <emphasis>org.jboss.portal.api.node.event.WindowEvent</emphasis> is an extension for portal nodes
- of type window. It provides access to the mode and window state of the window. It has 3 subclasses which
- represent different kind of event that can target windows.</para>
- <para>The <emphasis>org.jboss.portal.api.node.event.WindowNavigationEvent</emphasis> is fired when the
- window navigational state changes. For a portlet it means that the window is targetted by an URL of type
- render.</para>
- <para>The <emphasis>org.jboss.portal.api.node.event.WindowActionEvent</emphasis> is fired when the
- window is targetted by an action. For a portlet it means that the window is targetted by an URL of type
- action.</para>
- <para>The <emphasis>org.jboss.portal.api.node.event.WindowRenderEvent</emphasis> is fired when the
- window is going to be rendered by the portal.</para>
- <para>The <emphasis>org.jboss.portal.api.node.event.PageEvent</emphasis> is an extension for portal nodes
- of type page.</para>
- <para>The <emphasis>org.jboss.portal.api.node.event.PageRenderEvent</emphasis> is fired when the
- page is going to be rendered by the portal.</para>
- <section>
- <title>Portal node event propagation model</title>
- <para>
- A portal node event is fired when an event of interest happens to a portal node of the portal tree. The
- notification model is comparable to the <ulink url="http://en.wikipedia.org/wiki/DOM_Events#Event_flow">bubbling propagation model </ulink>
- defined by the DOM specification. When an event is fired, the event is propagated in the hierarchy from the most
- inner node where the event happens to the root node of the tree.
- </para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/eventpropagation.png"/>
- </imageobject>
- </mediaobject>
- <para>The portal node event propagation model</para>
-
-
- </section>
- <section>
- <title>Portal node event listener</title>
- <para>The <emphasis>org.jboss.portal.api.node.event.PortalNodeEventListener</emphasis> interface should
- be used instead of the too generic <emphasis>org.jboss.portal.api.event.PortalEventListener</emphasis> when
- it comes down of listening portal node events. Actually it does not replace it, the <emphasis>PortalEventListener</emphasis>
- interface semantic allows only traditional event delivering. The <emphasis>PortalNodeEventListener</emphasis>
- interface is designed to match the bubbling effect during an event delivery.</para>
- <para>The <emphasis>PortalNodeEvent onEvent(PortalNodeEventContext context, PortalNodeEvent event)</emphasis>
- method declares a <emphasis>PortalNodeEvent</emphasis> as return type. Commonly the method returns null;
- however, a returned PortalNodeEvent replaces the event in the listeners subsequently called during
- the event bubbling process.
- </para>
- </section>
- <section>
- <title>Portal node event context</title>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/PortalNodeEventContext.png"/>
- </imageobject>
- </mediaobject>
- <para>The PortalNodeEventContext interface</para>
-
- <para>The <emphasis>org.jboss.portal.api.node.event.PortalNodeEventContext</emphasis> interface extends
- the <emphasis>PortalEventContext</emphasis> interface and plays an important role
- in the event delivery model explained in the previous section. That interface gives full control over the
- delivery of the event to ascendant nodes in the hierarchy, even more it gives the possibility to replace
- the current event being delivered by a new event that will be transformed into the corresponding portal
- behavior. However there are no guarantees that the portal will turn the returned event into a portal
- behavior, here the portal provides a best effort policy, indeed sometime it is not possible to achieve
- the substitution of one event by another.</para>
- <para>Here the simplest implementation of a listener that does nothing except than correctly passing
- the control to a parent event listener if there is one.</para>
- <programlisting><![CDATA[
-public PortalNodeEvent onEvent(PortalNodeEventContext context, PortalNodeEvent event)
-{
- return context.dispatch();
-}
-]]></programlisting>
- <para>The method <emphasis>PortalNode getNode()</emphasis> returns the current node being selected
- during the event bubbler dispatching mechanism.</para>
- </section>
- </section>
- <section>
- <title>Portal session events</title>
- <para>The life cycle of the session of the portal associated with the user can also raise events. This kind of
- event is not bound to a portal node since it is triggered whenever a portal session is created or destroyed</para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/PortalSessionEvent.png"/>
- </imageobject>
- </mediaobject>
- <para>The PortalSessionEvent class</para>
-
- <para>There are two different types of events:
- <itemizedlist>
- <listitem><para>org.jboss.portal.api.session.event.PortalSessionEvent.SESSION_CREATED, fired when a new portal session is created</para></listitem>
- <listitem><para>org.jboss.portal.api.session.event.PortalSessionEvent.SESSION_DESTROYED, fired when a new portal session is destroyed</para></listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>Portal user events</title>
- <para>The life cycle of the portal user can also raise events such as its authentication. A subclass of the wider scope UserEvent class is
- provided and triggers events whenever a user signs in or out. The UserEvent object gives access to the user name of the logged-in user through
- the method <emphasis>String getId()</emphasis>.</para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/user.event.png"/>
- </imageobject>
-
- </mediaobject>
- <para>The UserEvent class and UserAuthenticationEvent sub-classes</para>
-
- <para>The UserAuthenticationEvent triggers two events that can be catched:
- <itemizedlist>
- <listitem><para>org.jboss.portal.api.session.event.UserAuthenticationEvent.SIGN_IN, fired when a portal user signs in</para></listitem>
- <listitem><para>org.jboss.portal.api.session.event.UserAuthenticationEvent.SIGN_OUT, fired when a portal user signs out</para></listitem>
- </itemizedlist>
- </para>
- <para>Based on the UserEvent class other custom user related events could be added like one that would trigger when a new user is
- being registered</para>
- </section>
- </section>
- <section>
- <title>Examples</title>
- <para>The events mechanism is quite powerful, in this section of the chapter we will see few simple examples to explain how
- it works.</para>
- <section>
- <title>UserAuthenticationEvent example</title>
- <para>In this example, we will create a simple counter of the number of logged-in registered users. In order to
- do that we just need to keep track of Sign-in and Sign-out events.</para>
- <para>First, let's write our listener. It just a class that will implement <emphasis>org.jboss.portal.api.event.PortalEventListener</emphasis> and
- its unique method <emphasis>void onEvent(PortalEventContext eventContext, PortalEvent event)</emphasis>. Here is such an example:
- <programlisting role="java"><![CDATA[
-package org.jboss.portal.core.portlet.test.event;
-
-import[...]
-
-public class UserCounterListener implements PortalEventListener
-{
-
- /** Thread-safe long */
- private final SynchronizedLong counter = new SynchronizedLong(0);
-
- /** Thread-safe long */
- private final SynchronizedLong counterEver = new SynchronizedLong(0);
-
- public void onEvent(PortalEventContext eventContext, PortalEvent event)
- {
- if (event instanceof UserAuthenticationEvent)
- {
- UserAuthenticationEvent userEvent = (UserAuthenticationEvent)event;
- if (userEvent.getType() == UserAuthenticationEvent.SIGN_IN)
- {
- counter.increment();
- counterEver.increment();
- }
- else if (userEvent.getType() == UserAuthenticationEvent.SIGN_OUT)
- {
- counter.decrement();
- }
- System.out.println("Counter : " + counter.get());
- System.out.println("Counter ever: " + counterEver.get());
- }
- }
-}
- ]]></programlisting>
- On this method we simply filter down to UserAuthenticationEvent then depending on the type of authentication event we update the
- counters. <emphasis>counter</emphasis> keeps track of the registered and logged-in users, while counterEver only counts the number of
- times people logged-in the portal.</para>
- <para>Now that the Java class has been written we need to register it so that it can be called when the events are triggered. To do
- so we need to register it as an MBean. It can be done by editing the sar descriptor file:
- <emphasis>YourService.sar/META-INF/jboss-service.xml</emphasis> so that it looks like the following:
- <programlisting><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
- <mbean
- code="org.jboss.portal.core.event.PortalEventListenerServiceImpl"
- name="portal:service=ListenerService,type=counter_listener"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends
- optional-attribute-name="Registry"
- proxy-type="attribute">portal:service=ListenerRegistry</depends>
- <attribute name="RegistryId">counter_listener</attribute>
- <attribute name="ListenerClassName">
- org.jboss.portal.core.portlet.test.event.UserCounterListener
- </attribute>
- </mbean>
-</server>
- ]]></programlisting>
- This snippet can be kept as it is, providing you change the values:
- <itemizedlist>
- <listitem>
- <para><emphasis role="bold">name:</emphasis> Must follow the pattern: portal:service=ListenerService,type={{UNIQUENAME}}</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">RegistryId:</emphasis> Must match the type (here: counter_listener)</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">ListenerClassName:</emphasis> Full path to the listener
- (here: org.jboss.portal.core.portlet.test.event.UserCounterListener).</para>
- </listitem>
- </itemizedlist>
- </para>
- <para>That's it - we now have a user counter that will display it states each time a user logs-in our logs-out.</para>
- </section>
- <section>
- <title>Achieving Inter Portlet Communication with the events mechanism</title>
- <para>The first version of the Portlet Specification (JSR 168), regretfully, did not cover interaction between
- portlets. The side-effect of diverting the issue to the subsequent release of the specification, has
- forced portal vendors to each craft their own proprietary API to achieve inter portlet communication. Here we will
- see how we can use the event mechanism to pass parameters from one portlet to the other (and only to the other portlet).</para>
- <para>The overall scenario will be that Portlet B will need to be updated based on some parameter set on Portlet A.
- To achieve that we will use a portal node event.</para>
- <para>Portlet A is a simple Generic portlet that has a form that sends a color name:
- <programlisting><![CDATA[
-public class PortletA extends GenericPortlet
-{
- protected void doView(RenderRequest request, RenderResponse response)
- throws PortletException, PortletSecurityException, IOException
- {
- response.setContentType("text/html");
- PrintWriter writer = response.getWriter();
- writer.println("<form action=\"" + response.createActionURL() + "\" method=\"post\">");
- writer.println("<select name=\"color\">");
- writer.println("<option>blue</option>");
- writer.println("<option>red</option>");
- writer.println("<option>black</option>");
- writer.println("</select>");
- writer.println("<input type=\"submit\"/>");
- writer.println("</form>");
- writer.close();
- }
-}
- ]]></programlisting>
- </para>
- <para>The other portlet (Portlet B) that will receive parameters from Portlet A is also a simple Generic portlet:
- <programlisting><![CDATA[
-public class PortletB extends GenericPortlet
-{
-
- public void processAction(ActionRequest request, ActionResponse response)
- throws PortletException, PortletSecurityException, IOException
- {
- String color = request.getParameter("color");
- if (color != null)
- {
- response.setRenderParameter("color", color);
- }
- }
-
- protected void doView(RenderRequest request, RenderResponse response)
- throws PortletException, PortletSecurityException, IOException
- {
- String color = request.getParameter("color");
- response.setContentType("text/html");
- PrintWriter writer = response.getWriter();
- writer.println("<div" +
- (color == null ? "" : " style=\"color:" + color + ";\"") +
- ">some text in color</div>");
- writer.close();
- }
-
- // Inner listener explained after
-}
- ]]></programlisting>
- </para>
- <para>With those two portlets in hands, we just want to pass parameters from Portlet A to Portlet B (the color in
- as a request parameter in our case). In order to achieve this goal, we will write an inner Listener in Portlet B
- that will be triggered on any WindowActionEvent of Portlet A. This listener will create a new WindowActionEvent
- on the window of Portlet B.
- <programlisting role="java"><![CDATA[
-public static class Listener implements PortalNodeEventListener
-{
- public PortalNodeEvent onEvent(PortalNodeEventContext context, PortalNodeEvent event)
- {
- PortalNode node = event.getNode();
- // Get node name
- String nodeName = node.getName();
- // See if we need to create a new event or not
- WindowActionEvent newEvent = null;
- if (nodeName.equals("PortletAWindow") && event instanceof WindowActionEvent)
- {
- // Find window B
- WindowActionEvent wae = (WindowActionEvent)event;
- PortalNode windowB = node.resolve("../PortletBWindow");
- if (windowB != null)
- {
- // We can redirect
- newEvent = new WindowActionEvent(windowB);
- newEvent.setParameters(wae.getParameters());
-
- newEvent.setMode(wae.getMode());
- newEvent.setWindowState(WindowState.MAXIMIZED);
-
- // Redirect to the new event
- return newEvent;
- }
- }
- // Otherwise bubble up
- return context.dispatch();
- }
-}
- ]]></programlisting>
- </para>
- <para>
- It is important to note here some of the important items in this listener class.
- Logic used to determine if the requesting node was Portlet A.:
- <programlisting>nodeName.equals("PortletAWindow")</programlisting>
- </para>
- <para>
- Get the current window object so we can dispatch the event to it:
- <programlisting>PortalNode windowB = node.resolve("../PortletBWindow");</programlisting>
- </para>
- <para>
- Set the original parameter from Portlet A, so Portlet B can access them in its processAction():
- <programlisting>newEvent.setParameters(wae.getParameters());</programlisting>
- </para>
- <!--
- <para>
- Modify Portlet B windowmode and/or windowstate (ie, Maximize and place in Edit Mode):
- <programlisting>
-newEvent.setMode(wae.getMode()); // Mode.EDIT;
-newEvent.setWindowState(wae.getWindowState()); // WindowState.MAXIMIZED</programlisting>
- </para>
- -->
- <para>
- We still need to register our listener as an mbean:
- <programlisting role="xml">
-<![CDATA[<mbean
- code="org.jboss.portal.core.event.PortalEventListenerServiceImpl"
- name="portal:service=ListenerService,type=test_listener"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends
- optional-attribute-name="Registry"
- proxy-type="attribute">portal:service=ListenerRegistry</depends>
- <attribute name="RegistryId">test_listener</attribute>
- <attribute name="ListenerClassName">
- org.jboss.portal.core.samples.basic.event.PortletB$Listener
- </attribute>
-</mbean>]]></programlisting>
- For node events, we also need to declare on which node we want to listen, this is done by modifying
- the <literal>*-object.xml</literal> that defines your portal nodes. In this example we want to trigger
- the listener each time the window containing the portlet A is actioned. We can add the <literal>listener</literal>
- tag to specify that out listener with <literal>RegistryId</literal>=test_listener should be triggered
- on events on the embedding object.
- <programlisting>
-<![CDATA[...
- <window>
- <window-name>PortletAWindow</window-name>
- <instance-ref>PortletAInstance</instance-ref>
- <region>center</region>
- <height>0</height>
- <listener>test_listener</listener>
- </window>
-...]]>
- </programlisting>
- Of course we could have added it at the page level instead of the window level. Note that a unique listener
- can be specified, the event mechanism is primarily done to let the developer change the navigation state of the
- portal, this example being a nice side-effect of this feature.
- </para>
- <note><para>The portlet 2.0 specification (JSR 286) will cover Inter Portlet Communication so that portlets using it
- can work with different portal vendors.</para></note>
- </section>
- <section>
- <title>Link to other pages</title>
- <para>Linking to some other pages or portals is also out of the scope of the portlet
- specification. As seen previously JBoss Portal offers an API in order to create links
- to other portal nodes. The JBoss request gives access to the current window node from
- which we can navigate from.</para>
- <programlisting role="java">
-<![CDATA[
-// Get the ParentNode. Since we are inside a Window, the Parent is the Page
-PortalNode thisNode = req.getPortalNode().getParent();
-
-// Get the Node in the Portal hierarchy tree known as "../default"
-PortalNode linkToNode = thisNode.resolve("../default");
-
-// Create a RenderURL to the "../default" Page Node
-PortalNodeURL pageURL = resp.createRenderURL(linkToNode);
-
-// Output the Node's name and URL for users
-html.append("Page: " + linkToNode.getName() + " -> ");
-html.append("<a href=\"" + pageURL.toString() + "\">" + linkToNode.getName() + "</a>");
- ]]></programlisting>
- <para>From this, it is easy to create a menu or sitemap, the <emphasis>List getChildren()</emphasis>
- method will return all the child nodes on which the user has the view right access.</para>
- </section>
- <section>
- <title>Samples</title>
- <para>Those examples are available in the core-samples package in the sources of JBoss Portal.
- There are more examples of events usage in the samples delivered with JBoss Portal. One of them
- shows the usage of a portal node event to only have one window in normal mode at a time in a region.
- Anytime another window is being put in normal mode, all the other windows of the same regions
- are automatically minimized.</para>
- </section>
- </section>
-</chapter>
- <chapter id="clustering">
- <!--<chapterinfo>
- <author>
- <firstname>Julien</firstname>
- <surname>Viet</surname>
- </author>
- <author>
- <firstname>Roy</firstname>
- <surname>Russo</surname>
- </author>
- </chapterinfo>-->
- <title>Clustering Configuration</title>
- <para>This section covers configuring JBoss Portal for a clustered environment.</para>
- <section>
- <title>Introduction</title>
- <para>JBoss Portal leverages various clustered services that are found in JBoss Application Server. This section briefly details how each is leveraged:
- </para>
- <itemizedlist>
- <listitem>
- <para>
- <emphasis role="bold">JBoss Cache:</emphasis>
- Used to replicate data among the different hibernate session factories that are deployed in
- each node of the cluster.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">JBoss HA Singleton:</emphasis>
- <orderedlist>
- <listitem><para>Used to make the deployer a singleton on the cluster, in order to avoid
- concurrency issues when
- deploying the various *-object.xml files. Without that, each node would try to create the
- same objects in the database when it deploys an archive containing such descriptors.</para></listitem>
- <listitem><para>Used with JCR. The Apache Jackrabbit server is not able to run in a cluster
- by itself, therefore we make a singleton on the cluster. This provides HA-CMS, which is
- similar to the current HA JBossMQ provided in JBoss AS.</para></listitem>
- </orderedlist>
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">HA-JNDI:</emphasis>
- Used to replicate a proxy that will talk to the HA CMS on the cluster.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">Http Session Replication:</emphasis>
- Used to replicate the portal and the portlet sessions.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">JBoss SSO:</emphasis>
- Used to replicate the user identity, an authenticated user does not have to login again when failover occurs.
- </para>
- </listitem>
- </itemizedlist>
-
- <note><title>Note</title><para>JBoss Clustering details can be found in the
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossHA">Wiki</ulink>
- or the
- <ulink url="http://labs.jboss.com/jbossas/docs/">clustering documentation</ulink>.</para>
- </note>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/clustering/overview.png" scalefit="1"/>
- </imageobject></mediaobject>
- </section>
- <section>
- <title>Considerations</title>
- <para>When you want to run JBoss Portal on a cluster there are a few things to keep in mind:
- <itemizedlist>
- <listitem><para>Deploy the portal under the <emphasis role="bold">all</emphasis> application server configuration as it contains the clustering services that is leveraged by JBoss Portal.</para></listitem>
- <listitem><para>All the portal instances have to use the same datasource : the database is used to store the portal
- persistent state like pages. If you don't use a shared database then you will have consistency problems.</para></listitem>
- </itemizedlist></para>
- </section>
-
- <section>
- <title>JBoss Portal Clustered Services</title>
-
- <section id="PortalSessionReplication">
- <title>Portal Session Replication</title>
- <para>The portal associates with each user a http session in order to keep specific objects such as:
- <itemizedlist>
- <listitem><para>Navigational state : this is mainly the state of different portlet windows that the user will manipulate
- during its interactions with the portal. For instance a maximized portlet window with specific render parameters.</para></listitem>
- <listitem><para>WSRP objects : the WSRP protocol can require to provide specific cookies during interactions with a remote
- portlet.</para></listitem>
- </itemizedlist>
- Replicating the portal session ensures that this state will be kept in sync on the cluster, e.g The user will see exactly
- the same portlet window on every node of the cluster. The activation of the portal session replication is made through the
- configuration of the web application that is the main entry point of the portal. This setting is available in the file
- <emphasis>jboss-portal.sar/portal-server.war/WEB-INF/web.xml</emphasis></para>
- <para>
- <programlisting><![CDATA[
-<web-app>
- <description>JBoss Portal</description>
- <!-- Comment/Uncomment to enable portal session replication -->
- <distributable/>
- ...
-</web-app>
-]]></programlisting>
- </para>
- </section>
-
- <section>
- <title>Hibernate clustering</title>
- <para>JBoss Portal leverages hibernate for its database access. In order to improve performances it uses
- the caching features provided by hibernate. On a cluster the cache needs to be replicated in order
- to avoid state inconsistencies. Hibernate is configured with JBoss Cache which performs that synchronization transparently.
- Therefore the different hibernate services must be configured to use JBoss Cache. The following hibernate configurations
- needs to use a replicated JBoss Cache :
- <itemizedlist>
- <listitem><para><emphasis>jboss-portal.sar/conf/hibernate/user/hibernate.cfg.xml</emphasis></para></listitem>
- <listitem><para><emphasis>jboss-portal.sar/conf/hibernate/instances/hibernate.cfg.xml</emphasis></para></listitem>
- <listitem><para><emphasis>jboss-portal.sar/conf/hibernate/portal/hibernate.cfg.xml</emphasis></para></listitem>
- <listitem><para><emphasis>jboss-portal.sar/conf/hibernate/portlet/hibernate.cfg.xml</emphasis></para></listitem>
- </itemizedlist>
- The cache configuration should look like :
- <programlisting><![CDATA[
-<!--
- | Uncomment in clustered mode : use transactional replicated cache
- -->
- <property name="cache.provider_class">org.jboss.portal.core.hibernate.JMXTreeCacheProvider
- </property>
- <property name="cache.object_name">portal:service=TreeCacheProvider,type=hibernate
- </property>
-
-<!--
- | Comment in clustered mode
- <property name="cache.provider_configuration_file_resource_path">
- conf/hibernate/instance/ehcache.xml</property>
- <property name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
--->
-]]></programlisting>
- Also we need to ensure that the cache is deployed by having in the file <emphasis>jboss-portal.sar/META-INF/jboss-service.xml</emphasis>
- the cache service uncommented :
- <programlisting><![CDATA[
-<!--
- | Uncomment in clustered mode : replicated cache for hibernate
- -->
- <mbean
- code="org.jboss.cache.TreeCache"
- name="portal:service=TreeCache,type=hibernate">
- <depends>jboss:service=Naming</depends>
- <depends>jboss:service=TransactionManager</depends>
- <attribute name="TransactionManagerLookupClass">
- org.jboss.cache.JBossTransactionManagerLookup</attribute>
- <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
- <attribute name="CacheMode">REPL_SYNC</attribute>
- <attribute name="ClusterName">portal.hibernate</attribute>
- </mbean>
-
- <mbean
- code="org.jboss.portal.core.hibernate.JBossTreeCacheProvider"
- name="portal:service=TreeCacheProvider,type=hibernate">
- <depends optional-attribute-name="CacheName">portal:service=TreeCache,type=hibernate
- </depends>
- </mbean>
-]]></programlisting>
- More information can be found <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossCacheHibernate">here</ulink>.
- </para>
- </section>
-
- <section>
- <title>Identity clustering</title>
- <para>JBoss Portal leverages the servlet container authentication for its own authentication mechanism. When
- the user is authenticated on one particular node he will have to reauthenticate again if a different
- node of the cluster (during a failover for instance) is used. This is valid only for the <emphasis>FORM</emphasis>
- based authentication which is the default form of authentication that JBoss Portal uses. Fortunately JBoss
- provides transparent reauthentication of the user called JBoss clustered SSO. Its configuration can be found
- in <literal>$JBOSS_HOME/server/all/deploy/jboss-web.deployer/server.xml</literal> and you will need to
- uncomment the following valve:
- <programlisting><![CDATA[<Valve className="org.jboss.web.tomcat.service.sso.ClusteredSingleSignOn" />]]></programlisting>
-
- More information can be found <ulink url="http://www.jboss.org/wiki/Wiki.jsp?page=SingleSignOn">here</ulink>.
- </para>
- </section>
-
- <section>
- <title>CMS clustering</title>
- <para>The CMS backend storage relies on the Apache Jackrabbit project. Jackrabbit does not support clustering out of the box.
- So the portal run the Jackrabbit service on one node of the cluster using the
- <ulink url="http://www.onjava.com/pub/a/onjava/2003/08/20/jboss_clustering.html">HA-Singleton</ulink> technology.
- The file <emphasis>jboss-portal.sar/portal-cms.sar/META-INF/jboss-service.xml</emphasis> contains the configuration. We will
- not reproduce it in this documentation as the changes are quite complex and numerous. Access from all nodes of the cluster
- is provided by a proxy bound in HA-JNDI. In order to avoid any bottleneck JBoss Cache is leveraged to cache CMS content cluster
- wide.</para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/clustering/cms.png"/>
- </imageobject></mediaobject>
- </section>
-
- </section>
-
- <section>
- <title>Setup</title>
- <para>We are going to outline how to setup a two node cluster on the same machine in order to test JBoss Portal HA. The only
- missing part from the full fledged setup is the addition of a load balancer in front of Apache Tomcat. However a lot of documentation
- exist on the subject. A detailed step by step setup of Apache and mod_jk is available from the
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingMod_jk1.2WithJBoss">JBoss Wiki</ulink>.</para>
- <para>As we need two application servers running at the same time, we must avoid any conflict. For instance we will
- need Apache Tomcat to bind its socket on two different ports otherwise a network conflict will occur. We will leverage
- the service binding manager <ulink url="http://docs.jboss.org/jbossas/jboss4guide/r3/html/ch10.html">this chapter</ulink> of
- the JBoss AS documentation.</para>
- <para>The first step is to copy the <emphasis>all</emphasis> configuration of JBoss into two separate
- configurations that we name <emphasis>ports-01</emphasis> and <emphasis>ports-02</emphasis> :
- <programlisting><![CDATA[
->cd $JBOSS_HOME/server
->cp -r all ports-01
->cp -r all ports-02
-]]></programlisting>
- </para>
- <para>Edit the file <emphasis>$JBOSS_HOME/server/ports-01/conf/jboss-service.xml</emphasis> and uncomment
- the service binding manager :
- <programlisting><![CDATA[
-<mbean code="org.jboss.services.binding.ServiceBindingManager"
- name="jboss.system:service=ServiceBindingManager">
- <attribute name="ServerName">ports-01</attribute>
- <attribute name="StoreURL">
- ${jboss.home.url}/docs/examples/binding-manager/sample-bindings.xml</attribute>
- <attribute name="StoreFactoryClassName">org.jboss.services.binding.XMLServicesStoreFactory</attribute>
-</mbean>
-]]></programlisting>
- </para>
- <para>Edit the file <emphasis>$JBOSS_HOME/server/ports-02/conf/jboss-service.xml</emphasis>, uncomment
- the service binding manager and change the value <emphasis>ports-01</emphasis> into <emphasis>ports-02</emphasis>:
- <programlisting><![CDATA[
-<mbean code="org.jboss.services.binding.ServiceBindingManager"
- name="jboss.system:service=ServiceBindingManager">
- <attribute name="ServerName">ports-02</attribute>
- <attribute name="StoreURL">
- ${jboss.home.url}/docs/examples/binding-manager/sample-bindings.xml</attribute>
- <attribute name="StoreFactoryClassName">
- org.jboss.services.binding.XMLServicesStoreFactory</attribute>
-</mbean>]]></programlisting>
- </para>
- <para>Setup a database that will be shared by the two nodes and obviously we cannot use
- an embedded database. For instance using postgresql we would need to copy the file <emphasis>portal-postgresql-ds.xml</emphasis>
- into <emphasis>$JBOSS_HOME/server/ports-01/deploy</emphasis> and <emphasis>$JBOSS_HOME/server/ports-02/deploy</emphasis>.
- </para>
- <para>Copy JBoss Portal HA to the deploy directory of the two configurations.</para>
-
- <!-- adding instruction about jboss cache versioning -->
- <formalpara>
- <title>JBoss Cache</title>
- <para>
- To improve CMS performance JBoss Cache is leveraged to cache the content cluster wide.
- We recommend that you use the following version of JBoss Cache for best performance:
- </para>
-</formalpara>
- <itemizedlist>
- <listitem><para>
- <emphasis>JBoss Cache 1.4.0.SP1 and above</emphasis></para>
- </listitem>
- <listitem><para>
- <emphasis>JGroups 2.2.7 or 2.2.8</emphasis></para>
- </listitem>
- </itemizedlist>
- <para>
- When building from source the following command:
- <literal>{core}/build.xml deploy-ha</literal> automatically upgrades your JBoss Cache version.
- </para>
- <para>
- <emphasis>Alternative:</emphasis>
- If upgrading your JBoss Cache version is not an option, the following configuration
- change is needed in the
- <literal>jboss-portal-ha.sar/portal-cms.sar/META-INF/jboss-service.xml</literal>.
- Replace the following configuration in the
- <emphasis>cms.pm.cache:service=TreeCache</emphasis>
- Mbean:
- </para>
- <programlisting role="XML"><![CDATA[
-<!--
- Configuring the PortalCMSCacheLoader
- CacheLoader configuration for 1.4.0
--->
-<attribute name="CacheLoaderConfiguration">
- <config>
- <passivation>false</passivation>
- <preload></preload>
- <shared>false</shared>
- <cacheloader>
- <class>org.jboss.portal.cms.hibernate.state.PortalCMSCacheLoader</class>
- <properties></properties>
- <async>false</async>
- <fetchPersistentState>false</fetchPersistentState>
- <ignoreModifications>false</ignoreModifications>
- </cacheloader>
- </config>
-</attribute>]]>
- </programlisting>
- <para>
- with the following configuration:
- </para>
- <programlisting role="XML"><![CDATA[
-<!--
- Configuring the PortalCMSCacheLoader
- CacheLoader configuratoon for 1.2.4SP2
--->
-<attribute name="CacheLoaderClass">org.jboss.portal.cms.hibernate.state.PortalCMSCacheLoader
-</attribute>
-<attribute name="CacheLoaderConfig" replace="false"></attribute>
-<attribute name="CacheLoaderPassivation">false</attribute>
-<attribute name="CacheLoaderPreload"></attribute>
-<attribute name="CacheLoaderShared">false</attribute>
-<attribute name="CacheLoaderFetchTransientState">false</attribute>
-<attribute name="CacheLoaderFetchPersistentState">false</attribute>
-<attribute name="CacheLoaderAsynchronous">false</attribute>]]></programlisting>
-
-<para>Finally we can start both servers, open two shells and execute :
- <programlisting><![CDATA[
->cd $JBOSS_HOME/bin
->sh run.sh -c ports-01
-]]></programlisting>
- <programlisting><![CDATA[
->cd $JBOSS_HOME/bin
->sh run.sh -c ports-02
-]]></programlisting>
- </para>
- </section>
-
- <section id="portlet_session_replication">
- <title>Portlet Session Replication</title>
- <para>Web containers offer the capability to replicate sessions of web applications. In the context of a portal using portlets the use case is different. The portal itself is a web application
- that benefits of web application session replication. We have to make the distinction between local or remote portlets :
- <itemizedlist>
- <listitem><para>Local portlets are web applications deployed in the same virtual machine as the portal
- web application. At runtime the access to a portlet is done using the mechanism of request dispatching. The portlet
- session is actually a mere wrapper of the underlying http session of the web application in which the portlet
- is deployed.</para></listitem>
-<listitem><para>Remote portlets are accessed using a web service, we will not cover the replication in this chapter.</para></listitem>
- </itemizedlist></para>
- <para>The servlet specification is very loose on the subject of replication and does not state anything about
- the replication of sessions during a dispatched request. JBoss Portal offers a portlet session replication
- mechanism that leverages the usage of the portal session instead which has several advantages
- </para>
- <itemizedlist>
- <listitem><para>Replicate only the portlet that requires it.</para></listitem>
- <listitem><para>Portal session replication is just web application replication and is very standard.</para></listitem>
- </itemizedlist>
- <para>There are, however, some limitations. For example, you can only replicate portlet-scoped attributes of a portlet
- session. This means that any application-scoped attribute are not replicated.</para>
- <section>
- <title>JBoss Portal configuration</title>
- <para>The mandatory step to make JBoss Portal able to replicate portlet sessions is to configure
- the portal web application to be distributed as explained in <xref linkend="PortalSessionReplication"/></para>
- </section>
- <section>
- <title>Portlet configuration</title>
- <para>In order to activate portlet session replication you need to:</para>
- <itemizedlist>
- <listitem><para>Add a Portal-specific listener class to the <literal>/WEB-INF/web.xml</literal> file of your portlet web application</para></listitem>
- <listitem><para>Configure your portlet to be distributed in the <literal>/WEB-INF/jboss-portlet.xml</literal> file</para></listitem>
- </itemizedlist>
-
- <programlisting><![CDATA[
-<web-app>
- ...
- <listener>
- <listener-class> org.jboss.portal.portlet.session.SessionListener </listener-class>
- </listener>
- ...
-</web-app>
-]]></programlisting>
-
- <para>Example web.xml</para>
-
-<programlisting><![CDATA[
-<portlet-app>
- ...
- <portlet>
- <portlet-name>YourPortlet</portlet-name>
- ...
- <session-config>
- <distributed>true</distributed>
- </session-config>
- ...
- </portlet>
- ...
-</portlet-app>
-]]></programlisting>
-
- <para>Configure YourPortlet to be replicated in jboss-portlet.xml</para>
-
- </section>
- <section>
- <title>Limitations</title>
- <para>As we noted above there are advantages as well as limitations to the clustering configuration</para>
- <itemizedlist>
- <listitem><para>You can only replicate portlet scoped attributes of a portlet. The main reason of this
- is to keep consistency with the session state. If accessing a portlet would trigger replication
- of application scoped attribute during the rendering of a page then another portlet on the same
- page could use this attribute for generating its markup. Then the state seen by this second portlet
- would not necessarily be the same depending on the order in which the portlets on this page are rendered.</para></listitem>
-<listitem><para>Mutable objects need an explicit call to <emphasis>setAttribute(String name, Object value)</emphasis>
- on the portlet session object in order to trigger replication by the container.</para></listitem>
- </itemizedlist>
- <para>
- <programlisting><![CDATA[
-public void processAction(ActionRequest req, ActionResponse resp)
- throws PortletException, IOException
-{
- ...
- if ("addItem".equals(action))
- {
- PortletSession session = req.getPortletSession();
- ShoppingCart cart = (PortletSession)session.getAttribute("cart");
- cart.addItem(item);
-
- // Perform an explicit set in order to signal to the container that the object
- // state has changed
- session.setAttribute("cart", cart);
- }
- ...
-}
-]]></programlisting>
- </para>
- </section>
- </section>
-</chapter>
- <chapter id="wsrp">
-<!-- <chapterinfo>
- <author>
- <firstname>Julien</firstname>
- <surname>Viet</surname>
- </author>
- <author>
- <firstname>Chris</firstname>
- <surname>Laprun</surname>
- </author>
- </chapterinfo>-->
-
- <title>Web Services for Remote Portlets (WSRP)</title>
-
- <section>
- <title>Introduction</title>
- <para>The Web Services for Remote Portlets specification defines a web service interface for accessing and
- interacting with interactive presentation-oriented web services. It has been produced through the efforts of
- the Web Services for Remote Portlets (WSRP) OASIS Technical Committee. It is based on the requirements
- gathered and on the concrete proposals made to the committee.
- </para>
-
- <para>Scenarios that motivate WSRP functionality include:
- <itemizedlist>
- <listitem><para>Content hosts, such as portal servers, providing Portlets as presentation-oriented web services
- that can be used by aggregation engines.</para>
- </listitem>
- <listitem><para>Aggregating frameworks, including portal servers, consuming presentation-oriented web services
- offered by content providers and integrating them into the framework.</para>
- </listitem>
- </itemizedlist>
- </para>
-
- <para>More information on WSRP can be found on the
- <ulink url="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=wsrp">official website for WSRP</ulink>.
- We suggest reading the <ulink url="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=wsrp">primer
- </ulink> for a good, albeit technical, overview of WSRP.
- </para>
- </section>
-
- <section id="wsrp_support">
- <title>Level of support in JBoss Portal</title>
- <para>The WSRP Technical Committee defined
- <ulink url="http://www.oasis-open.org/committees/download.php/3073">WSRP Use Profiles</ulink>
- to help with WSRP interoperability. We will refer to terms defined in that document in
- this section.
- </para>
-
- <para>JBoss Portal provides a Simple level of support for our WSRP Producer except that out-of-band registration
- is not currently handled. We support in-band registration and persistent local state (which are
- defined at the Complex level).
- </para>
-
- <para>On the Consumer side, JBoss Portal provides a Medium level of support for WSRP, except that we only handle
- HTML markup (as Portal itself doesn't handle other markup types). We do support explicit portlet cloning and
- we fully support the PortletManagement interface.
- </para>
-
- <para>As far as caching goes, we have Level 1 Producer and Consumer. We support Cookie handling properly on the
- Consumer and our Producer requires initialization of cookies (as we have found that it improved interoperabilty
- with some consumers). We don't support custom window states or modes, as Portal doesn't either. We do, however,
- support CSS on both the Producer (though it's more a function of the portlets than inherent Producer
- capability) and Consumer.
- </para>
-
- <para>While we provide a complete implementation of WSRP 1.0, we do need to go through the
- <ulink url="http://www.oasis-open.org/committees/download.php/6018">Conformance statements</ulink>
- and perform more interoperability testing (an area that needs to be better supported by the WSRP Technical
- Committee and Community at large).
- </para>
- </section>
-
- <section>
- <title>Deploying JBoss Portal's WSRP services</title>
- <para>
- JBoss Portal provides a complete support of WSRP 1.0 standard interfaces and offers both consumer and producer
- services. WSRP support is provided by the <filename>portal-wsrp.sar</filename> service archive, included in
- the main <filename>jboss-portal.sar</filename> service archive, if you've obtained JBoss Portal from a binary
- distribution. If you don't intend on using WSRP, we recommend that you remove <filename>portal-wspr.sar</filename>
- from the main <filename>jboss-portal.sar</filename> service archive.
- </para>
- <para>If you've obtained the source distribution of JBoss Portal, you need to build and deploy the WSRP service
- separately. Please follow the instructions on how to install
- <ulink url="http://docs.jboss.com/jbportal/v2.6/reference-guide/en/html/installation....">JBoss
- Portal from the sources</ulink>. Once this is done, navigate to
- <filename>JBOSS_PORTAL_HOME_DIRECTORY/wsrp</filename> and type: <command>build deploy</command>
- At the end of the build process, <filename>portal-wsrp.sar</filename> is copied to
- <filename>JBOSS_HOME/server/default/deploy</filename>.
- </para>
-
- <section id="wsrp-ports">
- <title>Considerations to use WSRP when running Portal on a non-default port or hostname</title>
- <para>If you have modified the port number on which Portal runs or bound your Application Server to a specific
- host name, you will also need
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=WSRPChangePorts">update the port and/or hostname
- information for WSRP</ulink> as found on
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossPortal">JBoss Portal's wiki</ulink>.
- </para>
- </section>
-
- <section>
- <title>Considerations to use WSRP with SSL</title>
- <para>It is possible to use WSRP over SSL for secure exchange of data. Please refer to the
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=WSRPUseSSL">instructions</ulink>
- on how to do so from
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossPortal">JBoss Portal's wiki</ulink>.
- </para>
- </section>
- </section>
-
- <section>
- <title>Making a portlet remotable</title>
- <para>JBoss Portal does <emphasis role="bold">NOT</emphasis>, by default, expose local portlets for consumption by
- remote WSRP consumers. In order to make a portlet remotely available, it must be made "remotable" by adding a
- <literal>remotable</literal> element to the <filename>jboss-portlet.xml</filename> deployment descriptor for
- that portlet. If a <filename>jboss-portlet.xml</filename> file does not exist, one must be added to the
- <filename>WEB-INF</filename> folder of the web application containing the portlet.
- </para>
- <para>In the following example, the "BasicPortlet" portlet is specified as being remotable. The
- <literal>remotable</literal> element is optional.
- </para>
-
- <programlisting><![CDATA[
-<?xml version="1.0" standalone="yes"?>
-<!DOCTYPE portlet-app PUBLIC "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
-<portlet-app>
- <portlet>
- <portlet-name>BasicPortlet</portlet-name>
- <remotable>true</remotable>
- </portlet>
-</portlet-app>]]></programlisting>
-
- <para>
- It is also possible to specify that all the portlets declared within a given <filename>jboss-portlet.xml</filename>
- file have a specific "remotable" status by default. This is done by adding a single <literal>remotable</literal>
- element to the root <literal>portlet-app</literal> element. Usually, this feature will be used to remotely expose
- several portlets without having to specify the status for all the declared portlets. Let's look at an example:
- </para>
-
- <programlisting><![CDATA[
-<?xml version="1.0" standalone="yes"?>
-<!DOCTYPE portlet-app PUBLIC
- "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
-<portlet-app>
- <remotable>true</remotable>
- <portlet>
- <portlet-name>RemotelyExposedPortlet</portlet-name>
- ...
- </portlet>
- <portlet>
- <portlet-name>NotRemotelyExposedPortlet</portlet-name>
- <remotable>false</remotable>
- ...
- </portlet>
-</portlet-app>]]>
- </programlisting>
-
-
- <para>
- In the example above, we defined two portlets with a default "remotable" status set to true. This means that
- all portlets defined in this descriptor are, by default, exposed remotely by JBoss Portal's WSRP producer.
- Note, however, that it is possible to override the default behavior by adding a <literal>remotable</literal>
- element to a portlet description. In that case, the "remotable" status defined by the portlet takes precedence
- over the default. In the example above, the <literal>RemotelyExposedPortlet</literal> inherits the "remotable"
- status defined by default since it does not specify a <literal>remotable</literal> element in its description.
- The <literal>NotRemotelyExposedPortlet</literal>, however, overrides the default behavior and is not remotely
- exposed. Note that in the absence of a top-level <literal>remotable</literal> element, portlets are NOT
- remotely exposed.
- </para>
- </section>
-
- <section>
- <title>Consuming JBoss Portal's WSRP portlets from a remote Consumer</title>
- <para>WSRP Consumers vary a lot as far as how they are configured. Most of them require that you either specify
- the URL for the Producer's WSDL definition or the URLs for the individual endpoints. Please refer to your
- Consumer's documentation for specific instructions. For instructions on how to do so in JBoss Portal, please
- refer to <xref linkend="consumer_configuration"/>.
- </para>
- <para>
- JBoss Portal's Producer is automatically set up when you deploy a portal instance with the WSRP service.
- You can access the WSDL file at
- <filename>http://{hostname}:{port}/portal-wsrp/MarkupService?wsdl</filename>. You can access the endpoint URLs
- at:
- <itemizedlist>
- <listitem><para>
- <filename>http://{hostname}:{port}/portal-wsrp/ServiceDescriptionService</filename></para>
- </listitem>
- <listitem><para>
- <filename>http://{hostname}:{port}/portal-wsrp/MarkupService</filename></para>
- </listitem>
- <listitem><para>
- <filename>http://{hostname}:{port}/portal-wsrp/RegistrationService</filename></para>
- </listitem>
- <listitem>
- <para><filename>http://{hostname}:{port}/portal-wsrp/PortletManagementService</filename></para>
- </listitem>
- </itemizedlist>
- The default hostname is <literal>localhost</literal> and the default port is 8080.
- </para>
- </section>
-
- <section id="consumer_configuration">
- <title>Consuming remote WSRP portlets in JBoss Portal</title>
- <section>
- <title>Overview</title>
- <para>
- To be able to consume WSRP portlets exposed by a remote producer, JBoss Portal's WSRP consumer needs to know
- how to access that remote producer. One can configure access to a remote producer using WSRP Producer
- descriptors. Alternatively, a portlet is provided to configure remote producers.
- </para>
- <para>
- Once a remote producer has been configured, it can be made available
- in the list of portlet providers in the Management portlet on the Admin page of JBoss Portal. You can then
- examine the list of portlets that are exposed by this producer and configure the portlets just like you
- would for local portlets.
- </para>
- <para>
- JBoss Portal's default configuration exposes some of the sample portlets for remote consumption. As a way to
- test the WSRP service, a default consumer has been configured to consume these portlets. To make sure that
- the service indeed works, check that there is a portlet provider with the
- <literal>self</literal>
- identifier in the portlet providers list in the Management portlet of the Admin page. All local portlets
- marked as remotable are exposed as remote portlets via the
- <literal>self</literal>
- portlet
- provider so that you can check that they work as expected with WSRP. The
- <filename>portal-wsrp.sar</filename>
- file contains a WSRP Producer descriptor (<filename>default-wsrp.xml</filename>) that configures this
- default producer. This file can be edited or removed if needed.
- </para>
- </section>
-
- <section>
- <title>Configuring a remote producer walk-through</title>
- <para>
- Let's work through the steps of defining access to a remote producer so that its portlets can be
- consumed within JBoss Portal. We will configure access to BEA's public WSRP producer. We will first examine
- how to do so using the configuration portlet. We will then show how the same result can be accomplish with
- a producer descriptor.
- </para>
-
- <section id="consumer_gui">
- <title>Using the configuration portlet</title>
- <para>
- As of Portal 2.6, a configuration portlet is provided to configure access to remote WSRP Producers
- grahically. You can access it at
- <filename>http://{hostname}:{port}/portal/auth/portal/admin/WSRP</filename>
- or by logging in as a Portal administrator and clicking on the WSRP tab in the Admin portal. If all went
- well, you should see something similar to this:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/config_init.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- This screen presents all the configured producers associated with their status and possible actions on
- them. A Consumer can be active or inactive. Activating a Consumer means that it is ready to act as a
- portlet provider. Deactivating it will remove it from the list of available portlet providers. Note also
- that a Consumer can be marked as requiring refresh meaning that the information held about it might not
- be up to date and refreshing it from the remote Producer might be a good idea. This can happen for
- several reasons: the service description for that remote Producer has not been fetched yet, the cached
- version has expired or modifications have been made to the configuration that could potentially
- invalidate it, thus requiring re-validation of the information.
- </para>
-
- <para>
- Next, we create a new Consumer which we will call<literal>bea</literal>. Type "<literal>bea</literal>" in
- the
- "Create a consumer named:" field then click on "Create consumer":
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/config_create.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- You should now see a form allowing you to enter/modify the information about the Consumer.
- Set the cache expiration value to 300 seconds and enter the WSDL URL for the producer in the text field
- and press the "Refresh & Save" button:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/config_usewsdl.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- This will retrieve the service description associated with the Producer which WSRP is described by the
- WSDL file found at the URL you just entered. In our case, querying the service description will allow us
- to learn that the Producer requires registration and that it expects a value for the registration
- property named <literal>registration/consumerRole</literal>:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/config_refresh.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- <note><title>Note</title><para>At this point, there is no automated way to learn about which possible values (if any) are
- expected by the remote Producer. In the case of BEA's public producer, the possible values are
- indicated in the registration property description. This is not always the case... Please refer to
- the specific Producer's documentation.</para>
- </note>
- Enter "<literal>public</literal>" as the value for the registration property and press "Save &
- Refresh" once more. You should now
- see something similar to:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/config_end.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- The Consumer for the <literal>bea</literal> Producer should now be available as a portlet provider and
- is ready to be used.
- </para>
- <para>
- A producer is configured, by default, by retrieving the producer's information via a WSDL URL. There are
- rare cases, however, where URLs need to be provided for each of the producer's end points. You can do
- exactly that by unchecking the "Use WSDL?" checkbox, as is the case for the <literal>self</literal>
- producer:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/config_self.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- </section>
-
- <section>
- <title>Using a WSRP Producer XML descriptor</title>
-
- <para>We will create a <filename>public-bea-wsrp.xml</filename> descriptor. Note that the actual name does not
- matter as long as it ends with <filename>-wsrp.xml</filename>:
- </para>
- <programlisting role="XML"><![CDATA[
-<?xml version='1.0' encoding='UTF-8' ?>
-<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-wsrp-consumer_2_6.dtd">
-<deployments>
- <deployment>
- <wsrp-producer id="bea" expiration-cache="300">
- <endpoint-wsdl-url>http://wsrp.bea.com:7001/producer/producer?WSDL</endpoint-wsdl-url>
- <registration-data>
- <property>
- <name>registration/consumerRole</name>
- <lang>en</lang>
- <value>public</value>
- </property>
- </registration-data>
- </wsrp-producer>
- </deployment>
-</deployments>]]></programlisting>
- <para>
- This producer descriptor gives access to BEA's public WSRP producer. We will look at the details of the different elements later. Note for now the <literal>producer-id</literal> element with a "<literal>bea</literal>" value. Put this file in the deploy directory and start the server (with JBoss Portal and its WSRP service deployed).
- </para>
- <para>
- <note><title>Note</title><para>A DTD and an XML Schema for WSRP Producer XML descriptors are available in
- <filename>jboss-portal.sar/portal-wsrp.sar/dtd/jboss-wsrp-consumer_2_6.dtd</filename> and
- <filename>jboss-portal.sar/portal-wsrp.sar/xsd/jboss-wsrp-consumer_2_6.xsd</filename></para>
- </note>
- </para>
- </section>
-
- <section>
- <title>Configuring access to a remote portlet</title>
- <para>
- Let's now look at the Admin page and the Management portlet. Click on the "Portlet definitions" tab at
- the
- top. Once this is done, look at the list of available portlet providers. If all went well,
- you should see something similar to this:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/portlets.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- We have 3 available portlet providers:
- <literal>local, self</literal>
- and<literal>bea</literal>. The
- <literal>local</literal>
- portlet provider exposes all the portlets deployed in this particular instance of Portal. As
- explained above, the
- <literal>self</literal>
- provider refers to the default WSRP consumer bundled with Portal that consumes
- the portlets exposed by the default WSRP producer. The
- <literal>bea</literal>
- provider corresponds to BEA's public producer
- we just configured. Select it and click on "View portlets". You should now see something similar to:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/bea.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- From there on out, you should be able to configure WSRP portlets just as any other. In particular, you
- can create an instance of one of the remote portlets offered by BEA's public producer just like you would
- create an instance of a local portlet and then assign it to a window in a page. If you go to that page,
- you should see something similar to below for this portlet:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/result.png" align="center" valign="middle"/>
- </imageobject>
- </mediaobject>
- </para>
- </section>
- </section>
-
- <section>
- <title>WSRP Producer descriptors</title>
-
- <para>
- A WSRP Producer descriptor is an XML file which name ends in <filename>-wsrp.xml</filename> and
- which can be dropped in the deploy directory of the JBoss application server or nested in .sar files. It is
- possible to configure access to several different producers within a single descriptor or use one file per
- producer, depending on your needs. An XML Schema for the WSRP Producer descriptor format can be found at
- <filename>jboss-portal.sar/portal-wsrp.sar/xsd/jboss-wsrp-consumer_2_6.xsd</filename>, while a (legacy) DTD
- can be found at <filename>jboss-portal.sar/portal-wsrp.sar/dtd/jboss-wsrp-consumer_2_6.dtd</filename>.
-
- <note><title>Note</title><para>It is important to note how WSRP Producer descriptors are processed. They are read the first time the
- WSRP service starts and the associated information is then put in the Portal database. Subsequent launch
- of the WSRP service will use the database-stored information for all producers which identifier is
- already known to Portal. More specifically, all the descriptors are scanned for producer identifiers.
- Any identifier that is already known will be bypassed and the configuration associated with this remote
- producer in the database will be used. If a producer identifier is found that wasn't already in the
- database, that producer information will be processed and recorded in the database. Therefore, if you
- wish to delete a producer configuration, you need to delete the associated information in the database
- (this can be accomplished using the configuration portlet as we saw in <xref linkend="consumer_gui"/>)
- <emphasis>AND</emphasis> remove the associated information in any WSRP Producer descriptor (if such
- information exists) as the producer will be re-created the next time the WSRP is launched if that
- information is not removed.</para>
- </note>
- </para>
-
- <section>
- <title>Required configuration information</title>
-
- <para>Let's now look at which information needs to be provided to configure access to a remote producer.
- </para>
-
- <para>First, we need to provide an identifier for the producer we are configuring so that we can refer to it
- afterwards. This is accomplished via the mandatory
- <literal>id</literal>
- attribute of the
- <literal><wsrp-producer></literal>
- element.
- </para>
-
- <para>JBoss Portal also needs to learn about the remote producer's endpoints to be able to connect to the
- remote web services and perform WSRP invocations. Two options are currently supported to provide this
- information:
- </para>
-
- <para>
- <itemizedlist>
- <listitem><para>You can provide the URLs for each of the different WSRP interfaces offered by the remote
- producer via the
- <literal><endpoint-config></literal>
- element and its
- <literal><service-description-url></literal>,
- <literal><markup-url></literal>,
- <literal><registration-url></literal>
- and
- <literal><portlet-management-url></literal>
- children. These URLs are
- producer-specific so you will need to refer to your producer documentation or WSDL file to
- determine
- the appropriate values.</para>
- </listitem>
- <listitem><para>Alternatively, and this is the easiest way to configure your producer, you can provide a URL
- pointing to the WSDL description of the producer's WSRP services. This is accomplished via the
- <literal><endpoint-wsdl-url></literal>
- element. JBoss Portal will then
- heuristically determine, from the information contained in the WSDL file, how to connect
- appropriately
- to the remote WSRP services.
- <note><title>Note</title><para>It is important to note that, when using this method, JBoss Portal will try to match a port
- name to an interface based solely on the provided name. There are no standard names for these
- ports so it is possible (though rare) that this matching process fails. In this case, you should
- look at the WSDL file and provide the endpoint URLs manually, as per the previous method.</para>
- </note></para>
- </listitem>
- </itemizedlist>
- </para>
-
- <para>Both the
- <literal>id</literal>
- attribute and either
- <literal><endpoint-config></literal>
- or
- <literal><endpoint-wsdl-url></literal>
- elements
- are required for a functional remote producer configuration.
- </para>
- </section>
-
- <section>
- <title>Optional configuration</title>
- <para>It is also possible to provide addtional configuration, which, in some cases, might be important to
- establish a proper connection to the remote producer.
- </para>
-
- <para>One such optional configuration concerns caching. To prevent useless roundtrips between the local
- consumer and the remote producer, it is possible to cache some of the information sent by the producer
- (such
- as the list of offered portlets) for a given duration. The rate at which the information is refreshed is
- defined by the
- <literal>expiration-cache</literal>
- attribute of the
- <literal><wsrp-producer></literal>
- element which specifies the
- refreshing period in seconds. For example, providing a value of 120 for expiration-cache means that the
- producer information will not be refreshed for 2 minutes after it has been somehow accessed. If no value
- is provided, JBoss Portal will always access the remote producer regardless of whether the remote
- information has changed or not. Since, in most instances, the information provided by the producer does
- not
- change often, we recommend that you use this caching facility to minimize bandwidth usage.
- </para>
-
- <para>Additionally, some producers require consumers to register with them before authorizing them to access
- their offered portlets. If you know that information beforehand, you can provide the required registration
- information in the producer configuration so that the Portal consumer can register with the remote
- producer when required.
- <note><title>Note</title><para>At this time, though, only simple String properties are supported and it is not possible to
- configure complex registration data. This should however be sufficient for most cases.</para>
- </note>
- </para>
-
- <para>Registration configuration is done via the
- <literal><registration-data></literal>
- element. Since JBoss Portal can generate the mandatory information for you, if the remote producer does
- not
- require any registration properties, you only need to provide an empty
- <literal><registration-data></literal>
- element. Values for the registration properties
- required by the remote producer can be provided via
- <literal><property></literal>
- elements. See the example below for more details. Additionally, you can override the default consumer
- name
- automatically provided by JBoss Portal via the
- <literal><consumer-name></literal>
- element. If you choose to provide a consumer name, please remember that this should uniquely identify
- your
- consumer.
- </para>
- </section>
- </section>
-
- <section>
- <title>Examples</title>
-
- <para>
- Here is the configuration of the <literal>self</literal> producer as found in
- <filename>default-wsrp.xml</filename> with a cache expiring every five minutes:
- </para>
-
-
- <programlisting><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-wsrp-consumer_2_6.dtd">
-
-<deployments>
- <deployment>
- <wsrp-producer id="self" expiration-cache="300">
- <!--
- we need to use the individual endpoint configuration because the configuration via
- wsdl forces an immediate attempt to access the web service description which is not
- available yet at this point of deployment
- -->
- <endpoint-config>
- <service-description-url>
- http://localhost:8080/portal-wsrp/ServiceDescriptionService
- </service-description-url>
- <markup-url>http://localhost:8080/portal-wsrp/MarkupService</markup-url>
- <registration-url>
- http://localhost:8080/portal-wsrp/RegistrationService
- </registration-url>
- <portlet-management-url>
- http://localhost:8080/portal-wsrp/PortletManagementService
- </portlet-management-url>
- </endpoint-config>
- <registration-data/>
- </wsrp-producer>
- </deployment>
-</deployments>]]>
- </programlisting>
-
-
- <para>Here is an example of a WSRP descriptor with a 2 minute caching time and manual definition of the
- endpoint URLs:
- </para>
-
-
- <programlisting><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-wsrp-consumer_2_6.dtd">
-
-<deployments>
- <deployment>
- <wsrp-producer id="MyProducer" expiration-cache="120">
- <endpoint-config>
- <service-description-url>
- http://www.someproducer.com/portal-wsrp/ServiceDescriptionService
- </service-description-url>
- <markup-url>
- http://www.someproducer.com/portal-wsrp/MarkupService
- </markup-url>
- <registration-url>
- http://www.someproducer.com/portal-wsrp/RegistrationService
- </registration-url>
- <portlet-management-url>
- http://www.someproducer.com/portal-wsrp/PortletManagementService
- </portlet-management-url>
- </endpoint-config>
- </wsrp-producer>
- </deployment>
-</deployments>]]></programlisting>
-
-
- <para>Here is an example of a WSRP descriptor with endpoint definition via remote WSDL file, registration
- data and cache expiring every minute:
- </para>
-
-
- <programlisting><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-wsrp-consumer_2_6.dtd">
-
-<deployments>
- <deployment>
- <wsrp-producer id="AnotherProducer" expiration-cache="60">
- <endpoint-wsdl-url>http://example.com/producer/producer?WSDL</endpoint-wsdl-url>
- <registration-data>
- <property>
- <name>property name</name>
- <lang>en</lang>
- <value>property value</value>
- </property>
- </registration-data>
- </wsrp-producer>
- </deployment>
-</deployments>]]></programlisting>
-
- </section>
- </section>
-
- <section>
- <title>Consumers maintenance</title>
-
- <section>
- <title>Modifying a currently held registration</title>
-
- <section>
- <title>Registration modification for service upgrade</title>
- <para>
- Producers often offer several levels of service depending on consumers' subscription levels (for
- example).
- This is implemented at the WSRP level with the registration concept: producers assert which level of
- service to provide to consumers based on the values of given registration properties.
- </para>
- <para>
- It is therefore sometimes necessary to modify the registration that concretizes the service agreement
- between a consumer and a producer. An example of easily available producer offering different level of
- services is BEA's public producer. We configured access to that producer in
- <xref linkend="consumer_gui"/>.
- If you recall, the producer was requiring registration and required a value to be provided for the
- <literal>registration/consumerRole</literal>
- property. The description of that property indicated that
- three values were possible: <literal>public</literal>, <literal>partner</literal> or
- <literal>insider</literal> each corresponding to a different service level. We registered using the
- <literal>public</literal> service level. This gave us access to three portlets as shown here:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/bea.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- Suppose now that we would like to upgrade our service level to the "insider" level. We will need to
- tell BEA's producer that our registration data has been modified. Let's see how to do this. Assuming you
- have configured access to the producer as previously described, please go to the configuration screen for
- the <literal>bea</literal> producer and modify the value of the <literal>registration/consumerRole</literal>
- to <literal>insider</literal> instead of <literal>public</literal>:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/modify_reg_start.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- Now click on "Update properties" to save the change. A "Modify registration" button should now appear to
- let you send this new data to the remote producer:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/modify_reg_modify.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- Click on this new button and, if everything went well and your updated registration has been accepted by
- the remote producer, you should see something similar to:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/modify_reg_end.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- You can now check the list of available portlets from the <literal>bea</literal> provider and verify that
- new portlets are now available:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/bea_insider.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
-
- </section>
-
- <section id="reg_mod_error">
- <title>Registration modification on producer error</title>
-
- <para>
- It can also happen that a producer administrator decided to require more information from registered
- consumers. In this case, invoking operations on the producer will fail with an
- <literal>OperationFailedFault</literal>. JBoss Portal will attempt to help you in this
- situation. Let's walk through an example using the <literal>self</literal> producer. Let's assume that
- registration is required without any registration properties (as is the case by default). If you go to
- the configuration screen for this producer, you should see:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/config_self.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
-
- Now suppose that the administrator of the producer now requires a value to be provided for an
- <literal>email</literal> registration property. We will actually see how to do perform this operation
- in JBoss Portal when we examine how to configure Portal's producer in <xref linkend="producer_config"/>.
- Operations with this producer will now fail. If you suspect that a registration modification is required,
- you should go to the configuration screen for this remote producer and refresh the information held by
- the consumer by pressing "Refresh & Save":
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/modify_reg_self.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
-
- As you can see, the configuration screen now shows the currently held registration information and
- the expected information from the producer. Enter a value for the <literal>email</literal> property
- and then click on "Modify registration". If all went well and the producer accepted your new registration
- data, you should see something similar to:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/modify_reg_self_end.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
-
- <note><title>Note</title><para>As of WSRP 1, it is rather difficult to ascertain for sure what caused an
- <literal>OperationFailedFault</literal> as it is the generic exception returned by
- producers if something didn't quite happen as expected during a method invocation. This means that
- <literal>OperationFailedFault</literal> can be caused by several different reasons, one
- of them being a request to modify the registration data. Please take a look at the log files to see
- if you can gather more information as to what happened. WSRP 2 introduces an exception that is
- specific to a request to modify registrations thus reducing the ambiguity that currently exists.</para>
- </note>
- </para>
- </section>
- </section>
-
- <section>
- <title>Consumer operations</title>
- <para>
- Several operations are available from the consumer list view of the WSRP configuration portlet:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/consumer_operations.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- The available operations are:
- <itemizedlist>
- <listitem><para>Configure: displays the consumer details and allows user to edit them</para></listitem>
- <listitem>
- <para>Refresh: forces the consumer to retrieve the service description from the remote producer to refresh
- the local information (offered portlets, registration information, etc.)</para>
- </listitem>
- <listitem><para>
- Activate/Deactivate: activates/deactivates a consumer, governing whether it will be available to
- provide portlets and receive portlet invocations</para>
- </listitem>
- <listitem><para>
- Register/Deregister: registers/deregisters a consumer based on whether registration is required
- and/or acquired</para>
- </listitem>
- <listitem><para>Delete: destroys the consumer, after deregisterting it if it was registered</para></listitem>
- </itemizedlist>
- </para>
- </section>
-
- <section>
- <title>Erasing local registration data</title>
- <para>
- There are rare cases where it might be required to erase the local information without being able to
- deregister first. This is the case when a consumer is registered with a producer that has been modified by
- its administrator to not require registration anymore. If that ever was to happen (most likely, it won't),
- you can erase the local registration information from the consumer so that it can resume interacting with
- the remote producer. To do so, click on "Erase local registration" button next to the registration context
- information on the consumer configuration screen:
- </para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/erase_registration.png" align="center" valign="middle"/>
- </imageobject>
- </mediaobject>
- <para>
- <emphasis>Warning:</emphasis> This operation is dangerous as it can result in inability to interact with the remote producer if invoked when not required. A warning screen will be displayed to give you a chance to change your mind:
- </para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/erase_registration_warning.png" align="center" valign="middle"/>
- </imageobject>
- </mediaobject>
- </section>
- </section>
-
- <section id="producer_config">
- <title>Configuring JBoss Portal's WSRP Producer</title>
- <section>
- <title>Overview</title>
- <para>
- You can configure the behavior of Portal's WSRP Producer by using the WSRP administration interface, which
- is the preferred way, or by editing the <filename>conf/config.xml</filename> file found in
- <filename>portal-wsrp.sar</filename>. Several aspects can be modified with respects to whether
- registration is required for consumers to access the Producer's services. An XML Schema for the configuration
- format is available at <filename>jboss-portal.sar/portal-wsrp.sar/xsd/jboss-wsrp-producer_2_6.xsd</filename>,
- while a (legacy) DTD is available at
- <filename>jboss-portal.sar/portal-wsrp.sar/dtd/jboss-wsrp-producer_2_6.dtd</filename>
- </para>
- </section>
- <section>
- <title>Default configuration</title>
- <para>
- The default producer configuration is to require that consumers register with it before providing access its
- services but does not require any specific registration properties (apart from what is mandated by the
- WSRP standard). It does, however, require consumers to be registered before sending them a full service
- description. This means that our WSRP producer will not provide the list of offered portlets and other
- capabilities to unregistered consumers. The producer also uses the default
- <classname>RegistrationPolicy</classname> paired with the default
- <classname>RegistrationPropertyValidator</classname>. We will look into property
- validators in greater detail later in <xref linkend="registration-configuration"/>. Suffice to say for now
- that this allows users to customize how Portal's WSRP Producer decides whether a given registration property
- is valid or not.
- </para>
- <para>
- JBoss Portal 2.6.3 introduces a web interface to configure the producer's behavior. You can access it
- by clicking on the "Producer Configuration" tab of the "WSRP" page of the "admin" portal. Here's what you
- should see with the default configuration:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/producer_default.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- As would be expected, you can specify whether or not the producer will send the full service description to
- unregistered consumers, and, if it requires registration, which <classname>RegistrationPolicy</classname> to
- use (and, if needed, which <classname>RegistrationPropertyValidator</classname>), along with required
- registration property description for which consumers must provide acceptable values to successfully
- register.
- </para>
- </section>
-
- <section id="registration-configuration">
- <title>Registration configuration</title>
- <para>
- In order to require consumers to register with Portal's producer before interacting with it, you need to
- configure Portal's behavior with respect to registration. Registration is optional, as are registration
- properties. The producer can require registration without requiring consumers to pass any registration
- properties as is the case in the default configuration. Let's configure our producer starting with a blank
- state:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/producer_blank.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- We will allow unregistered consumers to see the list of offered portlets so we leave the first checkbox
- ("Access to full service description requires consumers to be registered.") unchecked. We will, however,
- specify that consumers will need to be registered to be able to interact with our producer. Check the second
- checkbox ("Requires registration. Modifying this information will trigger invalidation of consumer
- registrations."). The screen should now refresh and display:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/producer_registration.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- You can specify the fully-qualified name for your <classname>RegistrationPolicy</classname> and
- <classname>RegistrationPropertyValidator</classname> there. We will keep the default value. See
- <xref linkend="custom_registration"/> for more details. Let's add, however, a registration property called
- <literal>email</literal>. Click "Add property" and enter the appropriate information in the fields,
- providing a description for the registration property that can be used by consumers to figure out its
- purpose:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/producer_email.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- Press "Save" to record your modifications.
-
- <note><title>Note</title><para>
- At this time, only String (xsd:string) properties are supported. If your application requires more
- complex properties, please let us know.</para>
- </note>
-
- <note><title>Note</title><para>
- If consumers are already registered with the producer, modifying the configuration of required
- registration
- information will trigger the invalidation of held registrations, requiring consumers to modify their
- registration before being able to access the producer again. We saw the consumer side of that process
- in <xref linkend="reg_mod_error"/>.</para>
- </note>
- </para>
-
- <section id="custom_registration">
- <title>Customization of Registration handling behavior</title>
- <para>
- Registration handling behavior can be customized by users to suit their Producer needs. This is
- accomplished by providing an implementation of the
- <classname>RegistrationPolicy</classname>
- interface. This interface defines methods that are called by Portal's Registration service so that
- decisions can be made appropriately. A default registration policy that provides basic
- behavior is provided and should be enough for most user needs.
- </para>
- <para>
- While the default registration policy provides default behavior for most registration-related aspects,
- there is still one aspect that requires configuration: whether a given value for a registration property
- is acceptable by the WSRP Producer. This is accomplished by plugging a
- <classname>RegistrationPropertyValidator</classname>
- in the default registration policy. This allows users to define their own validation mechanism.
- </para>
- <para>
- Please refer to the <trademark class="trade">Javadoc</trademark> for <classname>org.jboss.portal.registration.RegistrationPolicy</classname>
- and <classname>org.jboss.portal.Registration.policies.RegistrationPropertyValidator</classname> for more
- details on what is expected of each method.
- </para>
- <para>Defining a registration policy is required for the producer to be correctly configured. This is
- accomplished by specifying the qualified class name of the registration policy. Since we anticipate that
- most users will use the default registration policy, it is possible to provide the class
- name of your custom property validator instead to customize the default registration policy behavior.
- Note that property validators are only used by the default policy.
-
- <note><title>Note</title><para>Since the policy or the validator are defined via their class name and dynamically loaded, it is
- important that you make sure that the identified class is available to the application server. One way
- to accomplish that is to deploy your policy implementation as JAR file in your AS instance deploy
- directory. Note also that, since both policies and validators are dynamically instantiated, they must
- provide a default, no-argument constructor.</para>
- </note>
- </para>
- </section>
- </section>
- <section id="strict-mode">
- <title>WSRP validation mode</title>
- <para>The lack of conformance kit and the wording of the WSRP specification leaves room for differing
- interpretations, resulting in interoperability issues. It is therefore possible to encounter issues when
- using consumers from different vendors. We have experienced such issues and have introduced a way to relax
- the validation that our WSRP producer performs on the data provided by consumers to help with
- interoperability by accepting data that would normally be invalid. Note that we only relax our validation
- algorithm on aspects of the specification that are deemed harmless such as invalid language codes.
- </para>
- <para>
- By default, the WSRP producer is configured in strict mode. If you experience issues with a given consumer,
- you might want to try to relax the validation mode. This is accomplished by unchecking the "Use strict WSRP
- compliance." checkbox on the Producer configuration screen.
- </para>
- </section>
-
- </section>
-</chapter>
- <chapter id="security">
- <!-- <chapterinfo>
- <author>
- <firstname>Roy</firstname>
- <surname>Russo</surname>
- </author>
- <author>
- <firstname>Julien</firstname>
- <surname>Viet</surname>
- </author>
- </chapterinfo>-->
- <title>Security</title>
- <section id="securing_objects">
- <title>Securing Portal Objects</title>
- <para>
- This section describes how to secure portal objects (portal instances, pages, and portlet instances), using the
- JBoss
- Portal *-object.xml descriptor OR portlet-instances.xml descriptor. View the User Guide for information on how
- to secure objects using the
- Management Portlet.
- </para>
- <para>Securing portal objects declaratively, is done through the *-object.xml (
- <xref linkend="desc_objectxml"/>
- ), for Portal Instances and Pages, or the portlet-instances.xml (
- <xref linkend="desc_instancesxml"/>
- ) for Portlet Instances. The portion you will be adding to each object is denoted by the
- <emphasis><security-constraint></emphasis>
- tag:
- <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE deployments PUBLIC
- "-//JBoss Portal//DTD Portal Object 2.6//EN"
- "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
-<deployments>
- <deployment>
- <parent-ref>default</parent-ref>
- <if-exists>overwrite</if-exists>
- <properties/>
- <page>
- <page-name>MyPage</page-name>
- <window>
- <window-name>HelloWorldPortletPageWindow</window-name>
- <instance-ref>HelloWorldPortletPageInstance</instance-ref>
- <region>center</region>
- <height>0</height>
- </window>
- <security-constraint>
- <policy-permission>
- <action-name>viewrecursive</action-name>
- <unchecked/>
- </policy-permission>
- </security-constraint>
- </page>
- </deployment>
-</deployments>]]></programlisting>
- </para>
- <para>The basic principle of the security mechanism is that everything is restricted unless you grant privileges.
- You grant privilege on a portal node by adding a security constraint as explained here:
-
- <programlisting><![CDATA[<security-constraint>
- <policy-permission>
- <unchecked/>
- <action-name>viewrecursive</action-name>
- </policy-permission>
-</security-constraint>]]></programlisting>
- The example above will grant the view privilege to anyone (unchecked role) to the current object and any
- child object recursively.</para>
- <para>
- The security contraint portion is worth taking a look at, in an isolated fashion. It allows you to
- secure a specific window/page/portal-instance based on a user's role.
- </para>
- <para>
- <emphasis role="bold">Role definition:</emphasis>
- You must define a role that this security constraint will apply to. Possible values are:
- </para>
- <itemizedlist>
- <listitem>
- <para> <emphasis role="bold"><unchecked/></emphasis>
- Anyone can view this page.</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold"><role-name>SOMEROLE</role-name></emphasis>
- Access to this page is limited to the defined role.</para>
- </listitem>
- </itemizedlist>
- <para>
- <emphasis role="bold">Access Rights:</emphasis>
- You must define the access rights given to the role defined. Possible values are:
- </para>
- <itemizedlist>
- <listitem>
- <para> <emphasis role="bold">view</emphasis>
- Users can view the page.</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">viewrecursive</emphasis>
- Users can view the page and child pages.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">personalize</emphasis>
- Users are able to personalize the page's theme.</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">personalizerecursive</emphasis>
- Users are able to personalize the page AND its children's pages themes.</para>
- </listitem>
- </itemizedlist>
-
- <note>
- <title>Restricting access</title>
- <para>Out of the box the default portal as a viewrecursive right for all the users, it means that whenever a page
- is added, this page will be seen by any user. To restrict access to this page, the default portal security constraint
- must be changed from viewrecursive to view, and viewrecursive security constraints must be added to its children
- so that they can be viewed except the one you want to restrict access to.</para>
- </note>
- <para>
- We provide three live samples of this descriptor, here
- <xref linkend="desc_instancesxml"/>
- ,
- <xref linkend="desc_example_page"/>
- ,and
- <xref linkend="desc_example_portal"/>
- </para>
- </section>
-
- <section id="security.security_cms">
- <title>Securing the Content Management System</title>
- <para>
- The JBoss Portal CMS system consists of a directory structure of Files organized unto their respective Folders. Both Files and Folders are
- considered to be CMS resources that can be secured based on portal Roles and/or Users.
- </para>
- <para>
- The following features are supported by the fine grained security system of Portal CMS:
- <itemizedlist>
- <listitem><para>
- You can associate "Read", "Write", and "Manage" Permissions at the CMS node level. (Both Files and Folders are treated as CMS nodes)</para>
- </listitem>
- <listitem>
- <para>The Permissions are propagated recursively down a folder hierarchy</para>
- </listitem>
- <listitem>
- <para> Any Permissions specified explicitly on the CMS Node overrides the policy inherited via recursive propagation</para>
- </listitem>
- <listitem>
- <para>You can manage the Permissions using the CMS Admin GUI tool via the newly added "Secure Node" feature</para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- <table frame="all">
- <title> Portal CMS Permission Matrix: </title>
- <tgroup cols="3" align="left" colsep="1">
-
- <thead>
- <row>
- <entry align="center">Permissions</entry>
- <entry align="center">Allowed Actions</entry>
- <entry align="center">Implies</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry> Read </entry>
- <entry> Read Contents of Folder, File and its versions </entry>
- <entry> N/A </entry>
- </row>
- <row>
- <entry> Write</entry>
- <entry> Create and Update new Folder and File </entry>
- <entry> Read Access </entry>
- </row>
- <row>
- <entry> Manage </entry>
- <entry> Delete/Copy/Move/Rename Folders and Files</entry>
- <entry> Read and Write Access </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </para>
- <section id="security.security_cms_configuration">
- <title>CMS Security Configuration</title>
- <para>
- The configuration for the CMS Security service is specified in the
- <literal>jboss-portal.sar/portal-cms.sar/META-INF/jboss-service.xml</literal>
- file. The portion of the configuration relevant for securing the CMS service is listed as follows:
- <programlisting>
- <![CDATA[
- <!-- CMS Authorization Security Service -->
- <mbean
- code="org.jboss.portal.cms.security.AuthorizationManagerImpl"
- name="portal:service=AuthorizationManager,type=cms"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <attribute name="JNDIName">java:portal/cms/AuthorizationManager</attribute>
- <depends optional-attribute-name="Provider" proxy-type="attribute">
- portal:service=AuthorizationProvider,type=cms
- </depends>
- </mbean>
- <mbean
- code="org.jboss.portal.cms.security.AuthorizationProviderImpl"
- name="portal:service=AuthorizationProvider,type=cms"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <!--
- NOTE: cmsRootUserName denotes a single Portal user that has access to everything in the CMS. Denote this user
- carefully and should be synonymous to the 'root' user in UNIX operating systems. By default: this value is the built-in
- 'admin' user account. This can be changed to any other user account registered in your Portal
- -->
- <attribute name="CmsRootUserName">admin</attribute>
- <depends optional-attribute-name="IdentityServiceController" proxy-type="attribute">portal:service=Module,type=IdentityServiceController</depends>
- </mbean>
- <!-- ACL Security Interceptor -->
- <mbean
- code="org.jboss.portal.cms.impl.interceptors.ACLInterceptor"
- name="portal:service=Interceptor,type=Cms,name=ACL"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <attribute name="JNDIName">java:/portal/cms/ACLInterceptor</attribute>
- <attribute name="CmsSessionFactory">java:/portal/cms/CMSSessionFactory</attribute>
- <attribute name="IdentitySessionFactory">java:/portal/IdentitySessionFactory</attribute>
- <attribute name="DefaultPolicy">
- <policy>
- <!-- permissions on the root cms node -->
- <criteria name="path" value="/">
- <permission name="cms" action="read">
- <role name="Anonymous"/>
- </permission>
- <permission name="cms" action="write">
- <role name="User"/>
- </permission>
- <permission name="cms" action="manage">
- <role name="Admin"/>
- </permission>
- </criteria>
- <!-- permissions on the default cms node -->
- <criteria name="path" value="/default">
- <permission name="cms" action="read">
- <role name="Anonymous"/>
- </permission>
- <permission name="cms" action="write">
- <role name="User"/>
- </permission>
- <permission name="cms" action="manage">
- <role name="Admin"/>
- </permission>
- </criteria>
- <!-- permissions on the private/protected node -->
- <criteria name="path" value="/default/private">
- <permission name="cms" action="manage">
- <role name="Admin"/>
- </permission>
- </criteria>
- </policy>
- </attribute>
- <depends optional-attribute-name="AuthorizationManager" proxy-type="attribute">
- portal:service=AuthorizationManager,type=cms
- </depends>
- <depends>portal:service=Hibernate,type=CMS</depends>
- <depends>portal:service=Module,type=IdentityServiceController</depends>
- </mbean>]]>
- </programlisting>
- </para>
- <section id="security.security_cms_configuration_superuser">
- <title>CMS Super User</title>
- <para>
- A CMS Super User is a designated Portal User Account that has access to all resources/functions in the CMS. It is a concept similar to the
- super user concept in a Linux and UNIX security systems. This account should be carefully used and properly protected. By default, JBoss Portal designates the
- built-in 'admin' user account as a CMS Super User. This can be changed by modifying the <emphasis>cmsRootUserName</emphasis> value in the
- <literal>jboss-portal.sar/portal-cms.sar/META-INF/jboss-service.xml</literal> configuration.
- <programlisting>
- <![CDATA[
- <mbean
- code="org.jboss.portal.cms.security.AuthorizationProviderImpl"
- name="portal:service=AuthorizationProvider,type=cms"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <!--
- NOTE: cmsRootUserName denotes a single Portal user that has access to everything in the CMS. Denote this user
- carefully and should be synonymous to the 'root' user in UNIX operating systems. By default: this value is the built-in
- 'admin' user account. This can be changed to any other user account registered in your Portal
- -->
- <attribute name="CmsRootUserName">admin</attribute>
- <depends optional-attribute-name="IdentityServiceController" proxy-type="attribute">portal:service=Module,type=IdentityServiceController</depends>
- </mbean>
- ]]>
- </programlisting>
- </para>
- </section>
- <section id="security.security_cms_configuration_securityconsole">
- <title>CMS Security Console</title>
- <para>
- The CMS Security Console is used to assign proper permissions to all the nodes/content in the CMS. Besides protection on CMS content, this console itself
- needs to be secured against unauthorized acceess. Currently, the console can be accessed only by Portal users that are members of the specified Role. By default,
- JBoss Portal uses the built-in <emphasis>Admin</emphasis> role to allow access to this security console. This can be customized by modifying the value of
- <emphasis>defaultAdminRole</emphasis> option specified in <literal>jboss-portal.sar/conf/identity/standardidentity-config.xml</literal>
- </para>
- </section>
- </section>
- </section>
-
- <section id="security.security_authentication">
- <title>Authentication with JBoss Portal</title>
- <para>JBoss Portal relies on Java Platform, Enterprise Edition (Java EE) for the authentication of users. The Java EE authentication has its advantages and drawbacks. The main motivation for using Java EE security is the integration with the application server and the operational environment in which the portal is deployed. The servlet layer provides already the authentication functionality and obviously it is not a responsibility of the portal. Whenever a user is authenticated by the servlet layer its security identity is propagated throughout the call stack in the different layers of the Java EE stack. The weaknesses are the lack of an explicit logout mechanism and the lack of dynamicity in the mapping of URL as security resources. However JBoss Portal improves that behavior when it is possible to do so.</para>
- <section>
- <title>Authentication configuration</title>
- <para>JBoss Portal can be seen before all as a web application and therefore inherits all the configuration mechanisms
- related to web applications. The main entry point of the whole portal is the <emphasis>jboss-portal.sar/portal-server.war</emphasis>
- deployment which is the web application that defines and maps the portal servlet. Here you can configure various things
- <itemizedlist>
- <listitem><para>In the <emphasis>WEB-INF/web.xml</emphasis> you can change the authentication mode. The default
- authentication mechanism uses the form based authentication, however you can change it to any of the
- mechanism provided by the servlet specification.</para></listitem>
-<listitem><para>In the <emphasis>WEB-INF/jboss-web.xml</emphasis> you can change the security domain used by the portal.
- The default security domain used by the portal is <emphasis>java:/jaas/portal</emphasis>. That setting is specific
- to the JBoss Application Server and how it binds the Java EE security to the operational environment. A security domain
- is a scope defined at the Application Server Level and defines usually a JAAS authentication stack. The portal
- security domain authentication stack is defined in the <emphasis>jboss-portal.sar/conf/login-config.xml</emphasis>
- and is dynamically deployed with the portal. The JBoss Application Server documentation is certainly the best
- reference for that topic.</para>
- </listitem>
- <listitem><para>The files <emphasis>login.jsp</emphasis> and <emphasis>error.jsp</emphasis> represent the pages used
- the form based authentication process. More information can be found in any good servlet documentation.</para></listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>The portal servlet</title>
- <para>The portal defines a single servlet to take care of all portal requests. The class name of that servlet is
- <emphasis>org.jboss.portal.server.servlet.PortalServlet</emphasis>. That servlet needs to be declared two times with different
- configurations otherwise the portal would not be able to know about some request details which are importants.
- <itemizedlist>
- <listitem><para><emphasis>PortalServletWithPathMapping</emphasis> is used for path mapping mappings.</para></listitem>
- <listitem><para><emphasis>PortalServletWithDefaultServletMapping</emphasis> is used for the default servlet mapping.</para></listitem>
- </itemizedlist>
- The portal servlet is mapped four times with different semantics, the differences between the semantics are related to the transport layer.
- Each one of those for mappings will have the same request meaning for the portal beside the transport aspect. By default
- those mappings are
- <itemizedlist>
- <listitem><para><emphasis>/*</emphasis> : the default access, does not define any security constraint. This is the default
- access that everybody uses.</para></listitem>
- <listitem><para><emphasis>/sec/*</emphasis> : the secured access, requires https usage. It is triggered when
- a portlet is defined as secure or when a secure portlet link is created. It requires the configuration
- of the https connector in JBoss Web. The JBoss Application Server documentation provides more information
- about it.</para></listitem>
-<listitem><para><emphasis>/auth/*</emphasis> : the authenticated access, requires the user to be authenticated
- to be used.</para></listitem>
-<listitem><para><emphasis>/authsec/*</emphasis> : combine the two previous options into a single one.</para></listitem>
- </itemizedlist>
- Usually ones should not care much about those mappings as the portal will by itself switch to the most appropriate mapping.
- </para>
- </section>
- </section>
-
- <section id="security_authorization">
- <title>Authorization with JBoss Portal</title>
- <para>JBoss Portal defines a framework for authorization. The default implementation of that framework is based on
- the Java Authorization Contract for Containers (JACC) which is implemented by <trademark class="trade">J2EE</trademark> 1.4 Application Servers. This section of
- the documentation focuses on defining the framework and its usage and is not an attempt to define what authorization
- is or is not because it is out of scope of this context. Instead we will try to straightforwardly describe the
- framework and how it is used. No specific knowledge is expected about JACC although it is a recommended read.</para>
- <section>
- <title>The portal permission</title>
- <para>The <emphasis>org.jboss.portal.security.PortalPermission</emphasis> object is used to describe a permission for the portal. It extends the <emphasis>java.security.Permission</emphasis>
- class and any permission checked in the portal should extend the <emphasis>PortalPermission</emphasis> as well. That permission
- adds two fields to the <emphasis>Permission</emphasis> class
- <itemizedlist>
- <listitem><para>uri : is a string which represents an URI of the resource described by the permission.</para></listitem>
- <listitem><para>collection : an object of class <emphasis>org.jboss.portal.security.PortalPermissionCollection</emphasis> which
- is used when the permission act as a container for other permissions. If that object exists then the uri field should be null
- as a portal permission represents an uri or acts as a container in an exclusive manner.</para></listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>The authorization provider</title>
- <para>
- The <emphasis>org.jboss.portal.security.spi.provider.AuthorizationDomain</emphasis> is an interface which provides access to several services.
- <programlisting>
-public interface AuthorizationDomain
-{
- String getType();
- DomainConfigurator getConfigurator();
- PermissionRepository getPermissionRepository();
- PermissionFactory getPermissionFactory();
-}
- </programlisting>
- <itemizedlist>
- <listitem><para><emphasis>org.jboss.portal.security.spi.provider.DomainConfigurator</emphasis> provides configuration access
- to an authorization domain. The authorization schema is very simple as it consists of bindings between URI, roles and permissions.</para></listitem>
- <listitem><para><emphasis>org.jboss.portal.security.spi.provider.PermissionRepository</emphasis> provides runtime access to the authorization
- domain. Usually it is used to retrieve the permissions for a specific role and URI. It is used at runtime by the framework
- to take security decisions.</para></listitem>
-<listitem><para><emphasis>org.jboss.portal.security.spi.provider.PermissionFactory</emphasis> is a factory to instantiate permissions
- for the specific domain. It is used at runtime to create permissions objects of the appropriate type by the security framework.</para></listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>Making a programmatic security check</title>
- <para>Making a security check is an easy thing as it consists in creating a permission of the appropriate type and
- make a check against the <emphasis>org.jboss.portal.spi.auth.PortalAuthorizationManager</emphasis> service. That
- service is used by the portal to make security checks. It is connected to the different authorization providers
- in order to take decisions at runtime based on the type of the permission. Access to that service is done
- through the <emphasis>org.jboss.portal.spi.auth.PortalAuthorizationManagerFactory</emphasis>. The factory
- is a portal service which is usually injected in other services like that</para>
- <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<server>
- ...
- <mbean
- code='MyService"
- name="portal:service=MyService">
- <depends
- optional-attribute-name="PortalAuthorizationManagerFactory"
- proxy-type="attribute">portal:service=PortalAuthorizationManagerFactory</depends>
- ...
- </mbean>
- ...
-</server>]]></programlisting>
- <para>It can be injected in the servlet context of a war file in the file <emphasis>WEB-INF/jboss-portlet.xml</emphasis></para>
- <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE portlet-app PUBLIC
- "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
-<portlet-app>
- ...
- <service>
- <service-name>PortalAuthorizationManagerFactory</service-name>
- <service-class>
- org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory
- </service-class>
- <service-ref>:service=PortalAuthorizationManagerFactory</service-ref>
- </service>
- ...
-</portlet-app>]]></programlisting>
- <para>Here is an example of how a security check is made for a specific page</para>
- <programlisting>
-PortalAuthorizationManager pam = factory.getManager();
-PortalObjectId id = page.getId();
-PortalObjectPermission perm = new PortalObjectPermission(id, PortalObjectPermission.VIEW_MASK);
-if (pam.checkPermission(perm) == false)
-{
- System.out.println("Current user is not authorized to view page " + id);
-}</programlisting>
- </section>
- <section>
- <title>Configuring an authorization domain</title>
- <para>Configuring a domain can be done through the <emphasis>DomainConfigurator</emphasis> interface</para>
- <programlisting>
-public interface DomainConfigurator
-{
- Set getSecurityBindings(String uri);
- void setSecurityBindings(String uri, Set securityBindings)
- throws SecurityConfigurationException;
- void removeSecurityBindings(String uri) throws SecurityConfigurationException;
-}</programlisting>
- <para>The various methods of that interface allows to configure security bindings for a given resource where
- a resource is naturally identified by an URI. The <emphasis>org.jboss.portal.security.RoleSecurityBinding</emphasis>
- object is an object which encapsulate a role name and a set of actions bound to this role.
- </para>
- <programlisting>
-RoleSecurityBinding binding1 = new RoleSecurityBinding(Collections.singleton("view"), "Admin");
-RoleSecurityBinding binding2 = new RoleSecurityBinding(Collections.singleton("view"), "User");
-Set bindings = new HashSet();
-bindings.add(binding1);
-bindings.add(binding2);
-configurator.setSecurityBinding(pageURI, bindings); </programlisting>
- </section>
- </section>
-</chapter>
- <chapter id="identity">
- <!-- <chapterinfo>
- <author>
- <firstname>Boleslaw</firstname>
- <surname>Dawidowicz</surname>
- </author>
- </chapterinfo>-->
- <title>JBoss Portal Identity Management</title>
- <para>This chapter addresses identity management in JBoss Portal 2.6</para>
- <section id="management_api">
- <title>Identity management API</title>
- <para>Since JBoss Portal 2.6 there are 4 identity services and 2 identity related interfaces. The goal of
- having such a fine grained API is to enable flexible implementations based on different
- identity storage like relational databases or LDAP servers. The Membership service takes care of managing the relationship
- between user objects and role objects. The User Profile service is responsible for managing the profile of a user,
- it has database and LDAP implementations as well as a mode that combines data from both.
- </para>
- <itemizedlist>
- <listitem>
- <para>
- The <emphasis role="bold">org.jboss.portal.identity.User</emphasis>
- interface represents a user and exposes the following operations:
-
- <programlisting><![CDATA[
- /** The user identifier. */
- public Object getId();
-
- /** The user name. */
- public String getUserName();
-
- /** Set the password using proper encoding. */
- public void updatePassword(String password);
-
- /** Return true if the password is valid. */
- public boolean validatePassword(String password);
- ]]></programlisting>
- <warning>
- <para>
- Important Note! The proper usage of getId() method is:
- </para>
- <programlisting><![CDATA[
-// Always use it like this:
-user.getId().toString();
-
-// Do not use it like this:
-
-// We would get a Long object if we are using the database implementation
-(Long)user.getId();
-
-// We would get a String with an LDAP server
-(String)user.getId();
-]]></programlisting>
- <para>
- This is because the ID value depends on the User implementation. It'll probably be String object with the LDAP implementation and a Long object with the database implementation but it could be something else if one has chosen to make its own implementation.
- </para>
- </warning>
- </para>
- </listitem>
- <listitem>
- <para>
- The <emphasis role="bold">org.jboss.portal.identity.Role</emphasis> interface represents a Role
- and exposes the following operations:
-
- <programlisting><![CDATA[
-/** The role identifier. */
-public Object getId();
-
-/** The role name used in security rules. This name can not be modified */
-public String getName();
-
-/** The role display name used on screens. This name can be modified */
-public String getDisplayName();
-
-/** */
-public void setDisplayName(String name);
-]]></programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- The <emphasis role="bold">org.jboss.portal.identity.UserModule</emphasis>
- interface exposes operations for users management:
-
- <programlisting><![CDATA[
-/**Retrieve a user by its name.*/
-User findUserByUserName(String userName)
- throws IdentityException, IllegalArgumentException, NoSuchUserException;
-
-/**Retrieve a user by its id.*/
-User findUserById(Object id)
- throws IdentityException, IllegalArgumentException, NoSuchUserException;
-
-/**Retrieve a user by its id.*/
-User findUserById(String id)
- throws IdentityException, IllegalArgumentException, NoSuchUserException;
-
-/** Creates a new user with the specified name.*/
-User createUser(String userName, String password)
- throws IdentityException, IllegalArgumentException;
-
-/** Remove a user.*/
-void removeUser(Object id)
- throws IdentityException, IllegalArgumentException;
-
-/** Get a range of users.*/
-Set findUsers(int offset, int limit)
- throws IdentityException, IllegalArgumentException;
-
-/** Get a range of users.*/
-Set findUsersFilteredByUserName(String filter, int offset, int limit)
- throws IdentityException, IllegalArgumentException;
-
-/**Returns the number of users.*/
-int getUserCount() throws IdentityException, IllegalArgumentException;
-]]></programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- The <emphasis role="bold">org.jboss.portal.identity.RoleModule</emphasis>
- interface exposes operations for roles management:
-
- <programlisting><![CDATA[
-/** Retrieves a role by its name*/
-Role findRoleByName(String name)
- throws IdentityException, IllegalArgumentException;
-
-/**Retrieve a collection of role from the role names.*/
-Set findRolesByNames(String[] names)
- throws IdentityException, IllegalArgumentException;
-
-/** Retrieves a role by its id.*/
-Role findRoleById(Object id)
- throws IdentityException, IllegalArgumentException;
-
-/** Retrieves a role by its id.*/
-Role findRoleById(String id)
- throws IdentityException, IllegalArgumentException;
-
-/** Create a new role with the specified name.*/
-Role createRole(String name, String displayName)
- throws IdentityException, IllegalArgumentException;
-
-/** Remove a role.*/
-void removeRole(Object id)
- throws IdentityException, IllegalArgumentException;
-
-/** Returns the number of roles. */
-int getRolesCount()
- throws IdentityException;
-
-/** Get all the roles */
-Set findRoles() throws IdentityException;
-]]></programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- The <emphasis role="bold">MembershipModule</emphasis>
- interface exposes operations for obtaining or managing relationships beetween users and roles.
- The role of this service is to decouple relationship information from user and roles.
- Indeed while user role relationship is pretty straightforward with a relational database (using
- a many to many relationship with an intermediary table), with an LDAP server there a different
- ways to define relationships between users and roles.
-
- <programlisting><![CDATA[
-/** Return the set of role objects that a given user has.*/
-Set getRoles(User user) throws IdentityException, IllegalArgumentException;
-
-Set getUsers(Role role) throws IdentityException, IllegalArgumentException;
-
-/** Creates a relationship beetween a role and set of users. Other roles that have
- assotiontions with those users remain unaffected.*/
-void assignUsers(Role role, Set users) throws IdentityException, IllegalArgumentException;
-
-/** Creates a relationship beetween a user and set of roles. This operation will erase any
- other assotientions beetween the user and roles not specified in the provided set.*/
-void assignRoles(User user, Set roles) throws IdentityException, IllegalArgumentException;
-
-/** Returns role members based on rolename - depreciated method ethod here only
- for compatibility with old RoleModule interface */
-Set findRoleMembers(String roleName, int offset, int limit, String userNameFilter)
- throws IdentityException, IllegalArgumentException;
-]]></programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- The <emphasis role="bold">UserProfileModule</emphasis>
- interface exposes operations to access and manage informations stored in User profile:
-
- <programlisting><![CDATA[
-public Object getProperty(User user, String propertyName)
- throws IdentityException, IllegalArgumentException;
-
-public void setProperty(User user, String name, Object property)
- throws IdentityException, IllegalArgumentException;
-
-public Map getProperties(User user)
- throws IdentityException, IllegalArgumentException;
-
-public ProfileInfo getProfileInfo()
- throws IdentityException;
-]]></programlisting>
- <warning>
- <para>
- UserProfileModule.getProperty() method returns an Object.
- In most cases with DB backend it will always be String object. But normally you should check what
- object will be retrieved using getProfileInfo() method.</para>
- </warning>
- </para>
- </listitem>
- <listitem>
- <para>
- The <emphasis role="bold">ProfileInfo</emphasis>
- interface can be obtained using the
- <emphasis role="bold">UserProfileModule</emphasis>
- and exposes meta information of a profile:
-
- <programlisting><![CDATA[
-/** Returns a Map o PropertyInfo objects describing profile properties */
-public Map getPropertiesInfo();
-
-public PropertyInfo getPropertyInfo(String name);
-]]></programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">PropertyInfo</emphasis>
- interface expose methods to obtain information about accessible property in User profile
-
- <programlisting><![CDATA[
-public static final String ACCESS_MODE_READ_ONLY = "read-only";
-public static final String ACCESS_MODE_READ_WRITE = "read-write";
-public static final String USAGE_MANDATORY = "mandatory";
-public static final String USAGE_OPTIONAL = "optional";
-public static final String MAPPING_DB_TYPE_COLUMN = "column";
-public static final String MAPPING_DB_TYPE_DYNAMIC = "dynamic";
-
-public String getName();
-
-public String getType();
-
-public String getAccessMode();
-
-public String getUsage();
-
-public LocalizedString getDisplayName();
-
-public LocalizedString getDescription();
-
-public String getMappingDBType();
-
-public String getMappingLDAPValue();
-
-public String getMappingDBValue();
-
-public boolean isMappedDB();
-
-public boolean isMappedLDAP();
-]]></programlisting>
- </para>
- </listitem>
-
- </itemizedlist>
-
- <section>
- <title>How to obtain identity modules services ?</title>
- <para>
- The advocated way to get a reference to the identity modules is by using JNDI:
- </para>
- <programlisting>
-import org.jboss.portal.identity.UserModule;
-import org.jboss.portal.identity.RoleModule;
-import org.jboss.portal.identity.MembershipModule;
-import org.jboss.portal.identity.UserProfileModule;
-
-[...]
-
-(UserModule)new InitialContext().lookup("java:portal/UserModule");
-(RoleModule)new InitialContext().lookup("java:portal/RoleModule");
-(MembershipModule)new InitialContext().lookup("java:portal/MembershipModule");
-(UserProfileModule)new InitialContext().lookup("java:portal/UserProfileModule");</programlisting>
- <para>
- Another way to do this is, if you are fimiliar with JBoss Microkernel architecture is to
- get the <emphasis role="bold">IdentityServiceController</emphasis>
- mbean. You may want to inject it into your services like this:
- </para>
- <programlisting><![CDATA[
-<depends optional-attribute-name="IdentityServiceController" proxy-type="attribute">
- portal:service=Module,type=IdentityServiceController
-</depends>]]></programlisting>
- <para>
- or simply obtain in your code by doing a lookup using
- the <emphasis role="bold">portal:service=Module,type=IdentityServiceController</emphasis>
- name. Please refer to the JBoss Application Server documentation if you want to learn more
- about service MBeans. Once you obtained the object you can use it:
- </para>
-
- <programlisting>
-(UserModule)identityServiceController.getIdentityContext()
- .getObject(IdentityContext.TYPE_USER_MODULE);
-
-(RoleModule)identityServiceController.getIdentityContext()
- .getObject(IdentityContext.TYPE_ROLE_MODULE);
-
-(MembershipModule)identityServiceController.getIdentityContext()
- .getObject(IdentityContext.TYPE_MEMBERSHIP_MODULE);
-
-(UserProfileModule)identityServiceController.getIdentityContext()
- .getObject(IdentityContext.TYPE_USER_PROFILE_MODULE);
- </programlisting>
-
- </section>
- <section>
- <title>API changes since 2.4</title>
- <para>Because in JBoss Portal 2.4 there were only
- <emphasis role="bold">UserModule</emphasis>
- ,
- <emphasis role="bold">RoleModule</emphasis>
- ,
- <emphasis role="bold">User</emphasis>
- and
- <emphasis role="bold">Role</emphasis>
- interfaces some API usages changed. Here are the most important changes you will need to aply to your
- code while migrating your aplication to 2.6:
- </para>
- <itemizedlist>
- <listitem>
- <para>
- For the <emphasis role="bold">User</emphasis> interface:
-
- <programlisting><![CDATA[
-// Instead of: user.getEnabled()
-userProfileModule.getProperty(user, User.INFO_USER_ENABLED);
-
-// Instead of: user.setEnabled(value)
-userProfileModule.setProperty(user, User.INFO_USER_ENABLED, value);
-
-// In a similar way you should change rest of methods that are missing in User interface
-// in 2.6 by the call to the UserProfileModule
-
-// Instead of: user.getProperties()
-userProfileModule.getProperties(user);
-
-// Instead of: user.getGivenName()
-userProfileModule.getProperty(user, User.INFO_USER_NAME_GIVEN);
-
-// Instead of: user.getFamilyName()
-userProfileModule.getProperty(user, User.INFO_USER_NAME_FAMILY);
-
-// Instead of: user.getRealEmail()
-userProfileModule.getProperty(user, User.INFO_USER_EMAIL_REAL);
-
-// Instead of: user.getFakeEmail()
-userProfileModule.getProperty(user, User.INFO_USER_EMAIL_FAKE);
-
-// Instead of: user.getRegistrationDate()
-userProfileModule.getProperty(user, User.INFO_USER_REGISTRATION_DATE);
-
-// Instead of: user.getViewRealEmail()
-userProfileModule.getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL);
-
-// Instead of: user.getPreferredLocale()
-userProfileModule.getProperty(user, User.INFO_USER_LOCALE);
-
-// Instead of: user.getSignature()
-userProfileModule.getProperty(user, User.INFO_USER_SIGNATURE);
-
-// Instead of: user.getLastVisitDate()
-userProfileModule.getProperty(user, User.INFO_USER_LAST_LOGIN_DATE);]]></programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- The <emphasis role="bold">RoleModule</emphasis> interface:
-
- <programlisting><![CDATA[
-// Instead of
-// RoleModule.findRoleMembers(String roleName, int offset, int limit, String userNameFilter)
-// throws IdentityException;
-membershipModule.findRoleMembers(String roleName, int offset, int limit,
- String userNameFilter)
-
-// Instead of
-// RoleModule.setRoles(User user, Set roles) throws IdentityException;
-membershipModule.assignRoles(User user, Set roles)
-
-// Instead of
-// RoleModule.getRoles(User user) throws IdentityException;
-membershipModule.getRoles(User user)]]></programlisting>
- </para>
- </listitem>
- </itemizedlist>
- </section>
- </section>
- <section>
- <title>Identity configuration</title>
- <para>In order to understand identity configuration you need to understand its architecture.
- Different identity services like UserModule, RoleModule and etc are just plain Java classes that are instantiated and exposed
- by the portal. So an *example* of UserModule service could be a plain Java bean object that would be:
- </para>
- <itemizedlist>
- <listitem>
- <para><emphasis role="bold">Instantiated</emphasis> using reflection</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">Initialized/Started</emphasis> by invoking some methods</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">Registered/Exposed</emphasis> using JNDI and/or mbeans (JBoss Microkernel) services, so other services of the portal can use it</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">Managed</emphasis> in the matter of lifecycle - so it'll be stopped and unregistered during portal shutdown</para>
- </listitem>
- </itemizedlist>
- <para>
- As you see from this point of view, configuration just specifies what Java class will be used and how it should be used by portal as a service.
- </para>
- <note><title>Note</title><para>We use JBoss Microcontainer internally to manage the sub system made of those components so if you are interested in implementing
- custom services - look on the methods that are used by this framework.</para></note>
-
- <para>
- In JBoss Portal we provide a very flexible configuration. It is very easy to rearrange and customize services,
- provide alternative implementations, extend the existing ones or provide a custom identity model.
- </para>
- <para>To grasp the full picture of the configuration of identity services let's start from its root
- component. Whole configuration and setup of identity components is done by the
- <emphasis role="bold">IdentityServiceController</emphasis> service. It brings to life and registers all other services
- such as UserModule, RoleModule, MembershipModule and UserProfileModule.
- <emphasis role="bold">IdentityServiceController</emphasis> is defined in
- <emphasis>jboss-portal.sar/META-INF/jboss-service.xml</emphasis>
- </para>
-
- <programlisting><![CDATA[
-<mbean
- code="org.jboss.portal.identity.IdentityServiceControllerImpl"
- name="portal:service=Module,type=IdentityServiceController"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends>portal:service=Hibernate</depends>
- <attribute name="JndiName">java:/portal/IdentityServiceController</attribute>
- <attribute name="RegisterMBeans">true</attribute>
- <attribute name="ConfigFile">conf/identity/identity-config.xml</attribute>
- <attribute name="DefaultConfigFile">conf/identity/standardidentity-config.xml</attribute>
-</mbean>]]></programlisting>
- <para>
- We can specify a few options here:
- <itemizedlist>
- <listitem>
- <para>
- <emphasis role="bold">RegisterMBeans</emphasis> - defines if IdentityServiceController should
- register components which are instantiated as mbeans
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">ConfigFile</emphasis> - defines the location of the main identity services configuration file. It describes and configures all the components like UserModule, RoleModule... that need to be instantiated
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">DefaultConfigFile</emphasis> - defines the location of the configuration file containing
- the default values. For each component defined in <emphasis role="bold">ConfigFile</emphasis>, the IdentityServiceController
- will obtain a set of default options from this file. That helps to keep the main main configuration file
- simple, short and easy to read. Potentially it provides more powerful customizations.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <section>
- <title>Main configuration file architecture (identity-config.xml)</title>
- <para>
- The file describing portal identity services contains three sections:
- </para>
- <programlisting><![CDATA[
-<identity-configuration>
- <datasources>
- <!-- Datasources section -->
- <datasource> ... </datasource>
- <datasource> ... </datasource>
- ...
- </datasources>
- <modules>
- <!-- Modules section -->
- <module> ... </module>
- <module> ... </module>
- ...
- </modules>
- <options>
- <!-- Options section -->
- <option-group> ... </option-group>
- <option-group> ... </option-group>
- ...
- </options>
-</identity-configuration>]]></programlisting>
- <para>By default you can find it in <emphasis>jboss-portal.sar/conf/identity/identity-config.xml</emphasis></para>
- <section>
- <title>Datasources</title>
- <para>This section defines datasource components. They will be processed and instantiated before components in
- <emphasis role="bold">Module</emphasis> section, so they will be ready to serve them.</para>
-
- <note><title>Note</title>
- <para>This section isn't used with Database configuration as in JBoss Portal services exposing Hibernate
- are defined separately. It is used by LDAP configuration and we will use it as an example</para>
- </note>
- <programlisting><![CDATA[
-<datasource>
- <name>LDAP</name>
- <service-name>portal:service=Module,type=LDAPConnectionContext</service-name>
- <class>org.jboss.portal.identity.ldap.LDAPConnectionContext</class>
- <config>
- <option>
- <name>host</name>
- <value>jboss.com</value>
- </option>
- <option>
- <name>port</name>
- <value>10389</value>
- </option>
- <option>
- <name>adminDN</name>
- <value>cn=Directory Manager</value>
- </option>
- <option>
- <name>adminPassword</name>
- <value>xxxxx</value>
- </option>
-
- <!-- Other options here.... -->
-
- </config>
-</datasource>]]></programlisting>
-<note>
- <title>Note</title>
- <para>If you look into JBoss Portal configuration files you will find that <![CDATA[<service-name/> and <class/>]]>
- are specified in <emphasis role="bold">DefaultConfigFile</emphasis> and not in <emphasis role="bold">ConfigFile</emphasis>.
- So here is how it works: those two will be picked up from default configuration. The same rule is effective
- for the options - additional options will be picked up from default configuration. What is linking configuration in those two files
- is the <emphasis role="bold"><![CDATA[<name>]]></emphasis> tag.</para>
- </note>
- </section>
- <section>
- <title>Modules</title>
- <para>Modules are core service components like UserModule, RoleModule and etc. </para>
- <programlisting><![CDATA[
-<module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>User</type>
- <implementation>DB</implementation>
-
- <!--name of service and class for creating mbean-->
- <service-name>portal:service=Module,type=User</service-name>
- <class>org.jboss.portal.identity.db.HibernateUserModuleImpl</class>
-
- <!--set of options that are in the instantiated object-->
- <config>
- <option>
- <name>sessionFactoryJNDIName</name>
- <value>java:/portal/IdentitySessionFactory</value>
- </option>
- <option>
- <name>jNDIName</name>
- <value>java:/portal/UserModule</value>
- </option>
- </config>
-</module>]]></programlisting>
- <itemizedlist>
- <listitem>
- <para>
- <emphasis role="bold">implementation</emphasis> - defines the scope under which
- the configuration for different implementations of modules <emphasis role="bold">type</emphasis>s resides.
- It enables to define the default options of the configuration of the different implementations of
- same module types in one configuration file.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">type</emphasis> - must be unique name across all modules defined in the main
- configuration file. This is important as module will be stored with such name within IdentityContext
- registry at runtime. Standard names are used (User, Role, Membership, UserProfile). Together with
- <emphasis role="bold">implementation</emphasis> will create unique pair within file with default configuration values.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">service-name</emphasis> - will be used for the name when registered as an MBean.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">class</emphasis> - Java class that will be use to instantiate the module.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">config</emphasis> - contains options related to this module
- </para>
- </listitem>
- </itemizedlist>
- <note><title>Note</title><para>
- Here you can easily see the whole idea about having two config files - main one and the one with default values.
- The above code snippet with User module comes from <emphasis role="bold">standardidentity-config.xml</emphasis>, so the file
- that defines default configuration values. Because of this in the main configuration file the definition of
- User module will be as short as:
- <programlisting><![CDATA[
-<module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>User</type>
- <implementation>DB</implementation>
- <config/>
-</module>]]></programlisting>
- As you can see we specify only the type and the implementation - all the other values (service-name, class and set of options)
- are read from default configuration. But remember that you can still overwrite any of those values in the
- main config simply by overriding them.</para>
- </note>
-
- </section>
- <section>
- <title>Options</title>
- <para>This section provides common options that are accessible by identity modules. We set options
- here that may need to be shared. They are grouped, and can have many values:</para>
- <programlisting><![CDATA[
-<options>
-<!--Common options section-->
-<option-group>
- <group-name>common</group-name>
- <option>
- <name>userCtxDN</name>
- <value>ou=People,dc=example,dc=com</value>
- </option>
- <option>
- <name>uidAttributeID</name>
- <value>uid</value>
- </option>
- <option>
- <name>passwordAttributeID</name>
- <value>userPassword</value>
- </option>
- <option>
- <name>roleCtxDN</name>
- <value>ou=Roles,dc=example,dc=com</value>
- </option>
- <option>
- <name>ridAttributeId</name>
- <value>cn</value>
- </option>
- <option>
- <name>roleDisplayNameAttributeID</name>
- <value>cn</value>
- </option>
- <option>
- <name>membershipAttributeID</name>
- <value>member</value>
- </option>
- <option>
- <name>membershipAttributeIsDN</name>
- <value>true</value>
- </option>
-</option-group>
-<option-group>
- <group-name>userCreateAttibutes</group-name>
- <option>
- <name>objectClass</name>
- <value>top</value>
- <value>uidObject</value>
- <value>person</value>
- <value>inetUser</value>
- </option>
- <!--Schema requires those to have initial value-->
- <option>
- <name>cn</name>
- <value>none</value>
- </option>
- <option>
- <name>sn</name>
- <value>none</value>
- </option>
-</option-group>]]></programlisting>
- <note>
- <title>Note</title><para>
- In this section we use the same inheritance mechanism. When an option is not set, its value will be read
- from the default config file. But this also means that you may need to overwrite some values that
- are specific to your LDAP architecture. All the options will be described along with module implementations
- that use them.</para>
- </note>
- </section>
- </section>
- </section>
- <section id="user_profile_configuration">
- <title>User profile configuration</title>
- <para>UserProfileModule has additional configuration file that defines user properties. It is specified in configuration in:</para>
- <programlisting>
- <![CDATA[
- <module>
- <type>UserProfile</type>
- <implementation>DELEGATING</implementation>
-
- (...)
-
- <config>
-
- (...)
-
- <option>
- <name>profileConfigFile</name>
- <value>conf/identity/profile-config.xml</value>
- </option>
- </config>
- </module>
- ]]>
- </programlisting>
- <para>This means that you can configure user profile in <emphasis>jboss-portal.sar/conf/identity/profile-config.xml</emphasis></para>
-
- <programlisting>
- <![CDATA[
-<profile>
-
- <property>
- <name>user.name.nickName</name>
- <type>java.lang.String</type>
- <access-mode>read-only</access-mode>
- <usage>mandatory</usage>
- <display-name xml:lang="en">Name</display-name>
- <description xml:lang="en">The user name</description>
- <mapping>
- <database>
- <type>column</type>
- <value>jbp_uname</value>
- </database>
- </mapping>
- </property>
-
- <property>
- <name>user.business-info.online.email</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>mandatory</usage>
- <display-name xml:lang="en">Email</display-name>
- <description xml:lang="en">The user real email</description>
- <mapping>
- <database>
- <type>column</type>
- <value>jbp_realemail</value>
- </database>
- <ldap>
- <value>mail</value>
- </ldap>
- </mapping>
- </property>
-
- <property>
- <name>portal.user.location</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Location</display-name>
- <description xml:lang="en">The user location</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.location</value>
- </database>
- </mapping>
- </property>
-
- (...)
-
-</properties>
- ]]>
- </programlisting>
- <para> Configuration file contains properties definition that can be retrieved using the <emphasis role="bold">PropertyInfo</emphasis> interface.
- Each property used in portal has to be defined here.</para>
-
-<note><title>Note</title><para>Some information provided here can have a large impact on the behavior of the UserProfileModule. For instance
- <emphasis>access-mode</emphasis> can be made read-only and the value provided in <emphasis>type</emphasis> will be checked
- during <emphasis>setProperty()/getProperty()</emphasis> operations. On the other hand tags like <emphasis>usage</emphasis>,
- <emphasis>description</emphasis> or <emphasis>display-name</emphasis> have mostly informational meaning at the moment and
- are used by the management tools at runtime.</para></note>
-
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">name</emphasis> - property name. This value will be used to refer to the property in <emphasis>UserProfileModule</emphasis></para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">type</emphasis> - Java type of property. This type will be checked when in <emphasis>UserProfileModule</emphasis>
- methods invocation.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">access-mode</emphasis> - possible values are <emphasis>read-write</emphasis> and <emphasis>read-only</emphasis></para>
- </listitem>
-
- <listitem>
- <para><emphasis role="bold">usage</emphasis> - property usage can be <emphasis>mandatory</emphasis> or <emphasis>optional</emphasis>.</para>
- </listitem>
-
- <listitem>
- <para><emphasis role="bold">display-name</emphasis> - property display name.</para>
- </listitem>
-
- <listitem>
- <para><emphasis role="bold">description</emphasis> - description of property.</para>
- </listitem>
-
- <listitem>
- <para>
- <emphasis role="bold">mapping</emphasis> - defines how property is mapped in the underlaying storage mechanism. It can be mapped in <emphasis>database</emphasis>
- either as a <emphasis>column</emphasis> or <emphasis>dynamic</emphasis> value. It can also be mapped as <emphasis>ldap</emphasis> attribute.
-
- <note><title>Note</title><para>In current implementation <emphasis>column</emphasis> and <emphasis>dynamic</emphasis> mappings have the same effect, as database mappings are defined in hibernate configuration.</para></note>
-
- <note><title>Note</title>
- <para>Property can have both <emphasis>ldap</emphasis> and <emphasis>database</emphasis> mappings. In such situation when LDAP support is enabled <emphasis>ldap</emphasis> mapping will take precedense. Also even when using LDAP some properties will be mapped to LDAP and some to database. Its because LDAP schema doesn't support all attributes proper to for portal properties. To solve this we have <emphasis role="bold">DelegatingUserProfileModuleImpl</emphasis> that will delegate method invocation to
- <emphasis>ldap</emphasis> or <emphasis>database</emphasis> related <emphasis>UserProfile</emphasis> module. When <emphasis>LDAP</emphasis> support is enabled and property need to be stored in database user will be synchronized into database when needed. This behavior can be configured.</para>
- </note>
- </para>
- </listitem>
- </itemizedlist>
-
-
- </section>
-
- <section>
- <title>Identity modules implementations</title>
-
- <note><title>Note</title><para>Identity modules implementations related to LDAP are described in <xref linkend="ldap.ldap_identity_modules"/>.
- </para></note>
- <section>
- <title>Database modules</title>
- <para>JBoss portal comes with a set of database related identity modules implementations done using Hibernate - those are configured
- by default. Those are not very
- configurable in <emphasis>identity-config.xml</emphasis> file. The reason is that to keep backwards compatibility of database schema with previous
- portal version, we reused most of hibernate implementation. If you want to tweak the hibernate mappings you should look into files in
- <emphasis role="bold">jboss-portal.sar/conf/hibernate</emphasis>. Also those modules rely on hibernate <emphasis>SessionFactory</emphasis> components
- that are created in <emphasis>SessionFactoryBinder</emphasis> mbeans defined in <emphasis>jboss-portal.sar/META-INF/jboss-service.xml</emphasis></para>
- <para>Classes implementing identity modules:
- <itemizedlist>
- <listitem>
- <para>
- <emphasis role="bold">org.jboss.portal.identity.db.HibernateUserModuleImpl</emphasis> - implementaing <emphasis>UserModule</emphasis> interface</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">org.jboss.portal.identity.db.HibernateRoleModuleImpl</emphasis> - implementaing <emphasis>RoleModule</emphasis> interface</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">org.jboss.portal.identity.db.HibernateMembershipModuleImpl</emphasis> - implementaing <emphasis>MembershipModule</emphasis> interface</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">org.jboss.portal.identity.db.HibernateUserProfileModuleImpl</emphasis> - implementing <emphasis>UserProfileModule</emphasis> interface</para>
- </listitem>
- </itemizedlist>
- </para>
- <para>For each of those modules you can alter two config options:
- <itemizedlist>
- <listitem><para>
- <emphasis>sessionFactoryJNDIName</emphasis> - JNDI name under which hibernate SessionFactory object is registered</para>
- </listitem>
- <listitem>
- <para><emphasis>jNDIName</emphasis> - JNDI name under which this module should be registered</para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- <section id="identity.management_api">
- <title>Delegating UserProfile module</title>
- <para>
- Delegating UserProfileModule implementation has very specific role. When we use a storage mechanism like LDAP we may not be able to map all
- user properties into LDAP attributes because of schema limitations. To solve this problem we still can use the database to store user properties
- that do not exist in the LDAP schema.
- The Delegating user profile module will recognize if a property is mapped as <emphasis role="bold">ldap</emphasis> or <emphasis role="bold">database</emphasis>
- and delegate <emphasis>setProperty()/getProperty()</emphasis> method invocation to proper module implementation. This is implemented in
- <emphasis role="bold">org.jboss.portal.identity.DelegatingUserProfileModuleImpl</emphasis>. If property is mapped either as
- <emphasis role="bold">ldap</emphasis> and <emphasis role="bold">database</emphasis> the <emphasis role="bold">ldap</emphasis> mapping will
- have higher priority.
- </para>
- <programlisting>
- <![CDATA[
-<module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>UserProfile</type>
- <implementation>DELEGATING</implementation>
-
- <!--name of service and class for creating mbean-->
- <service-name>portal:service=Module,type=UserProfile</service-name>
- <class>org.jboss.portal.identity.DelegatingUserProfileModuleImpl</class>
- <!--set of options that are set in instantiated object-->
- <config>
- <option>
- <name>jNDIName</name>
- <value>java:/portal/UserProfileModule</value>
- </option>
- <option>
- <name>dbModuleJNDIName</name>
- <value>java:/portal/DBUserProfileModule</value>
- </option>
- <option>
- <name>profileConfigFile</name>
- <value>conf/identity/profile-config.xml</value>
- </option>
- </config>
-</module>]]>
- </programlisting>
- <para>
- Module options are:
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">dbModuleJNDIName</emphasis> - JNDI name under which database implementation of UserProfileModule is registered.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">ldapModuleJNDIName</emphasis> - JNDI name under which ldap implementation of UserProfileModule is registered.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">profileConfigFile</emphasis> - configuration file for user properties.</para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>Database UserProfile module implementation</title>
- <para>Because of the behavior described in the previous section, database UserProfileModule requires some special features. If a user is present in
- LDAP server but a writable property isn't mapped as an LDAP attribute, such property requires to be stored in the database. In order to achieve
- such result the user need to be synchronized from LDAP into the database first.</para>
- <para>Class <emphasis>org.jboss.portal.identity.db.HibernateUserProfileModuleImpl</emphasis> has additional synchronization features.
- Here are the options: </para>
-
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">synchronizeNonExistingUsers</emphasis> - when set to "true" if the user subject to the operation does not exist, then it will
- created it in database. By default it is "true".</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">acceptOtherImplementations</emphasis> - if set to "true" module will accept user objects other than
- <emphasis>org.jboss.portal.identity.db.HibernateUserImpl</emphasis>. This is needed to enable cooperation with UserModule implementations other
- than <emphasis>org.jboss.portal.identity.db.HibernateUserModuleImpl</emphasis>. The default value is set "true".</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">defaultSynchronizePassword</emphasis> - if this option is set, the value will be used as a password for synchronized user.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">randomSynchronizePassword</emphasis> - if this option is set to "true" synchronized user will have random generated password. This is mostly used for the security reasons. Default value is "false".</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">sessionFactoryJNDIName</emphasis> - JNDI name under which this user will be registered.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">profileConfigFile</emphasis> - file with user profile configuration. If this option is not set, and we use delegating UserProfileModule, profile configuration will be obtained from it.</para>
- </listitem>
- </itemizedlist>
-
- </section>
- </section>
-</chapter>
- <chapter id="identityportlets">
-<!-- <chapterinfo>
- <author>
- <firstname>Emanuel</firstname>
- <surname>Muckenhuber</surname>
- </author>
- </chapterinfo>-->
- <title>JBoss Portal Identity Portlets</title>
- <section id="identity_portlet_introduction">
- <title>Introduction</title>
- <para>
- Since JBoss Portal 2.6.2 two new Identity Portlets are
- shipped by default:
- <itemizedlist>
- <listitem>
- <para>The User Portlet</para>
- </listitem>
- <listitem>
- <para>The Identity Management Portlet</para>
- </listitem>
- </itemizedlist>
- As the names indicate - the User Portlet is responsible for
- actions related to the end user. Whereas the Identity Management
- Portlet contains all the functionality for managing users and roles.
- </para>
-<warning><title>Caution</title><para>
-The Identity portlets will evolve over time, therefore usage and configuration might change.</para>
-</warning>
- <section>
- <title>Features</title>
- <para>
- The identity portlets provide the following features:
- <itemizedlist>
- <listitem>
- <para>Email verification: The users can receive an email with a link on which they must click to confirm the
- creation of the new account. (Disabled by default,see <xref linkend="identity_portlet_configuration_jbpm"/>)</para>
- </listitem>
- <listitem>
- <para>Captcha support: The users are prompted to copy letters from a deformed image. (Disabled by default, see <xref linkend="identity_portlet_configuration_captcha"/>)</para>
- </listitem>
- <listitem>
- <para>Lost password: The users can receive a new password by email, any user with access to the admin portlet can also reset another user's password and send the new one by email in one click. (Disabled by default, see <xref linkend="identity_portlet_configuration_lost_password"/>)</para>
- </listitem>
- <listitem>
- <para>jBPM based user registration: Several business processes are available out of the box (this includes administration approval), this can
- be extended to custom ones. See <xref linkend="identity_portlet_configuration_jbpm"/>.</para>
- </listitem>
- <listitem>
- <para>User and role management: Ability for the administrator to add and edit users as well as adding, </para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- </section>
- <section>
- <title>Configuration</title>
- <para>
- This section covers the configuration of the Identity
- Portlets.
- </para>
- <section id="identity_portlet_configuration_captcha">
- <title>Captcha support</title>
- <para>
- CAPTCHA is an acronym for <literal>Completely Automated Public
- Turing test to tell Computers and Humans Apart</literal>. This is
- providing a mechanism to prevent automated programs
- from using different services. The User
- Portlet uses JCaptcha to provide a challenge-response.
- </para>
- <note><para>By default the captcha service needs a XServer to
- generate the images. For using the captcha service
- without a XServer make sure you run the JVM with the
- following option:
- <programlisting>-Djava.awt.headless=true</programlisting></para>
- </note>
- <para/>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/identityportlets/user_register.png"/>
- </imageobject>
-
- </mediaobject>
- <para>The registration page with captcha.</para>
- <para>
- The captcha support can be enabled by changing the
- portlet preference 'captcha' to 'true'. If enabled,
- captcha will be used for the registration and lost
- password action.
- </para>
- <programlisting><![CDATA[...
-<portlet>
-...
- <display-name>User portlet</display-name>
-...
- <portlet-preferences>
- <preference>
- <name>captcha</name>
- <value>true</value>
- </preference>
- </portlet-preferences>
-</portlet>
-...]]></programlisting>
- </section>
- <section id="identity_portlet_configuration_lost_password">
- <title>Lost password</title>
- <para>
- The lost password feature enables the end user to reset
- his password by entering his username.
- </para>
- <note>
- <title>Note</title><para>This feature requires a properly configured MailModule. See <xref linkend="emailConfiguration"/>.</para>
- </note>
- <para/>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/identityportlets/lost_password.png"/>
- </imageobject>
-
- </mediaobject>
- <para>
- The lost password page with captcha enabled.
- </para>
- <para>
- The lost password feature can be enabled by changing the
- portlet preference 'lostPassword' to 'true'. If captcha
- is enabled it will be also used for verifying the lost
- password action.
- </para>
- <programlisting><![CDATA[...
-<portlet>
-...
- <display-name>User portlet</display-name>
-...
- <portlet-preferences>
- <preference>
- <name>lostPassword</name>
- <value>true</value>
- </preference>
- </portlet-preferences>
-</portlet>
-...]]></programlisting>
- </section>
- <section id="identity_portlet_configuration_reset_password">
- <title>Reset password</title>
- <para>
- The reset password feature is similar to the lost
- password feature, but it is used in the User Management
- Portlet to reset the password of a user. That means
- changing the password of a user is slightly simplified,
- because a random password will be generated and sent to
- the users e-mail address.
- </para>
- <programlisting><![CDATA[...
-<portlet>
-...
- <display-name>User management portlet</display-name>
-...
- <portlet-preferences>
- <preference>
- <name>resetPassword</name>
- <value>true</value>
- </preference>
- </portlet-preferences>
-</portlet>
-...]]></programlisting>
- </section>
- <section id="identity_portlet_configuration_jbpm">
- <title>jBPM based user registration</title>
- <para>
- JBoss Portal supports three different subscription modes by default:
- <itemizedlist>
- <listitem>
- <para>Automatic subscription (no jBPM required), the users can register and directly login.</para>
- </listitem>
- <listitem>
- <para>E-Mail validation, the users need to click on a link sent by email before being able to login.</para>
- </listitem>
- <listitem>
- <para>E-Mail validation and admin approval, the users need to validate their email, then an admin needs to
- approve the newly created account.</para>
- </listitem>
- </itemizedlist>
- </para>
- <note><title>Note</title><para>
- The subscription mode has to be defined in the configuration file as explained here: <xref linkend="identity_portlet_configuration_file"/>.</para>
- </note>
- <warning><title>Caution</title><para>
- Make sure that the application server is restarted after re-deploying the Identity Portlets. This is required to make sure that
- the registration and approval process works properly! </para>
- </warning>
-
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/identityportlets/pending_users.png"/>
- </imageobject>
-
- </mediaobject>
- <para>
- Approve or reject pending registrations (<emphasis>jbp_identity_validation_approval_workflow</emphasis>).
- </para>
- </section>
- <section id="identity_portlet_configuration_file">
- <title>The configuration file</title>
- <para>
- The Identity Portlets use some metadata which can be
- easily changed in the main configuration file, which is
- located at <literal>jboss-portal.sar/portal-identity.sar/conf/identity-ui-configuration.xml</literal> as shown here:
- </para>
- <programlisting><![CDATA[<identity-ui-configuration>
-
- <subscription-mode>automatic</subscription-mode>
- <admin-subscription-mode>automatic</admin-subscription-mode>
- <overwrite-workflow>false</overwrite-workflow>
- <email-domain>jboss.org</email-domain>
- <email-from>no-reply(a)jboss.com</email-from>
- <password-generation-characters>a...Z</password-generation-characters>
- <default-roles>
- <role>User</role>
- </default-roles>
-
- <!-- user interface components -->
- <ui-components>
- <ui-component name="givenname">
- <property-ref>user.name.given</property-ref>
- </ui-component>
- <ui-component name="familyname">
- <property-ref>user.name.family</property-ref>
- </ui-component>
- ...
-</identity-ui-configuration>]]></programlisting>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- <emphasis role="bold">
- subscription-mode:
- </emphasis>
- defines the User Portlet registration process
- <itemizedlist>
- <listitem><para>
- <emphasis>automatic:</emphasis> no validation nor approval (default)</para>
- </listitem>
- <listitem><para>
- <emphasis>jbp_identity_validation_workflow:</emphasis> e-mail validation, no approval</para>
- </listitem>
- <listitem><para>
- <emphasis>jbp_identity_validation_approval_workflow:</emphasis> e-mail validation and approval</para>
- </listitem>
- <listitem><para>
- <emphasis>custom:</emphasis> Take a look at Customizing the workflow</para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- admin-subscription-mode:
- </emphasis>
- jBPM process used in the User Management Portlet for creating users
- <itemizedlist>
- <listitem><para>
- <emphasis>automatic:</emphasis>
- no validation nor approval (default)</para>
- </listitem>
- <listitem><para>
- <emphasis>jbp_identity_validation_workflow:</emphasis>
- e-mail validation, no approval</para>
- </listitem>
- <listitem><para>
- <emphasis>jbp_identity_validation_approval_workflow:</emphasis>
- e-mail validation and approval</para>
- </listitem>
- <listitem><para>
- <emphasis>custom:</emphasis>
- Take a look at Customizing the
- workflow</para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- overwrite-workflow:
- </emphasis>
- if set to 'true' the workflow will be overwritten during the next startup (default: false)
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- email-domain:
- </emphasis>
- e-mail domain used in the validation e-mail by the template (can be anything)
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">email-from:</emphasis>
- e-mail fro field used by the validation e-mail
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- password-generation-characters:
- </emphasis>
- characters to use to generate a random password
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- default-roles:
- </emphasis>
- one or more default roles
- <itemizedlist>
- <listitem><para>
- available element: <emphasis role="bold">role</emphasis></para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- ui-components:
- </emphasis>
- Defines the available user interface components. Take a look at the next section
- for further details.
- </para>
- </listitem>
- </itemizedlist>
- Due to the differentiation between subscription-mode and
- admin-subscription-mode it is possible to require e-mail
- validation and approval for new registrations and e-mail
- validation only when a user is created in the user
- management portlet.
- </para>
- </section>
- <section>
- <title>Customize e-mail templates</title>
- <para>
- The email templates can be found in the folder: <emphasis>portal-identity.sar/conf/templates/</emphasis>
- </para>
- <para>
- New languages can be added by creating a new file like: <emphasis>emailTemplate_fr.tpl</emphasis>
- </para>
- </section>
- </section>
- <section id="identity_portlet_configuration_ui_components">
- <title>User interface customization</title>
- <para>
- The following three examples describe common use cases for customizing the User Portlet.
- <itemizedlist>
- <listitem>
- <para>
- <emphasis role="bold">Example 1:</emphasis>
- Describes how to tag a input field as required
- and add it to the registration page.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">Example 2:</emphasis>
- Shows how to create a simple dropdown menu.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">Example 3:</emphasis>
- Describes how to add new properties.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <note>
- <title>Note</title><para>This is not a JavaServer Faces tutorial. Basic knowledge of
- this technology is a precondition for customizing the User
- Portlet Interface.</para>
- </note>
- <section id="identity_portlet_configuration_example1">
- <title>Example 1: required fields</title>
- <para>
- This example explains how to change optional properties to
- required properties, of course once this is done, we will also need to
- add the corresponding fields in the registration page.
- <!-- sbr/ -->
- Here are the modifications in <emphasis>portal-identity.sar/conf/identity-ui-configuration.xml</emphasis>,
- we simply changed the required element to true on our two fields corresponding to the given and family names.
- </para>
- <programlisting><![CDATA[<identity-ui-configuration>
-...
- <!-- user interface components -->
- ...
- <ui-component name="givenname">
- <property-ref>user.name.given</property-ref>
- <required>true</required>
- </ui-component>
- <ui-component name="familyname">
- <property-ref>user.name.family</property-ref>
- <required>true</required>
- </ui-component>
- ...
-</identity-ui-configuration>]]></programlisting>
- <para>
- Now that we changed those values to "required" we need to give a chance to the user to enter those
- values, here are the changes done in <emphasis>portal-identity.sar/portal-identity.war/WEB-INF/jsf/common/register.xhtml</emphasis>
- </para>
- <programlisting><![CDATA[
-...
- <h:outputText value="#{bundle.IDENTITY_GIVENNAME}"/>
- <h:inputText id="givenname" value="#{manager.uiUser.attribute.givenname}"
- required="#{metadataservice.givenname.required}"/>
- <h:panelGroup />
- <h:message for="givenname" />
-
- <h:outputText value="#{bundle.IDENTITY_FAMILYNAME}"/>
- <h:inputText id="lastname" value="#{manager.uiUser.attribute.familyname}"
- required="#{metadataservice.familyname.required}"/>
- <h:panelGroup />
- <h:message for="lastname"/>
-...]]></programlisting>
- <para>
- That's it - from now on the given name and family name will be
- required on registration.
- We dynamically obtain the values from the descriptor. Now if i just wanted to make them back to optional,
- i would change the values only in the descriptor, letting the user enter or not those values.
- </para>
- </section>
- <section id="identity_portlet_configuration_example2">
- <title>
- Example 2: dynamic values (dropdown menu with predefined values)
- </title>
- <para>
- If the data to enter is a choice instead of a free-text value, you can also define those
- in the descriptor like shown here:
- </para>
- <programlisting><![CDATA[<identity-ui-configuration>
-...
- <!-- user interface components -->
- ...
- <ui-component name="interests">
- <property-ref>portal.user.interests</property-ref>
- <values>
- <value key="board">snowboarding</value>
- <value key="ski">skiing</value>
- <value key="sledge">sledging</value>
- </values>
- </ui-component>
- ...
-</identity-ui-configuration>]]></programlisting>
- <para>
- <emphasis>
- In portal-identity.sar/portal-identity.war/WEB-INF/jsf/common/profile.xhtml
- </emphasis>
- - change inputText to a selectOneMenu:
- </para>
- <programlisting><![CDATA[
- ...
- <h:outputText value="#{bundle.IDENTITY_INTERESTS}"/>
- <h:selectOneMenu id="interests" value="#{manager.uiUser.attribute.interests}"
- required="#{metadataservice.interests.required}">
- <f:selectItems value="#{metadataservice.interests.values}" />
- </h.selectOneMenu>
- <h:panelGroup />
- <h:message for="interests"/>
-...
-]]></programlisting>
- <para>
- For localizing dynamic values it is also possible to use the resource bundle.
- This can be done by adding the key with a prefix (to i.e. <emphasis>Identity.properties</emphasis>) like in the following listing.
- The key will be stored in the users property and is used to identify the element. The value of the configuration file will only be used if no localization information is found.
- </para>
- <programlisting><![CDATA[
-...
-IDENTITY_DYNAMIC_VALUE_BOARD=localized snowboarding
-IDENTITY_DYNAMIC_VALUE_SKI=localized skiing
-IDENTITY_DYNAMIC_VALUE_SLEDGE=localized sledging
-...
-]]></programlisting>
- <note>
- <para>If the value is not required a blank element will be
- added at the top.</para>
- </note>
- </section>
- <section id="identity_portlet_configuration_example3">
- <title>Example 3: adding new properties</title>
- <note>
- <title>Note</title><para>Please make sure you read at least the section about
- user profile configuration: <xref linkend="user_profile_configuration"/>, to add a new value on
- the interface it also has to be defined in your model, as shown on Step 1.</para>
- </note>
- <para>
- <emphasis role="bold">step 1:</emphasis>
- add a new property to <emphasis>profile-config.xml</emphasis> e.g. a dynamic property called gender:
- </para>
- <programlisting><![CDATA[
-...
- <property>
- <name>user.gender</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Gender</display-name>
- <description xml:lang="en">The gender</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>user.gender</value>
- </database>
- </mapping>
- </property>
-...
-]]></programlisting>
- <note>
- <title>Note</title><para>It is recommended to use the 'User Information Attribute Names' from the <ulink url="http://jcp.org/en/jsr/detail?id=168">Portlet Specification</ulink> for defining properties.</para>
- </note>
- <para>
- <emphasis role="bold">step 2:</emphasis>
- add the property to the identity-ui-configuration: (<emphasis>portal-identity.sar/conf/identity-ui-configuration.xml</emphasis>)
- </para>
- <programlisting><![CDATA[
-...
- <ui-component name="gender">
- <property-ref>user.gender</property-ref>
- <required>true</required>
- <values>
- <value key="male">Male</value>
- <value key="female">Female</value>
- </values>
- </ui-component>
-...
-]]></programlisting>
- <note>
- <title>Note</title><para>The property-ref must match a property from the
- <emphasis>profile-config.xml</emphasis>.</para>
- </note>
- <para>
- <emphasis role="bold">step 3:</emphasis>
- add your custom ui-component to the profile page: (<emphasis>portal-identity.sar/portal-identity.war/WEB-INF/jsf/profile.xhtml</emphasis>)
- </para>
- <programlisting><![CDATA[
-...
- <h:outputText value="#{bundle.IDENTITY_GENDER}"/>
- <h:selectOneMenu id="gender" value="#{manager.uiUser.attribute.gender}"
- required="#{metadataservice.gender.required}">
- <f:selectItems value="#{metadataservice.gender.values}" />
- </h.selectOneMenu>
- <h:panelGroup />
- <h:message for="gender"/>
-...
-]]></programlisting>
-
-<note><title>Note</title><para>Don't forget to add the localization elements.</para></note>
-
-</section>
- <section>
- <title>Illustration</title>
- <para>
-
- </para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/identityportlets/illustration.png" scalefit="1"/>
- </imageobject>
-
- </mediaobject>
- <para>
- Illustration of the relationship between the
- configuration files.
- </para>
- <para>
- The JSF-View in more detail:
-<itemizedlist>
- <listitem>
- <para>
- <emphasis role="bold"> manager.uiUser.attribute:</emphasis>
- manages and stores the dynamic properties
- <itemizedlist>
- <listitem>
- <para>
- <emphasis role="bold">examples:</emphasis> <emphasis>manager.uiUser.attribute.gender</emphasis>,
- <emphasis>manager.uiUser.attribute.interests</emphasis>
- <programlisting><![CDATA[<h:inputText id="gender" value="#{manager.uiUser.attribute.gender}" />]]></programlisting>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- metadataservice
- </emphasis>
- <itemizedlist>
- <listitem>
- <para>
- <emphasis role="bold">
- required
- </emphasis>
- - references the required attribute from the ui-component<!-- sbr/ -->
- example: <emphasis>metadataservice.gender.required</emphasis>
- <programlisting><![CDATA[<h:inputText id="gender" value="#{manager.uiUser.attribute.gender}" required="#{metadataservice.gender.required}"/>]]></programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- values
- </emphasis>
- - references the values list from the ui-component<!-- sbr/ -->
- example: <emphasis>metadataservice.gender.values</emphasis>
- <programlisting><![CDATA[<h:selectOneMenu id="interests" value="#{manager.uiUser.attribute.interests}">
- <f:selectItems value="#{metadataservice.interests.values}" />
-</h:selectOneMenu>]]></programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- validator
- </emphasis>
- - references the name of a registered JSF validator<!-- sbr/ -->
- example:<emphasis>metadataservice.gender.validator</emphasis>
- - the first validator of the validator list<!-- sbr/ -->
- example: <emphasis>metadataservice.gender.validators[0]</emphasis>
- - the validator list with an index<!-- sbr/ -->
- <programlisting><![CDATA[<f:validator validatorId="#{metadataservice.gender.validator}"/>]]></programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- converter
- </emphasis>
- - references the name of a registered JSF converter<!-- sbr/ -->
- example: <emphasis>metadataservice.gender.converter</emphasis>
- <programlisting><![CDATA[<f:converter converterId="#{metadataservice.gender.converter}"/>]]></programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- readOnly
- </emphasis>
- - references the access-mode of <emphasis>profile-config.xml</emphasis><!-- sbr/ -->
- possible usage i.e. in <emphasis>/WEB-INF/jsf/common/profile.xhtml</emphasis>
- <programlisting><![CDATA[<h:inputText value="#{manager.uiUser.attribute.nickname}" disabled="#{metadataservice.nickname.readOnly}" />]]></programlisting>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <warning>
- <para>The values of the profile-config.xml have a higher
- priority than the values in the user portlet
- configuration. That means if the 'usage' is 'mandatory'
- in <emphasis>profile-config.xml</emphasis>
- and 'required' is 'false' it will be overwritten by the
- value from the profile config!</para>
- </warning>
- </section>
- <section>
- <title>Customizing the View Profile page</title>
- <para>
- By default not all values of the user profile will be displayed on the <emphasis>View profile</emphasis> page. For customization it is possible
- to add further properties to the page by editing the file: <emphasis>portal-identity.sar/portal-identity.war/WEB-INF/jsf/profile/viewProfile.xhtml</emphasis>
- </para>
- </section>
- </section>
- <section>
- <title>Customizing the workflow</title>
- <note><para>For more details about jBPM please read the <ulink url="http://docs.jboss.com/jbpm/v3/userguide/index.html">jBPM documentation</ulink></para></note>
- <para>
- The process definitions are located in:
- <emphasis>portal-identity.sar/conf/processes</emphasis>. To create a custom workflow, you can extend the existing process description file: <emphasis>custom.xml</emphasis>.
- </para>
- <para>
- Available variables in the business process:
- <itemizedlist>
- <listitem>
- <para>
- <emphasis role="bold">name:</emphasis>
- portalURL
- <!-- sbr/ -->
- <emphasis role="bold">type:</emphasis>
- <emphasis>java.lang.String</emphasis>
- <!-- sbr/ -->
- <emphasis role="bold">description:</emphasis>
- represents the full url of the portal e.g.
- <emphasis>
- http://localhost:8080/portal
- </emphasis>
- <!-- sbr/ -->
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">name:</emphasis>
- locale
- <!-- sbr/ -->
- <emphasis role="bold">type:</emphasis>
- <emphasis>java.util.Locale</emphasis>
- <!-- sbr/ -->
- <emphasis role="bold">description:</emphasis>
- the requested locale at registration
- <!-- sbr/ -->
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">name:</emphasis>
- email
- <!-- sbr/ -->
- <emphasis role="bold">type:</emphasis>
- <emphasis>java.lang.String</emphasis>
- <!-- sbr/ -->
- <emphasis role="bold">description:</emphasis>
- the e-mail address of the user in case of registration.<!-- sbr/ -->
- In case of changing the e-mail the new e-mail address.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">name:</emphasis>
- user
- <!-- sbr/ -->
- <emphasis role="bold">type:</emphasis>
- <emphasis>
- org.jboss.portal.core.identity.services.workflow.UserContainer
- </emphasis>
- <!-- sbr/ -->
- <emphasis role="bold">description:</emphasis>
- Seralizable Object containing user information through the jBPM process <!-- sbr/ -->
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">name:</emphasis>
- validationHash
- <!-- sbr/ -->
- <emphasis role="bold">type:</emphasis>
- <emphasis>java.lang.String</emphasis>
- <!-- sbr/ -->
- <emphasis role="bold">description:</emphasis>
- hash used for the validation part. Only available after executing SendValidationEmailAction<!-- sbr/ -->
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <note><title>Note</title><para>
- Make sure that the filename and the process name match! e.g.
- <emphasis>conf/processes/custom.xml</emphasis>
- and process-definition name="custom".</para>
- </note>
- <para>
- When using a custom workflow it is possible to customize the
- status message after registering in the locale bundle: ( e.g.
- <emphasis>portal-identity.sar/conf/bundles/Identity.properties</emphasis>)
- </para>
- <programlisting><![CDATA[
-
-IDENTITY_VERIFICATION_STATUS_REGISTER_CUSTOM=Customized message here
-
-]]></programlisting>
- <section>
- <title>Duration of process validity</title>
- <para>
- By default requests (e.g. e-mail validation and registrations) expire after some time in the validation state.
- Therefore it is not required to add additional maintenance mechanism to invalidate a request. The default expiration time is 2 days,
- but is quite easy to change the timing by editing the <emphasis>duedate</emphasis> attribute in the process definition.
- changes in: <emphasis>portal-identity.sar/conf/processes/*.xml</emphasis>
- </para>
- <programlisting><![CDATA[<process-definition>
-...
- <state name="validate_email">
- <timer name="time_to_expire" duedate="2 days" transition="timedOut" />
- </state>
-...
-</process-definition>]]></programlisting>
-
- <para>
- For further information take a look at the <ulink url="http://docs.jboss.com/jbpm/v3/userguide/index.html">jBPM documentation</ulink> on <emphasis>Duration</emphasis>.
- </para>
- </section>
-</section>
- <section>
- <title>Disabling the Identity Portlets</title>
- <para>
- Due to the fact that the former user portlets are still
- included in JBoss Portal 2.6.2 it is possible to activate
- it in the Portal Admin interface, by using the PortletInstances:
- <itemizedlist>
- <listitem><para>
- <emphasis>UserPortletInstance:</emphasis> The former user portlet</para>
- </listitem>
- <listitem><para>
- <emphasis>RolePortletInstance:</emphasis> The former role managment portlet</para>
- </listitem>
- </itemizedlist>
- </para>
- <section>
- <title>Enabling the Identity Portlets</title>
- <para>
- When migrating from former versions of JBoss Portal the Identity User Portlets won't be displayed by default,
- but windows can be created on basis of the existing Portlet Instances which are deployed by default. (The instances
- names being <literal>IdentityUserPortletInstance</literal> and <literal>IdentityAdminPortletInstance</literal>.)
- </para>
- </section>
- </section>
-</chapter>
- <chapter id="authentication">
- <!-- <chapterinfo>
- <author>
- <firstname>Boleslaw</firstname>
- <surname>Dawidowicz</surname>
- </author>
- </chapterinfo>-->
- <title>Authentication and Authorization</title>
- <para>This chapter describes the authentication mechanisms in JBoss Portal</para>
- <section id="authentication_in_portal">
- <title>Authentication in JBoss Portal</title>
- <para>JBoss Portal is heavily standard based so it leverages <emphasis>Java Authentication and Authorization Service (JAAS)</emphasis>
- in JBoss Application Server. Because of this it can be configured in a very flexible manner and other
- authentication solutions can be plugged in easily.
- To better understand authentication mechanisms in JBoss Portal please refer to
- <xref linkend="security.security_authentication"/>.
- To learn more about JAAS look for proper documentation on
- <ulink url="http://java.sun.com/javase/6/docs/technotes/guides/security/">Java Security</ulink> website.
- To learn more about security in JBoss Application Server please read
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossSX">JBossSX</ulink> documentation.
- </para>
- <section id="authentication_configuration">
- <title>Configuration</title>
- <para>You can configure the JAAS authentication stack in <emphasis>jboss-portal.sar/conf/login-config.xml</emphasis>.
- It is important to remember that authorization in portal starts at the JAAS level -
- configured <emphasis>LoginModule</emphasis>s apply proper <emphasis>Principal</emphasis> objects representing
- the roles of authenticated user. As you can see in <emphasis>jboss-portal.sar/portal-server.war/WEB-INF/web.xml</emphasis> portal
- servlet is secured with specified role ("<emphasis>Authenticated</emphasis>"). In the default portal configuration
- this role is dynamically added by <emphasis>IdentityLoginModule</emphasis>. If you reconfigure the default JAAS authentication
- chain with other <emphasis>LoginModule</emphasis> implementations, you should remember that you must deal with that
- security constraints in order to be able to access portal. For example if you place only one <emphasis>LoginModule</emphasis>
- that will authenticate users against LDAP server you may consider adding all users in your LDAP tree to such role.
- </para>
- </section>
- </section>
- <section id="portal_login_modules">
- <title>JAAS Login Modules</title>
- <para>JBoss Portal comes with a few implementations of JAAS <emphasis>LoginModule</emphasis> interface</para>
- <section>
- <title>org.jboss.portal.identity.auth.IdentityLoginModule</title>
- <para>This is the standard portal LoginModule implementation that uses portal identity modules in order to search users and roles.
- By default it is the only configured LoginModule in the portal authentication stack. Its behavior can be altered with the following options:
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">userModuleJNDIName</emphasis> - JNDI name of portal UserModule.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">roleModuleJNDIName</emphasis> - JNDI name of portal RoleModule.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">membershipModuleJNDIName</emphasis> - JNDI name of portal MembershipModule.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">additionalRole</emphasis> - additional user <emphasis>Principal</emphasis> that will be added to user <emphasis>Subject</emphasis>.
- This is important as in default portal configuration it is the role that portal servlet is secured with.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">havingRole</emphasis> - only users belonging to role specified with this option will be authenticated.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">unauthenticatedIdentity</emphasis> - the principal to use when a null username and password are seen.</para>
- </listitem>
- </itemizedlist>
- <note><title>Note</title><para>IdentityLoginModule extends org.jboss.security.auth.spi.UsernamePasswordLoginModule so if you are familiar with JBossSX you can apply
- few other options like "password-stacking". Please refer to JBossSX documentation.</para></note>
- </para>
- </section>
- <section>
- <title>org.jboss.portal.identity.auth.DBIdentityLoginModule</title>
- <para>This <emphasis>LoginModule</emphasis> implementation extends JBossSX <emphasis>org.jboss.security.auth.spi.DatabaseServerLoginModule</emphasis> and can be
- used to authenticate against Database. The main purpose of this module is to be configured directly against portal database (instead of using portal identity
- modules like in IdentityLoginModule). So if you are using custom LoginModule implementation you can place this module with "sufficient" flag. This can
- be extremely useful. For example if you authenticate against LDAP server using JBossSX <emphasis>LdapLoginModule</emphasis> you can
- fallback to users present in portal database and not present in LDAP like "admin" user. Please look into
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=DatabaseServerLoginModule">this</ulink> wiki page to learn more about
- <emphasis>DatabaseServerLoginModule</emphasis> configuration</para>
- <para>
- Options are:
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">dsJndiName</emphasis> - The name of the DataSource of the database containing the Principals and Roles tables</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">principalsQuery</emphasis> - The prepared statement query, equivalent to: <emphasis>"select Password from Principals where PrincipalID=?"</emphasis></para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">rolesQuery</emphasis> - The prepared statement query, equivalent to: <emphasis>"select Role, RoleGroup from Roles where PrincipalID=?"</emphasis></para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">hashAlgorithm</emphasis> - The name of the <emphasis>java.security.MessageDigest</emphasis> algorithm to use to hash the password.
- There is no default so this option must be specified to enable hashing. When hashAlgorithm is specified, the clear text password obtained from the <emphasis>CallbackHandler</emphasis>
- is hashed before it is passed to UsernamePasswordLoginModule.validatePassword as the inputPassword argument. The expectedPassword as stored in the users.properties
- file must be comparably hashed.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">hashEncoding</emphasis> - The string format for the hashed pass and st be either "base64" or "hex". Base64 is the default.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">additionalRole</emphasis> - additional user <emphasis>Principal</emphasis> that will be added to user <emphasis>Subject</emphasis>.</para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- Configuration using portal database will look like this:
- <programlisting>
- <![CDATA[
-<login-module code = "org.jboss.portal.identity.auth.DBIdentityLoginModule"
- flag="sufficient">
- <module-option name="dsJndiName">java:/PortalDS</module-option>
- <module-option name="principalsQuery">
- SELECT jbp_password FROM jbp_users WHERE jbp_uname=?
- </module-option/>
- <module-option name="rolesQuery">
- SELECT jbp_roles.jbp_name, 'Roles' FROM jbp_role_membership INNER JOIN
- jbp_roles ON jbp_role_membership.jbp_rid = jbp_roles.jbp_rid INNER JOIN jbp_users ON
- jbp_role_membership.jbp_uid = jbp_users.jbp_uid WHERE jbp_users.jbp_uname=?
- </module-option>
- <module-option name="hashAlgorithm">MD5</module-option>
- <module-option name="hashEncoding">HEX</module-option>
- <module-option name="additionalRole">Authenticated</module-option>
-</login-module>
- ]]>
- </programlisting>
-
- <note><title>Note</title><para>SQL query should be in single line. This code snipped was formatted like this only to fit documentation page.</para></note>
- </para>
- </section>
- <section>
- <title>org.jboss.portal.identity.auth.SynchronizingLdapLoginModule</title>
- <para>
- This module can be used instead of the IdentityLoginModule to bind to LDAP.
- <emphasis>org.jboss.portal.identity.auth.SynchronizingLDAPLoginModule</emphasis> class is a wrapper around
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=LdapLoginModule">LdapLoginModule</ulink> from JBossSX.
- It extends it so all configuration that can be applied to <emphasis>LdapExtLoginModule</emphasis> remains valid here. For a user that
- was authenticated successfully it will try to call the identity modules from portal, then check if such user
- exists or not, and if does not exist it will try to create it. Then for all roles assigned to this authenticated principal it will
- try to check and create them using identity modules. This behavior can be altered using following options:
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">userModuleJNDIName</emphasis> - JNDI name of portal UserModule. This option is <emphasis>obligatory</emphasis>
- if <emphasis>synchronizeIdentity</emphasis> option is set to <emphasis>true</emphasis></para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">roleModuleJNDIName</emphasis> - JNDI name of portal RoleModule. This option is <emphasis>obligatory</emphasis>
- if <emphasis>synchronizeIdentity</emphasis> and <emphasis>synchronizeRoles</emphasis> options are set to <emphasis>true</emphasis></para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">membershipModuleJNDIName</emphasis> - JNDI name of portal MembershipModule. This option is <emphasis>obligatory</emphasis>
- if <emphasis>synchronizeIdentity</emphasis> and <emphasis>synchronizeRoles</emphasis> options are set to <emphasis>true</emphasis></para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">userProfileModuleJNDIName</emphasis> - JNDI name of portal UserProfileModule. This option is <emphasis>obligatory</emphasis>
- if <emphasis>synchronizeIdentity</emphasis> option is set to <emphasis>true</emphasis></para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">synchronizeIdentity</emphasis> - if set to <emphasis>true</emphasis> module will check if
- successfully authenticated user exist in portal and if not it will try to create it. If user exists module will update its password
- to the one that was just validated.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">synchronizeRoles</emphasis> - if set to <emphasis>true</emphasis> module will iterate over all roles assigned to
- authenticated user and for each it will try to check if such role exists in portal and if not it will try to create it. This option is
- checked only if <emphasis>synchronizeIdentity</emphasis> is set to true;</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">additionalRole</emphasis> - module will add this role name to the group of principals assigned to the authenticated user.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">defaultAssignedRole</emphasis> - if <emphasis>synchronizeIdentity</emphasis> is set to true, module will try to assign
- portal role with such name to the authenticated user. If such role doesn't exist in portal, module will try to create it. </para>
- </listitem>
- </itemizedlist>
- For obvious reasons this is designed to use with portal identity modules configured with DB and not LDAP</para>
- </section>
- <section>
- <title>org.jboss.portal.identity.auth.SynchronizingLdapExtLoginModule</title>
- <para>All options that apply for <emphasis>SynchronizingLdapLoginModule</emphasis> also apply here. It's the same kind of wrapper
- made around <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=LdapExtLoginModule">LdapExtLoginModule</ulink> from JBossSX.
- Sample configuration can look like this:</para>
- <programlisting><![CDATA[
- <login-module code="org.jboss.portal.identity.auth.SynchronizingLDAPExtLoginModule"
- flag="required">
- <module-option name="synchronizeIdentity">true</module-option>
- <module-option name="synchronizeRoles">true</module-option>
- <module-option name="additionalRole">Authenticated</module-option>
- <module-option name="defaultAssignedRole">User</module-option>
- <module-option name="userModuleJNDIName">java:/portal/UserModule</module-option>
- <module-option name="roleModuleJNDIName">java:/portal/RoleModule</module-option>
- <module-option name="membershipModuleJNDIName">java:/portal/MembershipModule
- </module-option>
- <module-option name="userProfileModuleJNDIName">java:/portal/UserProfileModule
- </module-option>
- <module-option name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory
- </module-option>
- <module-option name="java.naming.provider.url">ldap://example.com:10389/
- </module-option>
- <module-option name="java.naming.security.authentication">simple</module-option>
- <module-option name="bindDN">cn=Directory Manager</module-option>
- <module-option name="bindCredential">secret</module-option>
- <module-option name="baseCtxDN">ou=People,dc=example,dc=com</module-option>
- <module-option name="baseFilter">(uid={0})</module-option>
- <module-option name="rolesCtxDN">ou=Roles,dc=example,dc=com</module-option>
- <module-option name="roleFilter">(member={1})</module-option>
- <module-option name="roleAttributeID">cn</module-option>
- <module-option name="roleRecursion">-1</module-option>
- <module-option name="searchTimeLimit">10000</module-option>
- <module-option name="searchScope">SUBTREE_SCOPE</module-option>
- <module-option name="allowEmptyPasswords">false</module-option>
-</login-module>]]>
- </programlisting>
- </section>
- <section id="authentication.synchronizing_login_module">
- <title>org.jboss.portal.identity.auth.SynchronizingLoginModule</title>
- <para>
- This module is designed to provide synchronization support for any other LoginModule placed in the authentication stack.
- It leverages the fact that in JAAS authentication process occurs in two phases. In first phase when login() method is invoked
- it always returns "true". Because of this behavior <emphasis>SynchronizingLoginModule</emphasis> should be always used with
- "optional" flag.
- More over it should be placed after the module we want to leverage as a source for synchronization and that module should have "required" flag set.
- During the second phase when commit() method is invoked it gets user <emphasis>Subject</emphasis> and its <emphasis>Principal</emphasis>s
- and tries to synchronize them into storage configured for portal identity modules. For this purposes such options are supported:
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">userModuleJNDIName</emphasis> - JNDI name of portal UserModule. This option is <emphasis>obligatory</emphasis>
- if <emphasis>synchronizeIdentity</emphasis> option is set to <emphasis>true</emphasis></para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">roleModuleJNDIName</emphasis> - JNDI name of portal RoleModule. This option is <emphasis>obligatory</emphasis>
- if <emphasis>synchronizeIdentity</emphasis> and <emphasis>synchronizeRoles</emphasis> options are set to <emphasis>true</emphasis></para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">membershipModuleJNDIName</emphasis> - JNDI name of portal MembershipModule. This option is <emphasis>obligatory</emphasis>
- if <emphasis>synchronizeIdentity</emphasis> and <emphasis>synchronizeRoles</emphasis> options are set to <emphasis>true</emphasis></para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">userProfileModuleJNDIName</emphasis> - JNDI name of portal UserProfileModule. This option is <emphasis>obligatory</emphasis>
- if <emphasis>synchronizeIdentity</emphasis> option is set to <emphasis>true</emphasis></para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">synchronizeIdentity</emphasis> - if set to <emphasis>true</emphasis> module will check if
- successfully authenticated user exist in portal and if not it will try to create it. If user exists module will update its password
- to the one that was just validated.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">synchronizeRoles</emphasis> - if set to <emphasis>true</emphasis> module will iterate over all roles assigned to
- authenticated user and for each it will try to check if such role exists in portal and if not it will try to create it. This option is
- checked only if <emphasis>synchronizeIdentity</emphasis> is set to true;</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">additionalRole</emphasis> - module will add this role name to the group of principals assigned to the authenticated user.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">defaultAssignedRole</emphasis> - if <emphasis>synchronizeIdentity</emphasis> is set to true, module will try to assign
- portal role with such name to the authenticated user. If such role doesn't exist in portal, module will try to create it.</para>
- </listitem>
- </itemizedlist>
- <note><title>Note</title><para>Example of usage in LDAP authentication can be found in <xref linkend="ldap.synchronizing"/>.</para></note>
- </para>
- </section>
- </section>
-</chapter>
- <chapter id="ldap">
-<!-- <chapterinfo>
- <author>
- <firstname>Boleslaw</firstname>
- <surname>Dawidowicz</surname>
- </author>
- </chapterinfo>-->
- <title>LDAP</title>
- <para>This chapter describes how to setup LDAP support in JBoss Portal</para>
- <note><title>Note</title>
- <para>To be able to fully understand this chapter you should also read <xref linkend="identity"/> and
- <xref linkend="authentication"/> before. </para></note>
- <section>
- <title>How to enable LDAP usage in JBoss Portal</title>
- <para>We'll describe here the simple steps that you will need to perform to enable LDAP support in JBoss Portal.
- For additional information you need to read more about configuration of identity and specific implementations of identity modules</para>
- <para>There are two ways to achieve this:</para>
- <itemizedlist>
- <listitem>
- <para>
- <emphasis role="bold">jboss-portal.sar/META-INF/jboss-service.xml</emphasis>
- in section:
- </para>
- <programlisting><![CDATA[
-<mbean
- code="org.jboss.portal.identity.IdentityServiceControllerImpl"
- name="portal:service=Module,type=IdentityServiceController"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends>portal:service=Hibernate</depends>
- <attribute name="JndiName">java:/portal/IdentityServiceController</attribute>
- <attribute name="RegisterMBeans">true</attribute>
- <attribute name="ConfigFile">conf/identity/identity-config.xml</attribute>
- <attribute name="DefaultConfigFile">conf/identity/standardidentity-config.xml</attribute>
-</mbean>]]></programlisting>
- <para>
- change
- <emphasis role="bold">identity-config.xml</emphasis>
- to
- <emphasis role="bold">ldap_identity-config.xml</emphasis>
- </para>
- </listitem>
- <listitem>
- <para>Swap the names or content of files in
- <emphasis role="bold">jboss-portal.sar/conf/identity/identity-config.xml</emphasis>
- and
- <emphasis role="bold">jboss-portal.sar/conf/identity/ldap_identity-config.xml</emphasis>
-
- </para>
- </listitem>
- </itemizedlist>
- <para>
- After doing one of the above changes you need to edit configuration file that you choose to
- use (identity-config.xml or ldap_identity-config.xml) and configure LDAP connection options in section:
- </para>
- <programlisting><![CDATA[
-<datasource>
- <name>LDAP</name>
- <config>
- <option>
- <name>host</name>
- <value>jboss.com</value>
- </option>
- <option>
- <name>port</name>
- <value>10389</value>
- </option>
- <option>
- <name>adminDN</name>
- <value>cn=Directory Manager</value>
- </option>
- <option>
- <name>adminPassword</name>
- <value>qpq123qpq</value>
- </option>
- </config>
-</datasource>]]></programlisting>
- <para>
- You also need to specify options for your LDAP tree (described in configuration documentation) like those:
- </para>
- <programlisting><![CDATA[
-<option-group>
- <group-name>common</group-name>
- <option>
- <name>userCtxDN</name>
- <value>ou=People,dc=portal26,dc=jboss,dc=com</value>
- </option>
- <option>
- <name>roleCtxDN</name>
- <value>ou=Roles,dc=portal26,dc=jboss,dc=com</value>
- </option>
-</option-group>]]></programlisting>
-
- <note><title>Note</title><para>
- Under <emphasis role="bold">PORTAL_SOURCES/identity/src/resources/example/</emphasis> you can find a sample ldif that
- you can use to populate LDAP server and quickly start playing with it.</para>
- </note>
-
- </section>
- <section>
- <title>Configuration of LDAP connection</title>
- <section>
- <title>Connection Pooling</title>
- <para>JBoss Portal uses <ulink url="http://java.sun.com/products/jndi/tutorial/ldap/connect/pool.html">connection pooling</ulink> provided by <ulink url="http://java.sun.com/products/jndi/">JNDI</ulink>, and is enabled by default. Use the following options to configure connection pooling settings:</para>
- <programlisting><![CDATA[
-<datasource>
- <name>LDAP</name>
- <config>
- ...
- <!-- com.sun.jndi.ldap.connect.pool -->
- <option>
- <name>pooling</name>
- <value>true</value>
- </option>
-
- <!-- com.sun.jndi.ldap.connect.pool.protocol -->
- <option>
- <name>poolingProtocol</name>
- <value>plain ssl</value>
- </option>
-
- <!-- com.sun.jndi.ldap.connect.pool.timeout -->
- <option>
- <name>poolingTimeout</name>
- <value>300000</value>
- </option>
-
- <!-- com.sun.jndi.ldap.connect.pool.debug -->
- <option>
- <name>pooling</name>
- <value> ... </value>
- </option>
-
- <!-- com.sun.jndi.ldap.connect.pool.initsize -->
- <option>
- <name>poolingInitsize</name>
- <value> ... </value>
- </option>
-
- <!-- com.sun.jndi.ldap.connect.pool.maxsize -->
- <option>
- <name>poolingMaxsize</name>
- <value> ... </value>
- </option>
-
- <!-- com.sun.jndi.ldap.connect.pool.prefsize -->
- <option>
- <name>poolingPrefsize</name>
- <value> ... </value>
- </option>
-
- ...
- </config>
-</datasource>]]></programlisting>
- <para>
- Remember, as it is described in the <ulink url="http://java.sun.com/products/jndi/tutorial/ldap/connect/config.html">JNDI documentation</ulink>, these options are system properties, not environment properties, and as such, they affect all connection pooling requests in the <trademark class="trade">Java runtime environment</trademark>.
- </para>
-
- </section>
- <section>
- <title>SSL</title>
- <para>The setup is very similar to the one described in LdapLoginModule <ulink url="http://www.jboss.org/wiki/Wiki.jsp?page=LdapLoginModule">wiki page</ulink></para>
- <para>You need to modify your identity configuration file and add "protocol"</para>
- <programlisting><![CDATA[
-<datasource>
- <name>LDAP</name>
- <config>
- ...
- <option>
- <name>protocol</name>
- <value>ssl</value>
- </option>
- ...
- </config>
-</datasource>]]></programlisting>
- <para>
- Then you need to have LDAP server certificate imported into your keystore. You can use following command:
- <programlisting>keytool -import -file ldapcert.der -keystore ldap.truststore</programlisting>
- </para>
- <para>
- Now you need to change the settings to use the alternative truststore. That can be done in the properties-service.xml in deploy directory:
- <programlisting><![CDATA[
-<attribute name="Properties">
- javax.net.ssl.trustStore=../some/path/to/ldap.truststore
- javax.net.ssl.trustStorePassword=somepw
-</attribute>]]></programlisting>
- </para>
- </section>
- <section>
- <title>ExternalContext</title>
- <para>Instead of configuring your own connection you can use JNDI context federation mechanism in JBoss Application Server. Configuration of
- ExternalContext is described in <ulink url="http://docs.jboss.com/jbossas/guides/j2eeguide/r2/en/html_single/#d0e6877">JBoss Application Server documentation</ulink></para>
- <para>When you have ExternalContext configured you can use it in JBoss Portal by providing proper JNDI name in the configuration:
- <programlisting><![CDATA[
-<datasource>
- <name>LDAP</name>
- <config>
- <option>
- <name>externalContextJndiName</name>
- <value>external/ldap/jboss</value>
- </option>
- </config>
-</datasource>]]></programlisting>
-<note><title>Note</title><para>When using "externalContextJndiName" you don't need to specify any other option for this datasource</para></note>
- </para>
- </section>
- </section>
- <section id="ldap.ldap_identity_modules">
- <title>LDAP Identity Modules</title>
- <para>JBoss Portal comes with base LDAP implementation of all identity modules.</para>
- <section>
- <title>Common settings</title>
- <para>For all modules you can set two config options:
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">jNDIName</emphasis> - JNDI name under which this module will be registered</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">connectionJNDIName</emphasis> - JNDI name under which LDAP datasource is registered </para>
- </listitem>
- </itemizedlist>
- <note><title>Note</title><para>Most configuration of LDAP identity modules is done in <emphasis>options</emphasis> section by adding module specific options
- in <emphasis>"common"</emphasis> option-group or in other module specific groups.</para></note>
- </para>
- </section>
- <section>
- <title>UserModule</title>
- <para>
- <table frame="all">
- <title>Comparision of UserModule implementations</title>
- <tgroup cols="3" align="left" colsep="1">
- <colspec colname="c1"/>
- <colspec colname="c2"/>
- <colspec colname="c3"/>
- <thead>
- <row>
- <entry align="center" morerows="1">Features</entry>
- <entry align="center" namest="c2" nameend="c3">UserModule</entry>
- </row>
- <row>
- <entry align="center">LDAPUserModuleImpl</entry>
- <entry align="center">LDAPExtUserModuleImpl</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>User creation</entry>
- <entry align="center">X</entry>
- <entry align="center">-</entry>
- </row>
- <row>
- <entry>User removal</entry>
- <entry align="center">X</entry>
- <entry align="center">-</entry>
- </row>
- <row>
- <entry>User search</entry>
- <entry align="center">Flat - one level scope</entry>
- <entry align="center">Flexible filter - sub tree scope</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </para>
- <section>
- <title>LDAPUserModuleImpl</title>
- <para>This is the base implementation of LDAP <emphasis>UserModule</emphasis>. It supports user creation, but will retrieve users and create them
- in strictly specified place in LDAP tree.</para>
- <para>To enable it in your configuration you should have:
- <programlisting><![CDATA[
-<module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>User</type>
- <implementation>LDAP</implementation>
- <config/>
-</module>]]></programlisting>
- </para>
- <para>org.jboss.portal.identity.ldap.LDAPUserModuleImpl configuration option-groups options:
- </para>
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">common</emphasis>:
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">userCtxDN</emphasis> - DN that will be used as context for user searches</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">uidAttributeID</emphasis> - attribute name under which user name is specified. Default value is "uid"</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">passwordAttributeID</emphasis> - attribute name under which user password is specified. Default value is "userPassword"</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">principalDNPrefix</emphasis> and <emphasis role="bold">principalDNSuffix</emphasis></para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">searchTimeLimit</emphasis> - The timeout in milliseconds for the user searches. Defaults to 10000 (10 seconds).</para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">userCreateAttibutes</emphasis>: This option-group defines a set of ldap attributes that will be set on user entry creation.
- Option name will be used as attribute name, and option values as attribute values. This enables to fulfill LDAP schema requirements.</para>
- </listitem>
- </itemizedlist>
-
- <para> Example configuration:
- <programlisting>
- <![CDATA[
-<option-group>
- <group-name>common</group-name>
- <option>
- <name>userCtxDN</name>
- <value>ou=People,o=portal,dc=my-domain,dc=com</value>
- </option>
- <option>
- <name>uidAttributeID</name>
- <value>uid</value>
- </option>
- <option>
- <name>passwordAttributeID</name>
- <value>userPassword</value>
- </option>
-</option-group>
-<option-group>
- <group-name>userCreateAttibutes</group-name>
- <option>
- <name>objectClass</name>
- <!--This objectclasses should work with Red Hat Directory-->
- <value>top</value>
- <value>person</value>
- <value>inetOrgPerson</value>
- </option>
- <!--Schema requires those to have initial value-->
- <option>
- <name>cn</name>
- <value>none</value>
- </option>
- <option>
- <name>sn</name>
- <value>none</value>
- </option>
-</option-group>]]></programlisting>
-
- </para>
- </section>
- <section>
- <title>LDAPExtUserModuleImpl</title>
- <para>Aim of this implementation is to give more flexibility for users retrieval. You can specify LDAP filter
- that will be used for searches. This module doesn't support user creation and removal</para>
- <para>To enable it in your configuration you should have:
- <programlisting><![CDATA[
-<module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>User</type>
- <implementation>LDAP</implementation>
- <class>org.jboss.portal.identity.ldap.LDAPExtUserModuleImpl</class>
- <config/>
-</module]]>
- </programlisting>
- </para>
- <para>org.jboss.portal.identity.ldap.LDAPExtUserModuleImpl configuration option-groups options:
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">common</emphasis>:
- <itemizedlist>
- <listitem>
- <para> <emphasis role="bold">userCtxDN</emphasis> - DN that will be used as context for user searches. More than one value can be specified.</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">userSearchFilter</emphasis> - ldap filter to search users with. {0} will be substitute with user name. Example filter can look like this:
- "(uid={0})". This substituion behavior comes from the standard <emphasis>DirContext.search(Name, String, Object, SearchControls cons)</emphasis> method</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">uidAttributeID</emphasis> - attribute name under which user name is specified. Default value is "uid"</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">searchTimeLimit</emphasis> - The timeout in milliseconds for the user searches. Defaults to 10000 (10 seconds).</para>
- </listitem>
- <!--<listitem>
- <emphasis role="bold">searchScope</emphasis> - Sets the search scope to one of the strings. The default is SUBTREE_SCOPE.
- <itemizedlist>
- <listitem>
- <emphasis role="bold">OBJECT_SCOPE</emphasis> - only search the named users context.
- </listitem>
- <listitem>
- <emphasis role="bold">ONELEVEL_SCOPE</emphasis> - search directly under the named users context.
- </listitem>
- <listitem>
- <emphasis role="bold">SUBTREE_SCOPE</emphasis> - If the users context is not a <emphasis>DirContext</emphasis>, search only the object.
- If the users context is a <emphasis>DirContext</emphasis>, search the subtree rooted at the named object, including the named object itself.
- </listitem>
- </itemizedlist>
- </listitem>-->
- </itemizedlist>
- </para>
- </listitem>
- </itemizedlist>
-
- </para>
- </section>
- </section>
- <section>
- <title>RoleModule</title>
- <para>
- <table frame="all">
- <title>Comparision of RoleModule implementations</title>
- <tgroup cols="3">
-
- <thead>
- <row>
- <entry align="center">Features</entry>
- <entry align="center">RoleModule</entry>
- </row>
- <row>
- <entry align="center">LDAPRoleModuleImpl</entry>
- <entry align="center">LDAPExtRoleModuleImpl</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>Role creation</entry>
- <entry align="center">X</entry>
- <entry align="center">-</entry>
- </row>
- <row>
- <entry>Role removal</entry>
- <entry align="center">X</entry>
- <entry align="center">-</entry>
- </row>
- <row>
- <entry>Role search</entry>
- <entry align="center">Flat - one level scope</entry>
- <entry align="center">Flexible filter - sub tree scope</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </para>
- <section>
- <title>LDAPRoleModuleImpl</title>
- <para>This is the base implementation of LDAP <emphasis>RoleModule</emphasis>. It supports user creation, but will retrieve roles and create them
- in strictly specified place in LDAP tree.</para>
- <para>To enable it in your configuration you should have:
- <programlisting><![CDATA[
-<module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>Role</type>
- <implementation>LDAP</implementation>
- <config/>
-</module>]]>
- </programlisting>
- </para>
- <para>org.jboss.portal.identity.ldap.LDAPRoleModuleImpl configuration option-groups options:
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">common</emphasis>:
- <itemizedlist>
- <listitem>
- <para><emphasis role="bold">roleCtxDN</emphasis> - DN that will be used as context for role searches.</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">ridAttributeID</emphasis> - attribute name under which role name is specified. Default value is "cn".</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">roleDisplayNameAttributeID</emphasis> - attribute name under which role display name is specified. Default value is "cn".</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">searchTimeLimit</emphasis> - The timeout in milliseconds for the roles searches. Defaults to 10000 (10 seconds).</para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>LDAPExtRoleModuleImpl</title>
- <para>Aim of this implementation is to give more flexibility for roles retrieval. You can specify LDAP filter
- that will be used for searches. This module doesn't support role creation and removal.</para>
- <para>This module doesn't support role creation and removal</para>
- <para>To enable it in your configuration you should have:</para>
- <programlisting><![CDATA[
-<module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>Role</type>
- <implementation>LDAP</implementation>
- <class>org.jboss.portal.identity.ldap.LDAPExtRoleModuleImpl</class>
- <config/>
-</module>]]>
- </programlisting>
-
- <para>org.jboss.portal.identity.ldap.LDAPExtRoleModuleImpl configuration option-groups options:
- </para>
- <itemizedlist>
- <listitem>
- <para> <emphasis role="bold">common</emphasis>:
- <itemizedlist>
- <listitem>
- <para> <emphasis role="bold">roleCtxDN</emphasis> - DN that will be used as context for role searches. More than one value can be specified.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">roleSearchFilter</emphasis> - ldap filter to search roles with. {0} will be substitute with role name. Example filter can look like this:
- "(cn={0})". This substituion behavior comes from the standard <emphasis>DirContext.search(Name, String, Object, SearchControls cons)</emphasis> method.</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">ridAttributeID</emphasis> - attribute name under which role name is specified. Default value is "cn".</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">roleDisplayNameAttributeID</emphasis> - attribute name under which role display name is specified. Default value is "cn".</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">searchTimeLimit</emphasis> - The timeout in milliseconds for the roles searches. Defaults to 10000 (10 seconds).</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">searchScope</emphasis> - Sets the search scope to one of the strings. The default is SUBTREE_SCOPE.
- <itemizedlist>
- <listitem>
- <para><emphasis role="bold">OBJECT_SCOPE</emphasis> - only search the named roles context.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">ONELEVEL_SCOPE</emphasis> - search directly under the named roles context.</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">SUBTREE_SCOPE</emphasis> - If the roles context is not a <emphasis>DirContext</emphasis>, search only the object.
- If the roles context is a <emphasis>DirContext</emphasis>, search the subtree rooted at the named object, including the named object itself.</para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- </itemizedlist>
-
-
- <note><title>Note</title><para>In <emphasis>UserModule</emphasis> there are two methods that handle offset/limit (pagination) behavior.
- <programlisting>
- <![CDATA[
-/** Get a range of users.*/
-Set findUsers(int offset, int limit) throws IdentityException, IllegalArgumentException;
-
-/** Get a range of users.*/
-Set findUsersFilteredByUserName(String filter, int offset, int limit)
- throws IdentityException, IllegalArgumentException;
- ]]>
- </programlisting>
- Pagination support is not widely implemented in LDAP servers. Because <emphasis>UserModule</emphasis>
- implementations rely on JNDI and are targetted to be LDAP server agnostic those methods aren't very effecient.
- As long as you don't rely on portal user management and use dedicated tools for user provisioning it
- shouldn't bother you. Otherwise you should consider extending the implementation and providing
- solution dedicated to your LDAP server.</para>
- </note>
- </section>
- </section>
- <section>
- <title>MembershipModule</title>
- <para>
- <table frame="all">
- <title>Comparision of MembershipModule implementations</title>
- <tgroup cols="3" align="left">
-
- <thead>
- <row>
- <entry align="center">Features</entry>
- <entry align="center">MembershipModule</entry>
- </row>
- <row>
- <entry align="center">LDAPStaticGroupMembershipModuleImpl</entry>
- <entry align="center">LDAPStaticRoleMembershipModuleImpl</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>Role assignment stored in LDAP role entry</entry>
- <entry align="center">X</entry>
- <entry align="center">-</entry>
- </row>
- <row>
- <entry>Role assignment stored in LDAP user entry</entry>
- <entry align="center">-</entry>
- <entry align="center">X</entry>
- </row>
- <row>
- <entry>User/Role relationship creation</entry>
- <entry align="center">X</entry>
- <entry align="center">X</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </para>
- <section>
- <title>LDAPStaticGroupMembershipModuleImpl</title>
- <para>This module support tree shape where role entries keep information about users that are their members.</para>
- <para>To enable it in your configuration you should have:
- <programlisting><![CDATA[
-<module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>Membership</type>
- <implementation>LDAP</implementation>
- <config/>
-</module>]]>
- </programlisting>
- </para>
- <para>org.jboss.portal.identity.ldap.LDAPStaticGroupMembershipModuleImpl configuration option-groups options:
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">common</emphasis>:
- <itemizedlist>
- <listitem>
- <para> <emphasis role="bold">membershipAttributeID</emphasis> - LDAP attribute that defines member users ids. This will be used to retrieved users from role entry.</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">membershipAttributeIsDN</emphasis> - defines if values of attribute defined in <emphasis>membershipAttributeID</emphasis> are fully qualified
- LDAP DNs.</para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>LDAPStaticRoleMembershipModuleImpl</title>
- <para>This module support tree shape where user entries keep information about roles that they belong to.</para>
- <para>To enable it in your configuration you should have:
- <programlisting><![CDATA[
-<module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>Membership</type>
- <implementation>LDAP</implementation>
- <class>org.jboss.portal.identity.ldap.LDAPStaticRoleMembershipModuleImpl</class>
- <config/>
-</module>]]>
- </programlisting>
- </para>
- <para>org.jboss.portal.identity.ldap.LDAPStaticRoleMembershipModuleImpl configuration option-groups options:
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">common</emphasis>:
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">membershipAttributeID</emphasis> - LDAP attribute that defines role ids that user belongs to. This will be used to retrieved roles
- from user entry.</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">membershipAttributeIsDN</emphasis> - defines if values of attribute defined in <emphasis>membershipAttributeID</emphasis> are fully qualified
- LDAP DNs.</para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- </section>
- <section>
- <title>UserProfileModule</title>
- <section>
- <title>LDAPUserProfileModuleImpl</title>
- <para>This is standard implementation that enables to retrieve user properties from atributes in LDAP entries.</para>
- <para>To enable it in your configuration you should have:
- <programlisting><![CDATA[
-<module>
- <type>UserProfile</type>
- <implementation>DELEGATING</implementation>
- <config>
- <option>
- <name>ldapModuleJNDIName</name>
- <value>java:/portal/LDAPUserProfileModule</value>
- </option>
- </config>
-</module>
-<module>
- <type>DBDelegateUserProfile</type>
- <implementation>DB</implementation>
- <config>
- <option>
- <name>randomSynchronizePassword</name>
- <value>true</value>
- </option>
- </config>
-</module>
-<module>
- <type>LDAPDelegateUserProfile</type>
- <implementation>LDAP</implementation>
- <config/>
-</module>]]>
- </programlisting>
- <note><title>Note</title><para>Using such configuration you will have LDAP MembershipModule along with DB MembershipModule and Delegating MembershipModule. Please read
- <xref linkend="identity.management_api"/> to see why this is important.</para>
- </note>
- </para>
- <para>org.jboss.portal.identity.ldap.LDAPUserModuleImpl configuration option-groups options:
- <itemizedlist>
- <listitem>
- <para><emphasis role="bold">common</emphasis>:
- <itemizedlist>
- <listitem>
- <para> <emphasis role="bold">profileConfigFile</emphasis> - file with user profile configuration. If this option is not set, and we use delegating UserProfileModule,
- profile configuration will be obtained from it.</para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- </section>
- </section>
- <section>
- <title>LDAP server tree shapes</title>
- <para>JBoss Portal supports full user/role management for simple LDAP tree shapes. Some more flexible
- trees can be supported by <emphasis>LdapExtUserModuleImpl</emphasis> and <emphasis>LdapExtRoleModuleImpl</emphasis>
- - but without user/role creation and removal capabilities.
- However if you have complex LDAP tree you should consider using
- <xref linkend="authentication.synchronizing_login_module"/> described in
- <xref linkend="authentication"/> along with dedicated tools for user
- provisioning provided with LDAP server.</para>
- <para>
- In following subsections we will describe two base LDAP tree shapes along with example LDIFs and portal
- identity modules configurations. Those two examples differ only by using different <emphasis>MembershipModule</emphasis>
- implementations and describe only tree shapes with supported user/role creation and removal capabilities.
- </para>
- <section>
- <title>Keeping users membership in role entries</title>
- <para>In this example, information about users/roles assignment is stored in roles entries using LDAP
- "<emphasis>member</emphasis>". Of course any other attribute that comes with schema can be used for this.</para>
- <para>Example tree shape in LDAP browser
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/ldap/tree1-1.png" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/ldap/tree1-2.png" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <section>
- <title>Example LDIF</title>
- <para>
- <programlisting><![CDATA[
-dn: dc=example,dc=com
-objectclass: top
-objectclass: dcObject
-objectclass: organization
-dc: example
-o: example
-
-dn: ou=People,dc=example,dc=com
-objectclass: top
-objectclass: organizationalUnit
-ou: People
-
-dn: uid=user,ou=People,dc=example,dc=com
-objectclass: top
-objectclass: inetOrgPerson
-objectclass: person
-uid: user
-cn: JBoss Portal user
-sn: user
-userPassword: user
-mail: email(a)email.com
-
-dn: uid=admin,ou=People,dc=example,dc=com
-objectclass: top
-objectclass: inetOrgPerson
-objectclass: person
-uid: admin
-cn: JBoss Portal admin
-sn: admin
-userPassword: admin
-mail: email(a)email.com
-
-dn: ou=Roles,dc=example,dc=com
-objectclass: top
-objectclass: organizationalUnit
-ou: Roles
-
-dn: cn=User,ou=Roles,dc=example,dc=com
-objectClass: top
-objectClass: groupOfNames
-cn: User
-description: the JBoss Portal user group
-member: uid=user,ou=People,dc=example,dc=com
-
-dn: cn=Admin,ou=Roles,dc=example,dc=com
-objectClass: top
-objectClass: groupOfNames
-cn: Echo
-description: the JBoss Portal admin group
-member: uid=admin,ou=People,dc=example,dc=com]]></programlisting>
- </para>
- </section>
- <section>
- <title>Example identity configuration</title>
- <para>
- <programlisting><![CDATA[
- <modules>
- <module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>User</type>
- <implementation>LDAP</implementation>
- <config/>
- </module>
- <module>
- <type>Role</type>
- <implementation>LDAP</implementation>
- <config/>
- </module>
- <module>
- <type>Membership</type>
- <implementation>LDAP</implementation>
- <config/>
- </module>
- <module>
- <type>UserProfile</type>
- <implementation>DELEGATING</implementation>
- <config>
- <option>
- <name>ldapModuleJNDIName</name>
- <value>java:/portal/LDAPUserProfileModule</value>
- </option>
- </config>
- </module>
- <module>
- <type>DBDelegateUserProfile</type>
- <implementation>DB</implementation>
- <config>
- <option>
- <name>randomSynchronizePassword</name>
- <value>true</value>
- </option>
- </config>
- </module>
- <module>
- <type>LDAPDelegateUserProfile</type>
- <implementation>LDAP</implementation>
- <config/>
- </module>
-</modules>
-
-<options>
- <option-group>
- <group-name>common</group-name>
- <option>
- <name>userCtxDN</name>
- <value>ou=People,dc=example,dc=com</value>
- </option>
- <option>
- <name>roleCtxDN</name>
- <value>ou=Roles,dc=example,dc=com</value>
- </option>
- </option-group>
- <option-group>
- <group-name>userCreateAttibutes</group-name>
- <option>
- <name>objectClass</name>
- <!--This objectclasses should work with Red Hat Directory-->
- <value>top</value>
- <value>person</value>
- <value>inetOrgPerson</value>
- </option>
- <!--Schema requires those to have initial value-->
- <option>
- <name>cn</name>
- <value>none</value>
- </option>
- <option>
- <name>sn</name>
- <value>none</value>
- </option>
- </option-group>
- <option-group>
- <group-name>roleCreateAttibutes</group-name>
- <!--Schema requires those to have initial value-->
- <option>
- <name>cn</name>
- <value>none</value>
- </option>
- <!--Some directory servers require this attribute to be valid DN-->
- <!--For safety reasons point to the admin user here-->
- <option>
- <name>member</name>
- <value>uid=admin,ou=People,dc=example,dc=com</value>
- </option>
- </option-group>
-</options>]]></programlisting>
- </para>
- </section>
-
- </section>
- <section>
- <title>Keeping users membership in user entries</title>
- <para>In this example, information about users/roles assignment is stored in user entries using LDAP
- "<emphasis>memberOf</emphasis>". Of course any other attribute that comes with schema can be used for this.</para>
- <para>Example tree shape in LDAP browser
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/ldap/tree2-3.png" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/ldap/tree2-4.png" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <section>
- <title>Example LDIF</title>
- <para>
- <programlisting><![CDATA[
-dn: dc=example,dc=com
-objectclass: top
-objectclass: dcObject
-objectclass: organization
-dc: example
-o: example
-
-dn: o=example2,dc=example,dc=com
-objectclass: top
-objectclass: organization
-o: example2
-
-dn: ou=People,o=example2,dc=example,dc=com
-objectclass: top
-objectclass: organizationalUnit
-ou: People
-
-dn: uid=admin,ou=People,o=example2,dc=example,dc=com
-objectclass: top
-objectclass: inetOrgPerson
-objectclass: inetUser
-uid: admin
-cn: JBoss Portal admin
-sn: admin
-userPassword: admin
-mail: email(a)email.com
-memberOf: cn=Admin,ou=Roles,o=example2,dc=example,dc=com
-
-dn: uid=user,ou=People,o=example2,dc=example,dc=com
-objectclass: top
-objectclass: inetOrgPerson
-objectclass: inetUser
-uid: user
-cn: JBoss Portal user
-sn: user
-userPassword: user
-mail: email(a)email.com
-memberOf: cn=User,ou=Roles,o=example2,dc=example,dc=com
-
-dn: ou=Roles,o=example2,dc=example,dc=com
-objectclass: top
-objectclass: organizationalUnit
-ou: Roles
-
-dn: cn=User,ou=Roles,o=example2,dc=example,dc=com
-objectClass: top
-objectClass: organizationalRole
-cn: User
-description: the JBoss Portal user group
-
-dn: cn=Admin,ou=Roles,o=example2,dc=example,dc=com
-objectClass: top
-objectClass: organizationalRole
-cn: Echo
-description: the JBoss Portal admin group]]></programlisting>
- </para>
- </section>
- <section>
- <title>Example identity configuration</title>
- <para>
- <programlisting><![CDATA[
- <modules>
- <module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>User</type>
- <implementation>LDAP</implementation>
- <config/>
- </module>
- <module>
- <type>Role</type>
- <implementation>LDAP</implementation>
- <config/>
- </module>
- <module>
- <type>Membership</type>
- <implementation>LDAP</implementation>
- <class>org.jboss.portal.identity.ldap.LDAPStaticRoleMembershipModuleImpl</class>
- <config/>
- </module>
- <module>
- <type>UserProfile</type>
- <implementation>DELEGATING</implementation>
- <config>
- <option>
- <name>ldapModuleJNDIName</name>
- <value>java:/portal/LDAPUserProfileModule</value>
- </option>
- </config>
- </module>
- <module>
- <type>DBDelegateUserProfile</type>
- <implementation>DB</implementation>
- <config>
- <option>
- <name>randomSynchronizePassword</name>
- <value>true</value>
- </option>
- </config>
- </module>
- <module>
- <type>LDAPDelegateUserProfile</type>
- <implementation>LDAP</implementation>
- <config/>
- </module>
-</modules>
-
-<options>
- <option-group>
- <group-name>common</group-name>
- <option>
- <name>userCtxDN</name>
- <value>ou=People,dc=example,dc=com</value>
- </option>
- <option>
- <name>roleCtxDN</name>
- <value>ou=Roles,dc=example,dc=com</value>
- </option>
- <option>
- <name>membershipAttributeID</name>
- <value>memberOf</value>
- </option>
- </option-group>
- <option-group>
- <group-name>userCreateAttibutes</group-name>
- <option>
- <name>objectClass</name>
- <!--This objectclasses should work with Red Hat Directory-->
- <value>top</value>
- <value>person</value>
- <value>inetOrgPerson</value>
- </option>
- <!--Schema requires those to have initial value-->
- <option>
- <name>cn</name>
- <value>none</value>
- </option>
- <option>
- <name>sn</name>
- <value>none</value>
- </option>
- </option-group>
- <option-group>
- <group-name>roleCreateAttibutes</group-name>
- <!--Schema requires those to have initial value-->
- <option>
- <name>cn</name>
- <value>none</value>
- </option>
- <!--Some directory servers require this attribute to be valid DN-->
- <!--For safety reasons point to the admin user here-->
- <option>
- <name>member</name>
- <value>uid=admin,ou=People,dc=example,dc=com</value>
- </option>
- </option-group>
-</options>]]></programlisting>
- </para>
- </section>
- </section>
- </section>
- <section id="ldap.synchronizing">
- <title>Synchronizing LDAP configuration</title>
- <para>
- Like it was described in previous section, you can meet some limitations in identity modules support for more
- complex LDAP tree shapes. To workaround this you can use identity synchronization on JAAS level. JBoss Portal comes with
- <xref linkend="authentication.synchronizing_login_module"/> that can be easily
- configured with other authentication solutions that support JAAS framework. Here we want to provide a simple
- example on how it can be integrated with
- <emphasis><ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=LdapExtLoginModule">LdapExtLoginModule</ulink>
- from <emphasis>JBossSX</emphasis> framework.</emphasis>
- </para>
- <para>
- First of all portal identity modules should be configured to work with portal database - default configuration.
- This is important as we will leverage them, and we want to synchronize users identity into default portal storage
- mechanism. So lets look at simple configuration that should take place in
- <emphasis>jboss-portal.sar/conf/login-config.xml</emphasis>
- <programlisting><![CDATA[
-<policy>
- <!-- For the JCR CMS -->
- <application-policy name="cms">
- <authentication>
- <login-module code="org.apache.jackrabbit.core.security.SimpleLoginModule"
- flag="required"/>
- </authentication>
- </application-policy>
-
- <application-policy name="portal">
- <authentication>
-
- <login-module code="org.jboss.security.auth.spi.LdapExtLoginModule" flag="required">
- <module-option name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory
- </module-option>
- <module-option name="java.naming.provider.url">ldap://example.com:10389/
- </module-option>
- <module-option name="java.naming.security.authentication">simple</module-option>
- <module-option name="bindDN">cn=Directory Manager</module-option>
- <module-option name="bindCredential">lolo</module-option>
- <module-option name="baseCtxDN">ou=People,dc=example,dc=com</module-option>
- <module-option name="baseFilter">(uid={0})</module-option>
- <module-option name="rolesCtxDN">ou=Roles,dc=example,dc=com</module-option>
- <module-option name="roleFilter">(member={1})</module-option>
- <module-option name="roleAttributeID">cn</module-option>
- <module-option name="roleRecursion">-1</module-option>
- <module-option name="searchTimeLimit">10000</module-option>
- <module-option name="searchScope">SUBTREE_SCOPE</module-option>
- <module-option name="allowEmptyPasswords">false</module-option>
- </login-module>
-
- <login-module code="org.jboss.portal.identity.auth.SynchronizingLoginModule"
- flag="optional">
- <module-option name="synchronizeIdentity">true</module-option>
- <module-option name="synchronizeRoles">true</module-option>
- <module-option name="additionalRole">Authenticated</module-option>
- <module-option name="defaultAssignedRole">User</module-option>
- <module-option name="userModuleJNDIName">java:/portal/UserModule</module-option>
- <module-option name="roleModuleJNDIName">java:/portal/RoleModule</module-option>
- <module-option name="membershipModuleJNDIName">java:/portal/MembershipModule
- </module-option>
- <module-option name="userProfileModuleJNDIName">java:/portal/UserProfileModule
- </module-option>
- </login-module>
-
- </authentication>
- </application-policy>
-</policy>]]></programlisting>
- </para>
- <para>
- Few things are important in this configuration:
- <itemizedlist>
- <listitem><para><emphasis>LdapExtLoginModule</emphasis> has <emphasis>flag="required"</emphasis> set
- which means that if this single <emphasis>LoginModule</emphasis> return <emphasis>fail</emphasis>
- from authentication request whole process will fail. <emphasis>SynchronizingLoginModule</emphasis>
- has <emphasis>flag="optional"</emphasis>. Such combination is critical as
- <emphasis>SynchronizingLoginModule</emphasis> always authenticates user sucessfully no matter what
- credentials were provided. You always must have at least one <emphasis>LoginModule</emphasis> that you
- will rely on.</para>
- </listitem>
- <listitem>
- <para><emphasis>SynchronizingLoginModule</emphasis> is always the <emphasis>last</emphasis> one in whole
- authentication chain. This is because in <emphasis>commit</emphasis> phase it will take users
- <emphasis>Subject</emphasis> and its <emphasis>Principals</emphasis> (roles) assigned by previous
- <emphasis>LoginModule</emphasis>s and try to synchronize them. Roles assigned to authenticated user by
- <emphasis>LoginModule</emphasis>s after it won't be handled.</para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>Supported LDAP servers</title>
- <para>LDAP servers support depends on few conditions. In most cases they differ in schema support - various objectClass
- objects are not present by default in server schema. Sometimes it can be workarounded by manually
- extending schema.</para>
- <para>
- Servers can be
- <itemizedlist>
- <listitem><para><emphasis>Supported</emphasis></para></listitem>
- <listitem><para><emphasis>Not Supported</emphasis></para></listitem>
- <listitem><para><emphasis>Experimental</emphasis> - implementation can work with such server but it's not well tested so shouldn't be considered for production.</para></listitem>
- </itemizedlist>
- </para>
- <table frame="all">
- <title>Support of identity modules with different LDAP servers</title>
- <tgroup cols="8" align="left" colsep="1">
- <colspec colname="c1"/>
- <colspec colname="c2"/>
- <colspec colname="c3"/>
- <colspec colname="c4"/>
- <colspec colname="c5"/>
- <colspec colname="c6"/>
- <colspec colname="c7"/>
- <colspec colname="c8"/>
- <thead>
- <row>
- <entry align="center" morerows="1">LDAP Server</entry>
- <entry align="center" namest="c2" nameend="c3">UserModule</entry>
- <entry align="center" namest="c4" nameend="c5">RoleModule</entry>
- <entry align="center" namest="c6" nameend="c7">MembershipModule</entry>
- <entry align="center">UserProfileModule</entry>
- </row>
- <row>
- <entry>LDAPUserModuleImpl</entry>
- <entry>LDAPExtUserModuleImpl</entry>
- <entry>LDAPRoleModuleImpl</entry>
- <entry>LDAPExtRoleModuleImpl</entry>
- <entry>LDAPStaticGroupMembershipModuleImpl</entry>
- <entry>LDAPStaticRoleMembershipModuleImpl</entry>
- <entry>LDAPUserProfileModuleImpl</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>Red Hat Directory Server</entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- </row>
- <row>
- <entry>OpenDS</entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Not Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- </row>
- <row>
- <entry>OpenLDAP</entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Not Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </section>
-</chapter>
- <chapter id="sso">
-<!-- <chapterinfo>
- <author>
- <firstname>Boleslaw</firstname>
- <surname>Dawidowicz</surname>
- </author>
- <author>
- <firstname>Sohil</firstname>
- <surname>Shah</surname>
- </author>
- </chapterinfo>-->
- <title>Single Sign On</title>
- <para>This chapter describes how to setup SSO in JBoss Portal</para>
- <section>
- <title>Overview of SSO in portal</title>
- <para>Portal as an integration and aggregation platform provides some form of SSO by itself. When you log into
- the portal you gain access to many systems through portlets using a single identity. Still in many cases you
- need to integrate the portal infrastructure with other SSO enabled systems. There are many different Identity Management
- solutions on the market. In most cases each SSO framework provides its own way to plug into Java EE application. For custom configurations
- you need to have a good understanding of <xref linkend="identity"/> and <xref linkend="authentication"/> authentication mechanisms.</para>
- </section>
-
- <section>
- <title>Using an Apache Tomcat Valve</title>
- <para>JBoss Application Server embeds Apache Tomcat as the default servlet container. Tomcat provides a builtin SSO support
- using a valve. The Single Sign On Valve caches credentials on the server side, and then invisibly authenticate users when they
- reach different web applications. Credentials are stored in a host-wide session which means that SSO will be effective throughout the session.
- </para>
- <section>
- <title>Enabling the Apache Tomcat SSO Valve</title>
- <para>
- To enable SSO valve in Apache Tomcat you should uncomment the following line
- <programlisting><![CDATA[<Valve className=’org.apache.catalina.authenticator.SingleSignOn’/>]]></programlisting>
- in the <literal>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml</literal> file.
- More information can be found <ulink url="http://www.jboss.org/wiki/Wiki.jsp?page=SingleSignOn">here</ulink>.
- </para>
- </section>
- <section>
- <title>Example of usage</title>
- <para>
- Lets look a little bit closer and configure SSO between portal and other web application. As an example
- we'll use <emphasis>jmx-console</emphasis> web-app that comes with every JBoss Application Server installation.
- You can find more information on how to secure <emphasis>jmx-console</emphasis> in <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=SecureTheJmxConsole">JBoss AS wiki</ulink>.
- </para>
- <orderedlist>
- <listitem>
- <para>Take a clean install of <emphasis>JBoss Application Server</emphasis></para>
- </listitem>
- <listitem>
- <para>Edit <emphasis>$JBOSS_HOME/server/default/deploy/jmx-console.war/WEB-INF/web.xml</emphasis> file and make sure it contains following content:</para>
- <programlisting>
- <![CDATA[
-<security-constraint>
- <web-resource-collection>
- <web-resource-name>HtmlAdaptor</web-resource-name>
- <description>An example security config that only allows users with the
- role JBossAdmin to access the HTML JMX console web application
- </description>
- <url-pattern>/*</url-pattern>
- <http-method>GET</http-method>
- <http-method>POST</http-method>
- </web-resource-collection>
- <auth-constraint>
- <role-name>Admin</role-name>
- </auth-constraint>
-</security-constraint>
-
-<security-constraint>
- <web-resource-collection>
- <web-resource-name>Public</web-resource-name>
- <url-pattern>/public/*</url-pattern>
- <http-method>GET</http-method>
- <http-method>POST</http-method>
- </web-resource-collection>
-</security-constraint>
-
-<login-config>
- <auth-method>BASIC</auth-method>
- <realm-name>jmx-console</realm-name>
-</login-config>
-
-<security-role>
- <role-name>Admin</role-name>
-</security-role>]]>
- </programlisting>
- <para>This will secure <emphasis>jmx-console</emphasis> web application using BASIC browser authentication and restrict access for
- users with <emphasis>Admin</emphasis> role only.</para>
- </listitem>
- <listitem>
- <para>
- Edit <emphasis>$JBOSS_HOME/server/default/conf/props/jmx-console-roles.properties</emphasis> file and make it contain:
-
- <programlisting>
- <![CDATA[
-admin=JBossAdmin,HttpInvoker,Admin]]>
- </programlisting>
-
- This file is a simple identity store for this web application authentication. It will make user <emphasis>admin</emphasis> belongs to <emphasis>Admin</emphasis> role.
- </para>
- </listitem>
- <listitem>
- <para>Deploy JBoss Portal</para>
- </listitem>
- <listitem>
- <para>Run JBoss Application Server</para>
- </listitem>
- <listitem>
- <para>Now you can check that when you go to
- <itemizedlist>
- <listitem><para>
- <emphasis>http://localhost:8080/portal</emphasis></para>
- </listitem>
- <listitem>
- <para> <emphasis>http://localhost:8080/jmx-console</emphasis></para>
- </listitem>
- </itemizedlist>
- you need to authenticate separately into each of those web applications.
- </para>
- </listitem>
- <listitem>
- <para>Shutdown Application Server</para>
- </listitem>
- <listitem>
- <para>
- Uncomment the following line
- <programlisting><![CDATA[<Valve className=’org.apache.catalina.authenticator.SingleSignOn’/>]]></programlisting>
- in the <literal>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml</literal> file.
- More information can be found <ulink url="http://www.jboss.org/wiki/Wiki.jsp?page=SingleSignOn">here</ulink>.
- </para>
- <para>
- Run JBoss Application Server.
- </para>
- </listitem>
- </orderedlist>
- <para>
- Now if you log into portal as user <emphasis>admin</emphasis> with password <emphasis>admin</emphasis>, you won't
- be asked for credentials when accessing <emphasis>jmx-console</emphasis>. This should work in both directions.
- </para>
- <note><title>Note</title><para>Please note that in this example <emphasis>jmx-console</emphasis> uses <emphasis>BASIC</emphasis> authentication method.
- This means that user credentials are cached on the client side by browser and passed on each request. Once authenticated to clear
- authentication cache you may need to restart browser.</para></note>
- </section>
- </section>
- <section>
- <title>CAS - Central Authentication Service</title>
- <para>This Single Sign On plugin enables seamless integration between JBoss Portal and the CAS Single Sign On Framework.
- Details about CAS can be found <ulink url="http://www.ja-sig.org/products/cas/">here</ulink></para>
- <section>
- <title>Integration steps</title>
- <note><title>Note</title><para>The steps below assume that CAS server and JBoss Portal will be deployed on the same JBoss Application Server instance.
- CAS will be configured to leverage identity services exposed by JBoss Portal to perform authentication. Procedure may be
- slightly different for other deployment scenarios. Both JBoss Portal and CAS will need to be configured to authenticate against
- same database or LDAP server. Please see CAS documentation to learn how to setup it up against proper identity store.</para></note>
-<note><title>Note</title><para>Configuration below assumes that JBoss Application Server is HTTPS enabled and operates on standard ports: 80 (for HTTP) and 443 (for HTTPS).</para></note>
-
- <orderedlist>
- <listitem>
- <para>Install CAS server (v 3.0.7). This should be as simple as deploying single <emphasis>cas.war</emphasis> file.</para>
- </listitem>
- <listitem>
- <para> Copy <emphasis>portal-identity-lib.jar</emphasis> and <emphasis>portal-identity-sso-lib.jar</emphasis> files from
- <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/lib</emphasis> to
- <emphasis>$JBOSS_HOME/server/default/deploy/cas.war/WEB-INF/lib</emphasis>.</para>
- </listitem>
- <listitem>
- <para> Edit <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/portal-server.war/WEB-INF/context.xml</emphasis> file and enable proper Apache Tomcat Valve
- by uncommenting following lines:
- <programlisting>
- <![CDATA[
-<Valve className="org.jboss.portal.identity.sso.cas.CASAuthenticationValve"
- casLogin="https://localhost/cas/login"
- casValidate="https://localhost/cas/serviceValidate"
- casServerName="localhost"
- authType="FORM"
-/>
- ]]>
- </programlisting>
- Update valve options as follow:
- <itemizedlist>
- <listitem>
- <para> <emphasis>casLogin: </emphasis> URL of your CAS Authentication Server</para>
- </listitem>
- <listitem>
- <para> <emphasis>casValidate: </emphasis> URL of your CAS Authentication Server validation service</para>
- </listitem>
- <listitem>
- <para> <emphasis>casServerName:</emphasis> the hostname:port combination of your CAS Authentication Server</para>
- </listitem>
- </itemizedlist>
- <note><title>Note</title><para>CAS client requires to use SSL connection. To learn how to setup JBoss Application Server to use HTTPS see here</para></note>
- </para>
- </listitem>
- <listitem>
- <para> Copy <emphasis>casclient.jar</emphasis> into <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/lib</emphasis>.
- You can download this file from CAS homepage or from JBoss repository under <emphasis>http://repository.jboss.com/cas/3.0.7/lib/</emphasis>
- <note><title>Note</title><para>The CAS engine does not accept self-signed SSL certificates. This requirement is fine for production use where a production
- level SSL certificate is available. However, for testing purposes, this can get a little annoying. Hence, if you are having this issue,
- you can use <emphasis>casclient-lenient.jar</emphasis> instead.</para></note>
- </para>
- </listitem>
- <listitem>
- <para> Edit <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/META-INF/jboss-service.xml</emphasis> file and uncomment following lines:
- <programlisting>
- <![CDATA[
-<mbean
- code="org.jboss.portal.identity.sso.cas.CASAuthenticationService"
- name="portal:service=Module,type=CASAuthenticationService"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends>portal:service=Module,type=IdentityServiceController</depends>
- <attribute name="HavingRole"></attribute>
-</mbean>
- ]]>
- </programlisting>
- This will expose special service in JBoss Portal that can be leveraged by CAS AuthenticationHandler if the server is deployed on the same
- application server instance. This AuthenticationHandler will be enabled in next 2 steps.</para>
- </listitem>
- <listitem>
- <para> Edit <emphasis>$JBOSS_HOME/server/default/deploy/cas.war/WEB-INF/deployerConfigContext.xml</emphasis> and add following line in the
- <emphasis>authenticationHandlers</emphasis> section:
- <programlisting>
- <![CDATA[
-<bean class="org.jboss.portal.identity.sso.cas.CASAuthenticationHandler" />
- ]]>
- </programlisting>
- This can replace default <emphasis>SimpleTestUsernamePasswordAuthenticationHandler</emphasis> so whole part of this config file can look
- as follows:
-
- <programlisting>
- <![CDATA[<property name="authenticationHandlers">
- <list>
- <!--
- | This is the authentication handler that authenticates services by means of callback via SSL, thereby validating
- | a server side SSL certificate.
- +-->
- <bean
- class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler">
- <property
- name="httpClient"
- ref="httpClient" />
- </bean>
-
- <!--
- | This is the authentication handler declaration that every CAS deployer will need to change before deploying CAS
- | into production. The default SimpleTestUsernamePasswordAuthenticationHandler authenticates UsernamePasswordCredentials
- | where the username equals the password. You will need to replace this with an AuthenticationHandler that implements your
- | local authentication strategy. You might accomplish this by coding a new such handler and declaring
- | edu.someschool.its.cas.MySpecialHandler here, or you might use one of the handlers provided in the adaptors modules.
- +-->
- <bean class="org.jboss.portal.identity.sso.cas.CASAuthenticationHandler" />
- </list>
-</property>]]>
- </programlisting>
- </para>
- </listitem>
- </orderedlist>
-
- <para>
- To test the integration:
- <itemizedlist>
- <listitem><para>Go to your portal. Typically, http://localhost:8080/portal</para></listitem>
- <listitem><para>Click on the "Login" link on the main portal page</para></listitem>
- <listitem><para>This should bring up the CAS Authentication Server's login screen instead of the default JBoss Portal login screen</para></listitem>
- <listitem><para>Input your portal username and password. For built-in portal login try user:user or admin:admin</para></listitem>
- <listitem><para>If login is successful, you should be redirected back to the portal with the appropriate user logged in</para></listitem>
- </itemizedlist>
- </para>
-
- </section>
- </section>
- <section>
- <title><trademark class="trade">Java</trademark> Open Single Sign-On (JOSSO)</title>
- <para>JBoss Portal enables seamless integration with JOSSO server. More details on JOSSO can be found
- <ulink url="http://www.josso.org/">here</ulink></para>
- <note><title>Note</title><para>The steps below assume that JOSS server and JBoss Portal will be deployed on the same JBoss Application Server instance.
- JOSSO will be configured to leverage identity services exposed by JBoss Portal to perform authentication. Procedure may be
- slightly different for other deployment scenarios. Both JBoss Portal and JOSSO will need to be configured to authenticate against
- same database or LDAP server. Please see JOSSO documentation to learn how to setup it up against proper identity store.</para></note>
-<note><title>Note</title><para>Configuration below assumes that JOSSO is already installed and deployed in the JBoss Application Server. This involves adding proper jar files
- into the classpath and altering several configuration files (adding Apache Tomcat Valves, security realm and specific JOSSO configuration files).
- For JBoss setup please refer to JOSSO <ulink url="http://www.josso.org/jboss4-howto.html">documentation</ulink></para></note>
- <section>
- <title>Integration steps</title>
-
- <para>
- <orderedlist>
- <listitem>
- <para> Copy <emphasis>portal-identity-lib.jar</emphasis> and <emphasis>portal-identity-sso-lib.jar</emphasis> files from
- <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/lib</emphasis> to
- <emphasis>$JBOSS_HOME/server/default/deploy/josso.ear/josso.war/WEB-INF/lib</emphasis>.</para>
- </listitem>
- <listitem>
- <para> Edit <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/portal-server.war/WEB-INF/context.xml</emphasis> file and enable proper Apache Tomcat Valve
- by uncommenting following lines:
- <programlisting>
- <![CDATA[
-<Valve className="org.jboss.portal.identity.sso.josso.JOSSOLogoutValve"/>
- ]]>
-</programlisting></para>
- </listitem>
- <listitem>
- <para>Edit <emphasis>$JBOSS_HOME/server/default/config/josso-agent-config.xml</emphasis> and mapping for portal web application:
- <programlisting>
- <![CDATA[
-<partner-apps>
-
- ...
-
- <partner-app>
- <context>/portal</context>
- </partner-app>
-
- ...
-
- </partner-apps>
- ]]>
- </programlisting>
- Complete config file can look as follows:
- <programlisting>
- <![CDATA[
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<agent>
- <class>org.josso.jb4.agent.JBossCatalinaSSOAgent</class>
- <gatewayLoginUrl>http://localhost:8080/josso/signon/login.do</gatewayLoginUrl>
- <gatewayLogoutUrl>http://localhost:8080/josso/signon/logout.do</gatewayLogoutUrl>
- <service-locator>
- <class>org.josso.gateway.WebserviceGatewayServiceLocator</class>
- <endpoint>localhost:8080</endpoint>
- </service-locator>
- <partner-apps>
- <partner-app>
- <context>/partnerapp</context>
- </partner-app>
- <partner-app>
- <context>/portal</context>
- </partner-app>
- </partner-apps>
-</agent>
- ]]>
-</programlisting></para>
- </listitem>
- <listitem>
- <para> Edit <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/portal-server.war/login.jsp</emphasis> and
- <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/portal-server.war/erros.jsp</emphasis> and uncomment following line:
- <programlisting>
- <![CDATA[
-<%
- response.sendRedirect(request.getContextPath() + "/josso_login/");
-%>
- ]]>
- </programlisting>
- (make sure to remove java style comment '/* */' - not the xml one).</para>
- </listitem>
- <listitem>
- <para> Edit <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/META-INF/jboss-service.xml</emphasis> file and uncomment following lines:
- <programlisting>
- <![CDATA[
-<mbean
- code="org.jboss.portal.identity.sso.josso.JOSSOIdentityServiceImpl"
- name="portal:service=Module,type=JOSSOIdentityService"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends>portal:service=Module,type=IdentityServiceController</depends>
-</mbean>
- ]]>
- </programlisting>
- This will expose a special service in JBoss Portal that can be leveraged by JOSSO Credential and Identity Stores if the server is deployed on the same
- application server instance.</para>
- </listitem>
- <listitem>
- <para> Edit <emphasis>$JBOSS_HOME/server/default/deploy/josso.ear/josso.war/WEB-INF/classes/josso-gateway-config.xml</emphasis> and configure following elements:
- <itemizedlist>
- <listitem>
- <para> <emphasis>Credential Store: </emphasis>
- <programlisting>
- <![CDATA[
-<!-- Basic Authentication Scheme -->
-<authentication-scheme>
- <name>basic-authentication</name>
- <class>org.josso.auth.scheme.BindUsernamePasswordAuthScheme</class>
-
- <!-- ================================================= -->
- <!-- JBoss Portal Credential Store -->
- <!-- ================================================= -->
- <credential-store>
- <class>org.jboss.portal.identity.sso.josso.JOSSOIdentityStore</class>
- </credential-store>
-
-
- <!-- ================================================= -->
- <!-- Credential Store Key adapter -->
- <!-- ================================================= -->
- <credential-store-key-adapter>
- <class>org.josso.gateway.identity.service.store.SimpleIdentityStoreKeyAdapter</class>
- </credential-store-key-adapter>
-
-</authentication-scheme>
- ]]>
-</programlisting></para>
- </listitem>
- <listitem>
- <para> <emphasis>SSO Identity Store: </emphasis>
- <programlisting>
- <![CDATA[
-<sso-identity-manager>
-
- <class>org.josso.gateway.identity.service.SSOIdentityManagerImpl</class>
-
- <!-- ================================================= -->
- <!-- JBoss Portal Credential Store -->
- <!-- ================================================= -->
- <sso-identity-store>
- <class>org.jboss.portal.identity.sso.josso.JOSSOIdentityStore</class>
- </sso-identity-store>
-
- <!-- ================================================= -->
- <!-- Identity Store Key adapter -->
- <!-- ================================================= -->
- <sso-identity-store-key-adapter>
- <class>org.josso.gateway.identity.service.store.SimpleIdentityStoreKeyAdapter</class>
- </sso-identity-store-key-adapter>
-
-</sso-identity-manager>
- ]]>
-</programlisting></para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- </orderedlist>
- </para>
- <para>
- To test the integration:
- <itemizedlist>
- <listitem><para>Go to your portal. Typically, http://localhost:8080/portal</para></listitem>
- <listitem><para>Click on the "Login" link on the main portal page</para></listitem>
- <listitem><para>This should bring up the JOSSO login screen instead of the default JBoss Portal login screen</para></listitem>
- <listitem><para>Input your portal username and password. For built-in portal login try user:user or admin:admin</para></listitem>
- <listitem><para>If login is successful, you should be redirected back to the portal with the appropriate user logged in</para></listitem>
- </itemizedlist>
- </para>
- </section>
- </section>
-
-</chapter>
- <chapter id="cmsPortlet">
- <!--<chapterinfo>
- <author>
- <firstname>Roy</firstname>
- <surname>Russo</surname>
- </author>
- <author>
- <firstname>Thomas</firstname>
- <surname>Heute</surname>
- </author>
- </chapterinfo>-->
- <title>CMS Portlet</title>
- <para>JBoss Portal packages a Web Content Management System capable of serving and allowing
- administration of web content. This chapter describes the CMS Portlet which is responsible for
- serving resources requested, the following chapter describes the CMSAdmin Portlet and all
- administration functionality.</para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/cms/cms_ss_1.gif" align="center" valign="middle" scalefit="1"/>
- </imageobject>
-</mediaobject>
- <section>
- <title>Introduction</title>
- <para>The CMS Portlet displays content from the file store inside a portlet window, or, in the
- case of binary content, outside of the portlet window altogether.</para>
- </section>
- <section>
- <title>Features</title>
- <para>The CMSPortlet handles all requests for all content types.</para>
- <para>The methodology of serving content within the CMSPortlet, allows for some beneficial
- features, like:</para>
- <orderedlist>
-
- <listitem><para>Search-engine friendly URLs: http://domain/[portal]/content/company.html</para></listitem>
- <listitem><para>Serve binaries with simple urls independent of the portal:
- http://domain/content/products.pdf</para></listitem>
- <listitem><para>Deploy several instances of the CMSPortlet on any page and configure them to
- display different start pages.</para></listitem>
- <listitem><para>Localization support: CMSPortlet will display content based on the user request
- locale, or display content using the default locale setting.</para></listitem>
- </orderedlist>
- </section>
- <section id="configuration-cms_content">
- <title>CMS content</title>
- <para>Since 2.6 displaying CMS content in the portal is done using the new content integration
- feature. Each window of the portal can be configured to display CMS content directly instead of
- having to configure the CMS portlet as it used to be.
- </para>
- <section>
- <title>Configuring a window to display CMS content</title>
- <para>Showing CMS content in a portal window can be done in the deployment descriptor quite easily
- <programlisting><![CDATA[<window>
- <window-name>MyCMSWindow</window-name>
- <content>
- <content-type>cms</content-type>
- <content-uri>/default/index.html</content-uri>
- </content>
- <region>center</region>
- <height>1</height>
-</window>
-]]></programlisting>
- At the first display of the window, the content is initialized with the content uri value.
- When the user clicks on a link that navigates to another CMS file, the CMS file will be shown in the
- same window.
- </para>
- </section>
- </section>
- <section>
- <title>CMS Configuration</title>
- <section>
- <title>Display CMS content</title>
- <para>Since 2.6 displaying CMS content in the portal is done using the new content integration
- feature.
-
-
- The portal is also able to map urls content to the CMS through a specific window.
- The CMS portlet default page is defined as a preference and can be overridden like any
- other preference up to the user's preference level. The default CMS portlet displayed
- when you install JBoss Portal for the first time is describe in the following file:
- <emphasis>jboss-portal.sar/portal-core.war/WEB-INF/portlet.xml</emphasis>
- .
- </para>
- <programlisting><![CDATA[<portlet-preferences>
- <preference>
- <name>indexpage</name>
- <value>/default/index.html</value>
- </preference>
-</portlet-preferences>]]></programlisting>
- <para>
- The preference key is "indexpage". To change the default page, just make sure to create
- an HTML document using the CMS Admin portlet then change the value of "indexpage" to
- the corresponding path.
- </para>
- </section>
- <section>
- <title>Service Configuration</title>
- <section>
- <title>Tuning Apache Jackrabbit</title>
- <para>JBoss Portal uses Apache Jackrabbit as its Java Content Repository implementation.
- Configuration of the service descriptor, allows for changing many of the variables
- associated with the service.</para>
- <para>Here is the default configuration for the CMS repository found under
- <literal>portal-cms.sar/META-INF-INF/jboss-service.xml</literal>
- </para>
- <programlisting><![CDATA[...
-<attribute name="DoChecking">true</attribute>
-<attribute name="DefaultContentLocation">portal/cms/conf/default-content/default/</attribute>
-<attribute name="DefaultLocale">en</attribute>
-<attribute name="RepositoryName">PortalRepository</attribute>
-<attribute name="HomeDir">${jboss.server.data.dir}${/}portal${/}cms${/}conf</attribute>]]>
-...</programlisting>
- <para>Below is a list of items found in the service descriptor and their definitions. Only
- items commonly changed are covered here and it is recommended you do not change any others
- unless you are very brave.</para>
- <para>
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">DoChecking:</emphasis>
- Should the portal attempt to check for the
- existence of the repository configuration files and default content on startup?</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">DefaultContentLocation:</emphasis>
- Location of the default content used to
- pre-populate the repository.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">DefaultLocale:</emphasis>
- Two-letter abbreviation of the default
- locale the portal should use when fetching content for users. A complete ISO-639 list
- can be found
- <ulink url="http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt">here</ulink>
- .</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">HomeDir:</emphasis>
- Location of configuration information for the
- repository when in 100% FileSystem store mode. Otherwise, its in the database.</para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>Changing the url under which the content should be accessible</title>
- <para>
- By default, the content will be accessible to a url like this: http://www.example.com/content/[...], if
- you need or prefer to change "content" to something else you will need to edit the following file:
- <literal>portal-cms.sar/META-INF-INF/jboss-service.xml</literal>
- and change the value of Prefix to something else. Please note that you cannot change it to "nothing", you
- need to provide a value.
- </para>
- <programlisting><![CDATA[...
-<mbean
- code="org.jboss.portal.core.cms.CMSObjectCommandFactory"
- name="portal:commandFactory=CMSObject"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.common.system.JBossServiceModelMBean">
- <xmbean/>
- <attribute name="Prefix">content</attribute>
- <attribute name="TargetWindowRef">default.default.CMSPortletWindow</attribute>
- <depends optional-attribute-name="Factory" proxy-type="attribute">
- portal:commandFactory=Delegating
- </depends>
- <depends optional-attribute-name="CMSService" proxy-type="attribute">
- portal:service=CMS
- </depends>
-</mbean>
-...]]>
- </programlisting>
- <itemizedlist>
- <listitem>
- <para><emphasis role="bold">Prefix:</emphasis>
- This is the context path prefix that will
- trigger the portal to render content. By default, navigating to a URL such as
- http://localhost:8080/[portal_context]/content/Test.PDF will trigger the portal to
- display the PDF isolated from the portal pages. The path following the
- <emphasis>Prefix</emphasis>
- has to be absolute when fetching content.</para>
- </listitem>
- </itemizedlist>
- </section>
- </section>
- <section id="configuration-cms">
- <title>Configuring the Content Store Location</title>
- <para>By default, the JBoss Portal CMS stores all node properties, references, and binary
- content in the database, using the portal datasource. The location of some of these items
- is configurable, and there are 3 options:
- <itemizedlist>
- <listitem>
- <para>
- <xref linkend="configuration-cms_fs"/>
- </para>
- </listitem>
- <listitem>
- <para>
- <xref linkend="configuration-cms_db"/>
- </para>
- </listitem>
- <listitem>
- <para>
- <xref linkend="configuration-cms_mixed"/>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <section id="configuration-cms_fs">
- <title>100% Filesystem Storage</title>
- <para>To enable 100% Filesystem storage, you must edit the file:
- <emphasis>jboss-portal.sar/portal-cms.sar/META-INF/jboss-service.xml</emphasis>
- . You will note that the file is set to use the HibernateStore
- and HibernatePersistenceManager classes, by default. To have the CMS use 100% file
- system storage, simply comment these blocks. Then, you should uncomment to use the
- LocalFileSystem and XMLPersistenceManager classes. Follow these steps to activate 100% FS storage:
- </para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- Comment out the following blocks (there are 3 in total):
- <programlisting><![CDATA[
-<!-- HibernateStore: uses RDBMS + Hibernate for storage -->
-<FileSystem class="org.jboss.portal.cms.hibernate.HibernateStore">
-...
-</FileSystem>
-]]></programlisting>
- And uncomment the blocks under them (there are 3 in total):
- <programlisting><![CDATA[
-<!-- LocalFileSystem: uses FileSystem for storage. -->
-<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
-...
-</FileSystem>]]></programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- Now comment out the following blocks (there are 2 in total):
- <programlisting><![CDATA[
-<!-- HibernatePersistentManager: uses RDBMS + Hibernate for storage -->
-<PersistenceManager class="org.jboss.portal.cms.hibernate.state.HibernatePersistenceManager">
-...
-</PersistenceManager>]]></programlisting>
- And uncomment the blocks under them (there are 2 in total):
- <programlisting><![CDATA[
-<!-- XMLPersistenceManager: uses FileSystem for storage -->
-<PersistenceManager class="org.apache.jackrabbit.core.state.xml.XMLPersistenceManager"/>
-]]></programlisting>
- </para>
- </listitem>
- </orderedlist>
- </para>
- <para>
- <warning><title>Caution</title><para>
- If you do any change at the workspaces configuration you will need to delete the file
- <emphasis>$JBOSS_HOME/server/xxx/data/portal/cms/conf/workspaces/default/workspace.xml</emphasis>
- before restarting JBoss or redeploying JBoss Portal. If you forget to do that, the changes
- won't affect the CMS.
- For the same reason, you also need to delete that file if you recompile JBoss Portal after
- changing the name of the datasource.
- Note that on a cluster environment, you need to remove that file (if it exists) on all the nodes.
- </para></warning>
- </para>
- </section>
- <section id="configuration-cms_db">
- <title>100% Database Storage</title>
- <para>This is the default configuration for the CMS store. Please view the original
- <emphasis>jboss-portal.sar/portal-cms.sar/META-INF/jboss-service.xml</emphasis>
- , for guidance on how to reset it.
- </para>
- </section>
- <section id="configuration-cms_mixed">
- <title>Mixed Storage</title>
- <para>Mixed storage consists of meta-data being stored in the DB and blobs being stored on the Filesystem.
- This is the recommended setting for those of you that serve large files or stream media content.</para>
- <para>
- Setting the repository this way is simple. Change every instance in the file
- <emphasis>jboss-portal.sar/portal-cms.sar/META-INF/jboss-service.xml</emphasis>
- , from:
- <programlisting><![CDATA[<param name="externalBLOBs" value="false"/>]]></programlisting>
- to:
- <programlisting><![CDATA[<param name="externalBLOBs" value="true"/>]]></programlisting>
- </para>
- <para>
- <warning><title>Caution</title><para>
- If you do any change at the workspaces configuration you will need to delete the file
- <emphasis>$JBOSS_HOME/server/xxx/data/portal/cms/conf/workspaces/default/workspace.xml</emphasis>
- before restarting JBoss or redeploying JBoss Portal. If you forget to do that, the changes
- won't affect the CMS.
- For the same reason, you also need to delete that file if you recompile JBoss Portal after
- changing the name of the datasource.
- Note that on a cluster environment, you need to remove that file (if it exists) on all the nodes.
- </para></warning>
- </para>
- </section>
- </section>
- </section>
- <!-- <section>
- <title>Portlet Preferences</title>
- <para>TODO</para>
- </section>-->
- <section>
- <title>Localization Support</title>
- <para>The CMS Portlet now serves content based on the user's locale setting. For example: if a
- user's locale is set to Spanish in his browser, and he requests URL:
- <emphasis>default/index.html</emphasis>
- , the CMSPortlet will first try and retrieve the
- Spanish version of that file. If a Spanish version is not found, it will then try and
- retrieve the default language version set for the CMSPortlet.
- </para>
- </section>
- <section>
- <title>CMS Service</title>
- <para>
- The CMS portlet calls a CMS service that can be reused in your own portlets.
- </para>
- <section>
- <title>CMS Interceptors</title>
- <para>
- Since JBoss Portal 2.4 you can add your own interceptor stack to the CMS service.
- The interceptors are called around each command (Get a file, write a file, create a folder...),
- this is a very easy way to customize some actions based on your needs.
- </para>
- <para>
- To create your own interceptor you just need to extend the
- <literal>org.jboss.portal.cms.CMSInterceptor</literal>
- class and provide the content of the
- <literal>invoke(JCRCommand)</literal>
- method. Do not forget to make a call
- to
- <literal>JCRCommand.invokeNext()</literal>
- or the command will never be executed.
- </para>
- <para>
- JBoss Portal relies on the interceptor mechanism to integrate its Fine Grained Security Service and
- the Publish/Approve Workflow Service
- </para>
- <para>
- To add or remove an interceptor, you just need to edit the following file:
- <literal>portal-cms-sar/META-INF/jboss-service.xml</literal>.
- It works the same way as the server interceptor, for each interceptor you need to define an MBean then add it
- to the cms interceptor stack. For example, if you have the 2 default interceptors, you should have the following
- lines in the jboss-service.xml file:
- <programlisting><![CDATA[<!-- ACL Security Interceptor -->
-<mbean code="org.jboss.portal.cms.impl.interceptors.ACLInterceptor"
- name="portal:service=Interceptor,type=Cms,name=ACL" xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean />
- <attribute name="JNDIName">
- java:/portal/cms/ACLInterceptor
- </attribute>
- <attribute name="CmsSessionFactory">
- java:/portal/cms/CMSSessionFactory
- </attribute>
- <attribute name="IdentitySessionFactory">
- java:/portal/IdentitySessionFactory
- </attribute>
- <attribute name="DefaultPolicy">
- <policy>
- <!-- permissions on the root cms node -->
- <criteria name="path" value="/">
- <permission name="cms" action="read">
- <role name="Anonymous" />
- </permission>
- <permission name="cms" action="write">
- <role name="User" />
- </permission>
- <permission name="cms" action="manage">
- <role name="Admin" />
- </permission>
- </criteria>
- <!-- permissions on the default cms node -->
- <criteria name="path" value="/default">
- <permission name="cms" action="read">
- <role name="Anonymous" />
- </permission>
- <permission name="cms" action="write">
- <role name="User" />
- </permission>
- <permission name="cms" action="manage">
- <role name="Admin" />
- </permission>
- </criteria>
- <!-- permissions on the private/protected node -->
- <criteria name="path" value="/default/private">
- <permission name="cms" action="manage">
- <role name="Admin" />
- </permission>
- </criteria>
- </policy>
- </attribute>
- <depends optional-attribute-name="AuthorizationManager"
- proxy-type="attribute">
- portal:service=AuthorizationManager,type=cms
- </depends>
- <depends>portal:service=Hibernate,type=CMS</depends>
- <depends>
- portal:service=Module,type=IdentityServiceController
- </depends>
-</mbean>
-
-<!-- Approval Workflow Interceptor -->
-<mbean
- code="org.jboss.portal.cms.impl.interceptors.ApprovalWorkflowInterceptor"
- name="portal:service=Interceptor,type=Cms,name=ApprovalWorkflow"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean />
- <attribute name="JNDIName">
- java:/portal/cms/ApprovalWorkflowInterceptor
- </attribute>
- <depends>portal:service=Hibernate,type=CMS</depends>
-</mbean>
-
-<!-- CMS Interceptor Registration -->
-<mbean
- code="org.jboss.portal.server.impl.invocation.JBossInterceptorStackFactory"
- name="portal:service=InterceptorStackFactory,type=Cms" xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean />
- <depends-list optional-attribute-name="InterceptorNames">
- <depends-list-element>
- portal:service=Interceptor,type=Cms,name=ACL
- </depends-list-element>
- <depends-list-element>
- portal:service=Interceptor,type=Cms,name=ApprovalWorkflow
- </depends-list-element>
- </depends-list>
-</mbean>
- ]]>
- </programlisting>
- The first two MBeans define the interceptors and the third MBean, define which interceptors to add to
- the CMS service.
- </para>
- <para>
- If you create your own interceptor <literal>org.example.myCMSInterceptor</literal>, the service descriptor file will look like:
- <programlisting><![CDATA[<mbean code="org.example.myCMSInterceptor"
- name="portal:service=Interceptor,type=Cms,name=MyName" xmbean-dd=""
- xmbean-code="org.jboss.portal.common.system.JBossServiceModelMBean">
- <xmbean />
-</mbean>
-
-<!-- ACL Security Interceptor -->
-<mbean code="org.jboss.portal.cms.impl.interceptors.ACLInterceptor"
- name="portal:service=Interceptor,type=Cms,name=ACL" xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean />
- <attribute name="JNDIName">
- java:/portal/cms/ACLInterceptor
- </attribute>
- <attribute name="CmsSessionFactory">
- java:/portal/cms/CMSSessionFactory
- </attribute>
- <attribute name="IdentitySessionFactory">
- java:/portal/IdentitySessionFactory
- </attribute>
- <attribute name="DefaultPolicy">
- <policy>
- <!-- permissions on the root cms node -->
- <criteria name="path" value="/">
- <permission name="cms" action="read">
- <role name="Anonymous" />
- </permission>
- <permission name="cms" action="write">
- <role name="User" />
- </permission>
- <permission name="cms" action="manage">
- <role name="Admin" />
- </permission>
- </criteria>
- <!-- permissions on the default cms node -->
- <criteria name="path" value="/default">
- <permission name="cms" action="read">
- <role name="Anonymous" />
- </permission>
- <permission name="cms" action="write">
- <role name="User" />
- </permission>
- <permission name="cms" action="manage">
- <role name="Admin" />
- </permission>
- </criteria>
- <!-- permissions on the private/protected node -->
- <criteria name="path" value="/default/private">
- <permission name="cms" action="manage">
- <role name="Admin" />
- </permission>
- </criteria>
- </policy>
- </attribute>
- <depends optional-attribute-name="AuthorizationManager"
- proxy-type="attribute">
- portal:service=AuthorizationManager,type=cms
- </depends>
- <depends>portal:service=Hibernate,type=CMS</depends>
- <depends>
- portal:service=Module,type=IdentityServiceController
- </depends>
-</mbean>
-
-<!-- Approval Workflow Interceptor -->
-<mbean
- code="org.jboss.portal.cms.impl.interceptors.ApprovalWorkflowInterceptor"
- name="portal:service=Interceptor,type=Cms,name=ApprovalWorkflow"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean />
- <attribute name="JNDIName">
- java:/portal/cms/ApprovalWorkflowInterceptor
- </attribute>
- <depends>portal:service=Hibernate,type=CMS</depends>
-</mbean>
-<mbean
- code="org.jboss.portal.server.impl.invocation.JBossInterceptorStackFactory"
- name="portal:service=InterceptorStackFactory,type=Cms" xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean />
- <depends-list optional-attribute-name="InterceptorNames">
- <depends-list-element>
- portal:service=Interceptor,type=Cms,name=ACL
- </depends-list-element>
- <depends-list-element>
- portal:service=Interceptor,type=Cms,name=ApprovalWorkflow
- </depends-list-element>
- </depends-list>
-</mbean>
-
-<!-- CMS Interceptor Registration -->
-<mbean
- code="org.jboss.portal.server.impl.invocation.JBossInterceptorStack"
- name="portal:service=InterceptorStack,type=Cms" xmbean-dd=""
- xmbean-code="org.jboss.portal.common.system.JBossServiceModelMBean">
- <xmbean />
- <depends-list optional-attribute-name="InterceptorNames">
- <depends-list-element>
- portal:service=Interceptor,type=Cms,name=ACL
- </depends-list-element>
- <depends-list-element>
- portal:service=Interceptor,type=Cms,name=ApprovalWorkflow
- </depends-list-element>
- <depends-list-element>
- portal:service=Interceptor,type=Cms,name=MyName
- </depends-list-element>
- </depends-list>
-</mbean>
-]]></programlisting>
- </para>
- <note>
- <para>
- The interceptor order is important !
- </para>
- </note>
- <para>
- To check that the interceptors have been correctly added, you can check the JMX console, by going to:
- <literal>http://localhost.localdomain:8080/jmx-console/HtmlAdaptor?action=inspectM...</literal>
- You should notice all the interceptors in the attribute "interceptors".
- </para>
- </section>
- </section>
-</chapter>
- <chapter id="workflow">
- <!-- <chapterinfo>
- <author>
- <firstname>Sohil</firstname>
- <surname>Shah</surname>
- <email>sshah @ redhat dot com</email>
- </author>
- </chapterinfo>-->
- <title>Portal Workflow</title>
- <para>
- JBoss Portal packages a Workflow Service based on jBPM. This service provides you with the jBPM services that your
- portal can use to build out the end-user/application workflows that should meet your portal's requirements.
- </para>
- <section>
- <title>jBPM Workflow Engine Integration</title>
- <para>
- The jBPM Workflow service is packaged as an mbean and takes care of all the low-level jBPM related functions.
- The configuration is found in <filename>portal-workflow.sar/META-INF/jboss-service.xml</filename>.
- </para>
- </section>
- <section>
- <title>CMS Publish/Approve Workflow Service</title>
- <para>
- The CMS Publish/Approval Workflow feature is turned on by default, so that every file that is created or
- updated needs to go through an <emphasis role="bold">approval process</emphasis> before it can be published to
- go live. The current implementation creates a pending queue for managers. The managers can then either approve
- or reject the publishing of the document in question.
- </para>
- <section>
- <title>How to activate this feature?</title>
- <para>
- The CMS Publish/Approval Workflow feature can be activated by uncommenting the
- <literal>ApprovePublishWorkflow</literal> attribute of the <literal>portal:service=CMS</literal> mbean in
- <filename>portal-cms.sar/META-INF/jboss-service.xml</filename>:
- <programlisting><![CDATA[
-<mbean
- code="@cms.service.code@"
- name="portal:service=CMS"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
-
- ...
-
- <!-- Add this to activate publish/approval workflow integration -->
- <!-- <depends optional-attribute-name="ApprovePublishWorkflow" proxy-type="attribute">portal:service=ApprovePublish,type=Workflow</depends> -->
-
- ...
-</mbean>]]></programlisting>
- </para>
- </section>
- <section>
- <title>How to configure this feature?</title>
- <para>
- The workflow service can be configured by editing the <literal>portal:service=ApprovePublish,type=Workflow</literal>
- mbean found in <filename>portal-cms.sar/META-INF/jboss-service.xml</filename>.
- <programlisting>
- <![CDATA[
-<!-- ApprovePublish workflow service -->
- <mbean
- code="org.jboss.portal.cms.workflow.ApprovePublishImpl"
- name="portal:service=ApprovePublish,type=Workflow"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="WorkflowService" proxy-type="attribute">
- portal:service=Workflow,type=WorkflowService
- </depends>
- <depends optional-attribute-name="IdentityServiceController" proxy-type="attribute">
- portal:service=Module,type=IdentityServiceController
- </depends>
- <!-- JBPM process definition -->
- <attribute name="Process">
- <!-- cms approval workflow -->
- <process-definition name="approval_workflow">
- <start-state>
- <transition to="request_approval"/>
- </start-state>
- <task-node name="request_approval" signal="first">
- <task name="approve_publish">
- <assignment class="org.jboss.portal.cms.workflow.PublishAssignmentHandler"/>
- <event type="task-start">
- <action class="org.jboss.portal.cms.workflow.FinalizePublish"/>
- </event>
- <exception-handler>
- <action class="org.jboss.portal.cms.workflow.TaskExceptionHandler"/>
- </exception-handler>
- </task>
- <transition name="approval" to="end"/>
- <transition name="rejection" to="end"/>
- </task-node>
- <end-state name="end"/>
- </process-definition>
- </attribute>
- <!--
- overwrite = false creates the process first time if does not exist, for
- subsequent server restarts, this process definition remains in tact
-
- overwrite = true creates the process first time if does not exist,
- for subsequent server restarts, it creates a new version of the process definition
- which will be used for processes created from then onwards. Old processes created
- for an older version of the definition remain in tact and use their corresponding
- process definition.
-
- Typically use overwrite=false and overwrite=true only when a new process definition
- related to this workflow needs to be deployed
- -->
- <attribute name="Overwrite">false</attribute>
- <!--
- A comma separated list of portal roles that are designated
- to act as workflow managers. They are allowed to
- approve/reject content publish requests
- -->
- <attribute name="ManagerRoles">Admin</attribute>
- <attribute name="JNDIName">java:portal/ApprovePublishWorkflow</attribute>
- </mbean>]]></programlisting>
- </para>
- <para>
- Of note in this configuration are the <literal>Process</literal> and <literal>ManagerRoles</literal>
- attributes. The <literal>Process</literal> attribute is used to provide the jBPM process definition to be
- followed by the workflow service during the approval process. This follows the standard jBPM syntax
- for process definition. <literal>ManagerRoles</literal>, on the other hand, is a comma-delimited list of
- user roles that are being marked as "managers" who can approve the publication of CMS documents.
- </para>
- </section>
- </section>
-</chapter>
- <chapter id="navtabs">
- <!--<chapterinfo>
- <author>
- <firstname>Roy</firstname>
- <surname>Russo</surname>
- </author>
- <author>
- <firstname>Thomas</firstname>
- <surname>Heute</surname>
- </author>
- </chapterinfo>-->
- <title>Navigation Tabs</title>
- <para>The navigation tabs allow users to navigate the portal pages. This section describes some of the functionality
- available in configuring them.
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/navtabs/navtabs_ss.gif" align="center" valign="middle"/>
- </imageobject>
- </mediaobject>
- </para>
- <section>
- <title>Explicit ordering of tabs</title>
- <para>Explicit ordering of the tab display, is accomplished via page properties that are defined in your
- <emphasis>*-object.xml</emphasis>
- (
- <xref linkend="desc_objectxml"/>
- ). Ordering is accomplished using the
- <emphasis>order</emphasis>
- tag at the page level as a page property.
- <programlisting><![CDATA[
-<page>
- <page-name>default</page-name>
- <properties>
- <property>
- <name>order</name>
- <value>1</value>
- </property>
- </properties>
- ...
-</page>]]></programlisting>
- </para>
- </section>
- <section>
- <title>Translating tab labels</title>
- <para>Labels on tabs can be defined in multiple languages. Two different ways can be used, the first one consist at
- defining several display name for page objects, the second one consists of defining a resource bundle where to find
- the localized display-name. Both methods have advantages and drawbacks.</para>
- <section>
- <title>Method one: Multiple <literal>display-name</literal></title>
- <para>In the <filename>*-object.xml</filename> descriptor under the <literal>page</literal> element, it is possible
- to define a display-name per locale. Here is an example:
- <programlisting><![CDATA[
-<page>
- <page-name>News</page-name>
- <display-name xml:lang="en">News</display-name>
- <display-name xml:lang="it">Novita'</display-name>
- <display-name xml:lang="es">Noticias</display-name>
- <display-name xml:lang="fr">Actualités</display-name>
- ...
-</page>
- ]]></programlisting>
- Here we defined a display name for four different languages. The advantage of this method is that it is simple and the
- display name is kept along the metadata. The drawback of this method is that if you may end up with different places
- to keep your localized data. If you are using resource bundles for other elements, the second method might be simpler
- when you add new supported languages.
- </para>
- </section>
- <section>
- <title>Defining a resource bundle and supported locales</title>
- <para>If you are already using resource bundles for localization you may prefer to point to those files. To do so you
- can define the name of your ressource bundle. The files should be in the classloader of the war containing the <filename>*-object.xml</filename>
- where you define them, meaning in the same war file.</para>
- <para>Here is an example:
- <programlisting><![CDATA[
-<page>
- <page-name>Weather</page-name>
- <supported-locale>fr</supported-locale>
- <supported-locale>en</supported-locale>
- ...
-</page>
- ]]></programlisting>
- With one or the other method, accessing the portal will now display the tab names with the preferred locale if a localized
- value exists.
- </para>
- <warning><para>If you change the values in the descriptor (method 1) or in the resource bundles (method 2) you need to use
- the <literal><if-exists>overwrite</if-exists></literal> so that the values are updated</para></warning>
- </section>
- </section>
-</chapter>
- <chapter id="themeandlayouts">
- <!-- <chapterinfo>
- <author>
- <firstname>Martin</firstname>
- <surname>Holzner</surname>
- </author>
- <author>
- <firstname>Mark</firstname>
- <surname>Fernandes</surname>
- </author>
- <author>
- <firstname>Thomas</firstname>
- <surname>Heute</surname>
- </author>
- </chapterinfo>-->
- <title>Layouts and Themes</title>
- <section>
- <title>Overview</title>
- <para>Portals usually render the markup fragments of several portlets, and aggregate these
- fragments into one page that ultimately gets sent back as response. Each portlet on that
- page will be decorated by the portal to limit the real estate the portlet has on the page,
- but also to allow the portal to inject extra functionality on a per portlet basis. Classic
- examples of this injection are the maximize, minimize and mode change links that will
- appear in the portlet window , together with the title.
- </para>
- <para>Layouts and themes allow to manipulate the look and feel of the portal. Layouts are
- responsible to render markup that will wrap the markup fragments produced by the individual
- portlets. Themes, on the other hand, are responsible to style and enhance this markup.
- </para>
- <para>In JBoss Portal, layouts are implemented as a JSP or a Servlet. Themes are implemented using CSS Style sheets, <trademark class="trade">JavaScript</trademark> and images. The binding element between layouts and themes are the class and id attributes of the rendered markup.
- </para>
- <para>JBoss Portal has the concept of regions on a page. When a page is defined, and portlet
- windows are assigned to the page, the region, and order inside the region, has to be
- specified as well. For portal layouts this has significant meaning. It defines the top most
- markup container that can wrap portlet content (other then the static markup in the JSP
- itself). In other words: from a layout perspective all portlets of a page are assigned to
- one or more regions. Each region can contain one or more portlets. To render the page
- content to return from a portal request, the portal has to render the layout JSP, and for
- each region, all the portlets in the region.
- </para>
- <para>Since the markup around each region, and around each portlet inside that region, is
- effectively the same for all the pages of a portal, it makes sense to encapsulate it in its
- own entity.
- </para>
- <para>To implement this encapsulation there are several ways:</para>
- <itemizedlist>
-
- <listitem><para>JSP pages that get included from the layout JSP for each region/portlet</para></listitem>
- <listitem><para>a taglib that allows to place region, window, and decoration tags into the layout JSP</para>
- </listitem>
- <listitem><para>a taglib that uses a pluggable API to delegate the markup generation to a set of classes</para>
- </listitem>
- </itemizedlist>
-
- <para>
- In JBoss Portal you can currently see two out of these approaches, namely
- the first and the last. Examples for the first can be found in the portal-core.war,
- implemented by the nodesk and phalanx layouts. Examples for the third approach can be found
- in the same war, implemented by the industrial and Nphalanx layout. What encapsulates the
- markup generation for each region, window, and portlet decoration in this last approach is
- what's called the RenderSet.
- </para>
- <para>The RenderSet consist of four interfaces that correspond with the four markup
- containers that wrap the markup fragments of one of more portlets:
- </para>
- <itemizedlist>
-
- <listitem><para>Region</para></listitem>
- <listitem><para>Window</para></listitem>
- <listitem><para>Decoration</para></listitem>
- <listitem><para>Portlet Content</para></listitem>
- </itemizedlist>
-
- <para>While we want to leave it open to you to decide which way to implement your layouts and
- themes, we strongly believe that the last approach is superior, and allows for far more
- flexibility, and clearer separation of duties between portal developers and web designers.
- </para>
- <!--
- <para>Portal layouts also have the concept of a layout strategy. The layout strategy is a
- pluggable API, and lets the layout developer have a last say about the content to be
- rendered. The strategy is called right after the portal has determined what needs to be
- rendered as part of the current request. So the strategy is invoked right between the point
- where the portal knows what needs to be done, and before the actual work is initiated. The
- strategy gets all the details about what is going to happen, and it can take measures to
- influence those details.
- <itemizedlist>
- <para>Some simple examples of those measures are:</para>
- <listitem>ommit one of the portlets from being rendered</listitem>
- <listitem>change the portlet mode or window state of a portlet before it gets rendered</listitem>
- <listitem>change the layout to be used for this request</listitem>
- <listitem>...and many more</listitem>
- </itemizedlist>
- </para>
- -->
- <para>The last topic to introduce in this overview is the one of portal themes. A theme is a
- collection of web design artifacts. It defines a set of CSS, JavaScript and image files
- that together decide about the look and feel of the portal page. The theme can take a wide
- spectrum of control over the look and feel. It can limit itself to decide fonts and colors,
- or it can take over a lot more and decide the placement (location) of portlets and much
- more.
- </para>
- </section>
- <section>
- <title>Header</title>
- <section>
- <title>Overview</title>
- <para>The default header is divided into two parts, links to pages displayed as tabs and links
- to navigate between portals and dahsboards as well as loggin in and out. Those two parts are
- included into the template thanks to the layout as defined in <xref linkend="layouts"/>.
- In fact, the region named, <literal>dashboardnav</literal> will include the navigation links,
- while the region named <literal>navigation</literal> will include the navigation tabs.
- It is then easy to hide one and/or the other by removing the corresponding inclusion in the
- layout.
- </para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/portal-header.gif" scalefit="1"/>
- </imageobject>
- </mediaobject>
- <para>Screenshot of the header with the 'renaissance' theme</para>
-
- <note><title>Note</title><para>Here, we use split content from rendering by using a CSS style sheet, it allows us to change the
- display by switching the CSS without affecting the content. THe Maple theme will display the links
- on the left side with a different font for example. THis is up to you to choose or not this approach</para>
- </note>
- <para>To customize the header there are several options detailed after.
- <itemizedlist>
- <listitem><para>The first option would simply require to modify
- the theme CSS, by doing this you could change the fonts, the way tabs are rendered, colors and many
- other things but not change the content.</para></listitem>
- <listitem><para>The second option is to modify the provided JSP files, <literal>header.jsp</literal> and
- <literal>tabs.jsp</literal>. It gives you more flexibility than the previous solution on modifying
- the content. Links to legacy application could easily be added, URLs could be arranged differently, the CSS
- approach could be replaced by good old HTML, CSS style names could be changed... The drawback of
- this method compare to the next one is the limitation in what is accessible from the JSP.</para></listitem>
- <!-- listitem>The third option is the most flexible and let you inject whatever you want, it consists in
- replacing the default <literal>PageCustomizerInterceptor</literal> by your own.</listitem-->
- </itemizedlist>
- </para>
- <section>
- <title>Writing his own <trademark class="trade">JSP</trademark> pages</title>
- <para>The content of those two parts are displayed thanks to two different <trademark class="trade">JSP</trademark> pages. By default
- you would find those pages in the directory <literal>portal-core.war/WEB-INF/jsp/header/</literal>.
- The file <literal>header.jsp</literal> is used to display the links that are displayed on the upper
- right of the default theme. The file <literal>tabs.jsp</literal> is used to display the pages tabs
- appearing on the left.
- </para>
- <para> Again, you have several choices, either to edit the included JSP files directly or create your own,
- store them in a web application then edit the following file: <literal>jboss-portal.sar/META-INF/jboss-service.xml</literal>.
- The interesting part in that file is the following:
- <programlisting><![CDATA[<mbean
- code="org.jboss.portal.core.aspects.controller.PageCustomizerInterceptor"
- name="portal:service=Interceptor,type=Command,name=PageCustomizer"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <attribute name="TargetContextPath">/portal-core</attribute>
- <attribute name="HeaderPath">/WEB-INF/jsp/header/header.jsp</attribute>
- <attribute name="TabsPath">/WEB-INF/jsp/header/tabs.jsp</attribute>
- <depends
- optional-attribute-name="PortalAuthorizationManagerFactory"
- proxy-type="attribute">portal:service=PortalAuthorizationManagerFactory</depends>
-</mbean>]]></programlisting>
- The three attributes are:
- <itemizedlist>
- <listitem><para>TargetContextPath: Defines the web application context where the JSP files are located</para></listitem>
- <listitem><para>HeaderPath: Defines the location (in the web application previously defined) of the JSP in charge of writing the header links</para></listitem>
- <listitem><para>TabsPath: Defines the location (in the web application previously defined) of the JSP in charge of writing the pages links (note that it doesn't have to be renderer as tabs)</para></listitem>
- </itemizedlist>
- </para>
- <para>Writing the header JSP</para>
- <para>A couple of request attributes are set so that they can be used by the JSP, here is the list of attributes and their meaning:
- <itemizedlist>
- <listitem><para><literal>org.jboss.portal.header.USER</literal>: A <literal>org.jboss.portal.identity.User</literal> object of the logged-in user, null if the user is not logged-in.</para></listitem>
- <listitem><para><literal>org.jboss.portal.header.LOGIN_URL</literal>: URL to logging-in.</para></listitem>
- <listitem><para><literal>org.jboss.portal.header.DASHBOARD_URL</literal>: URL to the dashboard, null if the user is already on the dashboard, null if the user is on the default portal already.</para></listitem>
- <listitem><para><literal>org.jboss.portal.header.DEFAULT_PORTAL_URL</literal>: URL to the default page of the portal named 'default', null if the user is on the default portal already.</para></listitem>
- <listitem><para><literal>org.jboss.portal.header.ADMIN_PORTAL_URL</literal>: URL to the default page of the admin portal (named 'admin'), null if the user is on the admin portal already.</para></listitem>
- <listitem><para><literal>org.jboss.portal.header.EDIT_DASHBOARD_URL</literal>: URL to the page content editor of the dashboard, set only if the user is on the dashboard, null otherwise.</para></listitem>
- <listitem><para><literal>org.jboss.portal.header.COPY_TO_DASHBOARD_URL</literal>: URL to copy a page from a portal to the personal dashboard, null if the user is on the dashboard.</para></listitem>
- <listitem><para><literal>org.jboss.portal.header.SIGN_OUT_URL</literal>: URL to log out the portal.</para></listitem>
- </itemizedlist>
- Every attribute that is an URL attribute is an object implementing the <emphasis>org.jboss.portal.api.PortalURL</emphasis> interface.
- Therefore it is possible to generate the URL using the <emphasis>toString()</emphasis> method and change various things related
- to the URL.
- With that in hand, if someone just wanted to display the logged-in username and a link to log out, he could write:
- <programlisting><![CDATA[<%@ page import="org.jboss.portal.identity.User" %>
-
-<%
- User user = (User) request.getAttribute("org.jboss.portal.header.USER");
- PortalURL signOutURL = (PortalURL)request.getAttribute("org.jboss.portal.header.SIGN_OUT_URL");
- PortalURL loginURL = (PortalURL)request.getAttribute("org.jboss.portal.header.LOGIN_URL");
-
-
- if (user == null)
- {
-%>
- <a href="<%= loginURL %>">Login</a>
-<%
- }
- else
- {
-%>
-Logged in as: <%= user.getUserName() %>
-<br/>
-<a href="<%= signOutURL %>">Logout</a>
-<%
- }
-%>]]></programlisting>
- </para>
- <para>Writing the tabs JSP</para>
- <para>A couple of request attributes are set so that they can be used by the JSP, here is the list of attributes and their meaning:
- <itemizedlist>
- <listitem><para><literal>org.jboss.portal.api.PORTAL_NODE</literal>: A <literal>org.jboss.portal.api.node.PortalNode</literal> object of the root Portal node. Authorized children and siblings
- of this object are accessible.</para></listitem>
- <listitem><para><literal>org.jboss.portal.api.PORTAL_RUNTIME_CONTEXT</literal>: A <literal>org.jboss.portal.api.PortalRuntimeContext</literal> object that can be used to render URLs.</para></listitem>
- </itemizedlist>
- </para>
- <para>The default file in charge of displaying the tabs can be found in: <literal>portal-core.war/WEB-INF/jsp/header/</literal></para>
- </section>
- <!-- section>
- <title>Modifying the default PageCustomizerInterceptor</title>
- <para>Instead of modifying the class directly, create your own Interceptor
- (I suggest you copy the default PageCustomizerInterceptor look at the source in
- <literal>core/src/main/org/jboss/portal/core/aspects/controller</literal>) then add it to:
- <literal>portal-core.sar/META-INF/jboss-service.xml</literal> the same way it
- is done by the default Interceptor. Then replace the default one by your own in
- the following part:
-<programlisting><![CDATA[
-<mbean
- code="org.jboss.portal.server.impl.invocation.JBossInterceptorStackFactory"
- name="portal:service=InterceptorStackFactory,type=Command"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends-list optional-attribute-name="InterceptorNames">
- <depends-list-element>portal:service=Interceptor,type=Command,name=Ajax</depends-list-element>
- <depends-list-element>portal:service=Interceptor,type=Command,name=NavigationalState</depends-list-element>
- <depends-list-element>portal:service=Interceptor,type=Command,name=PortalNode</depends-list-element>
- <depends-list-element>portal:service=Interceptor,type=Command,name=PolicyEnforcement</depends-list-element>
- <depends-list-element>portal:service=Interceptor,type=Command,name=PageCustomizer</depends-list-element>
- <depends-list-element>portal:service=Interceptor,type=Command,name=EventBroadcaster</depends-list-element>
- </depends-list>
-</mbean>
-]]></programlisting>
- Just replace the PageCustomizer by one of your own.
- </para>
- </section-->
- </section>
- </section>
- <section id="layouts">
- <title>Layouts</title>
- <section>
- <title>How to define a Layout</title>
- <para>Layouts are used by the portal to produce the actual markup of a portal response.
- After all the portlets on a page have been rendered and have produced their markup
- fragments, the layout is responsible for aggregating all these pieces, mix them with
- some ingredients from the portal itself, and at the end write the response back to the
- requesting client.
- </para>
- <para>Layouts can be either a JSP or a Servlet. The portal determines the layout to use
- via the configured properties of the portal, or the requested page. Both, portal and
- pages, can define the layout to use in order to render their content. In case both
- define a layout, the layout defined for the page will overwrite the one defined for the
- portal.
- </para>
- <para>A Layout is defined in the layout descriptor named portal-layouts.xml. This
- descriptor must be part of the portal application, and is picked up by the layout
- deployer. If the layout deployer detects such a descriptor in a web application, it will
- parse the content and register the layouts with the layout service of the portal. Here
- is an example of such a descriptor file:
- <programlisting><![CDATA[<layouts>
- <layout>
- <name>phalanx</name>
- <uri>/phalanx/index.jsp</uri>
- </layout>
- <layout>
- <name>industrial</name>
- <uri>/industrial/index.jsp</uri>
- <uri state="maximized">/industrial/maximized.jsp</uri>
- </layout>
-</layouts>]]></programlisting>
- </para>
- </section>
- <section>
- <title>How to use a Layout</title>
- <section>
- <title>Declarative use</title>
- <para>Portals and pages can be configured to use a particular layout. The connection to
- the desired layout is made in the portal descriptor (YourNameHere-object.xml). Here
- is an example of such a portal descriptor:
- <programlisting><![CDATA[<portal>
- <portal-name>default</portal-name>
- <properties>
- <!-- Set the layout for the default portal -->
- <!-- see also portal-layouts.xml -->
- <property>
- <name>layout.id</name>
- <value>phalanx</value>
- </property>
- </properties>
- <pages>
- <page>
- <page-name>theme test</page-name>
- <properties>
- <!-- set a difference layout for this page -->
- <property>
- <name>layout.id</name>
- <value>industrial</value>
- </property>
- </properties>
- </page>
- </pages>
-</portal>]]></programlisting>
- The name specified for the layout to use has to
- match one of the names defined in the portal-layouts.xml descriptor of one of the
- deployed applications.
- </para>
- <para>As you can see, the portal or page property points to the layout to use via the
- name of the layout. The name has been given to the layout in the layout descriptor.
- It is in that layout descriptor where the name gets linked to the physical resource
- (the JSP or Servlet) that will actually render the layout.
- </para>
- </section>
- <section>
- <title>Programmatic use</title>
- <para>To access a layout from code, you need to get a reference to the LayoutService
- interface. The layout service is an mbean that allows access to the PortalLayout
- interface for each layout that was defined in a portal layout descriptor. As a layout
- developer you should never have to deal with the layout service directly. Your layout
- hooks are the portal and page properties to configure the layout, and the layout
- strategy, where you can change the layout to use for the current request, before the
- actual render process begins.
- </para>
- </section>
- </section>
- <section>
- <title>Where to place the Descriptor files</title>
- <para>Both descriptors, the portal and the theme descriptor, are located in the WEB-INF/
- folder of the deployed portal application. Note that this is not limited to the
- portal-core.war, but can be added to any WAR that you deploy to the same server. The
- Portal runtime will detect the deployed application and introspect the WEB-INF folder
- for known descriptors like the two mentioned here. If present, the appropriate meta data
- is formed and added to the portal runtime. From that time on the resources in that
- application are available to be used by the portal. This is an elegant way to
- dynamically add new layouts or themes to the portal without having to bring down , or
- even rebuild the core portal itself.
- </para>
- </section>
- <!--
- <section>
- <title>How to connect a Layout to a Layout Strategy</title>
- <para>As you might have noticed already, a layout definition consists of a name and one or
- more uri elements. We have already seen the function of the name element. Now let's take
- a closer look at the uri element. In the example above, the phalanx layout defined one
- uri element only, the industrial layout defines two. What you can see in the industrial
- layout is the option of defining different uri's for different states. In this example ,
- we configured the layout to use a different JSP if the layout state is maximized. If no
- such separation is made in the layout descriptor, then the portal will always use the
- same JSP for this layout. Note that the 'state' attribute value works together with the
- state that was set by the layout strategy. Please refere to the section about the layout
- strategy for more details.
- </para>
- </section>
- -->
- <section>
- <title>Layout <trademark class="trade">JSP</trademark> tags</title>
- <para>The portal comes with a set of <trademark class="trade">JSP</trademark> tags that allow the layout developer faster
- development.
- </para>
- <para>There are currently two taglibs, containing tags for different approaches to
- layouts:
- </para>
- <itemizedlist>
-
- <listitem><para>portal-layout.tld</para></listitem>
- <listitem><para>theme-basic-lib.tld</para></listitem>
- </itemizedlist>
-
- <para>The theme-basic-lib.tld contains a list of tags that allow a JSP writer to access
- the state of the rendered page content. It is built on the assumption that regions,
- portlet windows and portlet decoration is managed inside the JSP.
- </para>
- <para>The portal-layout.tld contains tags that work under the assumption that the
- RenderSet will take care of how regions, portlet windows and the portlet decoration will
- be rendered. The advantage of this approach is that the resulting JSP is much simpler
- and easier to read and maintain.
- </para>
- <para>Here is an example layout JSP that uses tags from the latter:
- <programlisting>
- <![CDATA[<%@ taglib uri="/WEB-INF/theme/portal-layout.tld" prefix="p" %>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title><p:title default="My Great Portal"/></title>
- <meta http-equiv="Content-Type" content="text/html;" />
- <p:theme themeName='renaissance' />
- <p:headerContent />
- </head>
- <body id="body">
- <div id="portal-container">
- <div id="sizer">
- <div id="expander">
- <div id="logoName"></div>
- <table border="0" cellpadding="0" cellspacing="0" id="header-container">
- <tr>
- <td align="center" valign="top" id="header">
- <div id="spacer"></div>
- </td>
- </tr>
- </table>
- <div id="content-container">
- <p:region regionName='This-Is-The-Page-Region-To-Query-The-Page'
- regionID='This-Is-The-Tag-ID-Attribute-To-Match-The-CSS-Selector'/>
- <p:region regionName='left' regionID='regionA'/>
- <p:region regionName='center' regionID='regionB'/>
- <hr class="cleaner" />
- <div id="footer-container" class="portal-copyright">Powered by
- <a class="portal-copyright"
- href="http://www.jboss.com/products/jbossportal">
- JBoss Portal
- </a>
- </div>
- </div>
- </div>
- </div>
- </div>
- </body>
-</html>]]></programlisting>
- </para>
- <section>
- <title>The title tag</title>
- <para>The title tag is used to insert the web browser title defined by a portlet which
- is part of the page rendering. The default attribute defines the title to use if no
- portlet defined a web browser title.
- </para>
- </section>
- <section>
- <title>The theme tag</title>
- <para>The theme tag looks for the determined theme of the current request (see
- Portal Themes for more details). If no theme was determined, this tag allows an
- optional attribute 'themeName' that can be used to specify a default theme to use
- as a last resort. Based on the determined theme name, the ThemeService is called
- to lookup the theme with this name and to get the resources associated with this
- theme. The resulting style and link elements are injected, making sure that war
- context URLS are resolved appropriately.
- </para>
- </section>
- <section>
- <title>The headerContent tag</title>
- <para>This tags allows portlets to inject content into the header. More details
- about this function are mentioned in the 'other Theme Functions' section of this
- document.
- </para>
- </section>
- <section>
- <title>The region tag</title>
- <para>The region tag renders all the portlets in the specified region of the current
- page, using the determined RenderSet to produce the markup that surrounds the
- individual portlet markup fragments. The regionName attribute functions as a query
- param into the current page. It determines from what page region the portlets will
- be rendered in this tag. The regionID attribute is what the RenderSet can use to
- generate a CSS selector for this particular region. In case of the divRenderer, a
- DIV tag with an id attribute corresponding to the provided value will be rendered
- for this region. This id in turn can be picked up by the CSS to style the region.
- </para>
- </section>
- </section>
- </section>
- <!--
-<section>
-<title>Layout Strategy</title>
-<section>
-<title>What is a Layout Strategy</title>
-<para>The layout strategy is a pluggable API that allows the layout developer to influence
-the content of the page that is about to be rendered. Based on the current request URL,
-the portal determined the portal and page that needs to be rendered. The page contains a
-list of portlets, and those portlets are in a particular navigational state. The
-navigational state consists of the portlet mode and the window state of the portlet.
-This information, togeher with the determined layout, the region and order assignments
-of each portlet, the allowed window states and portlet modes for both, the portal and
-the individual portlets, is passed to the layout strategy before the actual rendering is
-invoked. The layout strategy can check what is about to be rendered, and take action in
-a limited way to influence the content that is about to be rendered.
-</para>
-</section>
-<section>
-<title>How can I use a Layout Strategy</title>
-<section>
-<title>Define a Strategy</title>
-<para>A layout strategy is defined in the strategy descriptor. The descriptor is named
- portal-strategies.xml, and is located in the WEB-INF/layout folder of any web
- application deployed to the server. Here is an example of such a descriptor:
- <programlisting>
- <![CDATA[<portal-strategies>
- <set name="default">
- <strategy content-type="text/html">
- <implementation>org.jboss.portal.theme.impl.strategy.DefaultStrategyImpl</implementation>
- </strategy>
- </set>
- <set name="maximizedRegion">
- <strategy content-type="text/html">
- <implementation>org.jboss.portal.theme.impl.strategy.MaximizingStrategyImpl</implementation>
- </strategy>
- </set>
- </portal-strategies>
- ]]></programlisting>
- Layout strategies are defined as sets. A set consists of one or
- more strategy definitions, separated by content type they are assigned for. The idea
- behind this is to allow the layout developer to apply different strategies based on
- requested content type. Each set has a name that is unique in the application context
- it is deployed in. The strategy can be refered to by this name. As a result of that
- it is considered a named layout strategy in contrast to an anonymous strategy as
- described below.
-</para>
-</section>
-<section>
-<title>Specify the Strategy to use</title>
-<para>The strategy that will be used for a portal request is defined as a property of
- the current layout, the requested portal, or the requested page. If the layout
- defines a strategy to use it will overwrite all other assignments. If there is no
- particular strategy defined for the layout, then the page property will overwrite the
- portal property. If no strategy can be determined, then a last attempt will be made
- to use the strategy with the name 'default'. If no strategy can be determined at all,
- the request will proceed normally without invoking any strategy. Here is an example
- layout descriptor that defines a strategy for the layouts defined:
- <programlisting>
- <![CDATA[
- <layouts>
- <strategy content-type="text/html">
- <implementation>com.novell.portal.strategy.MaximizingStrategy</implementation>
- </strategy>
-
- <layout>
- <name>generic</name>
- <uri>/generic/index.jsp</uri>
- <uri state="maximized">/generic/maximized.jsp</uri>
- </layout>
- </layouts>
- ]]></programlisting>
- In this case the strategy is anonymous and directly assigned to
- the generic layout. The strategy cannot be discovered independently from the generic
- layout. Here is an example portal descriptor that points to a strategy for the
- portal, and for a particular page:
- <programlisting>
- <![CDATA[
- <portal>
- <portal-name>default</portal-name>
- <properties>
- <property>
- <name>layout.strategyId</name>
- <value>default</value>
- </property>
- </properties>
- <pages>
- <default-page>theme test</default-page>
- <page>
- <page-name>theme test</page-name>
- <properties>
- -->
- <!-- set a difference layout strategy for this page -->
- <!--
- <property>
- <name>layout.strategyId</name>
- <value>maximizedRegion</value>
- </property>
- </properties>
- <window>
- <window-name>CatalogPortletWindow</window-name>
- <instance-ref>CatalogPortletInstance</instance-ref>
- <region>left</region>
- <height>0</height>
- </window>
- </page>
- </pages>
- </portal>
- ]]></programlisting>
- As you can see, analogous to how layouts are refered to, the
- strategy name is the linking element between the portal descriptor and the layout
- strategy descriptor. The content type is determined at runtime, and serves as a
- secondary query parameter to get the correct strategy for this content type out of
- the set that matches the name provided in the portal descriptor.
- </para>
- </section>
- </section>
- <section>
- <title>Linking the Strategy and the Layout</title>
- <para>As mentioned above, the layout descriptor can link a strategy directly to the
- layout. This will overwrite all other defined strategies for the portal or the page, for
- any page that uses this layout.
- </para>
- <para>The layout strategy can set a state to return to the portal as a result of the
- strategy evaluation. This state will be matched with the state attribute of the uri
- element of the layout. If there is a match, then the uri that matches this state will be
- used as the layout for the current request. So, if the strategy sets a state of
- 'maximized' , the portal will try to use the layout resource that is pointed to for that
- particular state in the currently selected layout. As you might remember from the
- previous layout section, a layout can point to another JSP or Servlet based on the state
- attribute of the uri element, like so:
- <programlisting><![CDATA[
- <layouts>
- <layout>
- <name>industrial</name>
- <uri>/industrial/index.jsp</uri>
- <uri state="maximized">/industrial/maximized.jsp</uri>
- </layout>
- </layouts>]]></programlisting>
- In this case all reuquests that don't return a state
- 'maximized' from the evaluation of the strategy will use the /industrial/index.jsp as
- the layout. However, if the evaluation of the strategy returns a state of 'maximized'
- then the request will use /industrial/maximized.jsp as the layout.
- </para>
- </section>
- </section>
- -->
- <section>
- <title>RenderSets</title>
- <section>
- <title>What is a RenderSet</title>
- <para>A RenderSet can be used to produce the markup containers around portlets and portlet
- regions. The markup for each region, and each portlet window in a region is identical.
- Further more, it is most likely identical across several layouts. The way portlets are
- arranged and decorated will most likely not change across layouts. What will change is
- the look and feel of the decoration, the images, fonts, and colors used to render each
- portlet window on the page. This is clearly a task for the web designer, and hence
- should be realized via the portal theme. The layout only needs to provide enough
- information to the theme so that it can do its job. The RenderSet is exactly that link
- between the layout and the theme that takes the information available in the portal and
- renders markup containing the current state of the page and each portlet on it. It makes
- sure that the markup around each region and portlet contains the selectors that the
- theme CSS needs to style the page content appropriately.
- </para>
- <para>A RenderSet consists of the implementations of four interfaces. Each of those
- interfaces corresponds to a markup container on the page.
- </para>
- <para>Here are the four markup containers and their interface representation:</para>
- <itemizedlist>
-
- <listitem><para>Region - RegionRenderer</para></listitem>
- <listitem><para>Window - WindowRenderer</para></listitem>
- <listitem><para>Decoration - DecorationRenderer</para></listitem>
- <listitem><para>Portlet Content - PortletRenderer</para></listitem>
- </itemizedlist>
- <para>
- All the renderer interfaces are specified in the
- org.jboss.portal.theme.render package.
- </para>
- <para>The four markup containers are hierarchical. The region contains one or more
- windows. A window contains the portlet decoration and the portlet content.
- </para>
- <para>The region is responsible for arranging the positioning and order of each portlet
- window. Should they be arranged in a row or a column? If there are more then one portlet
- window in a region, in what order should they appear?
- </para>
- <para>The window is responsible for placing the window decoration, including the portlet
- title, over the portlet content, or under, or next to it.
- </para>
- <para>The decoration is responsible for inserting the correct markup with the links to the
- portlet modes and window states currently available for each portlet.
- </para>
- <para>The portlet content is responsible for inserting the actually rendered markup
- fragment that was produced by the portlet itself.
- </para>
- </section>
- <section>
- <title>How is a RenderSet defined</title>
- <para>Similar to layouts, render sets must be defined in a RenderSet descriptor. The
- RenderSet descriptor is located in the WEB-INF/layout folder of a web application, and
- is named portal-renderSet.xml. Here is an example descriptor:
- <programlisting>
- <![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<portal-renderSet>
- <renderSet name="divRenderer">
- <set content-type="text/html">
- <region-renderer>org.jboss.portal.theme.impl.render.DivRegionRenderer</region-renderer>
- <window-renderer>org.jboss.portal.theme.impl.render.DivWindowRenderer</window-renderer>
- <portlet-renderer>org.jboss.portal.theme.impl.render.DivPortletRenderer</portlet-renderer>
- <decoration-renderer>
- org.jboss.portal.theme.impl.render.DivDecorationRenderer
- </decoration-renderer>
- </set>
- </renderSet>
- <renderSet name="emptyRenderer">
- <set content-type="text/html">
- <region-renderer>org.jboss.portal.theme.impl.render.EmptyRegionRenderer</region-renderer>
- <window-renderer>org.jboss.portal.theme.impl.render.EmptyWindowRenderer</window-renderer>
- <portlet-renderer>
- org.jboss.portal.theme.impl.render.EmptyPortletRenderer
- </portlet-renderer>
- <decoration-renderer>
- org.jboss.portal.theme.impl.render.EmptyDecorationRenderer
- </decoration-renderer>
- </set>
- </renderSet>
-</portal-renderSet>
- ]]></programlisting>
- </para>
- </section>
- <section>
- <title>How to specify what RenderSet to use</title>
- <para>Analogous to how a strategy is specified, the RenderSet can be specified as a portal
- or page property, or a particular layout can specify an anonymous RenderSet to use. Here
- is an example of a portal descriptor:
- <programlisting>
- <![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<portal>
- <portal-name>default</portal-name>
- <properties>
- <!-- use the divRenderer for this portal -->
- <property>
- <name>theme.renderSetId</name>
- <value>divRenderer</value>
- </property>
- </properties>
- <pages>
- <default-page>default</default-page>
- <page>
- <page-name>default</page-name>
- <properties>
- <!-- overwrite the portal's renderset for this page -->
- <property>
- <name>theme.renderSetId</name>
- <value>emptyRenderer</value>
- </property>
- </properties>
- <window>
- <window-name>TestPortletWindow</window-name>
- <instance-ref>TestPortletInstance</instance-ref>
- <region>center</region>
- <height>0</height>
- </window>
- </page>
- </pages>
-</portal>]]></programlisting>
- Here is an example of a layout descriptor with an anonymous
- RenderSet:
- <programlisting>
- <![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<layouts>
-<renderSet>
-<set content-type="text/html">
-<region-renderer>org.foo.theme.render.MyRegionRenderer</region-renderer>
-<window-renderer>org.foo.theme.render.MyWindowRenderer</window-renderer>
-<portlet-renderer>org.foo.theme.render.MyPortletRenderer</portlet-renderer>
-<decoration-renderer>org.foo.theme.render.MyDecorationRenderer</decoration-renderer>
-</set>
-</renderSet>
-<layout>
-<name>generic</name>
-<uri>/generic/index.jsp</uri>
-<uri state="maximized">/generic/maximized.jsp</uri>
-</layout>
-</layouts>]]></programlisting>
- Again, analogous to layout strategies, the anonymous RenderSet
- overwrites the one specified for the page, and that overwrites the one specified for the
- portal. In other words: all pages that use the layout that defines an anonymous
- RenderSet will use that RenderSet, and ignore what is defined as RenderSet for the
- portal or the page.
- </para>
- <para>
- In addition to specifying the renderSet for a portal or a page, each individual portlet window
- can define what renderSet to use for the one of the three aspects of a window, the window renderer,
- the decoration renderer, and the portlet renderer. This feature allow you to use the the window renderer
- implementation from one renderSet, and the decoration renderer from another.
- Here is an example for a window that uses the implementations of the emptyRenderer renderSet for all three
- aspects:
- <programlisting>
- <![CDATA[<window>
- <window-name>NavigationPortletWindow</window-name>
- <instance-ref>NavigationPortletInstance</instance-ref>
- <region>navigation</region>
- <height>0</height>
- <!-- overwrite portal and page properties set for the renderSet for this window -->
- <properties>
- <!-- use the window renderer from the emptyRenderer renderSet -->
- <property>
- <name>theme.windowRendererId</name>
- <value>emptyRenderer</value>
- </property>
- <!-- use the decoration renderer from the emptyRenderer renderSet -->
- <property>
- <name>theme.decorationRendererId</name>
- <value>emptyRenderer</value>
- </property>
- <!-- use the portlet renderer from the emptyRenderer renderSet -->
- <property>
- <name>theme.portletRendererId</name>
- <value>emptyRenderer</value>
- </property>
- </properties>
-</window>]]></programlisting>
-
- </para>
- </section>
- </section>
- <section>
- <title>Themes</title>
- <section>
- <title>What is a Theme</title>
- <para>A portal theme is a collection of CSS styles, JavaScript files, and images, that all
- work together to style and enhance the rendered markup of the portal page. The theme
- works together with the layout and the RenderSet in producing the content and final look
- and feel of the portal response. Through clean separation of markup and styles a much
- more flexible and powerful approach to theming portals is possible. While this approach
- is not enforced, it is strongly encouraged. If you follow the definitions of the
- Theme Style Guide (see later), it is not necessary to change the layout or the strategy,
- or the RenderSet to achieve very different look and feels for the portal. All you need
- to change is the theme. Since the theme has no binary dependencies, it is very simple to
- swap, or change individual items of it. No compile or redeploy is necessary. Themes
- can be added or removed while the portal is active. Themes can be deployed in separate
- web applications furthering even more the flexibility of this approach. Web developers
- don't have to work with JSP pages. They can stay in their favorite design tool and simple
- work against the exploded war content that is deployed into the portal. The results can
- be validated life in the portal.
- </para>
- </section>
- <section>
- <title>How to define a Theme</title>
- <para>Themes can be added as part of any web application that is deployed to the portal
- server. All what is needed is a theme descriptor file that is part of the deployed
- archive. This descriptor indicates to the portal what themes and theme resources are
- becoming available to the portal. The theme deployer scans the descriptor and adds the
- theme(s) to the ThemeService, which in turn makes the themes available for consumption
- by the portal. Here is an example of a theme descriptor:
- <programlisting>
- <![CDATA[<themes>
-<theme>
-<name>nodesk</name>
-<link href="/nodesk/css/portal_style.css" rel="stylesheet" type="text/css" />
-<link rel="shortcut icon" href="/images/favicon.ico" />
-</theme>
-<theme>
-<name>phalanx</name>
-<link href="/phalanx/css/portal_style.css" rel="stylesheet" type="text/css" />
-<link rel="shortcut icon" href="/images/favicon.ico" />
-</theme>
-
-<theme>
-<name>industrial-CSSSelect</name>
-<link rel="stylesheet" id="main_css" href="/industrial/portal_style.css" type="text/css" />
-<link rel="shortcut icon" href="/industrial/images/favicon.ico" />
-
-<script language="JavaScript" type="text/javascript">
-// MAF - script to switch current tab and css in layout...
-function switchCss(currentTab,colNum) {
-var obj = currentTab;
-var objParent = obj.parentNode;
-
-if (document.getElementById("current") != null) {
-var o = document.getElementById("current");
-o.setAttribute("id","");
-o.className = 'hoverOff';
-objParent.setAttribute("id","current");
-}
-
-var css = document.getElementById("main_css");
-source = css.href;
-if (colNum == "3Col") {
-if (source.indexOf("portal_style.css" != -1)) {
-source = source.replace("portal_style.css","portal_style_3Col.css");
-}
-if (source.indexOf("portal_style_1Col.css" != -1)) {
-source = source.replace("portal_style_1Col.css","portal_style_3Col.css");
-}
-}
-if (colNum == "2Col") {
-if (source.indexOf("portal_style_3Col.css" != -1)) {
-source = source.replace("portal_style_3Col.css","portal_style.css");
-}
-if (source.indexOf("portal_style_1Col.css" != -1)) {
-source = source.replace("portal_style_1Col.css","portal_style.css");
-}
-}
-if (colNum == "1Col") {
-if (source.indexOf("portal_style_3Col.css" != -1)) {
-source = source.replace("portal_style_3Col.css","portal_style_1Col.css");
-}
-if (source.indexOf("portal_style.css" != -1)) {
-source = source.replace("portal_style.css","portal_style_1Col.css");
-}
-}
-
-css.href = source;
-}
-</script>
-</theme>
-</themes>]]></programlisting>
- </para>
- <para>Themes are defined in the portal-themes.xml theme descriptor, which is located in
- the WEB-INF/ folder of the web application.
- </para>
- </section>
- <section>
- <title>How to use a Theme</title>
- <para>Again, analogous to the way it is done for layouts, themes are specified in the
- portal descriptor as a portal or page property. The page property overwrites the portal
- property. In addition to these two options, themes can also be specified as part of the
- theme JSP tag , that is placed on the layout JSP. Here is an example portal descriptor
- that specifies the phalanx theme as the theme for the entire portal, and the industrial
- theme for the theme test page:
- <programlisting>
- <![CDATA[<portal>
- <portal-name>default</portal-name>
- <properties>
- <!-- Set the theme for the default portal -->
- <property>
- <name>layout.id</name>
- <value>phalanx</value>
- </property>
- </properties>
- <pages>
- <page>
- <page-name>theme test</page-name>
- <properties>
- <!-- set a difference layout for this page -->
- <property>
- <name>layout.id</name>
- <value>industrial</value>
- </property>
- </properties>
- <window>
- <window-name>CatalogPortletWindow</window-name>
- <instance-ref>CatalogPortletInstance</instance-ref>
- <region>left</region>
- <height>0</height>
- </window>
- </page>
- </pages>
-</portal>]]></programlisting>
- And here is an example of a layout JSP that defines a default
- theme to use if no other theme was defined for the portal or page:
- <programlisting>
- <![CDATA[<%@ taglib uri="/WEB-INF/theme/portal-layout.tld" prefix="p" %>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title><%= "JBoss Portal :: 2.2 early (Industrial)" %></title>
- <meta http-equiv="Content-Type" content="text/html;" />
- <p:theme themeName='industrial' />
- <p:headerContent />
- </head>
- <body id="body">
- <div id="portal-container">
- <div id="sizer">
- <div id="expander">
- <div id="logoName"></div>
- <table border="0" cellpadding="0" cellspacing="0"
- id="header-container">
- <tr>
- <td align="center" valign="top" id="header">
- <div id="spacer"></div>
- </td>
- </tr>
- </table>
- <div id="content-container">
- <p:region
- regionName='This-Is-The-Page-Region-To-Query-The-Page'
- regionID='This-Is-The-Tag-ID-Attribute-To-Match-The-CSS-Selector' />
- <p:region regionName='left' regionID='regionA' />
- <p:region regionName='center' regionID='regionB' />
- <hr class="cleaner" />
- <div id="footer-container" class="portal-copyright">
- Powered by
- <a class="portal-copyright"
- href="http://www.jboss.com/products/jbossportal">
- JBoss Portal
- </a>
- <br />
- Theme by
- <a class="portal-copyright"
- href="http://www.novell.com">
- Novell
- </a>
- </div>
- </div>
- </div>
- </div>
- </div>
- </body>
-</html>]]></programlisting>
- For the function of the individual tags in this example, please
- refer to the layout section of this document.
- </para>
- </section>
- <section>
- <title>How to write your own Theme</title>
- <para>Ask your favorite web designer and/or consult the Theme Style Guide in this document.</para>
- </section>
- </section>
- <section>
- <title>Other Theme Functionalities and Features</title>
- <para>This section contains all the functionalities that don't fit with any of the other
- topics. Bits and pieces of useful functions that are related to the theme and layout
- functionality.
- </para>
- <section>
- <title>Content Rewriting and Header Content Injection</title>
- <para>Portlets can have their content rewritten by the portal. This is useful if you want
- to uniquely namespace markup (JavaScript functions for example) in the scope of a page.
- The rewrite functionality can be applied to the portlet content (the markup fragment)
- and to content a portlet wants to inject into the header. The rewrite is implemented as
- specified in the WSRP (OASIS: Web Services for Remote Portlets; producer write). As a
- result of this, the token to use for rewrite is the WSRP specified "wsrp_rewrite_". If
- the portlet sets the following response property
- <programlisting>res.setProperty("WSRP_REWRITE","true");</programlisting>
- all occurrences
- of the wsrp_rewrite_ token in the portlet fragment will be replaced with a unique token
- (the window id). If the portlet also specifies content to be injected into the header of
- the page, that content is also subject to this rewrite.
- <programlisting><![CDATA[res.setProperty("HEADER_CONTENT", "
- <script>function wsrp_rewrite_OnFocus(){alert('hello button');}</script>
- ");]]>
- </programlisting>
- Note that in order for the header content injection to work, the layout needs to make
- use of the headerContent JSP tag, like:
- <programlisting>
- <![CDATA[<%@ taglib uri="/WEB-INF/theme/portal-layout.tld" prefix="p" %>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title><JBoss Portal 2.2 early</title>
- <meta http-equiv="Content-Type" content="text/html;" />
-
- <p:headerContent />
- </head>
- <body id="body">
- <p>...</p>
- </body>
-</html>]]></programlisting>
- </para>
- </section>
- <section>
- <title>Declarative CSS Style injection</title>
- <para>If a portlet needs a CSS style sheet to be injected via a link tag in the page
- header, it can do so by providing the context relative URI to the file in the
- jboss-portlet.xml descriptor, like:
- <programlisting>
- <![CDATA[<portlet-app>
- <portlet>
- <portlet-name>HeaderContentPortlet</portlet-name>
- <header-content>
- <link rel="stylesheet" type="text/css" href="/portlet-styles/HeaderContent.css"
- title="" media="screen" />
- </header-content>
- </portlet>
-</portlet-app>]]></programlisting>
- </para>
- <para>This functionality, just like the previously described header content injection,
- requires the layout JSP to add the "headerContent" JSP tag (see example above). One thing to note here is
- the order of the tags. If the headerContent tag is placed after the theme tag, it will allow portlet
- injected
- CSS files to overwrite the theme's behavior, making this feature even more powerful!
- </para>
- </section>
- <section>
- <title>Disabling Portlet Decoration</title>
- <para>One possible use of window properties is demonstrated in the divRenderer RenderSet implementation.
- If a window definition (in the portal descriptor) contains a property like:
- <programlisting>
- <![CDATA[<window>
- <window-name>HintPortletWindow</window-name>
- <instance-ref>HintPortletInstance</instance-ref>
- <region>center</region>
- <height>0</height>
- <properties>
- <!-- turn the decoration off for this portlet (i.e. no title and mode/state links) -->
- <property>
- <name>theme.decorationRendererId</name>
- <value>emptyRenderer</value>
- </property>
- </properties>
-</window>]]></programlisting>
- the DivWindowRenderer will use the decoration renderer from the emptyRenderer
- RenderSet to render the decoration for this window (not delegate to the DivDecorationRenderer).
- As a result, the portlet window will be part of the rendered page, but it will not have a title,
- nor will it have any links to change the portlet mode or window state.
- </para>
- </section>
- </section>
- <section>
- <title>Theme Style Guide (based on the Industrial theme)</title>
- <section>
- <title>Overview</title>
- <note><title>Note</title><para>This section to be updated soon with new CSS selectors found in JBoss Portal 2.6. The current
- definitions remain, but the newer additions with regards to dashboards/drag-n-drop have not been
- documented as of yet.</para>
- </note>
- <para>This document outlines the different selectors used to handle the layout and
- look/feel of the Industrial theme included in the JBoss portal.
- </para>
- <para>A couple of things to know about the theming approach discussed below:</para>
-
- <itemizedlist>
-
- <listitem><para>Main premise behind this approach was to provide a clean separation between
- the business and presentation layer of the portal. As we go through each selector
- and explain the relation to the visual presentation on the page, this will become
- more apparent.</para>
- </listitem>
- <listitem><para>The flexibility of the selectors used in the theme stylesheet allow a
- designer to very easily customize the visual aspects of the portal, thereby taking
- the responsibility off of the developers hands through allowing the designer to
- quickly achieve the desired effect w/out the need to dive down into code and/or
- having to deploy changes to the portal. This saves time and allows both developers
- and designers to focus on what they do best.</para>
- </listitem>
- <listitem><para>This theme incorporates a liquid layout approach which allows elements on a
- page to expand/contract based on screen resolution and provides a consistent look
- across varying display settings. However, the stylesheet is adaptable to
- facilitate a fixed layout and/or combination approach where elements are pixel
- based and completely independent of viewport.</para>
- </listitem>
- <listitem><para>The pieces that make up the portal theme consist of at least one stylesheet
- and any associated images. Having a consolidated set of files to control the
- portal look and feel allows administrators to effortlessly swap themes on the fly.
- In addition, this clean separation of the pieces that make up a specific theme
- will enable sharing and collaboration of different themes by those looking to get
- involved or contribute to the open source initiative.</para>
- </listitem>
- </itemizedlist>
-
- </section>
- <section>
- <title>Main Screen Shot</title>
- <para>Screen shot using color outline of main ID selectors used to control presentation
- and layout:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/selector-outline.gif" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
-
- <itemizedlist>
- <listitem><para>Red Border - portal-container</para></listitem>
- <listitem><para>Yellow Border - header-container</para></listitem>
- <listitem><para>Orange Border - content-container</para></listitem>
- <listitem><para>Blue Border - regionA/regionB</para></listitem>
- <listitem><para>Green Border - portlet-container</para></listitem>
- </itemizedlist>
-
- </section>
- <section>
- <title>List of CSS Selectors</title>
-
- <para>The following is a list of the selectors used in the theme stylesheet,
- including a brief explanation of how each selector is used in the portal:
- </para>
- <itemizedlist>
-
- <listitem>
- <para>Portal Body Selector
- <programlisting>#body {
- background-color: #FFFFFF;
- background-image: url( images/header_bg.gif );
- background-repeat: repeat-x;
- margin: 0px;
- padding: 0px;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- background-repeat: repeat-x;
- font-size: 11px;
- color: #656565;
-}</programlisting>
- Usage: This selector controls the background of the page, and can be modified
- to set a base font-family, layout margin, etc. that will be inherited by all
- child elements that do not have their own individual style applied. By default,
- the selector pulls an image background for the page.
- </para>
- </listitem>
- <listitem>
- <para>Portal Header Selectors
- <programlisting>#spacer {
- width: 770px;
- line-height: 0px;
- font-size: 0px;
- height: 0px;
-}</programlisting>
- Usage: Spacer div used to keep header at certain width regardless of display
- size. This is done to avoid overlapping of tab navigation in header. To account
- for different display sizes, this selector can be modified to force a
- horizontal scroll in the browser which eliminates any issue with overlapping
- elements in the header.
- <programlisting>#header-container {
- background-repeat: repeat-y;
- height: 100%;
- min-width: 1000px;
- width: 100%;
- position: absolute;
- bottom: 5px;*/
- }</programlisting>
- Usage: Wrapper selector used to control the position of the header on the page.
- This selector is applied as an ID on the
- table used to structure the header. You can adjust the attributes to reposition
- the header location on the page and/or create margin space on the top, right,
- bottom and left sides of the header.
- Screenshot:
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/portal-header.gif" scalefit="1"/>
- </imageobject>
- </mediaobject>
-
- <programlisting>#header {
- height: 65px;
- width: 100%;
- padding: 0px;
- margin: 0px;
- z-index: 1;
-}</programlisting>
- Usage: This selector applies the header background image in the portal. It can
- be adjusted to accommodate a header background of a certain width/height or, as
- it currently does, repeat the header graphic so that it tiles across the header
- portion of the page.
- <programlisting>#logoName {
- background-image: url( images/logo.gif );
- background-repeat: no-repeat;
- float: left;
- width: 250px;
- height: 25px;
- z-index: 2;
- position: absolute;
- left: 20px;
- top: 10px;
-}</programlisting>
- Usage: Logo selector which is used to brand the header with a specific,
- customized logo. The style is applied as an ID on an absolutely positioned DIV
- element which enables it to be moved to any location on the page, and allows it
- to be adjusted to accommodate a logo of any set width/height.
- </para>
- </listitem>
- <listitem>
- <para>Portal Layout Region Selectors
- <programlisting>#portal-container {
-/* part of below IE hack to preserve min-width for portlet regions */
-/*width: 100%;*/
- margin: 4px 2% 0px 2%;
-
- padding: 0 350px 0 350px;
-}</programlisting>
- Usage: Wrapper for entire portal which starts/ends after/before the BODY tag
- (see red border in screen shot). The padding attribute for this selector is
- used to preserve a minimum width setting for the portlet regions (discussed
- below). Similar to body selector, this style can modified to create margin or
- padding space on the top, right, bottom and left sections of the page. It
- provides the design capability to accommodate most layouts (e.g. a centered
- look such as the phalanx theme where there is some spacing around the content
- of the portal, or a full width look as illustrated in the Industrial theme).
- Screenshot:
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/region-selectors.gif" scalefit="1"/>
- </imageobject>
- </mediaobject>
-
- <programlisting>/* min width for IE */
-#expander {
- position: relative;
- padding: 0 0 0 0;
-
- margin: 0 -350px 0 -350px;
- min-width: 770px;
- padding: 0 0 0 0;
-}
-
-/* min width hack for IE */
-#sizer {
- width: 100%;
-}
-
-/* IE Hack \*/
-* html #portal-container,
- * html #sizer,
- * html #expander {
- height: 0;
-}</programlisting>
- Usage: These selectors are used in conjunction with the above,
- portal-container, selector to preserve a minimum width setting for the portlet
- regions. This was implemented to maintain a consistent look across different
- browsers.
- <programlisting>#content-container {
- height: 100%;
- text-align: left;
- width: 100%;
- min-width: 770px;
- /*
- position: absolute;
- top: 70px;
- left: 0px; / * z-index: 1; * /
- / * part of below IE hack
-padding: 0 350px 0 350px; * /
- padding: 0px 100px 0px 0px;
- */
-}</programlisting>
- Usage: Wrapper that contains all regions in portal with the exception of the
- header (see orange border in screen shot). Its attributes can be adjusted to
- create margin space on page, as well as control positioning of the area of the
- page below the header.
- <programlisting>/* portlet regions within content-container. this includes footer-container. */
-#regionA {
- width: 30%;
- float: left;
- margin: 0px;
- padding: 0px;
- min-width: 250px; /*height: 300px;*/
-}</programlisting>
- Usage: First portlet region located within the content-container (see blue
- border in screen shot). This selector controls the width of the region as well
- as its location on the page. Designers can very easily reposition this region
- in the portal (e.g. swap left regionA with right regionB, etc.) by adjusting
- the attributes of this selector.
- <programlisting>#regionB {
- /* test to swap columns..
-margin: 0 30% 0 0; */
-
- /*two column layout
-margin: 0 0 0 30%;*/
- padding: 0px; /* test to add 3rd region in layout...*/
- width: 67%;
- float: left; /*height: 300px;*/
-}</programlisting>
- Usage: Second portlet region located within the content-container (see blue
- border in screen shot). Similar to regionA, this selector controls the width of
- the region as well as its location on the page.
- <programlisting>#regionC {
-/* inclusion of 3rd region - comment out for 2 region testing */
- padding: 0px;
- margin: 0px;
- width: 28%;
- float: left; /*hide 3rd region*/
- display: none;
-}</programlisting>
- Usage: Third portlet region located within the content-container (please refer
- to blue border in screen shot representing regionA and regionB for an example).
- Used for 3 column layout. Similar to regionA and regionB, this selector
- controls the width of the region as well as its location on the page.
- Screenshot:
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/regions.gif" scalefit="1"/>
- </imageobject>
- </mediaobject>
-
- <programlisting>
-hr.cleaner {
-clear:both;
-height:1px;
-margin: -1px 0 0 0;
-padding:0;
-border:none;
-visibility: hidden;
-}
- </programlisting>
- Usage: Used to clear floats in regionA, regionB and regionC DIVs so that footer
- spans bottom of page.
- <programlisting>#footer-container {
- padding: 10px;
- text-align: center;
- clear: both;
-}</programlisting>
- Usage: Footer region located towards the bottom of the content-container (see
- above screen shot). This region spans the entire width of the page, but can be
- adjusted (just like regionA, regionB and regionC) to take on a certain position
- and width/height in the layout.
- </para>
- </listitem>
- <listitem>
- <para>Portlet Container Window Selectors
- <programlisting>.portlet-container {
- padding: 10px;
-}</programlisting>
- Usage: Wrapper that surrounds the portlet windows (see green border in screen
- shot). Currently, this selector is used to create space (padding) between the
- portlets displayed in each particular region.
- <programlisting>.portlet-titlebar-title {
- color: #656565;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 12px;
- font-weight: bold;
- white-space: nowrap;
- line-height: 100%;
- float: left;
- text-indent: 5px;
- padding-top: 5px;
- padding-bottom: 6px;
-}</programlisting>
- Usage: Class used to style the title of each portlet window. Attributes of this
- selector set font properties, indentation and position of title.
- <programlisting>.portlet-mode-container {
- float: right;
- padding-top: 4px;
- white-space: nowrap;
-}</programlisting>
- Usage: Wrapper that contains the portlet window modes that display in the top
- right section of the portlet windows.
- <programlisting>.portlet-titlebar-left {
- background-image: url( images/portlet-top-left.gif );
- background-repeat: no-repeat;
- width: 9px;
- height: 29px;
- min-width: 9px;
- background-position: bottom;
-}</programlisting>
- Usage: Used to style the top left corner of the portlet window. Each portlet
- window consists of one table that has 3 columns and 3 rows. This selector
- styles the first column (TD) in the first row (TR).
- Screenshot:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/portlet-titlebar-left.gif"/>
- </imageobject>
- </mediaobject>
- <programlisting>.portlet-titlebar-center {
- background-image: url( images/portlet-top-middle.gif );
- background-repeat: repeat-x;
- height: 29px;
- background-position: bottom;
-}</programlisting>
- Usage: Used to style the center section of the portlet title bar. Each portlet
- window consists of one table that has 3 columns and 3 rows. This selector
- styles the second column (TD) in the first row (TR).
- Screenshot:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/portlet-titlebar-center.gif"/>
- </imageobject>
- </mediaobject>
- <programlisting>.portlet-titlebar-right {
- background-image: url( images/portlet-top-right.gif );
- background-repeat: no-repeat;
- width: 10px;
- height: 30px;
- min-width: 10px;
- background-position: bottom left;
-}</programlisting>
- Usage: Used to style the top right corner of the portlet window. Each portlet
- window consists of one table that has 3 columns and 3 rows. This selector
- styles the third column (TD) in the first row (TR).
- Screenshot:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/portlet-titlebar-right.gif"/>
- </imageobject>
- </mediaobject>
- <programlisting>.portlet-content-left {
- background-image: url( images/portlet-left-vertical.gif );
- background-repeat: repeat-y;
- width: 9px;
- min-width: 9px;
- /*
- width:20px;
- background-color:#FFFFFF;
- border-left: 1px solid #dfe8ed;
- */
-}</programlisting>
- Usage: Used to style the left hand vertical lines that make up the portlet
- window. Each portlet window consists of one table that has 3 columns and 3
- rows. This selector styles the first column (TD) in the second row (TR).
-
- Screenshot:
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/portlet-content-left.gif"/>
- </imageobject>
- </mediaobject>
- <programlisting>.portlet-content-center {
- vertical-align: top;
- padding: 0;
- margin: 0;
-}</programlisting>
- Usage: Used to style the center, content area where the portlet content is
- injected into the portlet window (see below screen). Attributes for this
- selector control the positioning of the portlet content as well as the
- background and font properties. Each portlet window consists of one table that
- has 3 columns and 3 rows. This selector styles the second column (TD) in the
- second row (TR).
- Screenshot:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/portlet-content-center.gif"/>
- </imageobject>
- </mediaobject>
- <programlisting>.portlet-body {
- background-color: #FFFFFF;
- padding: 0;
- margin: 0;
-}</programlisting>
- Usage: An extra selector for controlling the content section of the portlet
- windows (see below screen). This was added to better deal with structuring the
- content that gets inserted/rendered in the portlet windows, specifically if the
- content is causing display problems in a portlet.
- Screenshot:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/portlet-body.gif"/>
- </imageobject>
- </mediaobject>
- <programlisting>.portlet-content-right {
- background-image: url( images/portlet-right-vertical.gif );
- height: 100%;
- background-repeat: repeat-y;
- background-position: left;
- width: 5px;
- min-width: 5px;
- padding: 0;
- margin: 0;
- /*
- width:5px;
- background-color:#FFFFFF;
- border-right: 1px solid #dfe8ed;
- */
-}</programlisting>
- Usage: Used to style the right hand vertical lines that make up the portlet
- window. Each portlet window consists of one table that has 3 columns and 3
- rows. This selector styles the third column (TD) in the second row (TR).
-
- Screenshot:
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/portlet-content-right.gif"/>
- </imageobject>
- </mediaobject>
- <programlisting>.portlet-footer-left {
- background-image: url( images/portlet-bottom-left.gif );
- width: 9px;
- height: 4px;
- background-repeat: no-repeat;
- background-position: top right;
- min-width: 9px;
- padding: 0;
- margin: 0;
- /*
- background-color:#FFFFFF;
- border-bottom: 1px solid #98b7c6;
- border-left: 1px solid #dfe8ed;
- height:5px;
- */
-}</programlisting>
- Usage: Used to style the bottom left corner of the portlet window. Each portlet
- window consists of one table that has 3 columns and 3 rows. This selector
- styles the first column (TD) in the third row (TR).
- Screenshot:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/portlet-footer-left.gif"/>
- </imageobject>
- </mediaobject>
- <programlisting>.portlet-footer-center {
- background-image: url( images/portlet-bottom-middle.gif );
- height: 4px;
- background-repeat: repeat-x;
- /* background-color:#FFFFFF;
- border-bottom: 1px solid #98b7c6;
- height:5px;
- */
-}</programlisting>
- Usage: Used to style the bottom, center of the portlet window (i.e. the bottom
- horizontal line in the Industrial theme). Each portlet window consists of one
- table that has 3 columns and 3 rows. This selector styles the second column
- (TD) in the third row (TR).
- Screenshot:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/portlet-footer-center.gif"/>
- </imageobject>
- </mediaobject>
- <programlisting>.portlet-footer-right {
- background-image: url( images/portlet-bottom-right.gif );
- width: 5px;
- height: 4px;
- background-repeat: no-repeat;
- min-width: 5px;
- /*
- background-color:#FFFFFF;
- border-bottom: 1px solid #98b7c6;
- border-right: 1px solid #dfe8ed;
- height:5px;
- */
-}</programlisting>
- Usage: Used to style the bottom right corner of the portlet window. Each
- portlet window consists of one table that has 3 columns and 3 rows. This
- selector styles the third column (TD) in the third row (TR).
- Screenshot:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/portlet-footer-right.gif"/>
- </imageobject>
- </mediaobject>
- </para>
- </listitem>
- <listitem>
- <para>Portlet Window Mode Selectors
- <programlisting>.portlet-mode-maximized {
- background-image: url( images/ico_16_maximize.gif );
- background-repeat: no-repeat;
- width: 16px;
- height: 16px;
- float: left;
- display: inline;
- cursor: pointer;
- padding-left: 3px;
-}</programlisting>
- Usage: Selector used to display the portlet maximize mode. Attributes for this
- selector control the display and dimensions of the maximize icon, including the
- behavior of the mouse pointer when hovering the mode.
- <programlisting>.portlet-mode-minimized {
- background-image: url( images/ico_16_minimize.gif );
- background-repeat: no-repeat;
- width: 16px;
- height: 16px;
- float: left;
- display: inline;
- cursor: pointer;
- padding-left: 3px;
-}</programlisting>
- Usage: Selector used to display the portlet minimize mode. Attributes for this
- selector control the display and dimensions of the minimize icon, including the
- behavior of the mouse pointer when hovering the mode.
- <programlisting>.portlet-mode-normal {
- background-image: url( images/ico_16_normal.gif );
- width: 16px;
- height: 16px;
- background-repeat: no-repeat;
- float: left;
- display: inline;
- cursor: pointer;
- padding-left: 3px;
-}</programlisting>
- Usage: Selector used to display the portlet normal mode (i.e. the icon that
- when clicked, restores the portlet to the original, default view). Attributes
- for this selector control the display and dimensions of the normal icon,
- including the behavior of the mouse pointer when hovering the mode.
- <programlisting>.portlet-mode-help {
- background-image: url( images/ico_16_help.gif );
- width: 16px;
- height: 16px;
- background-repeat: no-repeat;
- float: left;
- display: inline;
- cursor: pointer;
- padding-left: 3px;
-}</programlisting>
- Usage: Selector used to display the portlet help mode. Attributes for this
- selector control the display and dimensions of the help icon, including the
- behavior of the mouse pointer when hovering the mode.
- <programlisting>.portlet-mode-edit {
- background-image: url( images/ico_edit.gif );
- background-repeat: no-repeat;
- width: 28px;
- height: 16px;
- float: left;
- display: inline;
- cursor: pointer;
- padding-left: 3px;
-}</programlisting>
- Usage: Selector used to display the portlet edit mode. Attributes for this
- selector control the display and dimensions of the edit icon, including the
- behavior of the mouse pointer when hovering the mode.
- <programlisting>.portlet-mode-remove {
- background-image: url( images/ico_16_remove.gif );
- background-repeat: no-repeat;
- width: 16px;
- height: 16px;
- float: left;
- display: inline;
- cursor: pointer;
- padding-left: 3px;
-}</programlisting>
- Usage: Currently not available. But here is the intended use: Selector used to
- display the portlet remove mode. Attributes for this selector control the
- display and dimensions of the remove icon, including the behavior of the mouse
- pointer when hovering the mode.
- <programlisting>.portlet-mode-view {
- background-image: url( images/ico_cancel.gif );
- background-repeat: no-repeat;
- width: 28px;
- height: 16px;
- float: left;
- display: inline;
- cursor: pointer;
- padding-left: 3px;
- padding-right: 20px;
-}</programlisting>
- Usage: Selector used to display the portlet view mode. Attributes for this
- selector control the display and dimensions of the view icon, including the
- behavior of the mouse pointer when hovering the mode.
- <programlisting>.portlet-mode-reload {
- background-image: url( images/ico_16_reload.gif );
- background-repeat: no-repeat;
- width: 16px;
- height: 16px;
- float: left;
- display: inline;
- cursor: pointer;
- padding-left: 3px;
-}</programlisting>
- Usage: Currently not available. But here is the intended use: Selector used to
- display the portlet reload mode. Attributes for this selector control the
- display and dimensions of the reload icon, including the behavior of the mouse
- pointer when hovering the mode.
- </para>
- </listitem>
- <listitem>
- <para>Copyright Selectors
- <programlisting>.portal-copyright {
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 10px;
- color: #5E6D7A;
-}
-
-a.portal-copyright {
- color: #768591;
- text-decoration: none;
-}
-
-a.portal-copyright:hover {
- color: #bcbcbc;
- text-decoration: underline;
-}</programlisting>
- Usage: The above three selectors are used to style copyright content in the
- portal. The portal-copyright selector sets the font properties (color, etc.),
- and the a.portal-copyright/a.portal-copyright:hover selectors style any links
- that are part of the copyright information.
- </para>
- </listitem>
- <listitem>
- <para>Table Selectors
- <programlisting>.portlet-table-header {
- background-color: #eef;
- padding: 0 5px 5px 5px;
- font-weight: bold;
- color: #656565;
- font-size: 12px;
- border-bottom: 1px solid #d5d5d5;
-}</programlisting>
- Usage: Intended for styling tables (specifically, the TH
- or table header elements) that get rendered within a portlet window.
- <programlisting>.portlet-table-body {
-
-}</programlisting>
- Usage: Intended for styling the table body element used
- to group rows in a table.
- <programlisting>.portlet-table-alternate {
- background-color: #E6E8E5;
- border-bottom: 1px solid #d5d5d5;
-}</programlisting>
- Usage: Used to style the background color (and possibly
- other attributes) for every other row within a table.
- <programlisting>.portlet-table-selected {
- color: #000;
- font-size: 12px;
- background-color: #CBD4E6;
-}</programlisting>
- Usage: Used to style text, color, etc. in a selected cell
- range.
- <programlisting>.portlet-table-subheader {
- font-weight: bold;
- color: #000;
- font-size: 12px;
-}</programlisting>
- Usage: Used to style a subheading within a table that
- gets rendered in a portlet.
- <programlisting>.portlet-table-footer {
- padding: 5px 5px 0 5px;
- font-weight: bold;
- color: #656565;
- font-size: 12px;
- border: none;
- border-top: 1px solid #d5d5d5;
-}</programlisting>
- Usage: Similar to portlet-table-header and
- portlet-table-body, this selector is used to style the table footer element
- which is used to group the footer row in a table.
- <programlisting>.portlet-table-text {
- padding: 3px 5px;
- border-bottom: 1px solid #d5d5d5;
-}</programlisting>
- Usage: Text that belongs to the table but does not fall in one of the other
- categories (e.g. explanatory or help text that is associated with the table).
- This selector can also be modified to provide styled text that can be used in
- all tables that are rendered within a portlet.
- </para>
- </listitem>
- <listitem>
- <para>FONT Selectors
- <programlisting>.portlet-font {
- color: #000000;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 11px;
-}</programlisting>
- Usage: Used to style the font properties on text used in a portlet. Typically
- this class is used for the display of non-accentuated information.
- <programlisting>.portlet-font-dim {
- color: #777777;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 11px;
-}</programlisting>
- Usage: A lighter version (color-wise) of the portlet-font selector.
- </para>
- </listitem>
- <listitem>
- <para>FORM Selectors
- <programlisting>.portlet-form-label {
- font-size: 10px;
- color: #656565;
-}</programlisting>
- Usage: Text used for the descriptive label of an entire form (not the label for
- each actual form field).
- <programlisting>.portlet-form-button {
- font-size: 10px;
- font-weight: bold;
- color: #FFFFFF;
- background-color: #5078aa;
- border-top: 1px solid #97B7C6;
- border-left: 1px solid #97B7C6;
- border-bottom: 1px solid #254869;
- border-right: 1px solid #254869;
-}</programlisting>
- Usage: Used to style portlet form buttons (e.g. Submit).
- <programlisting>.portlet-icon-label {
-
-}</programlisting>
- Usage: Text that appears beside a context dependent
- action icon.
- <programlisting>.portlet-dlg-icon-label {
-
-}</programlisting>
- Usage: Text that appears beside a "standard" icon (e.g
- Ok, or Cancel).
- <programlisting>.portlet-form-field-label {
- font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
- font-size: 10px;
- color: #000;
- vertical-align: bottom;
- white-space: nowrap
-}</programlisting>
- Usage: Selector used to style portlet form field labels.
- <programlisting>.portlet-form-field {
- font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
- font-size: 10px;
- color: #000; /*margin-top: 10px;*/
-}</programlisting>
- Usage: Selector used to style portlet form fields (i.e. INPUT controls, SELECT
- elements, etc.).
- </para>
- </listitem>
- <listitem>
- <para>LINK Selectors
- <programlisting>.portal-links:link {
- font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
- font-size: 11px;
- font-weight: bold;
- color: #242424;
- text-decoration: none;
-}
-
-.portal-links:hover {
- font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
- font-size: 11px;
- font-weight: bold;
- color: #5699B7;
- text-decoration: none;
-}
-
-.portal-links:active {
- font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
- font-size: 11px;
- font-weight: bold;
- color: #242424;
- text-decoration: none;
-}
-
-.portal-links:visited {
- font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
- font-size: 11px;
- font-weight: bold;
- color: #242424;
- text-decoration: none;
-}</programlisting>
- Usage: The above four selectors are used to style links in the portal. Each
- pseudo class (i.e. hover, active, etc.) provides a different link style.
- </para>
- </listitem>
- <listitem>
- <para>MESSAGE Selectors
- <programlisting>.portlet-msg-status {
- font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
- font-size: 12px;
- font-style: normal;
- color: #336699;
-}</programlisting>
- Usage: Selector used to signify the status of a current operation that takes
- place in the portlet (e.g. "saving results", "step 1 of 4").
- <programlisting>.portlet-msg-info {
- font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
- font-size: 12px;
- font-style: italic;
- color: #000;
-}</programlisting>
- Usage: Selector used to signify general information in a portlet (e.g. help
- messages).
- <programlisting>.portlet-msg-error {
- color: red;
- font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
- font-size: 12px;
- font-weight: bold;
-}</programlisting>
- Usage: Selector used to signify an error message in the portlet (e.g. form
- validation error).
- <programlisting>.portlet-msg-alert {
- font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
- font-size: 12px;
- font-weight: bold;
- color: #821717;
-}</programlisting>
- Usage: Selector used to style an alert that is displayed to the user.
- <programlisting>.portlet-msg-success {
- font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
- font-size: 12px;
- font-weight: bold;
- color: #359630;
-}</programlisting>
- Usage: Selector used to indicate successful completion of an action in a
- portlet (e.g. "save successful").
- </para>
- </listitem>
- <listitem>
- <para>SECTION Selectors
- <programlisting>.portlet-section-header {
- font-weight: bold;
- color: #656565;
- font-size: 12px;
-}
-</programlisting>
- Usage: Table or section header.
- <programlisting>.portlet-section-body {
- color: #656565;
-}</programlisting>
- Usage: Normal text in a table cell.
- <programlisting>.portlet-section-alternate {
- background-color: #F2F2F2;
-}</programlisting>
- Usage: Used to style background color and text in every other table row.
- <programlisting>.portlet-section-selected {
- background-color: #CBD4E6;
-}</programlisting>
- Usage: Used to style background and font properties in a selected cell range.
- <programlisting>.portlet-section-subheader {
- font-weight: bold;
- font-size: 10px;
-}</programlisting>
- Usage: Used to style a subheading within a table/section that gets rendered in
- a portlet.
- <programlisting>.portlet-section-footer {
- font-size: 11px;
-}</programlisting>
- Usage: Used to style footer area of a section/table that gets rendered in a
- portlet.
- <programlisting>.portlet-section-text {
- font-size: 12px;
- font-style: italic;
-}</programlisting>
- Usage: Text that belongs to a section but does not fall in
- one of the other categories. This selector can also be modified to provide
- styled text that can be used in all sections that are rendered within a
- portlet.
- </para>
- </listitem>
- <listitem>
- <para>MENU Selectors
- <programlisting>
-.portlet-menu {}
- </programlisting>
- Usage: General menu settings such as background color,
- margins, etc.
- <programlisting>.portlet-menu-item {
- color: #242424;
- text-decoration: none;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 12px;
-}</programlisting>
- Usage: Normal, unselected menu item.
- <programlisting>.portlet-menu-item:hover {
- color: #5699B7;
- text-decoration: none;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 12px;
-}</programlisting>
- Usage: Used to style hover effect on a normal, unselected
- menu item.
- <programlisting>
-.portlet-menu-item-selected {}
- </programlisting>
- Usage: Applies to selected menu items.
- <programlisting>
-.portlet-menu-item-selected:hover {}
- </programlisting>
- Usage: Selector styles the hover effect on a selected menu
- item.
- <programlisting>
-.portlet-menu-cascade-item {}
- </programlisting>
- Usage: Normal, unselected menu item that has sub-menus.
- <programlisting>
-.portlet-menu-cascade-item-selected {}
- </programlisting>
- Usage: Selected sub-menu item.
- <programlisting>
-.portlet-menu-description {}
- </programlisting>
- Usage: Descriptive text for the menu (e.g. in a help
- context below the menu).
- <programlisting>
-.portlet-menu-caption {}
- </programlisting>
- Usage: Selector used to style menu captions.
- </para>
- </listitem>
- <listitem>
- <para>WSRP Selectors
- <programlisting>
-.portlet-horizontal-separator {}
- </programlisting>
- Usage: A separator bar similar to a horizontal rule, but
- with styling matching the page.
- <programlisting>
-.portlet-nestedTitle-bar {}
- </programlisting>
- Usage: Allows portlets to mimic the title bar when nesting
- something.
- <programlisting>
-.portlet-nestedTitle {}
- </programlisting>
- Usage: Allows portlets to match the textual character of
- the title on the title bar.
- <programlisting>
-.portlet-tab {}
- </programlisting>
- Usage: Support portlets having tabs in the same style as
- the page or other portlets.
- <programlisting>
-.portlet-tab-active {}
- </programlisting>
- Usage: Highlight the tab currently being shown.
- <programlisting>
-.portlet-tab-selected {}
- </programlisting>
- Usage: Highlight the selected tab (not yet active).
- <programlisting>
-.portlet-tab-disabled {}
- </programlisting>
- Usage: A tab which can not be currently activated.
- <programlisting>
-.portlet-tab-area {}
- </programlisting>
- Usage: Top level style for the content of a tab.
- </para>
- </listitem>
- </itemizedlist>
-
- </section>
- </section>
- <section>
- <title>Additional Ajax selectors</title>
- <para>Since 2.6 JBoss Portal has ajax features. Those features introduce a couple of
- CSS selectors that enables further customization of the visual look and feel. Indeed by default
- those CSS styles are provided by ajaxified layouts but it may not fit with some themes. It is possible
- to redefine them in the stylesheet of the themes.</para>
- <itemizedlist>
- <listitem><para>
- <programlisting>
-.dyna-region {}
- </programlisting>
-
- Usage:
- Denotes a dynamic region which can be subject to ajax capabilities.</para>
- </listitem>
- <listitem><para>
- <programlisting>
-.dyna-window {}
- </programlisting>
-
- Usage:
- Denotes a dynamic window which can be subject to ajax capabilities.</para>
- </listitem>
- <listitem><para>
- <programlisting>
-.dyna-decoration {}
- </programlisting>
-
- Usage:
- Denotes a dynamic decorator which can be subject to ajax capabilities.</para>
- </listitem>
- <listitem><para>
- <programlisting>
-.dyna-portlet {}
- </programlisting>
-
- Usage:
- Denotes a dynamic content which can be subject to ajax capabilities.</para>
- </listitem>
- <listitem><para>
- <programlisting>
-.dnd-handle {
- cursor: move;
-}
- </programlisting>
-
- Usage:
- Denotes the handle offered by draggable windows. By default it changes the mouse shape to indicate
- to the user that his mouse is hovering a draggable window.</para>
- </listitem>
- <listitem><para>
- <programlisting>
-.dnd-droppable {
- border: red 1px dashed;
- background-color: Transparent;
-}
- </programlisting>
-
- Usage:
- Denotes a zone where a user can drop a window during drag and drop operations. This selector is added
- and removed dynamically at runtime by the ajax framework and is not present in the generated markup.</para>
- </listitem>
- </itemizedlist>
- </section>
-</chapter>
- <chapter id="ajax">
-<!-- <chapterinfo>
- <author>
- <firstname>Julien</firstname>
- <surname>Viet</surname>
- </author>
- </chapterinfo>-->
- <title>Ajax</title>
- <para>This section covers the ajax features provided by the portal.</para>
- <section>
- <title>Introduction</title>
- <para>Todo</para>
- </section>
- <section>
- <title>Ajaxified markup</title>
- <section>
- <title>Ajaxified layouts</title>
- <para>Part of the Ajax capabilities are implemented in the layout framework which provide the structure for
- generating portal pages. The good news is that the existing layout only requires a few modifications in
- order to be ajaxified.</para>
- <para>We will use as example an simplified version of the layout JSP provided in JBoss Portal 2.6 and outline
- what are the required changes that makes it an ajaxified layout:
- <programlisting><![CDATA[
-<%@ taglib uri="/WEB-INF/theme/portal-layout.tld" prefix="p" %>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <meta http-equiv="Content-Type" content="text/html;"/>
- <!-- inject the theme, default to the Renaissance theme if
- nothing is selected for the portal or the page -->
- <p:theme themeName="renaissance"/>
- <!-- insert header content that was possibly set by portlets on the page -->
- <p:headerContent/>
-</head>
-
-<body id="body">
-<p:region regionName='AJAXScripts' regionID='AJAXScripts'/>
-<div id="portal-container">
- <div id="sizer">
- <div id="expander">
- <div id="logoName"></div>
- <table border="0" cellpadding="0" cellspacing="0" id="header-container">
- <tr>
- <td align="center" valign="top" id="header">
-
- <!-- Utility controls -->
- <p:region regionName='dashboardnav' regionID='dashboardnav'/>
-
- <!-- navigation tabs and such -->
- <p:region regionName='navigation' regionID='navigation'/>
- <div id="spacer"></div>
- </td>
- </tr>
- </table>
- <div id="content-container">
- <!-- insert the content of the 'left' region of the page,
- and assign the css selector id 'regionA' -->
- <p:region regionName='left' regionID='regionA'/>
- <!-- insert the content of the 'center' region of the page,
- and assign the css selector id 'regionB' -->
- <p:region regionName='center' regionID='regionB'/>
- <hr class="cleaner"/>
- </div>
- </div>
- </div>
-</div>
-
-<p:region regionName='AJAXFooter' regionID='AJAXFooter'/>
-
-</body>
-</html>
-]]></programlisting>
- <itemizedlist>
- <listitem><para><![CDATA[<p:theme themeName="renaissance"/>]]> should be already present as it exists since 2.4 but is even more
- necessary as it will inject in the page the reference to the ajax stylesheet.</para></listitem>
- <listitem><para><![CDATA[<p:region regionName='AJAXScripts' regionID='AJAXScripts'/>]]> should be added before any other region
- in the markup of the layout.</para></listitem>
- <listitem><para><![CDATA[<p:region regionName='AJAXFooter' regionID='AJAXFooter'/>]]> should be added after any other region
- in the markup of the layout.</para></listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>Ajaxified renderers</title>
- <para>At runtime the portal combines the layout and the renderers in order create the markup returned to the
- web browser. The most used render set is the divRenderer. Renderers only need a modification in the deployment
- descriptor to indicate that they support ajax. Here is the declaration of the default divRenderer now in 2.6:</para>
- <programlisting role="XML"><![CDATA[
-<renderSet name="divRenderer">
- <set content-type="text/html">
- <ajax-enabled>true</ajax-enabled>
- <region-renderer>org.jboss.portal.theme.impl.render.div.DivRegionRenderer
- </region-renderer>
- <window-renderer>org.jboss.portal.theme.impl.render.div.DivWindowRenderer
- </window-renderer>
- <portlet-renderer>org.jboss.portal.theme.impl.render.div.DivPortletRenderer
- </portlet-renderer>
- <decoration-renderer>org.jboss.portal.theme.impl.render.div.DivDecorationRenderer
- </decoration-renderer>
- </set>
-</renderSet>
-]]></programlisting>
- <para>You should notice the <![CDATA[<ajax-enabled>true</ajax-enabled>]]> which indicates that the render set
- supports ajaxification.</para>
- </section>
- </section>
- <section>
- <title>Ajaxified pages</title>
- <para>The ajaxification of the portal pages can be configured in a fine grained manner. Thanks to the portal
- object properties it is possible to control which pages support ajax and which page do not support ajax. The
- administrator must pay attention to the fact that property values are inherited in the object hierarchy.</para>
- <section>
- <title>Drag and Drop</title>
- <para>That feature is only effective in dashboards as it requires the offer personalization of the page
- layout per user. By default the feature is enabled thanks to a property set on the dashboard object.
- It is possible to turn off that property if the administrator does not want to expose that feature
- to its user.</para>
- <para>In the file <emphasis>jboss-portal.sar/conf/data/default-object.xml</emphasis> is declared and configured the
- creation of the dashboard portal:</para>
- <programlisting role="XML"><![CDATA[
-<deployment>
- <parent-ref/>
- <if-exists>keep</if-exists>
- <context>
- <context-name>dashboard</context-name>
- <properties>
- ...
- <property>
- <name>theme.dyna.dnd_enabled</name>
- <value>true</value>
- </property>
- ...
- </properties>
- ...
- </context>
-</deployment>
-]]></programlisting>
- <para>The property <emphasis>theme.dyna.dnd_enabled</emphasis> is set to the value <emphasis>true</emphasis>
- which means that the dashboard object will provide the drag and drop feature.
- </para>
- </section>
- <section>
- <title>Partial refresh</title>
- <para>Partial refresh is a very powerful feature which allows the portal to optimize the refreshing
- of portlets on a page. When one portlet is invoked, instead of redrawing the full page, the portal is able
- to detect which portlets needs to be refreshed and will update only these portlets.</para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/ajax/partial-refresh.png" format="PNG" scalefit="1"/>
- </imageobject>
- </mediaobject>
- <para>The portal providing partial refresh.</para>
-
- <section>
- <title>Portal objects configuration</title>
- <para>Like with the drag and drop feature, partial page refresh is controlled via properties on portal objects.
- The name of the property is <emphasis>theme.dyna.partial_refresh_enabled</emphasis> and its values can
- be <emphasis>true</emphasis> or <emphasis>false</emphasis>. When this property is set on an object
- it is automatically inherited by the sub hierarchy located under that object. By default the drag
- and drop feature is positioned on the dashboard object and not on the rest of the portal objects.
- </para>
- <programlisting role="XML"><![CDATA[
-<deployment>
- <parent-ref/>
- <if-exists>keep</if-exists>
- <context>
- <context-name>dashboard</context-name>
- <properties>
- ...
- <property>
- <name>theme.dyna.partial_refresh_enabled</name>
- <value>true</value>
- </property>
- ...
- </properties>
- ...
- </context>
-</deployment>
-]]></programlisting>
- <note>
- <para>The partial page refresh feature is compatible with the Portal API. The Portal API allows programmatic
- update of the state of portlets at runtime. For instance it is possible to modify the window state or
- the mode of several portlets on a given page. When such event occurs, the portal detects the changes
- which occurred and will update the portlet fragments in the page.</para>
- </note>
- <para>It is possible to change that behavior at runtime using the property editor of the management portlet.
- If you want to enable partial refreshing on the default portal you should set the property to true
- directly on the portal and all the pages in that portal will automatically inherit those properties.</para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/ajax/partial-refresh-admin.png" format="PNG" scalefit="1"/>
- </imageobject>
- </mediaobject>
- <para>The default portal configured for partial page refresh</para>
-
- </section>
- <section>
- <title>Portlet configuration</title>
- <para>
- By default any portlet will support partial refreshing. When does the portal performs partial page
- refreshing ? By default it is enabled for action and render links with the following exceptions. In those
- situations, the portal will prefer to perform a full page refresh:
- <itemizedlist>
- <listitem>
- <para>Form GET are not handled, however it should not be an issue as this situation is discouraged
- by the Portlet specification. It however taken in account, just in case of. Here is an example
- of a JavaServer Page that would do one:</para>
- <programlisting><![CDATA[
-<form action="<%= renderResponse.createActionURL() %>" method="get">
- ...
-</form>
-]]></programlisting>
- </listitem>
- <listitem>
- <para>Form uploads are not handled.</para>
- </listitem>
- <listitem><para>Having an interaction that deals with the <emphasis>MAXIMIZED</emphasis> window state.
- When a window is entering a maximized state or leaving a maximized window state, the portal will
- perform a full page refresh.</para></listitem>
- </itemizedlist>
- </para>
- <para>It can happen that a portlet does not want to support partial refreshing, in those situations
- the <emphasis>jboss-portlet.xml</emphasis> can be used to control that behavior. Since 2.6 an ajax
- section has been added in order to configure ajax features related to the portlet.</para>
- <programlisting role="XML"><![CDATA[
-<portlet>
- <portlet-name>MyPortletNoAjax</portlet-name>
- <ajax>
- <partial-refresh>false</partial-refresh>
- </ajax>
-</portlet>
-]]></programlisting>
- <para>The usage of the <emphasis>partial-refresh</emphasis> set to the value false means that
- the portlet will not be subject of a partial page refresh when it is invoked. However the portlet
- markup can still be subject to a partial rendering.</para>
- </section>
- <section>
- <title>Limitations</title>
- <para>Partial refreshing of portlets has limitations both on the server side (portal) and on the client side (browser).</para>
- <section>
- <title>Application scoped session attributes</title>
- <para>When partial refresh is activated, the state of a page can potentially become inconsistent. for
- example, if some objects are shared in the application scope of the session between portlets. When one
- portlet update a session object, the other portlet won't be refreshed and will still display content based
- on the previous value of the object in the session. To avoid that, partial refresh can be deactivated
- for certain portlets by adding <portlet-refresh>false<portlet-refresh> in the jboss-portlet.xml file.</para>
- </section>
- <section>
- <title>Non ajax interactions</title>
- <para>The solution developed by JBoss Portal on the client side is built on top of DOM events emitted
- by the web browser when the user interacts with the page. If an interaction is done without an
- emission of an event then JBoss Portal will not be able to transform it into a partial refresh and
- it will result instead of a full refresh. This can happen with programmatic submission of forms.
- </para>
- <programlisting role="XHTML"><![CDATA[
-<form id="<%= formId %>" action="<%= renderResponse.createActionURL() %>" method="post">
- ...
- <select onclick="document.getElementById('<%= formId %>').submit()">
- ...
- </select>
- ...
-</form>
-]]></programlisting>
- </section>
- </section>
- </section>
- </section>
-</chapter>
- <chapter id="troubleshooting">
- <!-- <chapterinfo>
- <author>
- <firstname>Roy</firstname>
- <surname>Russo</surname>
- </author>
- </chapterinfo>-->
- <title>Troubleshooting and FAQ</title>
- <section id="troubleshooting-faq">
- <title>Troubleshooting and FAQ</title>
- <para>
- <emphasis role="bold">Installation / Configuration</emphasis>
- <itemizedlist>
- <listitem><para>
- <xref linkend="conf1"/> I am seeing "ERROR [JDBCExceptionReporter] Table not found in statement" in the
- logfile
- on first boot. What is this?</para>
- </listitem>
- <listitem><para>
- <xref linkend="conf2"/> I want to do a clean install/upgrade over my existing one. What are the
- steps?</para>
- </listitem>
- <listitem><para>
- <xref linkend="conf3"/> Is my database vendor/version combination supported?</para>
- </listitem>
- <listitem>
- <para><xref linkend="conf4"/> How do I force the Hibernate Dialect used for my database?</para>
- </listitem>
- <listitem>
- <para> <xref linkend="conf5"/> How do I change the context-root of the portal to http://localhost:8080/?</para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- <emphasis role="bold">CMS</emphasis>
- <itemizedlist>
- <listitem>
- <para> <xref linkend="cms1"/>. How do I change the CMS repository configuration?</para>
- </listitem>
- <listitem>
- <para> <xref linkend="cms2"/>.On reboot, the CMS is complaining about a locked repository.</para>
- </listitem>
- <listitem>
- <para> <xref linkend="cms3"/>. I created a file in the CMSAdmin. How do I view it?</para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- <emphasis role="bold">Errors</emphasis>
- <itemizedlist>
- <listitem>
- <para> <xref linkend="error1"/>. When I access a specific portal-instance or page, I keep seeing "401 - not
- authorized" error in my browser.</para>
- </listitem>
- <listitem>
- <para> <xref linkend="error2"/>. How do I disable development-mode errors on the presentation layer?</para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- <emphasis role="bold">Miscellaneous</emphasis>
- <itemizedlist>
- <listitem>
- <para> <xref linkend="misc1"/>Is there a sample portlet I can look at to learn about portlet development and
- JBoss
- Portal deployments?</para>
- </listitem>
- </itemizedlist>
- </para>
-
-
- <section id="conf1"><title>"Error [JDBCExceptionReporter] Table not found in statement"</title>
- <para>
- <emphasis role="bold">I am seeing "ERROR [JDBCExceptionReporter] Table not found in statement" in the logfile
- on first
- boot. What is
- this?</emphasis>
- Ignore this error. It is used by the portal to create the initial database tables. On second boot, you should
- not see them at all.
- </para>
-</section>
-
- <section id="conf2"><title>install/upgrade</title>
- <para>
- <emphasis role="bold">I want to do a clean install/upgrade over my existing one. What are the steps?</emphasis>
- <itemizedlist>
- <listitem><para>Shut down JBoss AS</para></listitem>
- <listitem><para>Delete JBOSS_HOME/server/default/data/portal</para></listitem>
- <listitem><para>Delete all JBoss Portal tables from your database</para></listitem>
- <listitem><para>Start JBoss AS.</para></listitem>
- </itemizedlist>
- </para>
-</section>
-
- <section id="conf3"><title>database support</title>
- <para>
- <emphasis role="bold">Is my database vendor/version combination supported?</emphasis>
- See
- <xref linkend="supportedversions-db"/>
- </para>
-</section>
-
- <section id="conf4"><title>Hibernate Dialect</title>
- <para>
- <emphasis role="bold">How do I force the Hibernate Dialect used for my database?</emphasis>
- See
- <xref linkend="configuration-hibdialect"/>
- </para>
-</section>
-
- <section id="conf5"><title>context-root</title>
- <para>
- <emphasis role="bold">How do I change the context-root of the portal to http://localhost:8080/?</emphasis>
- See
- <xref linkend="configuration-contextroot"/>
- </para>
-</section>
-
- <section id="cms1"><title>CMS repository configuration</title>
- <para>
- <emphasis role="bold">How do I change the CMS repository configuration?</emphasis>
-
- There are 3 supported modes: 100% DB (default), 100% Filsystem, and Mixed (Blobs on the Filesystem and metadata
- in the DB). You can see configuration options here:
- <xref linkend="configuration-cms"/>
- </para>
-</section>
- <section id="cms2"><title>Locked repository</title>
- <para>
- <emphasis role="bold">On reboot, the CMS is complaining about a locked repository.</emphasis>
-
- This occurs when JBoss AS is improperly shutdown or the CMS Service errors on startup. To remove the lock,
- shutdown JBoss, and then remove the file under JBOSS_HOME/server/default/data/portal/cms/conf/.lock.
- </para>
-</section>
-
- <section id="cms3"><title>CMSAdmin</title>
- <para>
- <emphasis role="bold">I created a file in the CMSAdmin. How do I view it?</emphasis>
-
- Using the default configuration, the path to the file in the browser would be:
- http://localhost:8080/portal/content/path/to/file.ext.
- Note that all requests for cms content must be prepended with /content and then followed by the
- path/to/the/file.gif as it is in your directory structure.
- </para>
-</section>
-
- <section id="error1"><title>"401 - not authorised"</title>
- <para>
- <emphasis role="bold">When I access a specific portal-instance or page, I keep seeing "401 - not
- authorized" error in my browser.</emphasis>
- You are likely not authorized to view the page or portal instance. You can either modify the security using the
- Management Portlet under the Admin Tab, or secure your portlets via the object descriptor,
- <xref linkend="securing_objects"/>
- </para>
-</section>
-
- <section id="error2"><title>Development errors</title>
- <para>
- <emphasis role="bold">How do I disable development-mode errors on the presentation layer?</emphasis>
- See:
- <xref linkend="descriptor_debug"/>
- </para>
-</section>
- <section id="misc1"><title>Portlet Deployment</title>
- <para>
- <emphasis role="bold">Is there a sample portlet I can look at to learn about portlet development and JBoss
- Portal deployments?</emphasis>
-</para>
-
- <itemizedlist>
- <listitem><para>Sample portlets with tutorials can be found here,
- <xref linkend="tutorials_tutorials"/></para>
- </listitem>
- <listitem><para>Additional Portlets can be found at
- <ulink url="http://www.portletswap.com">PortletSwap.com</ulink>
- .</para>
- </listitem>
- </itemizedlist>
- </section>
-
- </section>
-</chapter>
- <!-- DO NOT EDIT ME DIRECTLY, I AM GENERATED FROM THE DTD USING THE dtd2docbook ANT TASK --><appendix id="portalObjectsDTD">
- <title>*-object.xml DTD</title>
- <para>
-<programlisting><![CDATA[
-
- <?xml version="1.0" encoding="UTF-8" ?>
-
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
- ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<!--
-<!DOCTYPE deployments PUBLIC
- "-//JBoss Portal//DTD Portal Object 2.6//EN"
- "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
--->
-
-<!--
-The deployements element is a generic container for deployment elements.
--->
-<!ELEMENT deployments (deployment*)>
-
-<!--
-The deployment is a generic container for portal object elements. The parent-ref
-child gives the name of the parent object that the current object will use as parent.
-The optional if-exists element define the behavior when a portal object which
-an identical name is already child of the parent element. The default behavior of
-the if-exist tag is to keep the existing object and not create a new object. The
-last element is the portal object itself.
-
-Example:
-
-<deployment>
- <parent-ref>default</parent-ref>
- <page>
- ...
- </page>
-</deployment>
-
-All portal objects have a common configuration which can be :
-
-1/ a listener : specifies the id of a listener is the listener registry. A listener
-object is able to listen portal events which apply to the portal node hierarchy.
-
-2/ properties : a set of generic properties owned by the portal object. Some
-properties can drive the behavior of the object.
-
-3/ security-constraint : defines security configuration of the portal object.
-
--->
-<!ELEMENT deployment (parent-ref?,if-exists?,(context|portal|page|window))>
-
-<!--
-Contains a reference to the parent object. The naming convention for naming object
-is to concatenate the names of the path to the object and separate the names by a dot.
-If the path is empty then the empty string must be used.
-
-Example:
-
-<parent-ref/> the root having an empty path
-
-<parent-ref>default</parent-ref> the object with the name default under the root
-having the path (default)
-
-<parent-ref>default.default</parent-ref> the object with the path (default,default)
-
--->
-<!ELEMENT parent-ref (#PCDATA)>
-
-<!--
-The authorized values are overwrite and keep. Overwrite means that the existing
-object will be destroyed and the current declaration will be used. Keep means that
-the existing object will not be destroyed and no creation hence will be done.
--->
-<!ELEMENT if-exists (#PCDATA)>
-
-<!--
-A portal object of type context. A context type represent a node in the tree which
-does not have a visual representation. It can exist only under the root. A context can
-only have children with the portal type.
--->
-<!ELEMENT context (context-name,properties?,listener?,security-constraint?,portal*,
- (display-name* | (resource-bundle, supported-locale+)))>
-
-<!--
-The context name value.
--->
-<!ELEMENT context-name (#PCDATA)>
-
-<!--
-A portal object of type portal. A portal type represents a virtual portal and can
-have children of type page. In addition of the common portal object elements it support
-also the declaration of the modes and the window states it supports. If no declaration
-of modes or window states is done then the default value will be respectively
-(view,edit,help) and (normal,minimized,maximized).
--->
-<!ELEMENT portal (portal-name,supported-modes,supported-window-states?,properties?,
- listener?,security-constraint?,page*,
- (display-name* | (resource-bundle, supported-locale+)))>
-
-<!--
-The portal name value.
--->
-<!ELEMENT portal-name (#PCDATA)>
-
-
-<!--
-The supported modes of a portal.
-
-Example:
-
-<supported-mode>
- <mode>view</mode>
- <mode>edit</mode>
- <mode>help</mode>
-</supported-mode>
--->
-<!ELEMENT supported-modes (mode*)>
-
-<!--
-A portlet mode value.
--->
-<!ELEMENT mode (#PCDATA)>
-
-<!--
-The supported window states of a portal.
-
-Example:
-
-<supported-window-states>
- <window-state>normal</window-state>
- <window-state>minimized</window-state>
- <window-state>maximized</window-state>
-</supported-window-states>
-
--->
-<!ELEMENT supported-window-states (window-state*)>
-
-<!--
-A window state value.
--->
-<!ELEMENT window-state (#PCDATA)>
-
-<!--
-A portal object of type page. A page type represents a page which can have children of
-type page and window. The children windows are the windows of the page and the children
-pages are the subpages of this page.
--->
-<!ELEMENT page (page-name,properties?,listener?,security-constraint?,(page|window)*,
- (display-name* | (resource-bundle, supported-locale+)))>
-
-<!ELEMENT display-name (#PCDATA)>
-<!ATTLIST display-name
- xml:lang NMTOKEN #IMPLIED
->
-
-<!ELEMENT resource-bundle (#PCDATA)>
-
-<!ELEMENT supported-locale (#PCDATA)>
-
-<!--
-The page name value.
--->
-<!ELEMENT page-name (#PCDATA)>
-
-<!--
-A portal object of type window. A window type represents a window. Beside the common
-properties a window has a content and belong to a region on the page.
-
-The instance-ref or content tags are used to define the content of the window. The
-usage of the content tag is generic and can be used to describe any kind of content.
-The instance-ref is a shortcut to define a content type of portlet which points to a
-portlet instance.
-
-The region and height defines how the window is placed in the page.
--->
-<!ELEMENT window (window-name,(instance-ref|content),region,height,
- initial-window-state?,initial-mode?,properties?,listener?,
- (display-name* | (resource-bundle, supported-locale+)))>
-
-<!--
-The window name value.
--->
-<!ELEMENT window-name (#PCDATA)>
-
-<!--
-Define the content of the window as a reference to a portlet instance. The value
-is the id of the instance.
-
-Example:
-
-<instance-ref>MyPortletInstance</instance-ref>
-
--->
-<!ELEMENT instance-ref (#PCDATA)>
-
-<!--
-Define the content of the window in a generic manner. The content is define by
-the type of the content and an URI which acts as an identificator for the content.
-
-Example:
-
-<content>
- <content-type>portlet</content-type>
- <content-uri>MyPortletInstance</content-uri>
-</content>
-
-<content>
- <content-type>cms</content-type>
- <content-uri>/default/index.html</content-uri>
-</content>
-
--->
-<!ELEMENT content (content-type,content-uri)>
-
-<!--
-The content type of the window.
--->
-<!ELEMENT content-type (#PCDATA)>
-
-<!--
-The content URI of the window.
--->
-<!ELEMENT content-uri (#PCDATA)>
-
-<!--
-The region the window belongs to.
--->
-<!ELEMENT region (#PCDATA)>
-
-<!--
-The window state to use when the window is first accessed
--->
-<!ELEMENT initial-window-state (#PCDATA)>
-
-<!--
-The mode to use when the window is first accessed
--->
-<!ELEMENT initial-mode (#PCDATA)>
-
-<!--
-The height of the window in the particular region.
--->
-<!ELEMENT height (#PCDATA)>
-
-<!--
-Define a listener for a portal object. The value is the id of the listener.
--->
-<!ELEMENT listener (#PCDATA)>
-
-<!--
-A set of generic properties for the portal object.
--->
-<!ELEMENT properties (property*)>
-
-<!--
-A generic string property.
--->
-<!ELEMENT property (name,value)>
-
-<!--
-A name value.
--->
-<!ELEMENT name (#PCDATA)>
-
-<!--
-A value.
--->
-<!ELEMENT value (#PCDATA)>
-
-<!--
-The security-constraint element is a container for policy-permission elements
-
-Examples:
-
-<security-constraint>
- <policy-permission>
- <role-name>User</role-name>
- <action-name>view</action-name>
- </policy-permission>
-</security-constraint>
-
-<security-constraint>
- <policy-permission>
- <unchecked/>
- <action-name>view</action-name>
- </policy-permission>
-</security-constraint>
--->
-<!ELEMENT security-constraint (policy-permission*)>
-
-<!--
-The policy-permission element is used to secure a specific portal page based on a
-user's role.
--->
-<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>
-
-<!--
-The role-name element is used to define a role that this security constraint will apply to
-
- * <role-name>SOMEROLE</role-name> Access to this portal page is limited to the defined role.
--->
-<!ELEMENT action-name (#PCDATA)>
-
-<!--
-The unchecked element is used to define (if present) that anyone can view this portal page
--->
-<!ELEMENT unchecked EMPTY>
-
-<!--
-The action-name element is used to define the access rights given to the role defined.
-Possible values are:
-
- * view - Users can view the page.
--->
-<!ELEMENT role-name (#PCDATA)>
-
-
-]]></programlisting>
- </para>
-</appendix>
- <!-- DO NOT EDIT ME DIRECTLY, I AM GENERATED FROM THE DTD USING THE dtd2docbook ANT TASK --><appendix id="portletInstancesDTD">
- <title>portlet-instances.xml DTD</title>
- <para>
-<programlisting><![CDATA[
-
- <?xml version="1.0" encoding="UTF-8" ?>
-
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
- ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<!--
-<!DOCTYPE deployments PUBLIC
- "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
- "http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
--->
-
-<!--
-The deployements element is a container for deployment elements.
--->
-<!ELEMENT deployments (deployment*)>
-
-<!--
-The deployment is a container for an instance element.
--->
-<!ELEMENT deployment (if-exists?,instance)>
-
-<!--
-The if-exists element is used to define action to take if instance with such name is
-already present. Possible values are overwrite or keep . Overwrite will destroy the
-existing object in the database and create a new one, based on the content of the
-deployment. Keep will maintain the existing object deployment or create a new one if
-it does not yet exist.
--->
-<!ELEMENT if-exists (#PCDATA)>
-
-<!--
-The instance element is used to create an instance of a portlet from the portlet
-application of the same war file containing the portlet-instances.xml file. The portlet
-will be created and configured only if the portlet is present and an instance with
-such a name does not already exist.
-
-Example :
-
-<instance>
- <instance-id>MyPortletInstance</instance-id>
- <portlet-ref>MyPortlet</portlet-ref>
- <preferences>
- <preference>
- <name>abc</name>
- <value>def</value>
- </preference>
- </preferences>
- <security-constraint>
- <policy-permission>
- <role-name>User</role-name>
- <action-name>view</action-name>
- </policy-permission>
- </security-constraint>
-</instance>
-
--->
-<!ELEMENT instance (instance-id,portlet-ref,display-name*,preferences?,
- security-constraint?, (display-name* | (resource-bundle, supported-locale+)))>
-
-<!ELEMENT display-name (#PCDATA)>
-<!ATTLIST display-name
- xml:lang NMTOKEN #IMPLIED
->
-
-<!ELEMENT resource-bundle (#PCDATA)>
-
-<!ELEMENT supported-locale (#PCDATA)>
-
-
-<!--
-The identifier of the instance.
--->
-<!ELEMENT instance-id (#PCDATA)>
-
-<!--
-The reference to the portlet which is its portlet name.
--->
-<!ELEMENT portlet-ref (#PCDATA)>
-
-<!--
-Display name is the string used to represent this instance
--->
-<!ELEMENT display-name (#PCDATA)>
-<!ATTLIST display-name
- xml:lang NMTOKEN #IMPLIED
->
-
-<!--
-The preferences element configures the instance with a specific set of preferences.
--->
-<!ELEMENT preferences (preference+)>
-
-<!--
-The preference configure one preference of a set of preferences.
--->
-<!ELEMENT preference (name,value)>
-
-<!--
-A name.
--->
-<!ELEMENT name (#PCDATA)>
-
-<!--
-A string value.
--->
-<!ELEMENT value (#PCDATA)>
-
-<!--
-The security-constraint element is a container for policy-permission elements
-
-Examples:
-
-<security-constraint>
- <policy-permission>
- <role-name>User</role-name>
- <action-name>view</action-name>
- </policy-permission>
-</security-constraint>
-
-<security-constraint>
- <policy-permission>
- <unchecked/>
- <action-name>view</action-name>
- </policy-permission>
-</security-constraint>
--->
-<!ELEMENT security-constraint (policy-permission*)>
-
-<!--
-The policy-permission element is used to secure a specific portlet instance based on a
-user's role.
--->
-<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>
-
-<!--
-The action-name element is used to define the access rights given to the role defined.
-Possible values are:
-
- * view - Users can view the page.
- * viewrecursive - Users can view the page and child pages.
- * personalize - Users are able to view AND personalize the page.
- * personalizerecursive - Users are able to view AND personalize the page AND its child
- pages.
--->
-<!ELEMENT action-name (#PCDATA)>
-
-<!--
-The unchecked element is used to define (if present) that anyone can view this instance
--->
-<!ELEMENT unchecked EMPTY>
-
-<!--
-The role-name element is used to define a role that this security constraint will apply to
-
- * <role-name>SOMEROLE</role-name> Access to this instance is limited to the defined role.
--->
-<!ELEMENT role-name (#PCDATA)>
-
-
-]]></programlisting>
- </para>
-</appendix>
- <!-- DO NOT EDIT ME DIRECTLY, I AM GENERATED FROM THE DTD USING THE dtd2docbook ANT TASK --><appendix id="jbossPortletDTD">
- <title>jboss-portlet.xml DTD</title>
- <para>
-<programlisting><![CDATA[
-
- <?xml version="1.0" encoding="UTF-8" ?>
-
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
- ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<!-- The additional configuration elements of the JBoss portlet container.
-
-<!DOCTYPE portlet-app PUBLIC
- "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
--->
-
-<!--
-The remotable element is used to configure the default behavior of the portlets with
-respect to WSRP exposure.
-
-For each portlet defined in portlet.xml, it is possible to configure specific
-settings of the portlet container.
-
-It is also possible to inject services in the portlet context of the application
-using the service elements.
--->
-<!ELEMENT portlet-app (remotable?,portlet*,service*)>
-
-<!--
-Additional configuration for a portlet.
-
-The portlet-name defines the name of the portlet. It must match a portlet defined already
-in portlet.xml of the same web application.
-
-The remotable element configures the portlet exposure to WSRP. If no value is present
-then the value considered is either the value defined globally at the portlet
-application level or false.
-
-The trans-attribute value specifies the behavior of the portlet when it is invoked at
-runtime with respect to the transactionnal context. According to how the portlet is
-invoked a transaction may exist or not before the portlet is invoked. Usually in the
-local context the portal transaction could be present. By default the value considered is
- NotSupported which means that the portal transaction will be suspended for the duration
- of the portlet invocation.
-
-Example:
-
-<portlet>
- <portlet-name>MyPortlet</portlet-name>
- <remotable>true</remotable>
- <trans-attribute>Required</trans-attribute>
-</portlet>
-
--->
-<!ELEMENT portlet (portlet-name,remotable?,ajax?,session-config?,transaction?,
- header-content?,portlet-info?)>
-
-<!--
-The portlet name.
--->
-<!ELEMENT portlet-name (#PCDATA)>
-
-<!--
-The remotable value is used for WSRP exposure. The accepted values are the
-litterals true of false.
--->
-<!ELEMENT remotable (#PCDATA)>
-
-<!--
-The ajax tag allows to configure the ajax capabilities of the portlet. If
-the portlet is tagged as partial-refresh then the portal may use partial page
-refreshing and render only that portlet. If the portlet partial-refresh value
-is false, then the portal will perform a full page refresh when the portlet is refreshed.
--->
-<!ELEMENT ajax (partial-refresh)>
-
-<!--
-The authorized values for the partial-refresh element are true or false.
--->
-<!ELEMENT partial-refresh (#PCDATA)>
-
-<!--
-Additional portlet information
--->
-<!ELEMENT portlet-info (icon?)>
-
-<!--
-Defines icons for the portlet, they can be used by the administration portlet
-to represent a particular portlet.
--->
-<!ELEMENT icon (small-icon?, large-icon?)>
-
-<!--
-A small icon image, usually 16x16, gif, jpg and png are usually supported.
-An absolute URL or a URL starting with a '/' in the context of the webapp are accepted:
-eg. http://www.example.com/images/smallIcon.png
-eg. /images/smallIcon.png
--->
-<!ELEMENT small-icon (#PCDATA)>
-
-<!--
-A large icon image, usually 32x32, gif, jpg and png are usually supported.
-An absolute URL or a URL starting with a '/' in the context of the webapp are accepted:
-eg. http://www.example.com/images/smallIcon.png
-eg. /images/smallIcon.png
--->
-<!ELEMENT large-icon (#PCDATA)>
-
-<!--
-This element configure the portlet session of the portlet.
-
-The distributed element instructs the container to distribute the session attributes
-using the portal session replication. It applies only to local portlets are not to
-remote portlets. The default value is false.
-
-Example:
-
-<session-config>
- <distributed>true</distributed>
-</session-config>
-
--->
-<!ELEMENT session-config (distributed)>
-
-<!--
-The authorized values for the distributed element are true or false.
--->
-<!ELEMENT distributed (#PCDATA)>
-
-<!--
-Defines how the portlet behaves with the transactionnal context. The default value
-is Never.
-
-Example:
-
-<transaction>
- <trans-attribute>Required</transaction>
-<transaction>
--->
-<!ELEMENT transaction (trans-attribute)>
-
-<!--
-The trans-attribute value defines the transactionnal behavior. The accepted values
-are Required, Mandatory, Never, Supports, NotSupported and RequiresNew.
--->
-<!ELEMENT trans-attribute (#PCDATA)>
-
-<!--
-Specify content which should be included in the portal aggregated page when the portlet
-is present on that page. This setting only applies when the portlet is used in the local mode.
--->
-<!ELEMENT header-content (link|script|meta)*>
-
-<!--
-Creates a header markup element for linked resources,
-see http://www.w3.org/TR/html401/struct/links.html#h-12.3
-
-At runtime the href attribute value will be prefixed with the context path
-of the web application.
-
-Example:
-
-<link rel="stylesheet" type="text/css" href="/style.css" media="screen"/>
-
-will produce at runtime the following markup
-
-<link rel="stylesheet" type="text/css" href="/my-web-application/style.css" media="screen"/>
--->
-<!ATTLIST link
- href CDATA #IMPLIED
- rel CDATA #IMPLIED
- type CDATA #IMPLIED
- media CDATA #IMPLIED
- title CDATA #IMPLIED>
-
-<!--
-No content is allowed inside an link element.
--->
-<!ELEMENT link EMPTY>
-
-<!--
-Creates a header markup for scripting,
-see http://www.w3.org/TR/html401/interact/scripts.html
-
-At runtime the src attribute value will be prefixed with the context path
-of the web application.
-
-Example 1:
-
-<script type="text/javascript" src="/myscript.js"></script>
-
-will produce at runtime the following markup
-
-<script type="text/javascript" src="/my-web-application/myscript.js"></script>
-
-Example 2:
-
-<script type="text/javascript">
- function hello() {
- alert('Hello');
- }
-</script>
--->
-<!ATTLIST script
- src CDATA #IMPLIED
- type CDATA #IMPLIED
- language CDATA #IMPLIED>
-
-<!--
-The script header element can contain inline script definitions.
--->
-<!ELEMENT script (#PCDATA)>
-
-<!--
-Creates a header markup for adding meta data to a page,
-see http://www.w3.org/TR/html401/struct/global.html#h-7.4.4
-
-Example:
-
-<meta name="keywords" content="jboss, portal, redhat"/>
--->
-<!ATTLIST meta
- name CDATA #REQUIRED
- content CDATA #REQUIRED>
-
-<!--
-No content is allowed for meta element.
--->
-<!ELEMENT meta EMPTY>
-
-<!--
-Declare a service that will be injected by the portlet container as an
-attribute of the portlet context.
-
-Example:
-
-<service>
- <service-name>UserModule</service-name>
- <service-class>org.jboss.portal.identity.UserModule</service-class>
- <service-ref>:service=Module,type=User</service-ref>
-</service>
-
-In the portlet it is then possible to use it by doing a lookup on the service
-name, for example in the init() lifecycle method :
-
-public void init()
-{
- UserModule userModule = (UserModule)getPortletContext().getAttribute("UserModule");
-}
-
--->
-<!ELEMENT service (service-name,service-class,service-ref)>
-
-<!--
-The service name that will be used to bind the service as a portlet context attribute.
--->
-<!ELEMENT service-name (#PCDATA)>
-
-<!--
-The full qualified name of the interface that the service implements.
--->
-<!ELEMENT service-class (#PCDATA)>
-
-<!--
-The reference to the service. In the JMX Microkernel environment it consist of the JMX
-name of the service MBean. For an MBean reference if the domain is left out, then the
-current domain of the portal will be used.
--->
-<!ELEMENT service-ref (#PCDATA)>
-
-
-]]></programlisting>
- </para>
-</appendix>
-</book>
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Ajax.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Ajax.xml 2008-11-13 08:10:07 UTC (rev 12290)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Ajax.xml 2008-11-13 21:49:37 UTC (rev 12291)
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "JBoss_Portal_Reference_Guide.ent">
+%BOOK_ENTITIES;
]>
<chapter id="ajax">
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Authentication.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Authentication.xml 2008-11-13 08:10:07 UTC (rev 12290)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Authentication.xml 2008-11-13 21:49:37 UTC (rev 12291)
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "JBoss_Portal_Reference_Guide.ent">
+%BOOK_ENTITIES;
]>
<chapter id="authentication">
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Author_Group.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Author_Group.xml 2008-11-13 08:10:07 UTC (rev 12290)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Author_Group.xml 2008-11-13 21:49:37 UTC (rev 12291)
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE authorgroup PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "JBoss_Portal_Reference_Guide.ent">
+%BOOK_ENTITIES;
]>
<authorgroup>
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Book_Info.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Book_Info.xml 2008-11-13 08:10:07 UTC (rev 12290)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Book_Info.xml 2008-11-13 21:49:37 UTC (rev 12291)
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE bookinfo PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "JBoss_Portal_Reference_Guide.ent">
+%BOOK_ENTITIES;
]>
<bookinfo id="JBoss_Portal_Reference_Guide">
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/CMS_Portlet.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/CMS_Portlet.xml 2008-11-13 08:10:07 UTC (rev 12290)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/CMS_Portlet.xml 2008-11-13 21:49:37 UTC (rev 12291)
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "JBoss_Portal_Reference_Guide.ent">
+%BOOK_ENTITIES;
]>
<chapter id="cmsPortlet">
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Clustering.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Clustering.xml 2008-11-13 08:10:07 UTC (rev 12290)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Clustering.xml 2008-11-13 21:49:37 UTC (rev 12291)
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "JBoss_Portal_Reference_Guide.ent">
+%BOOK_ENTITIES;
]>
<chapter id="clustering">
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Common_Content/Conventions.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Common_Content/Conventions.xml 2008-11-13 08:10:07 UTC (rev 12290)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Common_Content/Conventions.xml 2008-11-13 21:49:37 UTC (rev 12291)
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "../JBoss_Portal_Reference_Guide.ent">
+%BOOK_ENTITIES;
]>
<section>
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Common_Content/Feedback.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Common_Content/Feedback.xml 2008-11-13 08:10:07 UTC (rev 12290)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Common_Content/Feedback.xml 2008-11-13 21:49:37 UTC (rev 12291)
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "../JBoss_Portal_Reference_Guide.ent">
+%BOOK_ENTITIES;
]>
<section>
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Common_Content/Legal_Notice.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Common_Content/Legal_Notice.xml 2008-11-13 08:10:07 UTC (rev 12290)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Common_Content/Legal_Notice.xml 2008-11-13 21:49:37 UTC (rev 12291)
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE legalnotice PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "../JBoss_Portal_Reference_Guide.ent">
+%BOOK_ENTITIES;
]>
<legalnotice>
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Configuration.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Configuration.xml 2008-11-13 08:10:07 UTC (rev 12290)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Configuration.xml 2008-11-13 21:49:37 UTC (rev 12291)
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "JBoss_Portal_Reference_Guide.ent">
+%BOOK_ENTITIES;
]>
<chapter id="configuration">
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Content_Integration.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Content_Integration.xml 2008-11-13 08:10:07 UTC (rev 12290)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Content_Integration.xml 2008-11-13 21:49:37 UTC (rev 12291)
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "JBoss_Portal_Reference_Guide.ent">
+%BOOK_ENTITIES;
]>
<chapter id="contentintegration">
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Coordination.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Coordination.xml 2008-11-13 08:10:07 UTC (rev 12290)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Coordination.xml 2008-11-13 21:49:37 UTC (rev 12291)
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "JBoss_Portal_Reference_Guide.ent">
+%BOOK_ENTITIES;
]>
<chapter id="coordination">
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Error_Handling.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Error_Handling.xml 2008-11-13 08:10:07 UTC (rev 12290)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Error_Handling.xml 2008-11-13 21:49:37 UTC (rev 12291)
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "JBoss_Portal_Reference_Guide.ent">
+%BOOK_ENTITIES;
]>
<chapter id="errorhandling">
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Identity.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Identity.xml 2008-11-13 08:10:07 UTC (rev 12290)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Identity.xml 2008-11-13 21:49:37 UTC (rev 12291)
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "JBoss_Portal_Reference_Guide.ent">
+%BOOK_ENTITIES;
]>
<chapter id="identity">
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Identity_Portlets.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Identity_Portlets.xml 2008-11-13 08:10:07 UTC (rev 12290)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Identity_Portlets.xml 2008-11-13 21:49:37 UTC (rev 12291)
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "JBoss_Portal_Reference_Guide.ent">
+%BOOK_ENTITIES;
]>
<chapter id="identityportlets">
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Installation.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Installation.xml 2008-11-13 08:10:07 UTC (rev 12290)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Installation.xml 2008-11-13 21:49:37 UTC (rev 12291)
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "JBoss_Portal_Reference_Guide.ent">
+%BOOK_ENTITIES;
]>
<chapter id="installation">
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/JBoss_Portal_Reference_Guide.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/JBoss_Portal_Reference_Guide.xml 2008-11-13 08:10:07 UTC (rev 12290)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/JBoss_Portal_Reference_Guide.xml 2008-11-13 21:49:37 UTC (rev 12291)
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "JBoss_Portal_Reference_Guide.ent">
+%BOOK_ENTITIES;
]>
<book id="jboss_portal_reference_guide">
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Jboss_Portlet_DTD.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Jboss_Portlet_DTD.xml 2008-11-13 08:10:07 UTC (rev 12290)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Jboss_Portlet_DTD.xml 2008-11-13 21:49:37 UTC (rev 12291)
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "JBoss_Portal_Reference_Guide.ent">
+%BOOK_ENTITIES;
]>
<appendix id="jbossPortletDTD">
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Ldap.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Ldap.xml 2008-11-13 08:10:07 UTC (rev 12290)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Ldap.xml 2008-11-13 21:49:37 UTC (rev 12291)
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "JBoss_Portal_Reference_Guide.ent">
+%BOOK_ENTITIES;
]>
<chapter id="ldap">
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Migration.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Migration.xml 2008-11-13 08:10:07 UTC (rev 12290)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Migration.xml 2008-11-13 21:49:37 UTC (rev 12291)
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "JBoss_Portal_Reference_Guide.ent">
+%BOOK_ENTITIES;
]>
<chapter id="changelog">
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Nav_Tabs.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Nav_Tabs.xml 2008-11-13 08:10:07 UTC (rev 12290)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Nav_Tabs.xml 2008-11-13 21:49:37 UTC (rev 12291)
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "JBoss_Portal_Reference_Guide.ent">
+%BOOK_ENTITIES;
]>
<chapter id="navtabs">
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Portal_API.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Portal_API.xml 2008-11-13 08:10:07 UTC (rev 12290)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Portal_API.xml 2008-11-13 21:49:37 UTC (rev 12291)
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "JBoss_Portal_Reference_Guide.ent">
+%BOOK_ENTITIES;
]>
<chapter id="portal_api">
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Portal_Objects_DTD.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Portal_Objects_DTD.xml 2008-11-13 08:10:07 UTC (rev 12290)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Portal_Objects_DTD.xml 2008-11-13 21:49:37 UTC (rev 12291)
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "JBoss_Portal_Reference_Guide.ent">
+%BOOK_ENTITIES;
]>
<appendix id="portalObjectsDTD">
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Portlet_Instances_DTD.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Portlet_Instances_DTD.xml 2008-11-13 08:10:07 UTC (rev 12290)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Portlet_Instances_DTD.xml 2008-11-13 21:49:37 UTC (rev 12291)
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "JBoss_Portal_Reference_Guide.ent">
+%BOOK_ENTITIES;
]>
<appendix id="portletInstancesDTD">
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Portlet_Modes.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Portlet_Modes.xml 2008-11-13 08:10:07 UTC (rev 12290)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Portlet_Modes.xml 2008-11-13 21:49:37 UTC (rev 12291)
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "JBoss_Portal_Reference_Guide.ent">
+%BOOK_ENTITIES;
]>
<chapter id="portletmodes">
15 years, 6 months
JBoss Portal SVN: r12290 - in modules/authorization/trunk: PAP/src/main/java/org/jboss/security/authz/pap/hierarchial and 3 other directories.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2008-11-13 03:10:07 -0500 (Thu, 13 Nov 2008)
New Revision: 12290
Modified:
modules/authorization/trunk/PAP/pom.xml
modules/authorization/trunk/PAP/src/main/java/org/jboss/security/authz/pap/hierarchial/HierarchialPolicy.java
modules/authorization/trunk/PAP/src/main/java/org/jboss/security/authz/pap/service/FileSystemWebTierPolicyManager.java
modules/authorization/trunk/PAP/src/test/java/org/jboss/security/authz/pap/service/TestWebTierPolicyManager.java
modules/authorization/trunk/common/src/main/java/org/jboss/security/authz/xacml/AttributeDesignatorUtil.java
Log:
backing up some code
Modified: modules/authorization/trunk/PAP/pom.xml
===================================================================
--- modules/authorization/trunk/PAP/pom.xml 2008-11-12 23:51:15 UTC (rev 12289)
+++ modules/authorization/trunk/PAP/pom.xml 2008-11-13 08:10:07 UTC (rev 12290)
@@ -58,7 +58,8 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version>
<configuration>
- <includes>
+ <includes>
+ <include>**/TestWebTierPolicyManager.java</include>
</includes>
</configuration>
</plugin>
Modified: modules/authorization/trunk/PAP/src/main/java/org/jboss/security/authz/pap/hierarchial/HierarchialPolicy.java
===================================================================
--- modules/authorization/trunk/PAP/src/main/java/org/jboss/security/authz/pap/hierarchial/HierarchialPolicy.java 2008-11-12 23:51:15 UTC (rev 12289)
+++ modules/authorization/trunk/PAP/src/main/java/org/jboss/security/authz/pap/hierarchial/HierarchialPolicy.java 2008-11-13 08:10:07 UTC (rev 12290)
@@ -128,11 +128,14 @@
}
//Process the Rule Target
- List<AttributeExpression> actionMatches = rule.getTarget().getActionMatches();
- if(actionMatches != null && !actionMatches.isEmpty())
+ if(rule.getTarget() != null)
{
- TargetType ruleTarget = this.generateRuleActions(actionMatches);
- ruleType.setTarget(ruleTarget);
+ List<AttributeExpression> actionMatches = rule.getTarget().getActionMatches();
+ if(actionMatches != null && !actionMatches.isEmpty())
+ {
+ TargetType ruleTarget = this.generateRuleActions(actionMatches);
+ ruleType.setTarget(ruleTarget);
+ }
}
//Process the Rule Expression/Condition
Modified: modules/authorization/trunk/PAP/src/main/java/org/jboss/security/authz/pap/service/FileSystemWebTierPolicyManager.java
===================================================================
--- modules/authorization/trunk/PAP/src/main/java/org/jboss/security/authz/pap/service/FileSystemWebTierPolicyManager.java 2008-11-12 23:51:15 UTC (rev 12289)
+++ modules/authorization/trunk/PAP/src/main/java/org/jboss/security/authz/pap/service/FileSystemWebTierPolicyManager.java 2008-11-13 08:10:07 UTC (rev 12290)
@@ -22,7 +22,29 @@
******************************************************************************/
package org.jboss.security.authz.pap.service;
+import java.io.InputStream;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.util.Set;
+import java.util.HashSet;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.DocumentBuilder;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import org.jboss.security.authz.model.Attribute;
+import org.jboss.security.authz.model.AttributeExpression;
+import org.jboss.security.authz.model.Effect;
+import org.jboss.security.authz.model.PolicyException;
import org.jboss.security.authz.model.Policy;
+import org.jboss.security.authz.model.Target;
+import org.jboss.security.authz.model.Rule;
+import org.jboss.security.authz.pap.hierarchial.HierarchialPolicy;
+import org.jboss.security.xacml.interfaces.XACMLConstants;
+import org.jboss.security.xacml.interfaces.XMLSchemaConstants;
/**
* The PolicyManager provides implementation for the Configuration related services of the PolicyManager. It extends the FileSystemPolicyManager in order to store the managed Policies
@@ -33,7 +55,7 @@
*
*/
public class FileSystemWebTierPolicyManager extends FileSystemPolicyManager
-{
+{
/**
*
*
@@ -50,8 +72,158 @@
* @param xmlConfiguration User Friendly XML configuration within the context of the Web Tier of an Application
* @return a Policy that can be represented in system level XACML format
*/
- public Policy generatePolicy(String xmlConfiguration)
+ public Policy generatePolicy(String xmlConfiguration) throws PolicyException
{
- return null;
- }
+ InputStream xmlStream = null;
+ try
+ {
+ Policy policy = null;
+
+ xmlStream = new ByteArrayInputStream(xmlConfiguration.getBytes());
+ DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ Document document = builder.parse(xmlStream);
+
+ Target target = this.parseTarget(document);
+
+ Set<Rule> rules = this.parseRules(document);
+
+ policy = new HierarchialPolicy(String.valueOf(this.getUniqueId()), target, rules);
+
+ return policy;
+ }
+ catch(Exception e)
+ {
+ throw new PolicyException(e);
+ }
+ finally
+ {
+ if(xmlStream != null)
+ {
+ try{xmlStream.close();}catch(IOException ioe){}
+ }
+ }
+ }
+ //XMLParsing----------------------------------------------------------------------------------------------------------------------------------------------------
+ private Target parseTarget(Document document) throws Exception
+ {
+ Target target = new Target();
+
+ Element resourceElem = (Element)document.getElementsByTagName("resource").item(0);
+ Element requestUriElem = (Element)resourceElem.getElementsByTagName("request-uri").item(0);
+
+ //Add RequestUri as a Resource To Match
+ String requestUri = requestUriElem.getTextContent();
+ AttributeExpression requestUriMatch = new AttributeExpression();
+ requestUriMatch.setFunctionId(XACMLConstants.FUNCTION_STRING_EQUAL);
+ Attribute attribute = new Attribute("request-uri",
+ XMLSchemaConstants.DATATYPE_STRING, requestUri);
+ requestUriMatch.setAttribute(attribute);
+ target.addResourceMatch(requestUriMatch);
+
+ //Process Parameters
+ NodeList parameters = resourceElem.getElementsByTagName("param");
+ for(int i=0; i<parameters.getLength(); i++)
+ {
+ Element parameter = (Element)parameters.item(i);
+
+ String name = ((Element)parameter.getElementsByTagName("name").item(0)).getTextContent();
+ String value = ((Element)parameter.getElementsByTagName("value").item(0)).getTextContent();
+
+ //Add Parameter as a Resource To Match
+ AttributeExpression paramMatch = new AttributeExpression();
+ paramMatch.setFunctionId(XACMLConstants.FUNCTION_STRING_EQUAL);
+ Attribute paramAttribute = new Attribute(name,
+ XMLSchemaConstants.DATATYPE_STRING, value);
+ paramMatch.setAttribute(paramAttribute);
+ target.addResourceMatch(paramMatch);
+ }
+
+ return target;
+ }
+
+ private Set<Rule> parseRules(Document document) throws Exception
+ {
+ Set<Rule> rules = new HashSet<Rule>();
+
+ NodeList conditionNodes = document.getElementsByTagName("condition");
+ for(int i=0; i<conditionNodes.getLength(); i++)
+ {
+ Element conditionElement = (Element)conditionNodes.item(i);
+
+ //Process Roles related conditions
+ NodeList roleNodes = conditionElement.getElementsByTagName("role-name");
+ if(roleNodes.getLength() >0)
+ {
+ rules.addAll(this.parseRoleRules(roleNodes));
+ }
+
+ //Process IP Ranges
+ NodeList ipNodes = conditionElement.getElementsByTagName("ip-range");
+ if(ipNodes.getLength() >0)
+ {
+ rules.addAll(this.parseIpRules(ipNodes));
+ }
+ }
+
+ return rules;
+ }
+
+ private Set<Rule> parseRoleRules(NodeList roleNodes)
+ {
+ Set<Rule> roleRules = new HashSet<Rule>();
+
+ for(int j=0; j<roleNodes.getLength(); j++)
+ {
+ Element roleNameElem = (Element)roleNodes.item(j);
+ String roleName = roleNameElem.getTextContent();
+
+ Rule roleRule = new Rule();
+ roleRule.setRuleId(String.valueOf(this.getUniqueId()));
+ roleRule.setEffect(Effect.PERMIT);
+
+ AttributeExpression roleExpression = new AttributeExpression();
+ roleExpression.setFunctionId(XACMLConstants.FUNCTION_STRING_EQUAL);
+ Attribute roleAttribute = new Attribute(XACMLConstants.ATTRIBUTEID_ROLE,
+ XMLSchemaConstants.DATATYPE_STRING, roleName);
+ roleExpression.setAttribute(roleAttribute);
+
+ roleRule.setExpression(roleExpression);
+
+ roleRules.add(roleRule);
+ }
+
+ return roleRules;
+ }
+
+ private Set<Rule> parseIpRules(NodeList ipNodes)
+ {
+ Set<Rule> ipRules = new HashSet<Rule>();
+
+ for(int j=0; j<ipNodes.getLength(); j++)
+ {
+ Element ipElem = (Element)ipNodes.item(j);
+ String ipRange = ipElem.getTextContent();
+
+ Rule rule = new Rule();
+ rule.setRuleId(String.valueOf(this.getUniqueId()));
+ rule.setEffect(Effect.PERMIT);
+
+ AttributeExpression expression = new AttributeExpression();
+ expression.setFunctionId(XACMLConstants.FUNCTION_REGEXP_IPADDRESS_MATCH);
+ Attribute attribute = new Attribute(XACMLConstants.ATTRIBUTEID_IP_ADDRESS,
+ XMLSchemaConstants.DATATYPE_IPADDRESS, ipRange);
+ expression.setAttribute(attribute);
+
+ rule.setExpression(expression);
+
+ ipRules.add(rule);
+ }
+
+ return ipRules;
+ }
+
+ private synchronized long getUniqueId()
+ {
+ return System.currentTimeMillis();
+ }
}
Modified: modules/authorization/trunk/PAP/src/test/java/org/jboss/security/authz/pap/service/TestWebTierPolicyManager.java
===================================================================
--- modules/authorization/trunk/PAP/src/test/java/org/jboss/security/authz/pap/service/TestWebTierPolicyManager.java 2008-11-12 23:51:15 UTC (rev 12289)
+++ modules/authorization/trunk/PAP/src/test/java/org/jboss/security/authz/pap/service/TestWebTierPolicyManager.java 2008-11-13 08:10:07 UTC (rev 12290)
@@ -57,6 +57,10 @@
"<name>page</name>"+
"<value>marketing_index.html</value>"+
"</param>"+
+ "<param>"+
+ "<name>action</name>"+
+ "<value>update</value>"+
+ "</param>"+
"</params>"+
"</resource>"+
"<conditions>"+
@@ -71,8 +75,50 @@
"</web-acl>";
/**
+ * A complex developer-friendly web tier policy that specifies:
*
+ * "Only Root Portal User and Users in the Marketing Department of the organization must be allowed to Modify the Layout of the "Main Marketing Portal Page
+ * as long as they are Logged in from a range of allowed IP addresses
+ * "
+ *
+ * Notice: This configuration is not muddled by the vast low-level details of XACML Policy representation. That part is automated by the
+ * PAP (Policy Administration Point) Component of the Authorization System
*/
+ private static String complexWebTierPolicy = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+
+ "<web-acl>"+
+ "<acl-rule>"+
+ "<resource>"+
+ "<request-uri>/portal/admin-tool/modifyLayout</request-uri>"+
+ "<params>"+
+ "<param>"+
+ "<name>page</name>"+
+ "<value>marketing_index.html</value>"+
+ "</param>"+
+ "<param>"+
+ "<name>action</name>"+
+ "<value>update</value>"+
+ "</param>"+
+ "</params>"+
+ "</resource>"+
+ "<conditions>"+
+ "<condition>"+
+ "<roles>"+
+ "<role-name>Root-Admin</role-name>"+
+ "<role-name>Marketing Team</role-name>"+
+ "</roles>"+
+ "</condition>"+
+ "<condition>"+
+ "<ip-address>"+
+ "<ip-range>192.168.xxx.xxx</ip-range>"+
+ "</ip-address>"+
+ "</condition>"+
+ "</conditions>"+
+ "</acl-rule>"+
+ "</web-acl>";
+
+ /**
+ *
+ */
protected void setUp() throws Exception
{
}
@@ -82,17 +128,28 @@
{
}
- /**
- *
- * @throws Exception
- */
+
public void testSimpleWebTierPolicy() throws Exception
{
PolicyManager policyManager = new FileSystemWebTierPolicyManager();
Policy policy = policyManager.generatePolicy(simpleWebTierPolicy);
+ assertNotNull(policy);
+
log.info("------------------------------------------------------");
log.info(policy.generateXACMLPolicy());
log.info("------------------------------------------------------");
}
+
+ public void testComplexWebTierPolicy() throws Exception
+ {
+ PolicyManager policyManager = new FileSystemWebTierPolicyManager();
+ Policy policy = policyManager.generatePolicy(complexWebTierPolicy);
+
+ assertNotNull(policy);
+
+ log.info("------------------------------------------------------");
+ log.info(policy.generateXACMLPolicy());
+ log.info("------------------------------------------------------");
+ }
}
Modified: modules/authorization/trunk/common/src/main/java/org/jboss/security/authz/xacml/AttributeDesignatorUtil.java
===================================================================
--- modules/authorization/trunk/common/src/main/java/org/jboss/security/authz/xacml/AttributeDesignatorUtil.java 2008-11-12 23:51:15 UTC (rev 12289)
+++ modules/authorization/trunk/common/src/main/java/org/jboss/security/authz/xacml/AttributeDesignatorUtil.java 2008-11-13 08:10:07 UTC (rev 12290)
@@ -50,7 +50,8 @@
String uri = attribute.getUri();
//TODO: add all the conditions to detect a Subject Attribute
- if(uri.equals(XACMLConstants.ATTRIBUTEID_ROLE)
+ if(uri.equals(XACMLConstants.ATTRIBUTEID_ROLE) ||
+ uri.equals(XACMLConstants.ATTRIBUTEID_IP_ADDRESS)
)
{
attributeDesignator = PolicyAttributeFactory.createSubjectAttributeDesignatorType(attribute.getUri(),
15 years, 6 months
JBoss Portal SVN: r12289 - in docs/enterprise/trunk/Reference_Guide: en-US and 3 other directories.
by portal-commits@lists.jboss.org
Author: skittoli(a)redhat.com
Date: 2008-11-12 18:51:15 -0500 (Wed, 12 Nov 2008)
New Revision: 12289
Modified:
docs/enterprise/trunk/Reference_Guide/en-US/resolved.xml
docs/enterprise/trunk/Reference_Guide/pom.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Book_Info.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Common_Content/Feedback.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Common_Content/Legal_Notice.xml
docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml_tmp/Book_Info.xml
Log:
updates
Modified: docs/enterprise/trunk/Reference_Guide/en-US/resolved.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/resolved.xml 2008-11-12 22:44:10 UTC (rev 12288)
+++ docs/enterprise/trunk/Reference_Guide/en-US/resolved.xml 2008-11-12 23:51:15 UTC (rev 12289)
@@ -0,0 +1,17450 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.docbook.org/xml/4.5/docbookx.dtd" [
+<!ENTITY uArr "⇑">
+<!ENTITY hcirc "ĥ">
+<!ENTITY icirc "î">
+<!ENTITY equals "=">
+<!ENTITY cong "≅">
+<!ENTITY icy "и">
+<!ENTITY HARDcy "Ъ">
+<!ENTITY Ecaron "Ě">
+<!ENTITY clubs "♣">
+<!ENTITY phmmat "ℳ">
+<!ENTITY sqcap "⊓">
+<!ENTITY thorn "þ">
+<!ENTITY Lcedil "Ļ">
+<!ENTITY verbar "|">
+<!ENTITY rarr "→">
+<!ENTITY cire "≗">
+<!ENTITY DZcy "Џ">
+<!ENTITY b.delta "δ">
+<!ENTITY Gcirc "Ĝ">
+<!ENTITY ocir "⊚">
+<!ENTITY circ "^">
+<!ENTITY Igr "Ι">
+<!ENTITY udigr "ϋ">
+<!ENTITY prime "′">
+<!ENTITY npr "⊀">
+<!ENTITY b.pi "π">
+<!ENTITY frac58 "⅝">
+<!ENTITY ldquor "„">
+<!ENTITY sqsup "⊐">
+<!ENTITY boxDR "╒">
+<!ENTITY kcedil "ķ">
+<!ENTITY vDash "⊨">
+<!ENTITY Scedil "Ş">
+<!ENTITY perp "⊥">
+<!ENTITY b.Gamma "Γ">
+<!ENTITY b.kappa "κ">
+<!ENTITY Uuml "Ü">
+<!ENTITY mnplus "∓">
+<!ENTITY nearr "↗">
+<!ENTITY nrtri "⋫">
+<!ENTITY cupre "≼">
+<!ENTITY boxV "║">
+<!ENTITY Zdot "Ż">
+<!ENTITY pound "£">
+<!ENTITY lharu "↼">
+<!ENTITY boxdr "┌">
+<!ENTITY ocy "о">
+<!ENTITY xgr "ξ">
+<!ENTITY b.xi "ξ">
+<!ENTITY middot "·">
+<!ENTITY larr "←">
+<!ENTITY xrArr "⇒">
+<!ENTITY Ncy "Н">
+<!ENTITY acute "´">
+<!ENTITY phis "φ">
+<!ENTITY ncedil "ņ">
+<!ENTITY lAarr "⇚">
+<!ENTITY sqsube "⊑">
+<!ENTITY quot '"'>
+<!ENTITY TSHcy "Ћ">
+<!ENTITY amacr "ā">
+<!ENTITY otimes "⊗">
+<!ENTITY inodot "ı">
+<!ENTITY gsdot "⋗">
+<!ENTITY LJcy "Љ">
+<!ENTITY phiv "ϕ">
+<!ENTITY odblac "ő">
+<!ENTITY filig "fi">
+<!ENTITY amalg "∐">
+<!ENTITY sdotb "⊡">
+<!ENTITY boxDL "╕">
+<!ENTITY Theta "Θ">
+<!ENTITY cdot "ċ">
+<!ENTITY ordm "º">
+<!ENTITY atilde "ã">
+<!ENTITY squf "▪">
+<!ENTITY notin "∉">
+<!ENTITY nmid "∤">
+<!ENTITY shchcy "щ">
+<!ENTITY lfloor "⌊">
+<!ENTITY Xi "Ξ">
+<!ENTITY Hstrok "Ħ">
+<!ENTITY period ".">
+<!ENTITY numsp " ">
+<!ENTITY nldr "‥">
+<!ENTITY boxdl "┐">
+<!ENTITY Fcy "Ф">
+<!ENTITY tscy "ц">
+<!ENTITY Iukcy "І">
+<!ENTITY cross "✗">
+<!ENTITY ohgr "ω">
+<!ENTITY nbsp " ">
+<!ENTITY ni "∍">
+<!ENTITY comp "∁">
+<!ENTITY boxH "═">
+<!ENTITY b.Delta "Δ">
+<!ENTITY Oslash "Ø">
+<!ENTITY ndash "–">
+<!ENTITY marker "▮">
+<!ENTITY ordf "ª">
+<!ENTITY nsce "⋡">
+<!ENTITY vrtri "⊳">
+<!ENTITY ubrcy "ў">
+<!ENTITY Ccirc "Ĉ">
+<!ENTITY quest "?">
+<!ENTITY ne "≠">
+<!ENTITY gap "≳">
+<!ENTITY efDot "≒">
+<!ENTITY rcy "р">
+<!ENTITY bsim "∽">
+<!ENTITY bgr "β">
+<!ENTITY omacr "ō">
+<!ENTITY umacr "ū">
+<!ENTITY lpar "(">
+<!ENTITY uharl "↿">
+<!ENTITY Gcy "Г">
+<!ENTITY ast "*">
+<!ENTITY acy "а">
+<!ENTITY thetas "θ">
+<!ENTITY uring "ů">
+<!ENTITY Zcaron "Ž">
+<!ENTITY horbar "―">
+<!ENTITY star "⋆">
+<!ENTITY timesb "⊠">
+<!ENTITY npre "⋠">
+<!ENTITY real "ℜ">
+<!ENTITY nrArr "⇏">
+<!ENTITY dlarr "↙">
+<!ENTITY oplus "⊕">
+<!ENTITY Xgr "Ξ">
+<!ENTITY ucy "у">
+<!ENTITY thetav "ϑ">
+<!ENTITY jcirc "ĵ">
+<!ENTITY uharr "↾">
+<!ENTITY mgr "μ">
+<!ENTITY hearts "♥">
+<!ENTITY nvDash "⊭">
+<!ENTITY yicy "ї">
+<!ENTITY dot "˙">
+<!ENTITY alpha "α">
+<!ENTITY wedgeq "≙">
+<!ENTITY bowtie "⋈">
+<!ENTITY boxDr "╓">
+<!ENTITY b.upsi "υ">
+<!ENTITY euml "ë">
+<!ENTITY vArr "⇕">
+<!ENTITY lgr "λ">
+<!ENTITY b.rhov "ϱ">
+<!ENTITY ubreve "ŭ">
+<!ENTITY copysr "℗">
+<!ENTITY cap "∩">
+<!ENTITY aogon "ą">
+<!ENTITY racute "ŕ">
+<!ENTITY rthree "⋌">
+<!ENTITY Sgr "Σ">
+<!ENTITY uacute "ú">
+<!ENTITY Tcaron "Ť">
+<!ENTITY dagger "†">
+<!ENTITY oast "⊛">
+<!ENTITY prnE "">
+<!ENTITY thkap "≈">
+<!ENTITY boxdR "╔">
+<!ENTITY dgr "δ">
+<!ENTITY nacute "ń">
+<!ENTITY hardcy "ъ">
+<!ENTITY sqsupe "⊒">
+<!ENTITY TScy "Ц">
+<!ENTITY reg "®">
+<!ENTITY cir "○">
+<!ENTITY lsquor "‚">
+<!ENTITY ycy "ы">
+<!ENTITY Sigma "Σ">
+<!ENTITY Gbreve "Ğ">
+<!ENTITY order "ℴ">
+<!ENTITY nlarr "↚">
+<!ENTITY eng "ŋ">
+<!ENTITY sacute "ś">
+<!ENTITY ensp " ">
+<!ENTITY rarr2 "⇉">
+<!ENTITY coprod "∐">
+<!ENTITY iacgr "ί">
+<!ENTITY b.piv "ϖ">
+<!ENTITY rlhar2 "⇌">
+<!ENTITY boxDl "╗">
+<!ENTITY Pcy "П">
+<!ENTITY Dagger "‡">
+<!ENTITY khcy "х">
+<!ENTITY sigma "σ">
+<!ENTITY nltrie "⋬">
+<!ENTITY gjcy "ѓ">
+<!ENTITY b.alpha "α">
+<!ENTITY plusmn "±">
+<!ENTITY scnap "⋩">
+<!ENTITY vprime "′">
+<!ENTITY iota "ι">
+<!ENTITY Dcaron "Ď">
+<!ENTITY emsp " ">
+<!ENTITY trie "≜">
+<!ENTITY boxdL "╖">
+<!ENTITY cacute "ć">
+<!ENTITY rcedil "ŗ">
+<!ENTITY lhblk "▄">
+<!ENTITY lnsim "⋦">
+<!ENTITY bsime "⋍">
+<!ENTITY Vvdash "⊪">
+<!ENTITY zgr "ζ">
+<!ENTITY Ncaron "Ň">
+<!ENTITY rcaron "ř">
+<!ENTITY radic "√">
+<!ENTITY colone "≔">
+<!ENTITY Ucy "У">
+<!ENTITY lcub "{">
+<!ENTITY mdash "—">
+<!ENTITY ogon "˛">
+<!ENTITY Lgr "Λ">
+<!ENTITY b.chi "χ">
+<!ENTITY Barwed "⌆">
+<!ENTITY odot "⊙">
+<!ENTITY softcy "ь">
+<!ENTITY yucy "ю">
+<!ENTITY Ogr "Ο">
+<!ENTITY ecirc "ê">
+<!ENTITY Uacute "Ú">
+<!ENTITY jcy "й">
+<!ENTITY Oacgr "Ό">
+<!ENTITY ntilde "ñ">
+<!ENTITY Uring "Ů">
+<!ENTITY Udigr "Ϋ">
+<!ENTITY squ "□">
+<!ENTITY image "ℑ">
+<!ENTITY Uacgr "Ύ">
+<!ENTITY uarr "↑">
+<!ENTITY sim "∼">
+<!ENTITY egr "ε">
+<!ENTITY aleph "ℵ">
+<!ENTITY nharr "↮">
+<!ENTITY kcy "к">
+<!ENTITY Rgr "Ρ">
+<!ENTITY ffilig "ffi">
+<!ENTITY boxvl "┤">
+<!ENTITY Iacgr "Ί">
+<!ENTITY ang90 "∟">
+<!ENTITY nrarr "↛">
+<!ENTITY nges "≱">
+<!ENTITY nsube "⊈">
+<!ENTITY nsup "⊅">
+<!ENTITY egs "⋝">
+<!ENTITY acirc "â">
+<!ENTITY Yuml "Ÿ">
+<!ENTITY ltrif "◂">
+<!ENTITY lagran "ℒ">
+<!ENTITY npar "∦">
+<!ENTITY scsim "≿">
+<!ENTITY boxvr "├">
+<!ENTITY Acirc "Â">
+<!ENTITY Ucirc "Û">
+<!ENTITY zcaron "ž">
+<!ENTITY shy "">
+<!ENTITY ominus "⊖">
+<!ENTITY frac38 "⅜">
+<!ENTITY incare "℅">
+<!ENTITY uhblk "▀">
+<!ENTITY lEg "⋚">
+<!ENTITY gcy "г">
+<!ENTITY b.eta "η">
+<!ENTITY lnap "">
+<!ENTITY Iacute "Í">
+<!ENTITY yacute "ý">
+<!ENTITY dstrok "đ">
+<!ENTITY Imacr "Ī">
+<!ENTITY orarr "↻">
+<!ENTITY Eacgr "Έ">
+<!ENTITY apos "'">
+<!ENTITY b.epsiv "ε">
+<!ENTITY gcirc "ĝ">
+<!ENTITY udblac "ű">
+<!ENTITY planck "ℏ">
+<!ENTITY upsi "υ">
+<!ENTITY b.Lambda "Λ">
+<!ENTITY Bgr "Β">
+<!ENTITY scedil "ş">
+<!ENTITY Rarr "↠">
+<!ENTITY nrtrie "⋭">
+<!ENTITY nsub "⊄">
+<!ENTITY vcy "в">
+<!ENTITY b.epsis "ε">
+<!ENTITY Eacute "É">
+<!ENTITY boxvh "┼">
+<!ENTITY dcy "д">
+<!ENTITY Aring "Å">
+<!ENTITY Igrave "Ì">
+<!ENTITY utilde "ũ">
+<!ENTITY divonx "⋇">
+<!ENTITY lne "≨">
+<!ENTITY scnE "">
+<!ENTITY ccedil "ç">
+<!ENTITY supne "⊋">
+<!ENTITY empty "∅">
+<!ENTITY b.nu "ν">
+<!ENTITY top "⊤">
+<!ENTITY lcy "л">
+<!ENTITY b.gamma "γ">
+<!ENTITY aelig "æ">
+<!ENTITY iuml "ï">
+<!ENTITY Lcaron "Ľ">
+<!ENTITY bottom "⊥">
+<!ENTITY rarrhk "↪">
+<!ENTITY DScy "Ѕ">
+<!ENTITY idiagr "ΐ">
+<!ENTITY imacr "ī">
+<!ENTITY ltri "◃">
+<!ENTITY infin "∞">
+<!ENTITY le "≤">
+<!ENTITY sime "≃">
+<!ENTITY kappa "κ">
+<!ENTITY kappav "ϰ">
+<!ENTITY OElig "Œ">
+<!ENTITY urcrop "⌎">
+<!ENTITY darr2 "⇊">
+<!ENTITY lg "≶">
+<!ENTITY spar "∥">
+<!ENTITY Mgr "Μ">
+<!ENTITY rtri "▹">
+<!ENTITY daleth "ℸ">
+<!ENTITY sfrown "⌢">
+<!ENTITY epsiv "ε">
+<!ENTITY Omega "Ω">
+<!ENTITY colon ":">
+<!ENTITY prop "∝">
+<!ENTITY lArr "⇐">
+<!ENTITY Upsi "ϒ">
+<!ENTITY oslash "ø">
+<!ENTITY ap "≈">
+<!ENTITY Sup "⋑">
+<!ENTITY epsis "∊">
+<!ENTITY b.omega "ω">
+<!ENTITY rpar ")">
+<!ENTITY Abreve "Ă">
+<!ENTITY mldr "…">
+<!ENTITY ltrie "⊴">
+<!ENTITY Psi "Ψ">
+<!ENTITY Agrave "À">
+<!ENTITY Tcedil "Ţ">
+<!ENTITY auml "ä">
+<!ENTITY lcedil "ļ">
+<!ENTITY scirc "ŝ">
+<!ENTITY larrhk "↩">
+<!ENTITY varr "↕">
+<!ENTITY ncong "≇">
+<!ENTITY subE "⊆">
+<!ENTITY kjcy "ќ">
+<!ENTITY larr2 "⇇">
+<!ENTITY rsh "↱">
+<!ENTITY sdot "⋅">
+<!ENTITY wreath "≀">
+<!ENTITY cuepr "⋞">
+<!ENTITY frown "⌢">
+<!ENTITY Agr "Α">
+<!ENTITY uacgr "ύ">
+<!ENTITY rcub "}">
+<!ENTITY dharl "⇃">
+<!ENTITY bcy "б">
+<!ENTITY Tgr "Τ">
+<!ENTITY diam "⋄">
+<!ENTITY eacute "é">
+<!ENTITY xlArr "⇐">
+<!ENTITY leg "⋚">
+<!ENTITY boxvL "╡">
+<!ENTITY Kcy "К">
+<!ENTITY ncy "н">
+<!ENTITY sgr "σ">
+<!ENTITY beta "β">
+<!ENTITY exist "∃">
+<!ENTITY bprime "‵">
+<!ENTITY boxul "┘">
+<!ENTITY Zcy "З">
+<!ENTITY Iuml "Ï">
+<!ENTITY Scaron "Š">
+<!ENTITY sol "/">
+<!ENTITY boxvR "╞">
+<!ENTITY fcy "ф">
+<!ENTITY Egrave "È">
+<!ENTITY Utilde "Ũ">
+<!ENTITY lthree "⋋">
+<!ENTITY boxur "└">
+<!ENTITY dharr "⇂">
+<!ENTITY uarr2 "⇈">
+<!ENTITY lacute "ĺ">
+<!ENTITY spades "♠">
+<!ENTITY int "∫">
+<!ENTITY rect "▭">
+<!ENTITY compfn "∘">
+<!ENTITY b.sigma "σ">
+<!ENTITY Amacr "Ā">
+<!ENTITY prod "∏">
+<!ENTITY rpargt "">
+<!ENTITY b.sigmav "ς">
+<!ENTITY excl "!">
+<!ENTITY fnof "ƒ">
+<!ENTITY beth "ℶ">
+<!ENTITY yuml "ÿ">
+<!ENTITY rsquo "’">
+<!ENTITY pr "≺">
+<!ENTITY ccaron "č">
+<!ENTITY hyphen "-">
+<!ENTITY weierp "℘">
+<!ENTITY smile "⌣">
+<!ENTITY Egr "Ε">
+<!ENTITY eeacgr "ή">
+<!ENTITY nsc "⊁">
+<!ENTITY les "≤">
+<!ENTITY boxvH "╪">
+<!ENTITY KHcy "Х">
+<!ENTITY bernou "ℬ">
+<!ENTITY tgr "τ">
+<!ENTITY zacute "ź">
+<!ENTITY amp "&">
+<!ENTITY lnE "≨">
+<!ENTITY nlE "≰">
+<!ENTITY sbsol "﹨">
+<!ENTITY Pi "Π">
+<!ENTITY b.beta "β">
+<!ENTITY b.mu "μ">
+<!ENTITY Ograve "Ò">
+<!ENTITY phone "☎">
+<!ENTITY iff "⇔">
+<!ENTITY gsim "≳">
+<!ENTITY rx "℞">
+<!ENTITY there4 "∴">
+<!ENTITY harrw "↭">
+<!ENTITY udiagr "ΰ">
+<!ENTITY otilde "õ">
+<!ENTITY DotDot "⃜">
+<!ENTITY lrhar2 "⇋">
+<!ENTITY lE "≦">
+<!ENTITY hstrok "ħ">
+<!ENTITY Racute "Ŕ">
+<!ENTITY rarrw "↝">
+<!ENTITY angmsd "∡">
+<!ENTITY tshcy "ћ">
+<!ENTITY szlig "ß">
+<!ENTITY nequiv "≢">
+<!ENTITY pcy "п">
+<!ENTITY darr "↓">
+<!ENTITY female "♀">
+<!ENTITY curarr "↷">
+<!ENTITY minusb "⊟">
+<!ENTITY aacute "á">
+<!ENTITY Dcy "Д">
+<!ENTITY THORN "Þ">
+<!ENTITY ucirc "û">
+<!ENTITY asymp "≍">
+<!ENTITY bcong "≌">
+<!ENTITY die "¨">
+<!ENTITY ograve "ò">
+<!ENTITY iexcl "¡">
+<!ENTITY frac56 "⅚">
+<!ENTITY rArr "⇒">
+<!ENTITY tprime "‴">
+<!ENTITY osol "⊘">
+<!ENTITY sqsub "⊏">
+<!ENTITY rho "ρ">
+<!ENTITY b.psi "ψ">
+<!ENTITY aring "å">
+<!ENTITY Edot "Ė">
+<!ENTITY lcaron "ľ">
+<!ENTITY rlarr2 "⇄">
+<!ENTITY EEacgr "Ή">
+<!ENTITY pi "π">
+<!ENTITY sect "§">
+<!ENTITY bepsi "∍">
+<!ENTITY ffllig "ffl">
+<!ENTITY lsh "↰">
+<!ENTITY dscy "ѕ">
+<!ENTITY macr "¯">
+<!ENTITY b.kappav "ϰ">
+<!ENTITY scaron "š">
+<!ENTITY dollar "$">
+<!ENTITY commat "@">
+<!ENTITY angsph "∢">
+<!ENTITY Udblac "Ű">
+<!ENTITY copy "©">
+<!ENTITY comma ",">
+<!ENTITY diams "♦">
+<!ENTITY sube "⊆">
+<!ENTITY Dot "¨">
+<!ENTITY Cap "⋒">
+<!ENTITY nsmid "">
+<!ENTITY SOFTcy "Ь">
+<!ENTITY eegr "η">
+<!ENTITY lsim "≲">
+<!ENTITY ssmile "⌣">
+<!ENTITY nlt "≮">
+<!ENTITY boxHU "╨">
+<!ENTITY ZHcy "Ж">
+<!ENTITY abreve "ă">
+<!ENTITY lmidot "ŀ">
+<!ENTITY angst "Å">
+<!ENTITY b.lambda "λ">
+<!ENTITY uuml "ü">
+<!ENTITY IJlig "IJ">
+<!ENTITY ENG "Ŋ">
+<!ENTITY brvbar "¦">
+<!ENTITY esdot "≐">
+<!ENTITY boxuL "╝">
+<!ENTITY blk14 "░">
+<!ENTITY YAcy "Я">
+<!ENTITY caron "ˇ">
+<!ENTITY ohacgr "ώ">
+<!ENTITY sup3 "³">
+<!ENTITY flat "♭">
+<!ENTITY minus "−">
+<!ENTITY olarr "↺">
+<!ENTITY dlcorn "⌞">
+<!ENTITY boxuR "╙">
+<!ENTITY iukcy "і">
+<!ENTITY b.tau "τ">
+<!ENTITY Otilde "Õ">
+<!ENTITY ldquo "“">
+<!ENTITY lang "〈">
+<!ENTITY Verbar "‖">
+<!ENTITY ges "≥">
+<!ENTITY prap "≾">
+<!ENTITY thksim "∼">
+<!ENTITY Vcy "В">
+<!ENTITY yacy "я">
+<!ENTITY drcrop "⌌">
+<!ENTITY omega "ω">
+<!ENTITY Hcirc "Ĥ">
+<!ENTITY tstrok "ŧ">
+<!ENTITY ang "∠">
+<!ENTITY khgr "χ">
+<!ENTITY b.thetas "θ">
+<!ENTITY ecaron "ě">
+<!ENTITY Odblac "Ő">
+<!ENTITY fflig "ff">
+<!ENTITY lowast "∗">
+<!ENTITY nvdash "⊬">
+<!ENTITY frac18 "⅛">
+<!ENTITY sup1 "¹">
+<!ENTITY njcy "њ">
+<!ENTITY b.thetav "ϑ">
+<!ENTITY sup2 "²">
+<!ENTITY gimel "ℷ">
+<!ENTITY ldot "⋖">
+<!ENTITY Ccedil "Ç">
+<!ENTITY rdquo "”">
+<!ENTITY rhard "⇁">
+<!ENTITY nsime "≄">
+<!ENTITY boxhu "┴">
+<!ENTITY intcal "⊺">
+<!ENTITY nsupe "⊉">
+<!ENTITY Gt "≫">
+<!ENTITY igr "ι">
+<!ENTITY nabla "∇">
+<!ENTITY urcorn "⌝">
+<!ENTITY nle "≰">
+<!ENTITY Icy "И">
+<!ENTITY DJcy "Ђ">
+<!ENTITY jukcy "є">
+<!ENTITY lceil "⌈">
+<!ENTITY oS "Ⓢ">
+<!ENTITY malt "✠">
+<!ENTITY ccirc "ĉ">
+<!ENTITY ycirc "ŷ">
+<!ENTITY Aacgr "Ά">
+<!ENTITY Ntilde "Ñ">
+<!ENTITY vsupnE "⊋">
+<!ENTITY ogr "ο">
+<!ENTITY and "∧">
+<!ENTITY gvnE "≩">
+<!ENTITY dashv "⊣">
+<!ENTITY supE "⊇">
+<!ENTITY mu "μ">
+<!ENTITY vsubnE "">
+<!ENTITY gE "≧">
+<!ENTITY smid "">
+<!ENTITY delta "δ">
+<!ENTITY tcaron "ť">
+<!ENTITY rsqb "]">
+<!ENTITY bull "•">
+<!ENTITY cuwed "⋏">
+<!ENTITY raquo "»">
+<!ENTITY frac45 "⅘">
+<!ENTITY part "∂">
+<!ENTITY Vdash "⊩">
+<!ENTITY boxhd "┬">
+<!ENTITY psi "ψ">
+<!ENTITY b.Omega "Ω">
+<!ENTITY iquest "¿">
+<!ENTITY sqcup "⊔">
+<!ENTITY YUcy "Ю">
+<!ENTITY psgr "ψ">
+<!ENTITY conint "∮">
+<!ENTITY gel "⋛">
+<!ENTITY Icirc "Î">
+<!ENTITY twixt "≬">
+<!ENTITY boxHD "╥">
+<!ENTITY male "♂">
+<!ENTITY euro "€">
+<!ENTITY epsi "∊">
+<!ENTITY Rcaron "Ř">
+<!ENTITY SHCHcy "Щ">
+<!ENTITY ugr "υ">
+<!ENTITY Phi "Φ">
+<!ENTITY b.Xi "Ξ">
+<!ENTITY lt "<">
+<!ENTITY scnsim "⋩">
+<!ENTITY models "⊧">
+<!ENTITY boxHu "╩">
+<!ENTITY Lcy "Л">
+<!ENTITY Sacute "Ś">
+<!ENTITY nwarr "↖">
+<!ENTITY drcorn "⌟">
+<!ENTITY NJcy "Њ">
+<!ENTITY mumap "⊸">
+<!ENTITY rAarr "⇛">
+<!ENTITY nsubE "⊈">
+<!ENTITY b.rho "ρ">
+<!ENTITY oelig "œ">
+<!ENTITY utrif "▴">
+<!ENTITY subne "⊊">
+<!ENTITY para "¶">
+<!ENTITY ocirc "ô">
+<!ENTITY ouml "ö">
+<!ENTITY num "#">
+<!ENTITY boxUL "╛">
+<!ENTITY IEcy "Е">
+<!ENTITY Ocy "О">
+<!ENTITY Ugrave "Ù">
+<!ENTITY eogon "ę">
+<!ENTITY sum "∑">
+<!ENTITY mcy "м">
+<!ENTITY YIcy "Ї">
+<!ENTITY Gamma "Γ">
+<!ENTITY isin "∊">
+<!ENTITY cuesc "⋟">
+<!ENTITY b.Pi "Π">
+<!ENTITY Ubreve "Ŭ">
+<!ENTITY starf "★">
+<!ENTITY gne "≩">
+<!ENTITY gammad "Ϝ">
+<!ENTITY napos "ʼn">
+<!ENTITY sup "⊃">
+<!ENTITY dArr "⇓">
+<!ENTITY Larr "↞">
+<!ENTITY nVDash "⊯">
+<!ENTITY boxhU "╧">
+<!ENTITY Ggr "Γ">
+<!ENTITY Idigr "Ϊ">
+<!ENTITY AElig "Æ">
+<!ENTITY Idot "İ">
+<!ENTITY Lacute "Ĺ">
+<!ENTITY sharp "♯">
+<!ENTITY Ubrcy "Ў">
+<!ENTITY lsqb "[">
+<!ENTITY micro "µ">
+<!ENTITY Sub "⋐">
+<!ENTITY agr "α">
+<!ENTITY nap "≉">
+<!ENTITY sfgr "ς">
+<!ENTITY block "█">
+<!ENTITY nspar "∦">
+<!ENTITY supnE "⊋">
+<!ENTITY prsim "≾">
+<!ENTITY shcy "ш">
+<!ENTITY dblac "˝">
+<!ENTITY xhArr "↔">
+<!ENTITY dtri "▿">
+<!ENTITY barwed "⊼">
+<!ENTITY zcy "з">
+<!ENTITY agrave "à">
+<!ENTITY par "∥">
+<!ENTITY vsupne "⊋">
+<!ENTITY Scy "С">
+<!ENTITY zdot "ż">
+<!ENTITY rsquor "‘">
+<!ENTITY Delta "Δ">
+<!ENTITY nVdash "⊮">
+<!ENTITY Pgr "Π">
+<!ENTITY gamma "γ">
+<!ENTITY tau "τ">
+<!ENTITY Ecirc "Ê">
+<!ENTITY sung "♩">
+<!ENTITY natur "♮">
+<!ENTITY or "∨">
+<!ENTITY vsubne "⊊">
+<!ENTITY Jcy "Й">
+<!ENTITY square "□">
+<!ENTITY b.zeta "ζ">
+<!ENTITY b.Psi "Ψ">
+<!ENTITY gbreve "ğ">
+<!ENTITY Kcedil "Ķ">
+<!ENTITY ohm "Ω">
+<!ENTITY frac35 "⅗">
+<!ENTITY ssetmn "∖">
+<!ENTITY boxUR "╘">
+<!ENTITY frac34 "¾">
+<!ENTITY target "⌖">
+<!ENTITY cularr "↶">
+<!ENTITY xcirc "○">
+<!ENTITY boxhD "╤">
+<!ENTITY iecy "е">
+<!ENTITY Euml "Ë">
+<!ENTITY half "½">
+<!ENTITY rang "〉">
+<!ENTITY numero "№">
+<!ENTITY Ugr "Υ">
+<!ENTITY times "×">
+<!ENTITY semi ";">
+<!ENTITY rharu "⇀">
+<!ENTITY iocy "ё">
+<!ENTITY b.gammad "Ϝ">
+<!ENTITY thinsp " ">
+<!ENTITY lozf "✦">
+<!ENTITY plusb "⊞">
+<!ENTITY tilde "˜">
+<!ENTITY Aogon "Ą">
+<!ENTITY Eogon "Ę">
+<!ENTITY blk12 "▒">
+<!ENTITY pre "≼">
+<!ENTITY boxHd "╦">
+<!ENTITY piv "ϖ">
+<!ENTITY ncaron "ň">
+<!ENTITY wcirc "ŵ">
+<!ENTITY utri "▵">
+<!ENTITY Prime "″">
+<!ENTITY cedil "¸">
+<!ENTITY idigr "ϊ">
+<!ENTITY curren "¤">
+<!ENTITY laquo "«">
+<!ENTITY ulcrop "⌏">
+<!ENTITY ring "˚">
+<!ENTITY oacute "ó">
+<!ENTITY Nacute "Ń">
+<!ENTITY permil "‰">
+<!ENTITY oacgr "ό">
+<!ENTITY b.phis "φ">
+<!ENTITY frac78 "⅞">
+<!ENTITY blk34 "▓">
+<!ENTITY gnsim "⋧">
+<!ENTITY boxVH "╫">
+<!ENTITY zhcy "ж">
+<!ENTITY b.phiv "ϕ">
+<!ENTITY loz "◊">
+<!ENTITY Ngr "Ν">
+<!ENTITY phgr "φ">
+<!ENTITY b.iota "ι">
+<!ENTITY ETH "Ð">
+<!ENTITY trade "™">
+<!ENTITY Cup "⋓">
+<!ENTITY subnE "⊊">
+<!ENTITY PHgr "Φ">
+<!ENTITY xi "ξ">
+<!ENTITY Rcy "Р">
+<!ENTITY ggr "γ">
+<!ENTITY Lmidot "Ŀ">
+<!ENTITY Scirc "Ŝ">
+<!ENTITY rtrif "▸">
+<!ENTITY larrtl "↢">
+<!ENTITY eDot "≑">
+<!ENTITY boxVL "╢">
+<!ENTITY THgr "Θ">
+<!ENTITY Dstrok "Đ">
+<!ENTITY cent "¢">
+<!ENTITY odash "⊝">
+<!ENTITY boxUl "╜">
+<!ENTITY ape "≊">
+<!ENTITY gEl "⋛">
+<!ENTITY nltri "⋪">
+<!ENTITY Aacute "Á">
+<!ENTITY cuvee "⋎">
+<!ENTITY gnE "≩">
+<!ENTITY kgr "κ">
+<!ENTITY iogon "į">
+<!ENTITY rarrtl "↣">
+<!ENTITY sccue "≽">
+<!ENTITY IOcy "Ё">
+<!ENTITY sext "✶">
+<!ENTITY uplus "⊎">
+<!ENTITY ecolon "≕">
+<!ENTITY nlArr "⇍">
+<!ENTITY scap "≿">
+<!ENTITY rarrlp "↬">
+<!ENTITY ngE "≱">
+<!ENTITY nsim "≁">
+<!ENTITY Acy "А">
+<!ENTITY emacr "ē">
+<!ENTITY Jcirc "Ĵ">
+<!ENTITY ltimes "⋉">
+<!ENTITY Bcy "Б">
+<!ENTITY b.Sigma "Σ">
+<!ENTITY cup "∪">
+<!ENTITY fork "⋔">
+<!ENTITY frac25 "⅖">
+<!ENTITY setmn "∖">
+<!ENTITY bsol "\">
+<!ENTITY Ycy "Ы">
+<!ENTITY b.Phi "Φ">
+<!ENTITY Gcedil "Ģ">
+<!ENTITY frac23 "⅔">
+<!ENTITY Iogon "Į">
+<!ENTITY blank "␣">
+<!ENTITY vprop "∝">
+<!ENTITY boxVR "╟">
+<!ENTITY ecy "э">
+<!ENTITY OHacgr "Ώ">
+<!ENTITY yen "¥">
+<!ENTITY hairsp " ">
+<!ENTITY plusdo "∔">
+<!ENTITY lvnE "≨">
+<!ENTITY boxUr "╚">
+<!ENTITY breve "˘">
+<!ENTITY rtimes "⋊">
+<!ENTITY gnap "">
+<!ENTITY rtrie "⊵">
+<!ENTITY Mcy "М">
+<!ENTITY chi "χ">
+<!ENTITY tdot "⃛">
+<!ENTITY PSgr "Ψ">
+<!ENTITY Umacr "Ū">
+<!ENTITY caret "⁁">
+<!ENTITY xutri "△">
+<!ENTITY CHcy "Ч">
+<!ENTITY djcy "ђ">
+<!ENTITY lambda "λ">
+<!ENTITY Tstrok "Ŧ">
+<!ENTITY puncsp " ">
+<!ENTITY Ll "⋘">
+<!ENTITY aacgr "ά">
+<!ENTITY xdtri "▽">
+<!ENTITY GJcy "Ѓ">
+<!ENTITY gdot "ġ">
+<!ENTITY sub "⊂">
+<!ENTITY mid "∣">
+<!ENTITY dzcy "џ">
+<!ENTITY igrave "ì">
+<!ENTITY Emacr "Ē">
+<!ENTITY Rcedil "Ŗ">
+<!ENTITY gt ">">
+<!ENTITY larrlp "↫">
+<!ENTITY harr "↔">
+<!ENTITY thgr "θ">
+<!ENTITY map "↦">
+<!ENTITY drarr "↘">
+<!ENTITY boxVh "╬">
+<!ENTITY ijlig "ij">
+<!ENTITY tcedil "ţ">
+<!ENTITY dlcrop "⌍">
+<!ENTITY prnsim "⋨">
+<!ENTITY ecir "≖">
+<!ENTITY rgr "ρ">
+<!ENTITY deg "°">
+<!ENTITY lap "≲">
+<!ENTITY KJcy "Ќ">
+<!ENTITY Cdot "Ċ">
+<!ENTITY Uogon "Ų">
+<!ENTITY not "¬">
+<!ENTITY dash "‐">
+<!ENTITY nexist "∄">
+<!ENTITY Lt "≪">
+<!ENTITY b.Upsi "ϒ">
+<!ENTITY Atilde "Ã">
+<!ENTITY edot "ė">
+<!ENTITY Ncedil "Ņ">
+<!ENTITY els "⋜">
+<!ENTITY erDot "≓">
+<!ENTITY boxVl "╣">
+<!ENTITY scy "с">
+<!ENTITY ulcorn "⌜">
+<!ENTITY eacgr "έ">
+<!ENTITY Itilde "Ĩ">
+<!ENTITY Zacute "Ź">
+<!ENTITY xharr "↔">
+<!ENTITY gl "≷">
+<!ENTITY chcy "ч">
+<!ENTITY Oacute "Ó">
+<!ENTITY itilde "ĩ">
+<!ENTITY Ycirc "Ŷ">
+<!ENTITY nhArr "⇎">
+<!ENTITY Lstrok "Ł">
+<!ENTITY divide "÷">
+<!ENTITY Tcy "Т">
+<!ENTITY Jukcy "Є">
+<!ENTITY Yacute "Ý">
+<!ENTITY boxv "│">
+<!ENTITY hamilt "ℋ">
+<!ENTITY nu "ν">
+<!ENTITY ngt "≯">
+<!ENTITY jsercy "ј">
+<!ENTITY uml "¨">
+<!ENTITY KHgr "Χ">
+<!ENTITY lstrok "ł">
+<!ENTITY nsupE "⊉">
+<!ENTITY dtrif "▾">
+<!ENTITY vellip "⋮">
+<!ENTITY rceil "⌉">
+<!ENTITY ell "ℓ">
+<!ENTITY Ecy "Э">
+<!ENTITY Jsercy "Ј">
+<!ENTITY ljcy "љ">
+<!ENTITY Kgr "Κ">
+<!ENTITY ngr "ν">
+<!ENTITY sigmav "ς">
+<!ENTITY Gdot "Ġ">
+<!ENTITY rdquor "“">
+<!ENTITY prnap "⋨">
+<!ENTITY tcy "т">
+<!ENTITY frac12 "½">
+<!ENTITY telrec "⌕">
+<!ENTITY vdash "⊢">
+<!ENTITY Zgr "Ζ">
+<!ENTITY Auml "Ä">
+<!ENTITY Ocirc "Ô">
+<!ENTITY uogon "ų">
+<!ENTITY hArr "⇔">
+<!ENTITY nge "≱">
+<!ENTITY iacute "í">
+<!ENTITY Cacute "Ć">
+<!ENTITY Omacr "Ō">
+<!ENTITY equiv "≡">
+<!ENTITY vltri "⊲">
+<!ENTITY eta "η">
+<!ENTITY SHcy "Ш">
+<!ENTITY percnt "%">
+<!ENTITY lowbar "_">
+<!ENTITY frac16 "⅙">
+<!ENTITY lrarr2 "⇆">
+<!ENTITY nles "≰">
+<!ENTITY bump "≎">
+<!ENTITY veebar "⊻">
+<!ENTITY Wcirc "Ŵ">
+<!ENTITY frac15 "⅕">
+<!ENTITY bumpe "≏">
+<!ENTITY egrave "è">
+<!ENTITY frac14 "¼">
+<!ENTITY supe "⊇">
+<!ENTITY rfloor "⌋">
+<!ENTITY Dgr "Δ">
+<!ENTITY frac13 "⅓">
+<!ENTITY ge "≥">
+<!ENTITY boxVr "╠">
+<!ENTITY pgr "π">
+<!ENTITY kgreen "ĸ">
+<!ENTITY boxh "─">
+<!ENTITY Lambda "Λ">
+<!ENTITY ugrave "ù">
+<!ENTITY emsp13 " ">
+<!ENTITY becaus "∵">
+<!ENTITY sce "≽">
+<!ENTITY grave "`">
+<!ENTITY zeta "ζ">
+<!ENTITY b.Theta "Θ">
+<!ENTITY eth "ð">
+<!ENTITY Ouml "Ö">
+<!ENTITY check "✓">
+<!ENTITY hybull "⁃">
+<!ENTITY Gg "⋙">
+<!ENTITY Ccaron "Č">
+<!ENTITY plus "+">
+<!ENTITY fllig "fl">
+<!ENTITY forall "∀">
+<!ENTITY dcaron "ď">
+<!ENTITY gacute "ǵ">
+<!ENTITY sc "≻">
+<!ENTITY OHgr "Ω">
+<!ENTITY emsp14 " ">
+<!ENTITY hellip "…">
+<!ENTITY lhard "↽">
+<!ENTITY sstarf "⋆">
+<!ENTITY samalg "∐">
+<!ENTITY EEgr "Η">
+<!ENTITY rhov "ϱ">
+<!ENTITY b.epsi "ε">
+<!ENTITY lsquo "‘">
+]>
+<book id="jboss_portal_reference_guide">
+<!--<book lang="en">
+ <bookinfo>
+ <title>JBoss Portal Reference Guide</title>
+ <subtitle>JBoss Portal Reference Guide</subtitle>
+ <edition>2.7.0</edition>
+ <pubsnumber>1</pubsnumber>
+ <productname>JBoss Portal</productname>
+ <productnumber>2.7</productnumber>
+ <pubdate>Nov, 2007</pubdate>
+ <isbn>N/A</isbn>
+
+
+ <abstract><para>This document is an outline of the information plan for JBoss AS 5 GA project's documentation.</para></abstract>
+
+
+
+
+
+
+
+ <xi:include href="Author_Group.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ </bookinfo>
+ -->
+ <!--<toc/>-->
+ <bookinfo id="JBoss_Portal_Reference_Guide">
+ <title>JBoss Portal Reference Guide</title>
+ <subtitle>JBoss Portal 2.7 Reference Guide</subtitle>
+ <edition>2</edition>
+ <pubsnumber>7</pubsnumber>
+ <productname>JBoss Portal</productname>
+ <productnumber>2.7</productnumber>
+ <pubdate>Oct, 2007</pubdate>
+ <isbn>N/A</isbn>
+ <issuenum>1</issuenum>
+
+
+ <abstract><para>This book is a JBoss Portal 2.7 Reference Guide.</para>
+ </abstract>
+ <corpauthor>
+ <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="Common_Content/images/redhat-logo.svg"/>
+ </imageobject>
+ </inlinemediaobject>
+ </corpauthor>
+
+ <copyright>
+ <year>&YEAR;</year>
+ <holder>&HOLDER;</holder>
+ </copyright>
+ <legalnotice xml:base="Common_Content/Legal_Notice.xml">
+ <para>
+ Copyright <trademark class="copyright"/> &YEAR; &HOLDER;. This material may only be distributed subject to the terms and conditions set forth in the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License (which is presently available at <ulink url="http://creativecommons.org/licenses/by-nc-sa/3.0/">http://creativecommons.org/licenses/by-nc-sa/3.0/</ulink>).
+ </para>
+ <para>
+ Red Hat and the Red Hat "Shadow Man" logo are registered trademarks of Red Hat, Inc. in the United States and other countries.
+ </para>
+ <para>
+ All other trademarks referenced herein are the property of their respective owners.
+ </para>
+ <para>
+ The GPG fingerprint of the security(a)redhat.com key is:
+ </para>
+ <para>
+ CA 20 86 86 2B D6 9D FC 65 F6 EC C4 21 91 80 CD DB 42 A6 0E
+ </para>
+ <para>
+ <address>
+ <street>1801 Varsity Drive</street>
+ <city>Raleigh</city>, <state>NC</state> <postcode>27606-2072</postcode><country>USA</country><phone>Phone: +1 919 754 3700</phone>
+ <phone>Phone: 888 733 4281</phone>
+ <fax>Fax: +1 919 754 3701</fax>
+ <pob>PO Box 13588</pob><city>Research Triangle Park</city>, <state>NC</state> <postcode>27709</postcode><country>USA</country>
+ </address>
+ </para>
+</legalnotice>
+ <authorgroup><corpauthor> JBoss Portal Team </corpauthor>
+
+
+<author>
+ <firstname>Thomas</firstname>
+ <surname>Heute</surname>
+ <email>theute(a)jboss.org</email>
+ </author>
+ <author>
+ <firstname>Julien</firstname>
+ <surname>Viet</surname>
+ <email>julien(a)jboss.org</email>
+ </author>
+ <author>
+ <firstname>Roy</firstname>
+ <surname>Russo</surname>
+ </author>
+ <author>
+ <firstname>Boleslaw</firstname>
+ <surname>Dawidowicz</surname>
+ <email>boleslaw dot dawidowicz at redhat dot com</email>
+ </author>
+ <author>
+ <firstname>Chris</firstname>
+ <surname>Laprun</surname>
+ <email>chris.laprun(a)jboss.com</email>
+ </author>
+ <author>
+ <firstname>Murray</firstname>
+ <surname>McAllister</surname>
+ <email>mmcallis(a)redhat.com</email>
+ </author>
+
+
+
+</authorgroup>
+</bookinfo>
+
+ <preface id="trademarks">
+ <title>Please Read: Important Trademark Information</title>
+ <para>
+ Sun, JavaServer, JSP, Java, JMX, JDK, Java runtime environment, J2EE, JVM, Javadoc, 100% Pure Java, JDBC, and JavaScript are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.
+ </para>
+ <para>
+ JBoss is a registered trademark of Red Hat, Inc. in the U.S. and other countries.
+ </para>
+ <para>
+ Red Hat is a registered trademark of Red Hat, Inc. in the United States and other countries.
+ </para>
+ <para>
+ Oracle is a registered trademark of Oracle International Corporation.
+ </para>
+ <para>
+ Microsoft, Windows, Active Directory, and SQL Server are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.
+ </para>
+ <para>
+ Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.
+ </para>
+ <para>
+ UNIX is a registered trademark of The Open Group.
+ </para>
+ <para>
+ MySQL is a trademark or registered trademark of MySQL AB in the U.S. and other countries.
+ </para>
+ <para>
+ Apache is a trademark of The Apache Software Foundation.
+ </para>
+ <para>
+ Mac and Mac OS are trademarks of Apple Inc., registered in the U.S. and other countries.
+ </para>
+ <para>
+ All other trademarks referenced herein are the property of their respective owners.
+ </para>
+</preface><!--To do:
+
+Apache?
+
+Linux?
+
+
+All the sun stuff
+
+
+
+Microsoft?
+
+
+Mail them first (see Apache Jackrabbit)
+
+
+
+
+
+'Apache is a trademark of The Apache Software Foundation, and is used with permission.' This is not necessary in the case of all-inclusive attribution language such as, 'All marks are the properties of their respective owners.' Contact the ASF Public Relations Committee <prc(a)apache.org> with all inquiries regarding trademark issues -->
+<!-- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Overview.xml" />-->
+<!-- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Featurelist.xml" />-->
+ <preface id="target" revision="1">
+ <title>Target Audience</title>
+ <para>
+ This guide is aimed towards portlet developers, portal administrators, and those wishing to
+ implement and extend the JBoss Portal framework. For end-user documentation, please refer to the JBoss Portal User Manual from the <ulink url="http://labs.jboss.com/portal/jbossportal/docs/index.html">JBoss Portal Documentation Library</ulink>
+ .</para>
+</preface>
+<!-- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Acknowledgements.xml" />-->
+ <chapter id="supportedversions">
+ <!-- <chapterinfo>
+ <author>
+ <firstname>Thomas</firstname>
+ <surname>Heute</surname>
+ </author>
+ <author>
+ <firstname>Roy</firstname>
+ <surname>Russo</surname>
+ </author>
+ </chapterinfo>-->
+ <title>System Requirements</title>
+ <para>
+ The following chapter details hardware and software versions that are compatible with JBoss Portal. The hardware and software listed has either been tested, or reported as working by users. Before reporting a problem, make sure you are using compatible hardware and software.
+ </para>
+ <para>
+ If you successfully installed JBoss Portal on versions not listed here, please let us know so it can be added to this section.
+ </para>
+ <section>
+ <title>Minimum System Requirements</title>
+ <para>
+ <itemizedlist>
+ <listitem><para>JDK 5 (JDK 6 is not part of the test platform)</para></listitem>
+ <listitem><para>512 MB RAM</para></listitem>
+ <listitem><para>100 MB hard disk space</para></listitem>
+ <listitem><para>400 MHz CPU</para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ <section>
+ <title>Supported Operating Systems</title>
+ <para>JBoss Portal is <trademark class="trade">100% Pure Java</trademark>, and therefore it is interoperable with most operating systems
+ capable of running a Java Virtual Machine (<trademark class="trade">JVM</trademark>), including <trademark class="registered">Linux</trademark>, <trademark class="registered">Windows</trademark>, <trademark class="registered">UNIX</trademark> operating systems, and Mac OS X.
+ </para>
+ </section>
+ <section>
+ <title>JBoss Application Server</title>
+ <para>JBoss Portal 2.7.0 is tested with JBoss Application Server (AS) JBoss AS 4.2.3, JBoss Enterprise Application Platform (EAP) 4.2 and JBoss EAP 4.3. It is highly recommended that customers who have access to the <ulink url="https://support.redhat.com/portal/login.html">JBoss Customer Support Portal (CSP)</ulink> use JBoss EAP 4.3. Customers who do not have access to the JBoss CSP should use <ulink url="http://labs.jboss.com/jbossas/">JBoss AS</ulink>.
+ </para>
+ <warning>
+ <para>JBoss AS versions 4.0.<replaceable>x</replaceable> are not supported.</para>
+ </warning>
+ </section>
+ <section id="supportedversions-db">
+ <title>Databases</title>
+ <para>JBoss Portal is database-agnostic. The following list outlines known-to-be-working database vendor and version combinations:</para>
+ <itemizedlist>
+ <listitem><para><trademark class="registered">MySQL</trademark> 4 (use <ulink url="http://dev.mysql.com/downloads/connector/j/3.1.html">Connector/J 3.1</ulink>) and 5 (<ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=AvoidMySQL5DataTruncationErrors">known issue</ulink>)</para></listitem>
+ <listitem><para>PostgreSQL 8.<replaceable>x</replaceable></para></listitem>
+ <listitem><para>Hypersonic SQL</para></listitem>
+ <listitem><para>Apache Derby</para></listitem>
+ <listitem><para><trademark class="registered">Oracle</trademark> Database 9 and 10g (use the <ulink url="http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html">latest driver from the Oracle 10 branch</ulink> even if you are running Oracle 9)</para></listitem>
+ <listitem><para><trademark class="registered">Microsoft</trademark><trademark class="registered"> SQL Server</trademark></para></listitem>
+ <listitem><para>MaxDB</para></listitem>
+ </itemizedlist>
+ <para>JBoss Portal employs Hibernate as an interface to a Relational Database Management System (RDBMS). Most Relational Database Management Systems supported by Hibernate will work with JBoss Portal.</para>
+ </section>
+ <section>
+ <title>Source Building</title>
+ <para>The source building mechanism works on Linux, Windows, Mac OS X, and UNIX operating systems.</para>
+ </section>
+</chapter>
+ <chapter id="installation">
+ <title>Installation</title>
+ <para>
+ Depending on your needs, there are several different methods to install JBoss
+ Portal. Pre-configured clustered versions (
+ <computeroutput>JBoss Portal Binary (Clustered)</computeroutput>
+ ) are available from the
+ <ulink url="http://labs.jboss.com/portal/jbossportal/download/index.html">
+ JBoss Portal Downloads
+ </ulink>
+ page. Clustered versions of JBoss Portal must be deployed in the
+ <filename>JBOSS_INSTALLATION_DIRECTORY/server/all/deploy/</filename>
+ directory. All JBoss AS instances must reference the same datasource. Refer to
+ <xref linkend="install_source_env"/>
+ for details on how to configure JBoss Portal for clustering.
+ </para>
+ <para>
+ An environment variable,
+ <computeroutput>JBOSS_HOME</computeroutput>
+ , is configured in
+ <xref linkend="install_source_env"/>
+ . References to
+ <computeroutput>$JBOSS_HOME</computeroutput>
+ assume this to be your
+ <replaceable>JBOSS_INSTALLATION_DIRECTORY</replaceable>
+ .
+ </para>
+ <section id="install_bundle">
+ <title>The JBoss Portal and JBoss AS Bundle</title>
+ <para>
+ This is the easiest and fastest way to get JBoss Portal installed and running.
+ The JBoss Portal and JBoss AS bundle contains JBoss AS, JBoss Portal, and the
+ embedded Hypersonic SQL database. To install the JBoss Portal and JBoss AS
+ bundle:
+ </para>
+ <para>
+ <orderedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">Get the bundle:</emphasis>
+ the bundle is available from the
+ <ulink url="http://labs.jboss.com/portal/jbossportal/download/index.html">
+ JBoss Portal Downloads
+ </ulink>
+ page. Bundles use the
+ <computeroutput>JBoss Portal + JBoss AS</computeroutput>
+ naming convention.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">Extract the bundle:</emphasis>
+ extract the ZIP archive. It does not matter which directory is used. On
+ Windows, the recommended directory is
+ <filename>
+ C:\jboss-
+ <replaceable>version-number</replaceable>
+ </filename>
+ .
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">Start the server:</emphasis>
+ change into the
+ <filename>JBOSS_PORTAL_INSTALLATION_DIRECTORY/bin/</filename>
+ directory. On Windows, execute
+ <command>run.bat</command>
+ . On Linux, run the
+ <command>sh run.sh</command>
+ command. To specify a configuration to use, for example, the default
+ configuration, append the
+ <command>-c default</command>
+ option to the
+ <command>run.bat</command>
+ or
+ <command>sh run.sh</command>
+ commands.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">Log in to JBoss Portal:</emphasis>
+ using a Web browser, navigate to
+ <ulink url="http://localhost:8080/portal"/>
+ to open the JBoss Portal homepage. Log in using one of the two default
+ accounts: username
+ <emphasis>user</emphasis>
+ , password
+ <emphasis>user</emphasis>
+ , or username
+ <emphasis>admin</emphasis>
+ , password
+ <emphasis>admin</emphasis>
+ :
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" valign="middle" fileref="images/common/frontpage.png" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <formalpara>
+ <title>SQL Errors</title>
+ <para>
+ Tables are automatically created the first time JBoss Portal starts. When
+ deployed for the first time, JBoss Portal checks for the existence of the
+ initial tables, which have not been created yet. This causes errors such as
+ the following, which can safely be ignored:
+ </para>
+ </formalpara>
+ <para>
+ <programlisting><![CDATA[
+WARN [JDBCExceptionReporter] SQL Error: -22, SQLState: S0002
+ERROR [JDBCExceptionReporter] Table not found in statement ...
+WARN [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
+ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_repositoryentry' doesn't exist
+WARN [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
+ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_version_refs' doesn't exist]]></programlisting>
+ </para>
+ </section>
+ <section id="install_binary">
+ <title>Installing the Binary Download</title>
+ <para>
+ The binary package typically consists of the
+ <filename>jboss-portal.sar/</filename>
+ directory, documentation such as the JBoss Portal User Guide and the JBoss Portal
+ Reference Guide, and a set of pre-configured Datasource descriptors that allow
+ JBoss Portal to communicate with an external database. This installation method
+ is recommended for users who already have JBoss EAP or JBoss AS installed, or
+ those who need to install JBoss Portal in a clustered environment.
+ </para>
+ <section>
+ <title>Setting up your Environment</title>
+ <section id="install_binarydownload">
+ <title>Getting the Binary</title>
+ <para>
+ The binary download is available from the
+ <ulink url="http://labs.jboss.com/portal/jbossportal/download/index.html">
+ JBoss Portal Downloads
+ </ulink>
+ page. Look for the
+ <computeroutput>JBoss Portal Binary</computeroutput>
+ package. Once the binary ZIP file has been downloaded and extracted, the
+ folder hierarchy will look similar to the following:
+ </para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" valign="middle" fileref="images/setup/package.png"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>
+ Files contained in this download are used in later sections. Download and
+ extract the JBoss Portal binary ZIP file before proceeding.
+ </para>
+ </section>
+ <section>
+ <title>JBoss EAP and JBoss AS Setup</title>
+ <para>
+ Before deploying JBoss Portal, make sure you have JBoss EAP or JBoss AS
+ installed. Customers who have access to the
+ <ulink url="https://support.redhat.com/portal/login.html">
+ JBoss Customer Support Portal (CSP)
+ </ulink>
+ are advised to download and install JBoss EAP 4.3. Customers who do not
+ have access to the JBoss CSP are advised to use
+ <ulink url="http://labs.jboss.com/jbossas/downloads/">JBoss AS</ulink>
+ . For JBoss AS installation instructions, please refer to the
+ <ulink url="http://labs.jboss.com/jbossas/docs/index.html">
+ JBoss AS Installation Guide
+ </ulink>
+ .
+ </para>
+ <warning>
+ <title>Use the JBoss EAP and JBoss AS ZIP file</title>
+ <para>
+ Only use the JBoss EAP and JBoss AS ZIP file versions.
+ <emphasis role="bold">
+ DO NOT ATTEMPT to deploy JBoss Portal on the installer version of
+ JBoss EAP or JBoss AS.
+ </emphasis>
+ </para>
+ </warning>
+ </section>
+ <section id="install_source_env_0">
+ <title>Operating System Environment Settings</title>
+ <para>
+ For JBoss EAP, JBoss AS, and build targets to work, you must configure a
+ <filename>JBOSS_HOME</filename>
+ environment variable. This environment variable must point to the root
+ directory of the JBoss EAP or JBoss AS installation directory, which is the
+ directory where the JBoss EAP or JBoss AS files were extracted to.
+ </para>
+ <para>
+ On Windows, this is accomplished by going to
+ <emphasis>
+ Start > Settings > Control Panel > System > Advanced > Environment
+ Variables
+ </emphasis>
+ . Under the
+ <emphasis>System Variables</emphasis>
+ section, click
+ <emphasis>New</emphasis>
+ . Set the
+ <filename>JBOSS_HOME</filename>
+ environment variable to the location of your JBoss EAP or JBoss AS
+ installation directory:
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" valign="middle" fileref="images/setup/win_envsetup.gif"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>
+ To configure the
+ <filename>JBOSS_HOME</filename>
+ environment variable on Linux:
+ </para>
+ <para>
+ <orderedlist>
+ <listitem>
+ <para>
+ Add the following line to the
+ <filename>~/.bashrc</filename>
+ file. Note: this must be configured while logged in as the user
+ who runs JBoss EAP or JBoss AS:
+ </para>
+ <para>
+ <programlisting>
+ export JBOSS_HOME=/path/to/jboss/installation/
+ </programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Run the following command to enable the
+ <filename>JBOSS_HOME</filename>
+ environment variable:
+ </para>
+ <para>
+ <programlisting>source ~/.bashrc</programlisting>
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <note>
+ <title>
+ JBoss EAP
+ <filename>JBOSS_HOME</filename>
+ Environment Variable
+ </title>
+ <para>
+ If you are running JBoss EAP, configure the
+ <filename>JBOSS_HOME</filename>
+ environment variable to point to the
+ <filename>
+ /path/to/jboss-eap-
+ <replaceable>version</replaceable>
+ /jboss-as/
+ </filename>
+ directory.
+ </para>
+ </note>
+ </section>
+ <section>
+ <title>Database Setup</title>
+ <para>
+ A database is required for JBoss Portal to run. JBoss EAP and JBoss AS
+ include an embedded Hypersonic SQL database that JBoss Portal can use;
+ however, this is only recommended for developer use. The following
+ databases are recommended for production use, and have had test suites run
+ against them:
+ <trademark class="registered">MySQL</trademark>
+ 4 and 5,
+ <trademark class="registered">Microsoft</trademark>
+ <trademark class="registered">SQL Server</trademark>
+ , PostgreSQL 8, and
+ <trademark class="registered">Oracle</trademark>
+ Database 9 and 10. JBoss Portal can use any database that is supported by
+ Hibernate.
+ </para>
+ <para>To configure a database to use with JBoss Portal:</para>
+ <para>
+ <orderedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">Create a new database:</emphasis>
+ this guide assumes that the new database is called
+ <emphasis>jbossportal</emphasis>
+ .
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ Grant access rights for a user to the
+ <emphasis>jbossportal</emphasis>
+ database:
+ </emphasis>
+ JBoss Portal needs to create tables and modify table data. Grant
+ access rights to a desired user to the
+ <emphasis>jbossportal</emphasis>
+ database. Configure the same username and password in the
+ Datasource descriptor.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ Deploy an RDBMS
+ <trademark class="trade">JDBC</trademark>
+ connector:
+ </emphasis>
+ an RDBMS JDBC connector is required for JBoss Portal to
+ communicate with a database. Copy the connector into the
+ <filename>$JBOSS_HOME/server/default/lib/</filename>
+ directory. For example, an RDBMS JDBC connector for MySQL can be
+ download from
+ <ulink url="http://www.mysql.com/products/connector/j/"/>
+ . For the correct RDMBS JDBC connector, please refer to the
+ database documentation.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </section>
+ <section>
+ <title>Datasource Descriptors</title>
+ <para>
+ The JBoss Portal binary download that was extracted in
+ <xref linkend="install_binarydownload"/>
+ , contains pre-configured Datasource descriptors for the more popular
+ databases. Datasource descriptors are provided for the MySQL 4 and 5,
+ PostgreSQL, Microsoft SQL Server, and Oracle databases, and can be found in
+ the
+ <filename>setup</filename>
+ subdirectory where the JBoss Portal binary was extracted to:
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" valign="middle" fileref="images/setup/dsfiles.png"/>
+ </imageobject>
+ </mediaobject>
+ <para>
+ Copy the Datasource descriptor that matches your database into the
+ <filename>
+ $JBOSS_HOME/server/
+ <replaceable>configuration</replaceable>
+ /deploy/
+ </filename>
+ directory, where
+ <replaceable>configuration</replaceable>
+ is either all, default, minimal or production. The production configuration
+ only exists on JBoss EAP, and not JBoss AS. For example, if you are using
+ the all configuration, copy the Datasource descriptor into the
+ <filename>$JBOSS_HOME/server/all/deploy/</filename>
+ directory.
+ </para>
+ <para>
+ After the Datasource descriptor has been copied into the
+ <filename>deploy</filename>
+ directory, make sure the
+ <computeroutput>user-name</computeroutput>
+ ,
+ <computeroutput>password</computeroutput>
+ ,
+ <computeroutput>connection-url</computeroutput>
+ , and
+ <computeroutput>driver-class</computeroutput>
+ , are correct for your chosen database. Datasource descriptor files can be
+ deployed to test before being used in production. The following is an
+ example Datasource descriptor for a PostgreSQL database:
+ </para>
+ <programlisting role="XML">
+ <![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<datasources>
+ <local-tx-datasource>
+ <jndi-name>PortalDS</jndi-name>
+ <connection-url>jdbc:postgresql:jbossportal</connection-url>
+ <driver-class>org.postgresql.Driver</driver-class>
+ <user-name>portal</user-name>
+ <password>portalpassword</password>
+ </local-tx-datasource>
+</datasources>]]></programlisting>
+ <para>
+ For further details about Datasource descriptors, please refer to the
+ <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=CreateAJDBCDataSource">
+ JBoss JDBC Datasource Wiki page
+ </ulink>
+ .
+ </para>
+ </section>
+ </section>
+ <section>
+ <title>Deploying JBoss Portal</title>
+ <para>To start JBoss EAP or JBoss AS and deploy JBoss Portal:</para>
+ <para>
+ <orderedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">Datasource descriptor:</emphasis>
+ if you have not done so already, change into the
+ <filename>setup</filename>
+ subdirectory where the JBoss Portal binary was extracted to. Copy the
+ correct Datasource descriptor file (
+ <filename>*-ds.xml</filename>
+ ) you modified in the previous steps into the
+ <filename>
+ $JBOSS_HOME/server/
+ <replaceable>configuration</replaceable>
+ /deploy/
+ </filename>
+ directory.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">Start the server:</emphasis>
+ change into the
+ <filename>$JBOSS_HOME/bin/</filename>
+ directory. On Windows, execute
+ <command>run.bat</command>
+ . On Linux, run the
+ <command>sh run.sh</command>
+ command. To specify a configuration to use, for example, the default
+ configuration, append the
+ <command>-c default</command>
+ option to the
+ <command>run.bat</command>
+ or
+ <command>sh run.sh</command>
+ commands.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">Log in to JBoss Portal:</emphasis>
+ using a Web browser, navigate to
+ <ulink url="http://localhost:8080/portal"/>
+ to open the JBoss Portal homepage. Log in using one of the two
+ default accounts: username
+ <emphasis>user</emphasis>
+ , password
+ <emphasis>user</emphasis>
+ , or username
+ <emphasis>admin</emphasis>
+ , password
+ <emphasis>admin</emphasis>
+ .
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <formalpara>
+ <title>SQL Errors</title>
+ <para>
+ Tables are automatically created the first time JBoss Portal starts. When
+ deployed for the first time, JBoss Portal checks for the existence of the
+ initial tables, which have not been created yet. This causes errors such as
+ the following, which can safely be ignored:
+ </para>
+ </formalpara>
+ <para>
+ <programlisting><![CDATA[
+WARN [JDBCExceptionReporter] SQL Error: -22, SQLState: S0002
+ERROR [JDBCExceptionReporter] Table not found in statement ...
+WARN [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
+ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_repositoryentry' doesn't exist
+WARN [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
+ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_version_refs' doesn't exist
+]]></programlisting>
+ </para>
+ </section>
+ </section>
+ <section id="install_source">
+ <title>Installing from the Sources</title>
+ <section>
+ <title>Getting the Sources</title>
+ <para>
+ The JBoss Portal source files can be obtained from the
+ <ulink url="http://labs.jboss.com/portal/jbossportal/download/index.html">
+ JBoss Portal Downloads
+ </ulink>
+ page. The source files download uses a
+ <filename>JBoss Portal Source Code</filename>
+ naming convention. As well, the sources can be obtained from SVN. The latest
+ sources for the 2.7.
+ <replaceable>x</replaceable>
+ versions are located at
+ <ulink url="http://anonsvn.jboss.org/repos/portal/branches/JBoss_Portal_Branch_2_7"/>
+ .
+ </para>
+ <para>
+ Several modules have been extracted from the JBoss Portal SVN repository.
+ These modules have a different lifecycle and a different version scheme. The
+ following is a list of modules used in JBoss Portal 2.7.0, and the locations
+ of their source code:
+ </para>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ JBoss Portal Common 1.2.1:
+ <emphasis>
+ http://anonsvn.jboss.org/repos/portal/modules/common/tags/JBP_COMMON_1_2_1
+ </emphasis>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ JBoss Portal Web 1.2.1:
+ <emphasis>
+ http://anonsvn.jboss.org/repos/portal/modules/web/tags/JBP_WEB_1_2_1
+ </emphasis>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ JBoss Portal Test 1.0.3:
+ <emphasis>
+ http://anonsvn.jboss.org/repos/portal/modules/test/tags/JBP_TEST_1_0_3
+ </emphasis>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ JBoss Portal Portlet 2.0.3:
+ <emphasis>
+ http://anonsvn.jboss.org/repos/portal/modules/portlet/tags/JBP_PORTLET_2_0_3
+ </emphasis>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ JBoss Portal Identity 1.0.4:
+ <emphasis>
+ http://anonsvn.jboss.org/repos/portal/modules/identity/tags/JBP_IDENTITY_...
+ </emphasis>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ JBoss Portal CMS 1.2.0:
+ <emphasis>
+ http://anonsvn.jboss.org/repos/portal/modules/cms/tags/JBP_CMS_1_2_0
+ </emphasis>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ After checking out the source from SVN, or after extracting the
+ <filename>JBoss Portal Source Code</filename>
+ ZIP file, a directory structure similar to the following will be created:
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" valign="middle" fileref="images/setup/svncodir.png"/>
+ </imageobject>
+ </mediaobject>
+ <para>
+ If the source files were obtained from SVN, change into the
+ <filename>trunk/src/</filename>
+ directory to see the directories from the above image. As well, there is an
+ empty
+ <filename>thirdparty</filename>
+ directory. This directory contains files after building the JBoss Portal
+ source code (refer to
+ <xref linkend="building_deploying_from_source"/>
+ ). For more information about the JBoss Portal SVN repository, and accessing
+ different versions of the JBoss Portal codebase, refer to the
+ <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=PortalSVNRepo">
+ JBoss Portal SVN Repo
+ </ulink>
+ page on the JBoss Wiki.
+ </para>
+ </section>
+ <section>
+ <title>JBoss EAP and JBoss AS Setup</title>
+ <section>
+ <title>JBoss Application Server Setup</title>
+ <para>
+ Before deploying JBoss Portal, make sure you have JBoss EAP or JBoss AS
+ installed. Customers who have access to the
+ <ulink url="https://support.redhat.com/portal/login.html">
+ JBoss Customer Support Portal (CSP)
+ </ulink>
+ are advised to download and install JBoss EAP 4.3. Customers who do not
+ have access to the JBoss CSP are advised to use
+ <ulink url="http://labs.jboss.com/jbossas/downloads/">JBoss AS</ulink>
+ . For JBoss AS installation instructions, please refer to the
+ <ulink url="http://labs.jboss.com/jbossas/docs/index.html">
+ JBoss AS Installation Guide
+ </ulink>
+ .
+ </para>
+ <warning>
+ <title>Use the JBoss EAP and JBoss AS ZIP file</title>
+ <para>
+ Only use the JBoss EAP and JBoss AS ZIP file versions.
+ <emphasis role="bold">
+ DO NOT ATTEMPT to deploy JBoss Portal on the installer version of
+ JBoss EAP or JBoss AS.
+ </emphasis>
+ We are currently working on aligning the Application installer with
+ JBoss Portal.
+ </para>
+ </warning>
+ </section>
+ <section id="install_source_env">
+ <title>Operating System Environment Settings</title>
+ <para>
+ For JBoss EAP, JBoss AS, and build targets to work, you must configure a
+ <filename>JBOSS_HOME</filename>
+ environment variable. This environment variable must point to the root
+ directory of the JBoss EAP or JBoss AS installation directory, which is the
+ directory where the JBoss EAP or JBoss AS files were extracted to.
+ </para>
+ <para>
+ On Windows, this is accomplished by going to
+ <emphasis>
+ Start > Settings > Control Panel > System > Advanced > Environment
+ Variables
+ </emphasis>
+ . Under the
+ <emphasis>System Variables</emphasis>
+ section, click
+ <emphasis>New</emphasis>
+ . Set the
+ <filename>JBOSS_HOME</filename>
+ environment variable to the location of your JBoss EAP or JBoss AS
+ installation directory:
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" valign="middle" fileref="images/setup/win_envsetup.gif"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>
+ To configure the
+ <filename>JBOSS_HOME</filename>
+ environment variable on Linux:
+ </para>
+ <para>
+ <orderedlist>
+ <listitem>
+ <para>
+ Add the following line to the
+ <filename>~/.bashrc</filename>
+ file. Note: this must be configured while logged in as the user
+ who runs JBoss EAP or JBoss AS:
+ </para>
+ <para>
+ <programlisting>
+ export JBOSS_HOME=/path/to/jboss/installation/
+ </programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Run the following command to enable the
+ <filename>JBOSS_HOME</filename>
+ environment variable:
+ </para>
+ <para>
+ <programlisting>source ~/.bashrc</programlisting>
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <note>
+ <title>
+ JBoss EAP
+ <filename>JBOSS_HOME</filename>
+ Environment Variable
+ </title>
+ <para>
+ If you are running JBoss EAP, configure the
+ <filename>JBOSS_HOME</filename>
+ environment variable to point to the
+ <filename>
+ /path/to/jboss-eap-
+ <replaceable>version</replaceable>
+ /jboss-as/
+ </filename>
+ directory.
+ </para>
+ </note>
+ </section>
+ </section>
+ <section id="building_deploying_from_source">
+ <title>Building and Deploying from the Sources</title>
+ <para>
+ During the first build, third-party libraries are obtained from an online
+ repository, so you must be connected to the Internet, and if you are behind a
+ proxy server, you need to define your proxy server address and proxy server
+ port number. To define a proxy server, add the following line to the
+ <filename>$JBOSS_HOME/bin/run.conf</filename>
+ file:
+ </para>
+
+<!--<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="extras/runconf_javaops.xmlt"/>-->
+<programlisting>JAVA_OPTS=-Dhttp.proxyHost=<proxy-hostname> -Dhttp.proxyPort=<proxy-port></programlisting>
+
+ <para>
+ Replace
+ <replaceable>proxy-hostname</replaceable>
+ with the proxy server's hostname, and
+ <replaceable>proxy-port</replaceable>
+ with the correct proxy server port number.
+ </para>
+ <para>
+ To build and deploy JBoss Portal from the sources, change into the
+ <filename>JBOSS_PORTAL_SOURCE_DIRECTORY/build/</filename>
+ directory, where
+ <filename>JBOSS_PORTAL_SOURCE_DIRECTORY</filename>
+ is the directory where the JBoss Portal source code was downloaded to. Then,
+ Windows users need to run the
+ <command>build.bat deploy</command>
+ command, and Linux users need to run the
+ <command>sh build.sh deploy</command>
+ command.
+ </para>
+ <para>
+ At the end of the build process, the
+ <filename>jboss-portal.sar</filename>
+ file is copied into the
+ <filename>$JBOSS_HOME/server/default/deploy/</filename>
+ directory:
+ </para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" valign="middle" fileref="images/setup/build_deploy.png" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>
+ <note>
+ <title>Portal Modules</title>
+ <para>
+ The previous steps install a bare version of JBoss Portal. In previous
+ versions, several additional modules were deployed as well, but this has
+ since been modularized to provide greater flexibility. To deploy
+ additional modules, refer to the
+ <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=PortalModules">
+ Portal's module list
+ </ulink>
+ for more information. To deploy all modules at once, change into the
+ <filename>build</filename>
+ directory. If you are running Linux, run the
+ <command>sh build.sh deploy-all</command>
+ command. On Windows, run the
+ <command>build.bat deploy-all</command>
+ command.
+ </para>
+ </note>
+ </para>
+ <para>To build the clustered version on Linux operating systems:</para>
+ <para>
+ <orderedlist>
+ <listitem>
+ <para>
+ Change into the
+ <filename>JBOSS_PORTAL_SOURCE_DIRECTORY/build/</filename>
+ directory, and run the following command:
+ </para>
+ <para>
+ <programlisting>sh build.sh main</programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Change into the
+ <filename>JBOSS_PORTAL_SOURCE_DIRECTORY/core/</filename>
+ directory, and run the following command:
+ </para>
+ <para>
+ <programlisting>sh build.sh deploy-ha</programlisting>
+ </para>
+ <para>
+ After the
+ <command>sh build.sh deploy-ha</command>
+ command completes, the
+ <filename>jboss-portal-ha.sar</filename>
+ file is copied into the
+ <filename>$JBOSS_HOME/server/all/deploy/</filename>
+ directory.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <para>
+ To build the clustered version on Windows, repeat the previous steps,
+ replacing
+ <command>sh build.sh</command>
+ with
+ <command>build.bat</command>
+ .
+ </para>
+ </section>
+ <section>
+ <title>Database Setup</title>
+ <para>
+ A database is required for JBoss Portal to run. JBoss EAP and JBoss AS include
+ an embedded Hypersonic SQL database that JBoss Portal can use; however, this
+ is only recommended for developer use. The following databases are recommended
+ for production use, and have had test suites run against them: MySQL 4 and 5,
+ Microsoft SQL Server, PostgreSQL 8, and Oracle Database 9 and 10. JBoss Portal
+ can use any database that is supported by Hibernate.
+ </para>
+ <para>To configure a database to use with JBoss Portal:</para>
+ <para>
+ <orderedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">Create a new database:</emphasis>
+ this guide assumes that the new database is called
+ <emphasis>jbossportal</emphasis>
+ .
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ Grant access rights for a user to the
+ <emphasis>jbossportal</emphasis>
+ database:
+ </emphasis>
+ JBoss Portal needs to create tables and modify table data. Grant
+ access rights to a desired user to the
+ <emphasis>jbossportal</emphasis>
+ database. Configure the same username and password in the Datasource
+ descriptor.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">Deploy an RDBMS JDBC connector:</emphasis>
+ an RDBMS JDBC connector is required for JBoss Portal to communicate
+ with a database. Copy the connector into the
+ <filename>$JBOSS_HOME/server/default/lib/</filename>
+ directory. For example, an RDBMS JDBC connector for MySQL can be
+ download from
+ <ulink url="http://www.mysql.com/products/connector/j/"/>
+ . For the correct RDMBS JDBC connector, please refer to the database
+ documentation.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </section>
+ <section>
+ <title>Datasource Configuration</title>
+ <para>
+ The JBoss Portal binary download that was extracted in
+ <xref linkend="install_binarydownload"/>
+ , contains pre-configured Datasource descriptors for the more popular
+ databases. Datasource descriptors are provided for the MySQL 4 and 5,
+ PostgreSQL, Microsoft SQL Server, and Oracle databases, and can be found in
+ the
+ <filename>setup</filename>
+ subdirectory where the JBoss Portal binary was extracted to:
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" valign="middle" fileref="images/setup/dsfiles.png"/>
+ </imageobject>
+ </mediaobject>
+ <para>
+ Copy the Datasource descriptor that matches your database into the
+ <filename>
+ $JBOSS_HOME/server/
+ <replaceable>configuration</replaceable>
+ /deploy/
+ </filename>
+ directory, where
+ <replaceable>configuration</replaceable>
+ is either all, default, minimal, or production. For example, if you are using
+ the production configuration, copy the Datasource descriptor into the
+ <filename>$JBOSS_HOME/server/production/deploy/</filename>
+ directory. The production configuration only exists on JBoss EAP
+ installations, and not JBoss AS.
+ </para>
+ <para>
+ After the Datasource descriptor has been copied into the
+ <filename>deploy</filename>
+ directory, make sure the
+ <computeroutput>user-name</computeroutput>
+ ,
+ <computeroutput>password</computeroutput>
+ ,
+ <computeroutput>connection-url</computeroutput>
+ , and
+ <computeroutput>driver-class</computeroutput>
+ , are correct for your chosen database. Datasource descriptor files can be
+ deployed to test before being used in production. The following is an example
+ Datasource descriptor for a PostgreSQL database:
+ </para>
+ <programlisting role="XML"><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<datasources>
+ <local-tx-datasource>
+ <jndi-name>PortalDS</jndi-name>
+ <connection-url>jdbc:postgresql:jbossportal</connection-url>
+ <driver-class>org.postgresql.Driver</driver-class>
+ <user-name>portal</user-name>
+ <password>portalpassword</password>
+ </local-tx-datasource>
+</datasources>
+ ]]></programlisting>
+ <para>
+ For further details about Datasource descriptors, please refer to the
+ <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=CreateAJDBCDataSource">
+ JBoss JDBC Datasource Wiki page
+ </ulink>
+ .
+ </para>
+ </section>
+ </section>
+ <section>
+ <title>Deploying JBoss Portal</title>
+ <para>To start JBoss EAP or JBoss AS and deploy JBoss Portal:</para>
+ <para>
+ <orderedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">Datasource descriptor:</emphasis>
+ if you have not done so already, change into the
+ <filename>setup</filename>
+ subdirectory where the JBoss Portal binary was extracted to. Copy the
+ correct Datasource descriptor file (
+ <filename>*-ds.xml</filename>
+ ) you modified in the previous steps into the
+ <filename>
+ $JBOSS_HOME/server/
+ <replaceable>configuration</replaceable>
+ /deploy/
+ </filename>
+ directory.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">Start the server:</emphasis>
+ change into the
+ <filename>$JBOSS_HOME/bin/</filename>
+ directory. On Windows, execute
+ <command>run.bat</command>
+ . On Linux, run the
+ <command>sh run.sh</command>
+ command. To specify a configuration to use, for example, the default
+ configuration, append the
+ <command>-c default</command>
+ option to the
+ <command>run.bat</command>
+ or
+ <command>sh run.sh</command>
+ commands.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">Log in to JBoss Portal:</emphasis>
+ using a Web browser, navigate to
+ <ulink url="http://localhost:8080/portal"/>
+ to open the JBoss Portal homepage. Log in using one of the two default
+ accounts: username
+ <emphasis>user</emphasis>
+ , password
+ <emphasis>user</emphasis>
+ , or username
+ <emphasis>admin</emphasis>
+ , password
+ <emphasis>admin</emphasis>
+ .
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <formalpara>
+ <title>SQL Errors</title>
+ <para>
+ Tables are automatically created the first time JBoss Portal starts. When
+ deployed for the first time, JBoss Portal checks for the existence of the
+ initial tables, which have not been created yet. This causes errors such as
+ the following, which can safely be ignored:
+ </para>
+ </formalpara>
+ <para>
+ <programlisting><![CDATA[
+WARN [JDBCExceptionReporter] SQL Error: -22, SQLState: S0002
+ERROR [JDBCExceptionReporter] Table not found in statement ...
+WARN [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
+ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_repositoryentry' doesn't exist
+WARN [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
+ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_version_refs' doesn't exist
+]]></programlisting>
+ </para>
+ </section>
+
+</chapter>
+ <chapter id="configuration">
+ <!-- <chapterinfo>
+ <author>
+ <firstname>Thomas</firstname>
+ <surname>Heute</surname>
+ </author>
+ <author>
+ <firstname>Roy</firstname>
+ <surname>Russo</surname>
+ </author>
+ </chapterinfo>-->
+ <title>Customizing your Installation</title>
+ <para>
+ This chapter describes how to customize the default installation. This includes the JBoss EAP or JBoss AS listening port, email and proxy settings, and database dialect settings. For further configuration details, refer to <xref linkend="portaldescriptors"/> and <xref linkend="troubleshooting"/>.
+ </para>
+ <section>
+ <title>Changing the Port</title>
+ <para>
+ It is common for web services to run on port 80. By default, JBoss EAP and JBoss AS use port 8080. If you can not use <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingPortForwardingWithJBoss">port forwarding</ulink>, it is recommended to change the port JBoss EAP or JBoss AS listens on. To change the default port, open the <filename>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml</filename> file, and edit the <computeroutput>Connector port</computeroutput> value for the <computeroutput>jboss.web</computeroutput> service; however, this configuration only applies to Apache Tomcat:
+ </para>
+<programlisting role="XML">
+<Service name="jboss.web">
+<Connector port="8088" address="${jboss.bind.address}"
+</programlisting>
+ <para>
+ This example changes the default port to port 8088. The JBoss EAP or JBoss AS server must be restarted before the new port settings take affect.
+ </para>
+ <para>
+ The default SSL port is 8843. To enable HTTPS support, refer to the <ulink url="http://docs.jboss.org/jbossas/jboss4guide/r4/html/ch9.chapt.html#d0e21962">JBoss AS Guide</ulink>. For further information, refer to the <ulink url="http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html">Apache Tomcat SSL configuration how-to</ulink>.
+ </para>
+ <para>
+ Please refer to <xref linkend="wsrp-ports"/> to update the WSRP service after having changed the port.
+ </para>
+ <para>
+ <warning>
+ <title>Root User Privileges</title>
+ <para>
+ Linux operating systems require root user privileges to run a service on a port less than 1024. Starting JBoss EAP or JBoss AS on port 80 as a non-privileged user will not work. Running JBoss EAP or JBoss AS as the root user could lead to security breaches.
+ </para>
+ </warning>
+ </para>
+ </section>
+ <section id="configuration-contextroot">
+ <title>Changing the Context Path</title>
+ <para>By default, the main JBoss Portal page is accessible by navigating to <emphasis>http://localhost:8080/portal/index.html</emphasis>. This
+can be changed to a different path, for example,
+<emphasis>http://localhost:8080/index.html</emphasis>. The context path can be changed when using the deployed <filename>jboss-portal.sar/</filename>, or before building from source. To change the context path when using the JBoss Portal binary package:
+</para>
+<para>
+ <orderedlist>
+ <listitem>
+ <para>Open the <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/portal-server.war/WEB-INF/jboss-web.xml</emphasis> file. If this file does not exist, copy and save the following example:
+ </para>
+<programlisting><![CDATA[
+<?xml version="1.0"?>
+<jboss-web>
+ <security-domain>java:jaas/portal</security-domain>
+ <context-root>/portal</context-root>
+ <replication-config>
+ <replication-trigger>SET</replication-trigger>
+ </replication-config>
+ <resource-ref>
+ <res-ref-name>jdbc/PortalDS</res-ref-name>
+ <jndi-name>java:PortalDS</jndi-name>
+ </resource-ref>
+</jboss-web>]]></programlisting>
+ </listitem>
+ <listitem>
+ <para>Edit the
+ <computeroutput><context-root></computeroutput> element with the desired context path:
+ </para>
+<programlisting>
+<![CDATA[<context-root>/testing</context-root>]]>
+</programlisting>
+ <para>
+ Using this example, the main JBoss Portal page would be reached by navigating to <emphasis>http://localhost:8080/testing</emphasis>.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <para>
+ To change the context path when building from source:
+ </para>
+ <para>
+ <orderedlist>
+ <listitem>
+ <para>
+ Change into the directory where the <filename>JBoss Portal Source Code</filename> ZIP file was extracted to, or where the source from SVN was checked out to. Copy the <filename>build/etc/local.properties-example</filename> file and save it as <filename>build/local.properties</filename>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Open the <filename>build/local.properties</filename> file and edit the <computeroutput>portal.web.context-root</computeroutput> option with the desired context path:
+ </para>
+<programlisting>
+# Context root for the portal main servlet
+portal.web.context-root=/testing
+</programlisting>
+ <para>
+ Using this example, the main JBoss Portal page would be reached by navigating to <emphasis>http://localhost:8080/testing</emphasis>.
+ </para>
+ </listitem>
+ <listitem>
+
+ <para>
+ To clean the project, make sure you are connected to the Internet, and change into the <filename>build/</filename> directory. Run the <command>ant clean</command> command.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Rebuild and redeploy JBoss Portal. Refer to <xref linkend="install_source"/> for build instructions.
+ </para>
+ </listitem>
+ </orderedlist>
+</para>
+<section>
+ <title>Changing the context-root</title>
+ <para>
+ By default, Apache Tomcat holds on to the root context, <emphasis>/</emphasis>. You may need to remove the <filename>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/ROOT.war/</filename> directory,
+ or add a <filename>jboss-web.xml</filename> file, which declares another
+ context-root other than <emphasis>/</emphasis>, under the <filename>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/ROOT.war/WEB-INF/</filename> directory, for the above changes to take affect. The following is an example <filename>jboss-web.xml</filename> file, which changes the Apache Tomcat context path to <computeroutput>/tomcat-root</computeroutput>:
+ </para>
+<programlisting role="XML"><![CDATA[
+<?xml version="1.0"?>
+<jboss-web>
+ <context-root>/tomcat-root</context-root>
+</jboss-web>]]></programlisting>
+</section>
+ </section>
+ <section id="configuration-hibdialect">
+ <title>Forcing the Database Dialect</title>
+ <para>
+ This sections describes how to override the Database (DB) dialect settings. Under most circumstances, the auto-detect feature works. If the Hibernate dialect is not working correctly, override the default behavior by following the instructions in this section.
+ </para>
+ <section>
+ <title>Database Dialect Settings for JBoss Portal</title>
+ <para>
+ All <filename>hibernate.cfg.xml</filename> files in all JBoss Portal modules you intend to use need to be modified. The <filename>hibernate.cfg.xml</filename> files are found in the <filename>jboss-portal.sar/<replaceable>module</replaceable>/conf/hibernate/<replaceable>directory</replaceable>/</filename> directory, where <replaceable>module</replaceable> is the module name, and <replaceable>directory</replaceable> is a directory that, depending on the module, may or may not exist.
+ </para>
+ <para>
+ To modify these files to force the DB dialect, un-comment the following line from each <filename>hibernate.cfg.xml</filename> file in each JBoss Portal module you intend to use, so that it looks like the following:
+ </para>
+<programlisting role="XML"><![CDATA[
+<!-- Force the dialect instead of using autodetection -->
+<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
+]]></programlisting>
+ <para>
+ Note: this example is for a PostgreSQL database. If you use another database, you need to modify <computeroutput>org.hibernate.dialect.PostgreSQLDialect</computeroutput> to reflect the correct database. For a list of supported dialects, refer to the <ulink url="http://www.hibernate.org/hib_docs/v3/reference/en/html/session-configurat...">dialects list on the Hibernate website</ulink>.
+ </para>
+ </section>
+ <section>
+ <title>DB Dialect Settings for the CMS Component</title>
+ <para>
+ To modify the DB dialect setting for the JBoss Portal CMS component:
+ </para>
+ <para>
+ <orderedlist>
+ <listitem>
+ <para>
+ Open the <filename>jboss-portal.sar/portal-cms.sar/conf/hibernate/cms/hibernate.cfg.xml</filename> file.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Un-comment the following line, so that it looks as follows:
+
+<programlisting><![CDATA[
+<!-- Force the dialect instead of using autodetection -->
+<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
+]]></programlisting>
+</para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <para>
+ Note: this example is for a PostgreSQL database. If you use another database, you need to modify <computeroutput>org.hibernate.dialect.PostgreSQLDialect</computeroutput> to reflect the correct database. For a list of supported dialects, refer to the <ulink url="http://www.hibernate.org/hib_docs/v3/reference/en/html/session-configurat...">dialects list on the Hibernate website</ulink>.
+ </para>
+ </section>
+ </section>
+ <section id="emailConfiguration">
+ <title>Configuring the Email Service</title>
+ <para>
+ If you have a standard setup and a mail server installed, the email service should work without any extra configuration. Most Linux distributions have a mail server installed by default. The email service, for example, can be used to verify a user's email address when a user subscribes, or for CMS workflow notifications.
+ </para>
+ <para>
+ The email service is configured using the <filename>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/META-INF/jboss-service.xml</filename> file. The following is an example of the section which is used to configure the email service:
+ </para>
+<programlisting role="XML"><![CDATA[
+<mbean
+code="org.jboss.portal.core.impl.mail.MailModuleImpl"
+name="portal:service=Module,type=Mail"
+xmbean-dd=""
+xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+<xmbean/>
+<depends>jboss:service=Mail</depends>
+<depends>portal:service=Module,type=IdentityServiceController</depends>
+<attribute name="QueueCapacity">-1</attribute>
+<attribute name="Gateway">localhost</attribute>
+<attribute name="SmtpUser"></attribute>
+<attribute name="SmtpPassword"></attribute>
+<attribute name="JavaMailDebugEnabled">false</attribute>
+<attribute name="SMTPConnectionTimeout">100000</attribute>
+<attribute name="SMTPTimeout">10000</attribute>
+<attribute name="JNDIName">java:portal/MailModule</attribute>
+</mbean>]]>
+</programlisting>
+
+ <para>
+ A different SMTP server (other than localhost) can be configured, along with a SMTP username and an SMTP password. The following is an example configuration that uses the Gmail SMTP server:
+ </para>
+<programlisting role="XML"><![CDATA[
+<mbean
+code="org.jboss.portal.core.impl.mail.MailModuleImpl"
+name="portal:service=Module,type=Mail"
+xmbean-dd=""
+xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+<xmbean/>
+<depends>jboss:service=Mail</depends>
+<depends>portal:service=Module,type=IdentityServiceController</depends>
+<attribute name="QueueCapacity">-1</attribute>
+<attribute name="Gateway">smtp.gmail.com</attribute>
+<attribute name="SmtpUser">username(a)gmail.com</attribute>
+<attribute name="SmtpPassword">myPassword</attribute>
+<attribute name="JavaMailDebugEnabled">false</attribute>
+<attribute name="SMTPConnectionTimeout">100000</attribute>
+<attribute name="SMTPTimeout">10000</attribute>
+<attribute name="JNDIName">java:portal/MailModule</attribute>
+</mbean>]]>
+</programlisting>
+ <para>
+ Using this example, replace <computeroutput>username(a)gmail.com</computeroutput> and <computeroutput>myPassword</computeroutput> with your correct Gmail username and password.
+ </para>
+</section>
+ <section>
+ <title>Configuring proxy settings</title>
+ <para>There are a couple of scenarios where you need your proxy to be correctly defined at the <trademark class="trade">JVM</trademark> level so that you can access documents from Internet. It could be to get the thirdparty libraries if you decided to build JBoss Portal from the sources, to access RSS feeds or weather information in the samples portlet we provide or for your own needs.</para>
+ <para>To configure the proxy settings, you need to know the proxy host and the port to use. Then,
+ add them when starting Java.</para>
+ <para>Usually setting up JAVA_OPTS environment variable to <literal>-Dhttp.proxyHost=YOUR_PROXY_HOST -Dhttp.proxyPort=YOUR_PROXY_PORT</literal>
+ is enough.</para>
+ </section>
+ <section>
+ <title>Disabling Dynamic Proxy Un-wrapping</title>
+ <para>JBoss Portal uses the JBoss Microkernel for the service infrastructure. The JBoss Microkernel provides injection of services into other services, otherwise known as wiring. Due to the Microkernel being <trademark class="trade">JMX</trademark> based, it is only possible to inject dynamic proxies that talk to the MBeanServer. The overhead at runtime is minimal since the Microkernel implementation is highly optimized; however, when it is used with Java 5, a noticeable bottleneck occurs due to the fact that the implementation of the JMX API classes, <emphasis>javax.management.*</emphasis>, provided by the Java Platform, perform synchronization. This does not occur under <trademark class="trade">JDK</trademark> 1.4, since those classes are implemented by JBoss MX.
+ </para>
+ <para>
+ JBoss Portal services use a special kind of Model MBean called <emphasis>JBossServiceModelMBean</emphasis>, which allows the un-wrapping of injected dynamic proxies, and replaces them with Plain Old Java Object (POJO) services. This removes the bottleneck when using Java 5, and also provides a performance boost on JDK 1.4. By default this feature is enabled, but it is possible to disable. To do this on Linux operating systems, change into the <filename>$JBOSS_HOME/bin/</filename> directory and run the following command:
+ </para>
+ <para>
+<programlisting>
+sh run.sh -Dportal.kernel.no_proxies=false
+</programlisting>
+</para>
+<para>
+ On Windows, run the following command:
+</para>
+<para>
+<programlisting>
+run.bat -Dportal.kernel.no_proxies=false
+</programlisting>
+</para>
+ </section>
+</chapter>
+ <chapter id="changelog">
+ <!-- <chapterinfo>
+ <author>
+ <firstname>Thomas</firstname>
+ <surname>Heute</surname>
+ </author>
+ </chapterinfo>-->
+ <title>Upgrading JBoss Portal 2.6 to 2.7</title>
+ <para>
+ <warning>
+ <para>
+ Before performing any instructions or operations in this chapter, back up your database and the entire JBoss EAP or JBoss AS directory!
+ </para>
+ </warning>
+ </para>
+ <para>
+ JBoss Portal 2.7 compatibility with JBoss Portal 2.6 is very high. The main differences are the use of JSR-286 features to replace
+ JBoss Portal specific features. The database schema hasn't changed.
+ </para>
+
+ <section id="manual_migration">
+ <title>Usage of JBossActionRequest</title>
+ <para>Usage of JBossActionRequest is not available directly anymore. From now on it is only accessible if the
+ <emphasis>org.jboss.portlet.filter.JBossPortletFilter</emphasis> is applied on the portlet.
+ To do so, first you will need to change the <emphasis>portlet.xml</emphasis> descriptor in order to declare
+ the new portlet as a JSR-286 portlet so that the filter can be applied. For a portlet named <emphasis>MyFooPortlet</emphasis>
+ it would now look like this:
+ </para>
+<programlisting role="XML"><![CDATA[
+<portlet-app
+ xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+
+ <filter>
+ <filter-name>JBoss Portlet Filter</filter-name>
+ <filter-class>org.jboss.portlet.filter.JBossPortletFilter</filter-class>
+ <lifecycle>ACTION_PHASE</lifecycle>
+ <lifecycle>RENDER_PHASE</lifecycle>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>JBoss Portlet Filter</filter-name>
+ <portlet-name>MyFooPortlet</portlet-name>
+ </filter-mapping>
+
+
+ <portlet>
+ <description>My foo portlet</description>
+ <portlet-name>MyFooPortlet</portlet-name>
+ ...
+ </portlet>
+</portlet-app>
+
+]]></programlisting>
+ <para>By not adding this filter on a portlet using JBossActionRequest/JBossActionResponse, an error message such as:
+ <emphasis>The request isn't a JBossRenderRequest, you probably need to activate the JBoss Portlet Filter: org.jboss.portlet.filter.JBossPortletFilter on MyFooPortlet</emphasis>
+ </para>
+ </section>
+
+</chapter>
+ <chapter id="tutorials">
+ <!-- <chapterinfo>
+ <author>
+ <firstname>Chris</firstname>
+ <surname>Laprun</surname>
+ </author>
+ <author>
+ <firstname>Thomas</firstname>
+ <surname>Heute</surname>
+ </author>
+ </chapterinfo>-->
+ <title>Portlet Primer</title>
+ <section id="portlet_primer">
+ <title>JSR-168 and JSR-286 overview</title>
+ <para>
+ The Portlet Specifications aims at defining portlets that can be used by any
+ <ulink url="http://www.jcp.org/en/jsr/detail?id=168">
+ JSR-168 (Portlet 1.0)
+ </ulink>
+ or
+ <ulink url="http://www.jcp.org/en/jsr/detail?id=286">
+ JSR-286 (Portlet 2.0)
+ </ulink>
+ portlet container. Most Java EE portals include one, it is obviously the case for
+ JBoss Portal which includes the JBoss Portlet container supporting the two
+ versions. This chapter gives a brief overview of the Portlet Specifications but
+ portlet developers are strongly encouraged to read the
+ <ulink url="http://www.jcp.org/en/jsr/detail?id=286">
+ JSR-286 Portlet Specification
+ </ulink>
+ .
+ </para>
+ <para>
+ JBoss Portal is fully JSR-286 compliant, which means any JSR-168 or JSR-286
+ portlet behaves as it is mandated by the respective specifications inside the
+ portal.
+ </para>
+ <section>
+ <title>Portal Pages</title>
+ <para>
+ A portal can be seen as pages with different areas, and inside areas,
+ different windows, and each window having one portlet:
+ </para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/tutorials/SpecPortalDef.png" format="PNG" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ </section>
+ <section>
+ <title>Rendering Modes</title>
+ <para>
+ A portlet can have different view modes. Three modes are defined by the
+ JSR-286 specification:
+ </para>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>view</emphasis>
+ - generates markup reflecting the current state of the portlet.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>edit</emphasis>
+ - allows a user to customize the behavior of the portlet.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>help</emphasis>
+ - provides information to the user as to how to use the portlet.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ <section>
+ <title>Window States</title>
+ <para>
+ Window states are an indicator of how much page real-estate a portlet consumes
+ on any given page. The three states defined by the JSR-168 specification are:
+ </para>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>normal</emphasis>
+ - a portlet shares this page with other portlets.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>minimized</emphasis>
+ -a portlet may show very little information, or none at all.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>maximized</emphasis>
+ - a portlet may be the only portlet displayed on this page.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+ <section id="tutorials_tutorials">
+ <title>Tutorials</title>
+ <para>
+ The tutorials contained in this chapter are targeted toward portlet developers.
+ Although they are a good starting and reference point, it is highly recommend
+ that portlet developers read and understand the
+ <ulink url="http://www.jcp.org/en/jsr/detail?id=286">
+ JSR-286 Portlet Specification
+ </ulink>
+ . Feel free to use the
+ <ulink url="http://jboss.org/index.html?module=bb&op=viewforum&f=215">
+ JBoss Portal User Forums
+ </ulink>
+ for user-to-user help.
+ </para>
+ <section>
+ <title>Deploying your first Portlet</title>
+ <section>
+ <title>Introduction</title>
+ <para>
+ This section describes how to deploy a portlet in JBoss Portal. You will
+ find the
+ <emphasis>SimplestHelloWorld</emphasis>
+ portlet in the
+ <literal>examples</literal>
+ directory at the root of your JBoss Portal binary package.
+ </para>
+ </section>
+ <section>
+ <title>Compiling</title>
+ <para>
+ This example is using Maven to compile and build the web archive. If you
+ don't have Maven already installed, you will find a version for your
+ operating system
+ <ulink url="http://maven.apache.org/download.html">here</ulink>
+ </para>
+ <para>
+ To compile and package the application, go to the SimplestHelloWorld
+ directory and type
+ <literal>mvn package</literal>
+ .
+ </para>
+ <para>
+ Once successfully packaged, the result should be available in:
+ <literal>SimplestHelloWorld/target/SimplestHelloWorld-0.0.1.war</literal>
+ . Simply copy that file into
+ <literal>JBOSS_HOME/server/default/deploy</literal>
+ , then start JBoss Application Server if it was not already started.
+ </para>
+ <para>
+ You should now see a new page called
+ <literal>SimplestHelloWorld</literal>
+ , with a window inside containing the portlet instance we have created, as
+ seen below.
+ </para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/tutorials/first_portlet/deployed.png"/>
+ </imageobject>
+ </mediaobject>
+
+ SimplestHelloWorldPortlet deployed on a new page.
+
+ </para>
+ </section>
+ <section>
+ <title>Package Structure</title>
+ <para>
+ Now that we have seen how to deploy an existing web application, let's have
+ a look inside.
+ </para>
+ <para>
+ Like other Java Platform, Enterprise Edition (Java EE) applications,
+ portlets are packaged in WAR files. A typical portlet WAR file can include
+ servlets, resource bundles, images, HTML,
+ <trademark class="trade">JavaServer</trademark>
+ Pages (
+ <trademark class="trade">JSP</trademark>
+ ), and other static or dynamic files. The following is an example of the
+ directory structure of the HelloWorldPortlet portlet:
+ </para>
+ <programlistingco>
+ <areaspec>
+ <area id="tutorials.simplest.javaclass" coords="9"/>
+ <area id="tutorials.simplest.defaultobject" coords="10"/>
+ <area id="tutorials.simplest.portletinstances" coords="11"/>
+ <area id="tutorials.simplest.portlet" coords="12"/>
+ <area id="tutorials.simplest.web" coords="13"/>
+ </areaspec>
+ <programlisting><![CDATA[|-- SimplestHelloWorld-0.0.1.war
+| `-- WEB-INF
+| |-- classes
+| | `-- org
+| | `-- jboss
+| | `-- portal
+| | `-- portlet
+| | `-- samples
+| | `-- SimplestHelloWorldPortlet.class
+| |-- default-object.xml
+| |-- portlet-instances.xml
+| |-- portlet.xml
+| `-- web.xml]]>
+ </programlisting>
+ <calloutlist>
+ <callout arearefs="tutorials.simplest.javaclass">
+ <para>
+ The compiled Java class implementing
+ <emphasis>javax.portlet.Portlet</emphasis>
+ (through
+ <emphasis>javax.portlet.GenericPortlet</emphasis>
+ )
+ </para>
+ </callout>
+ <callout arearefs="tutorials.simplest.defaultobject">
+ <para>
+ <emphasis>default-object.xml</emphasis>
+ is an optional file, it is used to define the layout of the
+ portal. It can be used to define the different portals, pages and
+ windows. The same result can be obtained through the
+ administration portal. Note that the definition of the layout is
+ stored in database, this file is then used to populate the
+ database during deployment which can be very useful during
+ development.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.simplest.portletinstances">
+ <para>
+ <emphasis>portlet-instances.xml</emphasis>
+ is also optional, it allows to create a portlet instance from the
+ SimpleHelloWorld portlet definition. Creating instances can also
+ be done through the administration portal. Note that the
+ definition of instances is stored in database, this file is then
+ used to populate the database during deployment which can be very
+ useful during development. Having portlet-instances.xml and
+ default-object.xml included in this package ensures that the
+ portlet will appear directly on the portal by just deploying the
+ web application.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.simplest.portlet">
+ <para>
+ This is the mandatory descriptor files for portlets. It is used
+ during deployment..
+ </para>
+ </callout>
+ <callout arearefs="tutorials.simplest.web">
+ <para>This is the mandatory descriptor for web applications.</para>
+ </callout>
+ </calloutlist>
+ </programlistingco>
+ </section>
+
+ <section>
+ <title>Portlet Class</title>
+ <para>Let us study the Java class in detail.</para>
+ <para>
+ The following file is the
+ <filename>
+ SimplestHelloWorldPortlet/src/main/java/org/jboss/portal/portlet/samples/SimplestHelloWorldPortlet.java
+ </filename>
+ Java source.
+ </para>
+ <programlistingco>
+ <areaspec>
+ <area id="tutorials.simplest.extends" coords="10"/>
+ <area id="tutorials.simplest.doview" coords="13"/>
+ <area id="tutorials.simplest.writer" coords="15"/>
+ <area id="tutorials.simplest.write" coords="16"/>
+ <area id="tutorials.simplest.close" coords="17"/>
+ </areaspec>
+ <programlisting role="JAVA"><![CDATA[package org.jboss.portal.portlet.samples;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.portlet.GenericPortlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+public class SimplestHelloWorldPortlet extends GenericPortlet
+{
+ public void doView(RenderRequest request,
+ RenderResponse response) throws IOException
+ {
+ PrintWriter writer = response.getWriter();
+ writer.write("Hello World !");
+ writer.close();
+ }
+}]]>
+ </programlisting>
+ <calloutlist>
+ <callout arearefs="tutorials.simplest.extends">
+ <para>
+ All portlets must implement the
+ <literal>javax.portlet.Portlet</literal>
+ interface. The portlet API provides a convenient implementation of
+ this interface, in the form of the
+ <literal>javax.portlet.GenericPortlet</literal>
+ class, which among other things, implements the
+ <literal>Portlet render</literal>
+ method to dispatch to abstract mode-specific methods to make it
+ easier to support the standard portlet modes. As well, it provides
+ a default implementation for the
+ <literal>processAction</literal>
+ ,
+ <literal>init</literal>
+ and
+ <literal>destroy</literal>
+ methods. It is recommended to extend
+ <literal>GenericPortlet</literal>
+ for most cases.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.simplest.doview">
+ <para>
+ As we extend from
+ <literal>GenericPortlet</literal>
+ , and are only interested in supporting the
+ <literal>view</literal>
+ mode, only the
+ <literal>doView</literal>
+ method needs to be implemented, and the
+ <literal>GenericPortlet</literal>
+ <literal>render</literal>
+ implemention calls our implementation when the
+ <literal>view</literal>
+ mode is requested.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.simplest.writer">
+ <para>
+ Use the
+ <emphasis>RenderResponse</emphasis>
+ to obtain a writer to be used to produce content.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.simplest.write">
+ <para>Write the markup to display.</para>
+ </callout>
+ <callout arearefs="tutorials.simplest.close">
+ <para>Closing the writer.</para>
+ </callout>
+ </calloutlist>
+ </programlistingco>
+ <para>
+ <note>
+ <title>Markup Fragments</title>
+ <para>
+ Portlets are responsible for generating markup fragments, as they are
+ included on a page and are surrounded by other portlets. In
+ particular, this means that a portlet outputting HTML must not output
+ any markup that cannot be found in a
+ <literal><body></literal>
+ element.
+ </para>
+ </note>
+ </para>
+ </section>
+ <section id="first_portlet_descriptors">
+ <title>Application Descriptors</title>
+ <para>
+ JBoss Portal requires certain descriptors to be included in a portlet WAR
+ file. Some of these descriptors are defined by the Portlet Specification,
+ and others are specific to JBoss Portal.
+ </para>
+ <para>
+ The following is an example of the
+ <filename>SimplestHelloWorldPortlet/WEB-INF/portlet.xml</filename>
+ file. This file must adhere to its definition in the JSR-286 Portlet
+ Specification. You may define more than one portlet application in this
+ file:
+ </para>
+ <programlistingco>
+ <areaspec>
+ <area id="tutorials.simplest.portletname" coords="8"/>
+ <area id="tutorials.simplest.portletclass" coords="9"/>
+ <area id="tutorials.simplest.supports" coords="12"/>
+ <area id="tutorials.simplest.portletinfo" coords="15"/>
+ </areaspec>
+ <programlisting><![CDATA[
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
+ http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+ <portlet>
+ <portlet-name>SimplestHelloWorldPortlet</portlet-name>
+ <portlet-class>
+ org.jboss.portal.portlet.samples.SimplestHelloWorldPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Simplest Hello World Portlet</title>
+ </portlet-info>
+ </portlet>
+</portlet-app>]]>
+ </programlisting>
+ <calloutlist>
+ <callout arearefs="tutorials.simplest.portletname">
+ <para>
+ Define the portlet name. It does not have to be the class name.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.simplest.portletclass">
+ <para>
+ The Fully Qualified Name (FQN) of your portlet class must be
+ declared here.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.simplest.supports">
+ <para>
+ The
+ <computeroutput><supports></computeroutput>
+ element declares all of the markup types that a portlet supports
+ in the
+ <literal>render</literal>
+ method. This is accomplished via the
+ <computeroutput><mime-type></computeroutput>
+ element, which is required for every portlet. The declared MIME
+ types must match the capability of the portlet. As well, it allows
+ you to pair which modes and window states are supported for each
+ markup type. All portlets must support the
+ <computeroutput>view</computeroutput>
+ portlet mode, so this does not have to be declared. Use the
+ <computeroutput><mime-type></computeroutput>
+ element to define which markup type your portlet supports, which
+ in this example, is
+ <computeroutput>text/html</computeroutput>
+ . This section tells the portal that it only outputs HTML.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.simplest.portletinfo">
+ <para>
+ When rendered, the portlet's title is displayed as the header in
+ the portlet window, unless it is overridden programmatically. In
+ this example, the title would be
+ <computeroutput>Simplest Hello World Portlet</computeroutput>
+ .
+ </para>
+ </callout>
+ </calloutlist>
+ </programlistingco>
+ <para>
+ The
+ <filename>
+ SimplestHelloWorldPortlet/WEB-INF/portlet-instances.xml
+ </filename>
+ file is a JBoss Portal specific descriptor, that allows you to create
+ instances of portlets. The
+ <computeroutput><portlet-ref></computeroutput>
+ value must match the
+ <computeroutput><portlet-name></computeroutput>
+ value given in the
+ <filename>SimplestHelloWorldPortlet/WEB-INF/portlet.xml</filename>
+ file. The
+ <computeroutput><instance-id></computeroutput>
+ value can be named anything, but it must match the
+ <computeroutput><instance-ref></computeroutput>
+ value given in the
+ <filename>*-object.xml</filename>
+ file, which in this example, would be the
+ <filename>SimplestHelloWorldPortlet/WEB-INF/default-object.xml</filename>
+ file.
+ </para>
+ <para>
+ The following is an example of the
+ <filename>
+ SimplestHelloWorldPortlet/WEB-INF/portlet-instances.xml
+ </filename>
+ file:
+ </para>
+ <programlisting role="XML"><![CDATA[<?xml version="1.0" standalone="yes"?>
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
+ "http://www.jboss.org/portlet/dtd/portlet-instances_2_6.dtd">
+<deployments>
+ <deployment>
+ <instance>
+ <instance-id>SimplestHelloWorldInstance</instance-id>
+ <portlet-ref>SimplestHelloWorldPortlet</portlet-ref>
+ </instance>
+ </deployment>
+</deployments>]]>
+ </programlisting>
+ <para>
+ The
+ <filename>*-object.xml</filename>
+ file is a JBoss Portal specific descriptor that allow users to define the
+ structure of their portal instances, and create and configure their windows
+ and pages. In the following example:
+ </para>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>a portlet window is created.</para>
+ </listitem>
+ <listitem>
+ <para>
+ specifies that the window displays the markup generated by the
+ <computeroutput>SimplestHelloWorldInstance</computeroutput>
+ portlet instance.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ the window is assigned to the page that we are creating and called
+ <computeroutput>SimplestHelloWorld</computeroutput>
+ page.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ the
+ <computeroutput><region></computeroutput>
+ element specifies where the window appears on the page.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ The following is an example
+ <filename>SimplestHelloWorldPortlet/WEB-INF/default-object.xml</filename>
+ file:
+ </para>
+ <programlistingco>
+ <areaspec>
+ <area id="tutorials.simplest.parentref" coords="7"/>
+ <area id="tutorials.simplest.ifexists" coords="8"/>
+ <area id="tutorials.simplest.pagename" coords="12"/>
+ <area id="tutorials.simplest.windowname" coords="12"/>
+ <area id="tutorials.simplest.instanceref" coords="13"/>
+ <area id="tutorials.simplest.region" coords="14"/>
+ <area id="tutorials.simplest.height" coords="15"/>
+ </areaspec>
+ <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portal Object 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
+<deployments>
+ <deployment>
+ <parent-ref>default</parent-ref>
+ <if-exists>overwrite</if-exists>
+ <page>
+ <page-name>SimplestHelloWorld</page-name>
+ <window>
+ <window-name>SimplestHelloWorldWindow</window-name>
+ <instance-ref>SimplestHelloWorldInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ </page>
+ </deployment>
+</deployments>]]>
+ </programlisting>
+ <calloutlist>
+ <callout arearefs="tutorials.simplest.parentref">
+ <para>
+ Tells the portal where this portlet appears. In this case,
+ <computeroutput>default.default</computeroutput>
+ specifies that the portlet appears in the portal instance named
+ <computeroutput>default</computeroutput>
+ , and on the page named
+ <computeroutput>default</computeroutput>
+ .
+ </para>
+ </callout>
+ <callout arearefs="tutorials.simplest.ifexists">
+ <para>
+ Instructs the portal to overwrite or keep this object if it
+ already exists. Accepted values are
+ <computeroutput>overwrite</computeroutput>
+ and
+ <computeroutput>keep</computeroutput>
+ . The
+ <computeroutput>overwrite</computeroutput>
+ option destroys the existing object, and creates a new one based
+ on the content of the deployment. The
+ <computeroutput>keep</computeroutput>
+ option maintains the existing object deployment, or creates a new
+ one if it does not exist.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.simplest.pagename">
+ <para>
+ Here we are creating a new page to put the new window on. We give
+ that new page a name that will be by default used on the tab of
+ the default theme.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.simplest.windowname">
+ <para>
+ A
+ <emphasis role="bold">unique name</emphasis>
+ given to the portlet window. This can be named anything.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.simplest.instanceref">
+ <para>
+ The value of
+ <computeroutput><instance-ref></computeroutput>
+ must match the value of one of the
+ <computeroutput><instance-id></computeroutput>
+ elements found in the
+ <filename>
+ HelloWorldPortlet/WEB-INF/portlet-instances.xml
+ </filename>
+ file.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.simplest.region">
+ <para>
+ Specifies where the window appears within the page layout.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.simplest.height">
+ <para>
+ Specifies where the window appears within the page layout.
+ </para>
+ </callout>
+ </calloutlist>
+ </programlistingco>
+ <para>
+ The following diagram illustrates the relationship between the
+ <filename>portlet.xml</filename>
+ ,
+ <filename>portlet-instances.xml</filename>
+ , and
+ <filename>default-object.xml</filename>
+ descriptors:
+ </para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/tutorials/first_portlet/desc_relationship.png" align="center" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+
+ <para>
+ JBoss Portal 2.6 introduced the notion of
+ <emphasis>content-type</emphasis>
+ , which is a generic mechanism to specify what content displayed by a given
+ portlet window. The
+ <computeroutput>window</computeroutput>
+ section of the previous example,
+ <filename>SimplestHelloWorldPortlet/WEB-INF/default-object.xml</filename>
+ , can be re-written to take advantage of the new content framework. The
+ following is an example deployment descriptor that uses the new content
+ framework:
+ </para>
+ <programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portal Object 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
+<deployments>
+ <deployment>
+ <parent-ref>default.default</parent-ref>
+ <if-exists>overwrite</if-exists>
+ <window>
+ <window-name>SimplestHelloWorldWindow</window-name>
+ <content>
+ <content-type>portlet</content-type>
+ <content-uri>SimplestHelloWorldInstance</content-uri>
+ </content>
+ <region>center</region>
+ <height>1</height>
+ </window>
+ </deployment>
+</deployments>]]>
+ </programlisting>
+ <para>
+
+ This declaration is equivalent to the previous
+ <filename>SimplestHelloWorldPortlet/WEB-INF/default-object.xml</filename>
+ example. Use
+ <computeroutput><content-type></computeroutput>
+ to specify the content to display. In this example, the content being
+ displayed by the
+ <computeroutput>SimplestHelloWorldWindow</computeroutput>
+ is a
+ <computeroutput>portlet</computeroutput>
+ . The
+ <computeroutput><content-uri></computeroutput>
+ element specifies which content to display, which in this example, is the
+ <computeroutput>SimplestHelloWorldInstance</computeroutput>
+ :
+ </para>
+ <programlisting role="XML"><![CDATA[<content>
+ <content-type>portlet</content-type>
+ <content-uri>SimplestHelloWorldInstance</content-uri>
+</content>]]>
+ </programlisting>
+ <para>
+ To display certain content or a file, use the
+ <computeroutput>cms</computeroutput>
+ content-type, with the
+ <computeroutput><content-uri></computeroutput>
+ element being the path to the file in the CMS. This behavior is pluggable:
+ you can plug in almost any type of content.
+ </para>
+ <formalpara>
+ <title>Beware of context-path change</title>
+ <para>
+ If the context-path change the portal may not be able to find a
+ reference on your portlets anymore. For that reason it's recommended to
+ add the following descriptor
+ <filename>WEB-INF/jboss-portlet.xml</filename>
+ which is not mandatory:
+ </para>
+ </formalpara>
+<programlisting role="XML"><![CDATA[
+<!DOCTYPE portlet-app PUBLIC
+ "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
+
+<portlet-app>
+ <app-id>SimplestHelloWorld</app-id>
+</portlet-app>]]></programlisting>
+ </section>
+ </section>
+ <section>
+ <title>
+ <trademark class="trade">JavaServer</trademark>
+ Pages Portlet Example
+ </title>
+ <section>
+ <title>Introduction</title>
+ <para>
+ Now we will add more features to the previous example and also use a JSP
+ page to render the markup. We will use the portlet tag library to generate
+ links to our portlet in different ways and use the other standard portlet
+ modes. This example can be found in the directory
+ <literal>JSPHelloUser</literal>.
+ Use <literal>mvn package</literal> then copy <filename>JSPHelloUser/target/JSPHelloUser-0.0.1.war</filename>
+ in the <literal>deploy</literal> directory of JBoss Application Server.
+ Point your brwoser to <literal/>, you should see the following:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/tutorials/jsp_portlet/output.png" align="center" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ <note>
+ <para>The <literal>EDIT</literal> button only appears with logged-in users, which is not the case
+ on the screenshot</para>
+ </note>
+ </para>
+ </section>
+ <section>
+ <title>Package Structure</title>
+ <para>
+ The structure doesn't change much at the exception of adding some JSP files
+ detailed later.
+ </para>
+ <para>
+ The JSPHelloUser portlet contains the traditional portlet and JBoss Portal
+ specific application descriptors. The following is an example of the
+ directory structure of the JSPHelloUser portlet:
+ </para>
+ <programlisting><![CDATA[JSPHelloUser-0.0.1.war
+ |-- META-INF
+ | |-- MANIFEST.MF
+ | `-- maven
+ | `-- org.jboss.portal.example
+ | `-- JSPHelloUser
+ | |-- pom.properties
+ | `-- pom.xml
+ |-- WEB-INF
+ | |-- classes
+ | | `-- org
+ | | `-- jboss
+ | | `-- portal
+ | | `-- portlet
+ | | `-- samples
+ | | `-- JSPHelloUserPortlet.class
+ | |-- default-object.xml
+ | |-- jboss-portlet.xml
+ | |-- portlet-instances.xml
+ | |-- portlet.xml
+ | `-- web.xml
+ `-- jsp
+ |-- edit.jsp
+ |-- hello.jsp
+ |-- help.jsp
+ `-- welcome.jsp]]>
+ </programlisting>
+ </section>
+ <section>
+ <title>Portlet Class</title>
+ <para>Let's study the Java class in detail.</para>
+ <para>
+ The following file is the
+ <filename>
+ JSPHelloUser/src/main/java/org/jboss/portal/portlet/samples/JSPHelloUserPortlet.java
+ </filename>
+ Java source. It is split in different pieces.
+ </para>
+ <programlistingco>
+ <areaspec>
+ <area id="tutorials.jsphello.doView" coords="18"/>
+ <area id="tutorials.jsphello.renderParameter" coords="21"/>
+ <area id="tutorials.jsphello.requestDispatcher" coords="25"/>
+ <area id="tutorials.jsphello.include" coords="26"/>
+ </areaspec>
+ <programlisting role="JAVA"><![CDATA[package org.jboss.portal.portlet.samples;
+package org.jboss.portal.portlet.samples;
+
+import java.io.IOException;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.UnavailableException;
+
+public class JSPHelloUserPortlet extends GenericPortlet
+{
+
+ public void doView(RenderRequest request, RenderResponse response)
+ throws PortletException, IOException
+ {
+ String sYourName = (String) request.getParameter("yourname");
+ if (sYourName != null)
+ {
+ request.setAttribute("yourname", sYourName);
+ PortletRequestDispatcher prd =
+ getPortletContext().getRequestDispatcher("/jsp/hello.jsp");
+ prd.include(request, response);
+ }
+ else
+ {
+ PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/welcome.jsp");
+ prd.include(request, response);
+ }
+ }
+...]]></programlisting>
+ <calloutlist>
+ <callout arearefs="tutorials.jsphello.doView">
+ <para>
+ As in the first portlet, we override the
+ <emphasis>doView</emphasis>
+ method.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.jsphello.renderParameter">
+ <para>
+ Here we try to obtain the value of the render parameter names
+ <literal>yourname</literal>
+ . If defined we want to redirect to the
+ <filename>hello.jsp</filename>
+ JSP page, otherwise to the
+ <filename>welcome.jsp</filename>
+ JSP page.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.jsphello.requestDispatcher">
+ <para>
+ Very similar to the Servlet way, we get a request dispatcher on a
+ file located within the web archive.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.jsphello.include">
+ <para>
+ The last step is to perform the inclusion of the markup obtained
+ from the JSP.
+ </para>
+ </callout>
+ </calloutlist>
+ </programlistingco>
+ <para>
+ We have seen the
+ <literal>VIEW</literal>
+ portlet mode, the spec defines two other modes that can be used called
+ <literal>EDIT</literal>
+ and
+ <literal>HELP</literal>
+ . In order to enable those modes, they will need to be defined in the
+ <filename>portlet.xml</filename>
+ descriptor as we will see later. Having those modes defined will enable the
+ corresponding buttons on the portlet's window.
+ </para>
+ <para>
+ The generic portlet that is inherited dispatches the different views to
+ methods named:
+ <literal>doView</literal>
+ ,
+ <literal>doHelp</literal>
+ and
+ <literal>doEdit</literal>
+ . Let's watch the code for those two last portlet modes.
+ </para>
+ <programlisting role="JAVA"><![CDATA[...
+ protected void doHelp(RenderRequest rRequest, RenderResponse rResponse) throws PortletException, IOException,
+ UnavailableException
+ {
+ rResponse.setContentType("text/html");
+ PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/help.jsp");
+ prd.include(rRequest, rResponse);
+ }
+
+ protected void doEdit(RenderRequest rRequest, RenderResponse rResponse) throws PortletException, IOException,
+ UnavailableException
+ {
+ rResponse.setContentType("text/html");
+ PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/edit.jsp");
+ prd.include(rRequest, rResponse);
+ }
+...]]></programlisting>
+
+ <para>
+ If you have read the portlet specification carefully you should have notice
+ that portlet calls happen in one or two phases. One when the portlet is
+ just rendered, two when the portlet is actionned then rendered. An action
+ phase is a phase where some state change. The render phase will have access
+ to render parameters that will be passed each time the portlet is refreshed
+ (with the exception of caching capabilities).
+ </para>
+ <para>
+ The code to be executed during an action has to be implemented in the
+ <emphasis>processAction</emphasis>
+ method of the portlet.
+ </para>
+ <programlistingco>
+ <areaspec>
+ <area id="tutorials.jsphello.processAction" coords="2"/>
+ <area id="tutorials.jsphello.getActionParameter" coords="5"/>
+ <area id="tutorials.jsphello.setRenderParameter" coords="6"/>
+ </areaspec>
+ <programlisting role="JAVA"><![CDATA[...
+ public void processAction(ActionRequest aRequest, ActionResponse aResponse) throws PortletException, IOException,
+ UnavailableException
+ {
+ String sYourname = (String) aRequest.getParameter("yourname");
+ aResponse.setRenderParameter("yourname", sYourname);
+ }
+...]]></programlisting>
+ <calloutlist>
+ <callout arearefs="tutorials.jsphello.processAction">
+ <para>
+ <literal>processAction</literal>
+ is the method from GernericPorlet to override for the
+ <emphasis>action</emphasis>
+ phase.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.jsphello.getActionParameter">
+ <para>
+ Here we retrieve the parameter obtained through an
+ <emphasis>action URL</emphasis>
+ .
+ </para>
+ </callout>
+ <callout arearefs="tutorials.jsphello.setRenderParameter">
+ <para>
+ Here we need to keep the value of
+ <literal>yourname</literal>
+ to make it available in the rendering phase. With the previous
+ line, we are simply copying an action parameter to a render
+ parameter for the sake of this example.
+ </para>
+ </callout>
+ </calloutlist>
+ </programlistingco>
+ </section>
+ <section>
+ <title>
+ <trademark class="trade">JSP</trademark>
+ files and the Portlet Tag Library
+ </title>
+ <para>Let's have a look inside the JSP pages.</para>
+ <para>
+ The
+ <filename>help.jsp</filename>
+ and
+ <filename>edit.jsp</filename>
+ files are very simple, they simply display some text. Note that we used CSS
+ styles as defined in the portlet specification. It ensures that the portlet
+ will look "good" within the theme and accross portal vendors.
+ </para>
+ <programlisting role="XHTML"><![CDATA[<div class="portlet-section-header">Help mode</div>
+<div class="portlet-section-body">This is the help mode, a convenient place to give the user some help information.</div>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<div class="portlet-section-header">Edit mode</div>
+<div class="portlet-section-body">This is the edit mode, a convenient place to let the user change his portlet preferences.</div>]]></programlisting>
+ <para>
+ Now let's have a look at the landing page, it contains the links and form
+ to call our portlet:
+ </para>
+ <programlistingco>
+ <areaspec>
+ <area id="tutorials.jsphello.taglib" coords="1"/>
+ <area id="tutorials.jsphello.method1" coords="13"/>
+ <area id="tutorials.jsphello.method2.1" coords="20"/>
+ <area id="tutorials.jsphello.method2.2" coords="24"/>
+ <area id="tutorials.jsphello.method3.1" coords="30"/>
+ <area id="tutorials.jsphello.method3.2" coords="31"/>
+ </areaspec>
+
+ <programlisting><![CDATA[<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+
+<div class="portlet-section-header">Welcome !</div>
+
+<br/>
+
+<div class="portlet-font">Welcome on the JSP Hello User portlet,
+my name is JBoss Portal. What's yours ?</div>
+
+<br/>
+
+<div class="portlet-font">Method 1: We simply pass the parameter to the render phase:<br/>
+<a href="<portlet:renderURL><portlet:param name="yourname" value="John Doe"/>
+ </portlet:renderURL>">John Doe</a></div>
+
+<br/>
+
+<div class="portlet-font">Method 2: We pass the parameter to the render phase, using valid XML:
+Please check the source code to see the difference with Method 1.
+<portlet:renderURL var="myRenderURL">
+ <portlet:param name="yourname" value='John Doe'/>
+</portlet:renderURL>
+<br/>
+<a href="<%= myRenderURL %>">John Doe</a></div>
+
+<br/>
+
+<div class="portlet-font">Method 3: We use a form:<br/>
+
+<portlet:actionURL var="myActionURL"/>
+<form action="<%= myActionURL %>" method="POST">
+ <span class="portlet-form-field-label">Name:</span>
+ <input class="portlet-form-input-field" type="text" name="yourname"/>
+ <input class="portlet-form-button" type="Submit"/>
+</form>
+</div>]]></programlisting>
+ <calloutlist>
+ <callout arearefs="tutorials.jsphello.taglib">
+ <para>
+ Since we will use the portlet taglib, we first need to declare it.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.jsphello.method1">
+ <para>
+ The first method showed here is the simplest one,
+ <literal>portlet:renderURL</literal>
+ will create a URL that will call the render phase of the current
+ portlet and append the result at the place of the markup (Here
+ within a tag...). We also added a parameter directly on the URL.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.jsphello.method2.1">
+ <para>
+ In this method instead of having a tag within another tag, which
+ is not XML valid, we use the
+ <literal>var</literal>
+ attribute. Instead of printing the url the
+ <literal>portlet:renderURL</literal>
+ tag will store the result in the referenced variable (
+ <literal>myRenderURL</literal>
+ in our case).
+ </para>
+ </callout>
+ <callout arearefs="tutorials.jsphello.method2.2">
+ <para>
+ The variable
+ <literal>myRenderURL</literal>
+ is used like any other JSP variable.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.jsphello.method3.1">
+ <para>
+ The third method mixes form submission and action request. Like in
+ the second method, we used a temporary variable to put the created
+ URL into.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.jsphello.method3.2">
+ <para>The action URL is used in the HTML form.</para>
+ </callout>
+ </calloutlist>
+ </programlistingco>
+
+ <para>
+ On the third method, first the action phase is triggered then later in the request, the render
+ phase is triggered, which output some content back to the web browser based on the
+ available render parameters.
+ <mediaobject>
+ <imageobject>
+ <imagedata format="PNG" fileref="images/tutorials/jsp_portlet/process.png" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ </section>
+ <section>
+ <title>
+ <trademark class="trade">JSF</trademark>
+ example using the JBoss Portlet Bridge
+ </title>
+ <para>In order to write a portlet using JSF we need a piece of software called 'bridge' that
+ lets us write a portlet application as if it was a JSF application, the bridge takes care of the
+ interactions between the two layers.</para>
+ <para>Such an example is available in examples/JSFHelloUser, it uses the JBoss Portlet Bridge.
+ The configuration is slightly different from a JSP application, since it is a bit tricky it is usally a good
+ idea to copy an existing application that starting from scratch.</para>
+ <para>First, as any JSF application, the file <literal>faces-config.xml</literal> is required. It includes
+ the following required information in it:
+ <programlisting role="XML"><![CDATA[<faces-config>
+...
+ <application>
+ <view-handler>org.jboss.portletbridge.application.PortletViewHandler</view-handler>
+ <state-manager>org.jboss.portletbridge.application.PortletStateManager</state-manager>
+ </application>
+...
+</faces-config> ]]></programlisting>
+ The portlet bridge libraries must be available and are usually bundled with the <literal>WEB-INF/lib</literal>
+ directory of the web archive.</para>
+ <para>The other difference compare to a regular portlet application, can be found in the portlet
+ descriptor. All details about it can be found in the JSR-301 specification that the JBoss Portlet Bridge
+ implements.
+ <programlistingco>
+ <areaspec>
+ <area id="tutorials.jsf.portlet" coords="9"/>
+ <area id="tutorials.jsf.view" coords="21"/>
+ <area id="tutorials.jsf.edit" coords="26"/>
+ <area id="tutorials.jsf.help" coords="31"/>
+ </areaspec>
+ <programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
+ http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+ <portlet>
+ <portlet-name>JSFHelloUserPortlet</portlet-name>
+ <portlet-class>javax.portlet.faces.GenericFacesPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>view</portlet-mode>
+ <portlet-mode>edit</portlet-mode>
+ <portlet-mode>help</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>JSF Hello User Portlet</title>
+ </portlet-info>
+
+ <init-param>
+ <name>javax.portlet.faces.defaultViewId.view</name>
+ <value>/jsf/welcome.jsp</value>
+ </init-param>
+
+ <init-param>
+ <name>javax.portlet.faces.defaultViewId.edit</name>
+ <value>/jsf/edit.jsp</value>
+ </init-param>
+
+ <init-param>
+ <name>javax.portlet.faces.defaultViewId.help</name>
+ <value>/jsf/help.jsp</value>
+ </init-param>
+
+ </portlet>
+</portlet-app>]]></programlisting>
+ <calloutlist>
+ <callout arearefs="tutorials.jsf.portlet"><para>All JSF portlets define <literal>javax.portlet.faces.GenericFacesPortlet</literal>
+ as portlet class. This class is part of the JBoss Portlet Bridge</para></callout>
+ <callout arearefs="tutorials.jsf.view"><para>This is a mandatory parameter to define what's the default page to display.</para></callout>
+ <callout arearefs="tutorials.jsf.edit"><para>This parameter defines which page to display on the 'edit' mode.</para></callout>
+ <callout arearefs="tutorials.jsf.help"><para>This parameter defines which page to display on the 'help' mode.</para></callout>
+ </calloutlist>
+ </programlistingco>
+ </para>
+ </section>
+ </section>
+ </section>
+</chapter>
+ <chapter id="xmldescriptors">
+ <!-- <chapterinfo>
+ <author>
+ <firstname>Thomas</firstname>
+ <surname>Heute</surname>
+ </author>
+ <author>
+ <firstname>Roy</firstname>
+ <surname>Russo</surname>
+ </author>
+ </chapterinfo>-->
+ <title>XML Descriptors</title>
+ <section>
+ <title>DTDs</title>
+ <para>
+ To use a DTD, add the following declaration to the start of the desired descriptors:
+ </para>
+<programlisting role="XML"><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE deployments PUBLIC
+"-//JBoss Portal//DTD Portal Object 2.6//EN"
+"http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">]]>
+</programlisting>
+ <para>
+ If you do not use the DTD declaration, the previous mechanism for XML validation is used. The DTD is more strict, specifically with the order of XML elements. The following is an example from a <filename>*-object.xml</filename> descriptor, which is valid if you are not using the DTD, but is rejected if you are:
+ </para>
+ <programlisting role="XML"><![CDATA[
+<if-exists>overwrite</if-exists>
+<parent-ref>default.default</parent-ref>]]>
+</programlisting>
+ <para>
+ The correct element order, and one which is valid against the DTD, is as follows:
+ </para>
+<programlisting role="XML"><![CDATA[
+<parent-ref>default.default</parent-ref>
+<if-exists>overwrite</if-exists>]]>
+</programlisting>
+ <para>
+ The following DTDs are available:
+ </para>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ for <filename>-object.xml</filename> descriptors: <userinput>"-//JBoss Portal//DTD Portal Object 2.6//EN"</userinput>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ for <filename>jboss-app.xml</filename> descriptors: <userinput>"-//JBoss Portal//DTD JBoss Web Application 2.6//EN"</userinput>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ for <filename>jboss-portlet.xml</filename> descriptors: <userinput>"-//JBoss Portal//DTD JBoss Portlet 2.6//EN"</userinput>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ for <filename>portlet-instances.xml</filename> descriptors: <userinput>"-//JBoss Portal//DTD Portlet Instances 2.6//EN"</userinput>
+ </para>
+ </listitem>
+ </itemizedlist>
+</para>
+<para>
+ The DTDs are located in the <filename>$JBOSS_HOME/server/<replaceable>configuration</replaceable>/deploy/jboss-portal.sar/dtd/</filename> directory.
+</para>
+ <section>
+ <title>The JBoss Portlet DTD</title>
+ <para>
+ The following items refer to elements found in the JBoss Portlet DTD, <filename>$JBOSS_HOME/server/<replaceable>configuration</replaceable>/deploy/jboss-portal.sar/dtd/jboss-portlet_<replaceable>version_number</replaceable>.dtd</filename>:
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT portlet-app (remotable?,portlet*,service*)>]]>
+</programlisting>
+ <para>
+ Use the <computeroutput><remotable></computeroutput> element to configure the default behavior of portlets with respect to WSRP exposure: if no value is given, the value is either the value globally defined at the portlet application level, or <computeroutput>false</computeroutput>. Accepted values are <computeroutput>true</computeroutput> and <computeroutput>false</computeroutput>.
+ </para>
+ <para>
+ You can configure specific settings of the portlet container for each portlet defined in the <filename>WEB-INF/portlet.xml</filename> file. Use the <computeroutput><service></computeroutput> element to inject services into the portlet context of applications.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT portlet (portlet-name,remotable?,ajax?,session-config?,transaction?,
+header-content?,portlet-info?)>]]>
+</programlisting>
+ <para>
+ Additional configuration of the portlet. The <computeroutput><portlet-name></computeroutput> element defines the portlet name. It must match a portlet defined in the <filename>WEB-INF/portlet.xml</filename> file for that application.
+ </para>
+ <para>
+ Use the <computeroutput><remotable></computeroutput> element to configure the default behavior of portlets with respect to WSRP exposure: if no value is given, the value is either the value globally defined at the portlet application level, or <computeroutput>false</computeroutput>.
+ </para>
+ <para>
+ The <computeroutput><trans-attribute></computeroutput> element specifies the behavior of the portlet when it is invoked at runtime with respect to the transactional context. Depending on how the portlet is
+ invoked, a transaction may or may not exist before the portlet is invoked. The portal transaction is usually present in the local context. The default value is <computeroutput>NotSupported</computeroutput>, which means that the portal transaction is suspended for the duration of the portlet's invocation. Accepted values are <computeroutput>Required</computeroutput>, <computeroutput>Mandatory</computeroutput>, <computeroutput>Never</computeroutput>, <computeroutput>Supports</computeroutput>, <computeroutput>NotSupported</computeroutput>, and <computeroutput>RequiresNew</computeroutput>.
+ </para>
+ <para>
+ The following is an example section from a <filename>WEB-INF/portlet.xml</filename> file, which uses the <computeroutput><portlet-name></computeroutput>, <computeroutput><remotable></computeroutput>, and <computeroutput><trans-attribute></computeroutput> elements:
+ </para>
+<programlisting role="XML"><![CDATA[
+<portlet>
+ <portlet-name>MyPortlet</portlet-name>
+ <remotable>true</remotable>
+ <trans-attribute>Required</trans-attribute>
+</portlet>]]>
+</programlisting>
+<programlisting><![CDATA[
+<!ELEMENT portlet-name (#PCDATA)>]]>
+</programlisting><para>
+ The portlet name.
+ </para>
+ <programlisting><![CDATA[
+<!ELEMENT remotable (#PCDATA)>]]>
+</programlisting>
+ <para>
+ Accepted values are <computeroutput>true</computeroutput> and <computeroutput>false</computeroutput>.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT ajax (partial-refresh)>]]>
+</programlisting>
+ <para>
+ Use the <computeroutput>ajax</computeroutput> element to configure the Asynchronous JavaScript and XML (AJAX) capabilities of the portlet.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT partial-refresh (#PCDATA)>]]>
+</programlisting>
+ <para>
+ If a portlet uses the <computeroutput>true</computeroutput> value for the <computeroutput><partial-refresh></computeroutput> element, the portal uses partial-page refreshing and only renders that portlet. If the <computeroutput><partial-refresh></computeroutput> element uses a <computeroutput>false</computeroutput> value, the portal uses a full-page refresh when the portlet is refreshed.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT session-config (distributed)>]]>
+</programlisting>
+ <para>
+ The <computeroutput><session-config></computeroutput> element configures the portlet session for the portlet. The <computeroutput><distributed></computeroutput> element instructs the container to distribute the session attributes using portal session replication. This only applies to local portlets, not remote portlets.
+ </para>
+ <para>
+ The following is an example of the <computeroutput><session-config></computeroutput> and <computeroutput><distributed></computeroutput> elements:
+ </para>
+<programlisting role="XML"><![CDATA[
+<session-config>
+ <distributed>true</distributed>
+</session-config>]]>
+</programlisting>
+<programlisting><![CDATA[
+<!ELEMENT distributed (#PCDATA)>]]>
+</programlisting>
+ <para>
+ Accepted values are <computeroutput>true</computeroutput> and <computeroutput>false</computeroutput>. The default value is <computeroutput>false</computeroutput>.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT transaction (trans-attribute)>]]>
+</programlisting>
+ <para>
+ The <computeroutput><transaction></computeroutput> element defines how the portlet behaves with regards to the transactional context. The <computeroutput><trans-attribute></computeroutput> element specifies the behavior of the portlet when it is invoked at runtime, with respect to the transactional context. Depending on how the portlet is invoked, a transaction may or may not exist before the portlet is invoked. The portal transaction is usually present in the local context.
+ </para>
+ <para>
+ The following is an example of the <computeroutput><transaction></computeroutput> and <computeroutput><trans-attribute></computeroutput> elements:
+ </para>
+<programlisting role="XML"><![CDATA[
+<transaction>
+ <trans-attribute>Required</transaction>
+<transaction>]]>
+</programlisting>
+<programlisting><![CDATA[
+<!ELEMENT trans-attribute (#PCDATA)>]]>
+</programlisting>
+ <para>
+ The default value is <computeroutput>NotSupported</computeroutput>, which means that the portal transaction is suspended for the duration of the portlet's invocation. Accepted values are <computeroutput>Required</computeroutput>, <computeroutput>Mandatory</computeroutput>, <computeroutput>Never</computeroutput>, <computeroutput>Supports</computeroutput>, <computeroutput>NotSupported</computeroutput>, and <computeroutput>RequiresNew</computeroutput>.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT header-content (link|script|meta)*>]]>
+</programlisting>
+ <para>
+ Specify the content to be included in the portal aggregated page when the portlet is present on that page. This setting only applies when the portlet is used in the local mode.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT link EMPTY>]]>
+</programlisting>
+ <para>
+ No content is allowed inside a link element.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT script (#PCDATA)>]]>
+</programlisting>
+ <para>
+ Use the <computeroutput><script></computeroutput> element for inline script definitions.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT meta EMPTY>]]>
+</programlisting>
+ <para>
+ No content is allowed for the <computeroutput><meta></computeroutput> element.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT service (service-name,service-class,service-ref)>]]>
+</programlisting>
+ <para>
+ Declare a service that will be injected by the portlet container as an attribute of the portlet context.
+ </para>
+ <para>
+ The following is an example of the <computeroutput><service></computeroutput> element:
+ </para>
+<programlisting role="XML"><![CDATA[
+<service>
+ <service-name>UserModule</service-name>
+ <service-class>org.jboss.portal.identity.UserModule</service-class>
+ <service-ref>:service=Module,type=User</service-ref>
+</service>]]>
+</programlisting>
+ <para>
+ To use an injected service in a portlet, perform a lookup of the <computeroutput><service-name></computeroutput>, for example, using the <computeroutput>init()</computeroutput> lifecycle method:
+ </para>
+<programlisting role="JAVA"><![CDATA[
+public void init()
+{
+ UserModule userModule = (UserModule)getPortletContext().getAttribute("UserModule");
+}]]>
+</programlisting>
+<programlisting><![CDATA[
+<!ELEMENT service-name (#PCDATA)>]]>
+</programlisting>
+ <para>
+ The <computeroutput><service-name></computeroutput> element defines the name that binds the service as a portlet context attribute.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT service-class (#PCDATA)>]]>
+</programlisting>
+ <para>
+ The <computeroutput><service-class></computeroutput> element defines the fully qualified name of the interface that the service implements.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT service-ref (#PCDATA)>]]>
+</programlisting>
+ <para>
+ The <computeroutput><service-ref></computeroutput> element defines the reference to the service. In the JMX Microkernel environment, this consist of the JMX name of the service MBean. For an MBean reference, if the domain is left out, the current domain of the portal is used.
+ </para>
+ </section>
+ <section>
+ <title>The JBoss Portlet Instance DTD</title>
+ <para>
+ The following items refer to elements found in the JBoss Portlet Instance DTD, <filename>$JBOSS_HOME/server/<replaceable>configuration</replaceable>/deploy/jboss-portal.sar/dtd/portlet-instances_<replaceable>version_number</replaceable>.dtd</filename>:
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT deployments (deployment*)>]]>
+</programlisting>
+ <para>
+ The <computeroutput><deployments></computeroutput> element is a container for <computeroutput><deployment></computeroutput> elements.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT deployment (if-exists?,instance)>]]>
+</programlisting>
+ <para>
+ The <computeroutput><deployment></computeroutput> element is a container for the <computeroutput><instance></computeroutput> element.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT if-exists (#PCDATA)>]]>
+</programlisting>
+ <para>
+ The <computeroutput><if-exists></computeroutput> element defines the action to take if an instance with the same name already exists. Accepted values are <computeroutput>overwrite</computeroutput> and <computeroutput>keep</computeroutput>. The <computeroutput>overwrite</computeroutput> option destroys the existing object, and creates a new one based on the content of the deployment. The <computeroutput>keep</computeroutput> option maintains the existing object deployment, or creates a new one if it does not exist.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT instance (instance-id,portlet-ref,display-name*,preferences?,
+security-constraint?, (display-name* | (resource-bundle, supported-locale+)))>]]>
+</programlisting>
+ <para>
+ The <computeroutput><instance></computeroutput> element is used in the <filename>WEB-INF/portlet-instances.xml</filename> file, which creates instances of portlets. The portlet will only be created and configured if the portlet is present, and if an instance with the same name does not already exist.
+ </para>
+ <para>
+ The following is an example of the <computeroutput><instance></computeroutput> element, which also contains the <computeroutput><security-constraint></computeroutput> element. Descriptions of each element follow afterwards:
+ </para>
+<programlisting role="XML"><![CDATA[
+<instance>
+ <instance-id>MyPortletInstance</instance-id>
+ <portlet-ref>MyPortlet</portlet-ref>
+ <preferences>
+ <preference>
+ <name>abc</name>
+ <value>def</value>
+ </preference>
+ </preferences>
+ <security-constraint>
+ <policy-permission>
+ <role-name>User</role-name>
+ <action-name>view</action-name>
+ </policy-permission>
+ </security-constraint>
+</instance>]]>
+</programlisting>
+<programlisting><![CDATA[
+<!ELEMENT instance-id (#PCDATA)>]]>
+</programlisting>
+ <para>
+ The instance identifier. The <computeroutput><instance-id></computeroutput> value can be named anything, but it must match the <computeroutput><instance-ref></computeroutput>value given in the <filename>*-object.xml</filename> file.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT portlet-ref (#PCDATA)>]]>
+</programlisting>
+ <para>
+ The <computeroutput><portlet-ref></computeroutput> element defines the portlet that an instance represents. The <computeroutput><portlet-ref></computeroutput> value must match the <computeroutput><portlet-name></computeroutput> given in the <filename>WEB-INF/portlet.xml</filename> file.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT preferences (preference+)>]]>
+</programlisting>
+ <para>
+ The <computeroutput><preferences></computeroutput> element configures an instance with a set of preferences.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT preference (name,value)>]]>
+</programlisting>
+ <para>
+ The <computeroutput><preference></computeroutput> element configures one preference, which is part of a set of preferences. Use the <computeroutput><preferences></computeroutput> element to define a set of preferences.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT name (#PCDATA)>]]>
+</programlisting>
+ <para>
+ A name.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT value (#PCDATA)>]]>
+</programlisting>
+ <para>
+ A string value.
+ </para>
+ <programlisting><![CDATA[
+<!ELEMENT security-constraint (policy-permission*)>]]>
+</programlisting>
+ <para>
+ The <computeroutput><security-constraint></computeroutput> element is a container for <computeroutput><policy-permission></computeroutput> elements. The following is an example of the <computeroutput><security-constraint></computeroutput> and <computeroutput><policy-permission></computeroutput> elements:
+ </para>
+<programlisting role="XML"><![CDATA[
+<security-constraint>
+ <policy-permission>
+ <role-name>User</role-name>
+ <action-name>view</action-name>
+ </policy-permission>
+</security-constraint>
+
+<security-constraint>
+ <policy-permission>
+ <unchecked/>
+ <action-name>view</action-name>
+ </policy-permission>
+</security-constraint>]]>
+</programlisting>
+<programlisting><![CDATA[
+<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>]]>
+</programlisting>
+ <para>
+ The <computeroutput><policy-permission></computeroutput> element secures a specific portlet instance based on a user's role.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT action-name (#PCDATA)>]]>
+</programlisting>
+ <para>
+ The <computeroutput><action-name></computeroutput> element defines the access rights given to the role defined. Accepted values are:
+ </para>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <computeroutput>view</computeroutput>: users can view the page.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <computeroutput>viewrecursive</computeroutput>: users can view the page and child pages.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <computeroutput>personalize</computeroutput>: users are able personalize the page's theme.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <computeroutput>personalizerecursive</computeroutput>: users are able personalize the page and child pages themes.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT unchecked EMPTY>]]>
+</programlisting>
+ <para>
+ If present, the <computeroutput><unchecked></computeroutput> element defines anyone can view the instance.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT role-name (#PCDATA)>]]>
+</programlisting>
+ <para>
+ The <computeroutput><role-name></computeroutput> element defines a role that the security constraint will apply to. The following example only allows users that are part of the <computeroutput>EXAMPLEROLE</computeroutput> role to access the instance:
+ </para>
+<programlisting role="XML"><![CDATA[
+<role-name>EXAMPLEROLE</role-name>]]>
+</programlisting>
+ </section>
+ <section>
+ <title>The JBoss Portal Object DTD</title>
+ <para>
+ The following items refer to elements found in the JBoss Portal Object DTD, <filename>$JBOSS_HOME/server/<replaceable>configuration</replaceable>/deploy/jboss-portal.sar/dtd/portal-object_<replaceable>version_number</replaceable>.dtd</filename>:
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT deployments (deployment*)>]]>
+</programlisting>
+ <para>
+ The <computeroutput><deployments></computeroutput> element is a container for <computeroutput><deployment></computeroutput> elements.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT deployment (parent-ref?,if-exists?,(context|portal|page|window))>]]>
+</programlisting>
+ <para>
+ The <computeroutput><deployment></computeroutput> element is a generic container for portal object elements. The <computeroutput><parent-ref></computeroutput> child element gives the name of the parent object that the current object will use as parent. The optional <computeroutput><if-exists></computeroutput> element defines the action to take if an instance with the same name already exists. The default behavior of the <computeroutput><if-exists></computeroutput> element is to keep the existing object, and not to create a new object.
+ </para>
+ <para>
+ The following is an example of the <computeroutput><deployment></computeroutput> and <computeroutput><parent-ref></computeroutput> elements:
+ </para>
+<programlisting role="XML"><![CDATA[
+<deployment>
+ <parent-ref>default</parent-ref>
+ <page>
+ ...
+ </page>
+</deployment>]]>
+</programlisting>
+ <para>
+ All portal objects have a common configuration which can include:
+ </para>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ a listener: specifies the ID of a listener in the listener registry. A listener object is able to listen to portal events, which apply to the portal node hierarchy.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ properties: a set of generic properties owned by the portal object. Certain properties drive the behavior of the portal object.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ security-constraint: defines the security configuration for the portal object.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT parent-ref (#PCDATA)>]]>
+</programlisting>
+ <para>
+ The <computeroutput><parent-ref></computeroutput> element contains a reference to the parent object. The naming convention for naming objects is to concatenate the names of the path to the object, and separate the names using a period. If the path is empty, the empty string must be used. The <computeroutput><parent-ref></computeroutput> element tells the portal where the portlet appears. The syntax for the <computeroutput><parent-ref></computeroutput> element is <computeroutput><replaceable>portal-instance</replaceable>.<replaceable>portal-page</replaceable></computeroutput>.
+ </para>
+ <para>
+ The following is an example of the root having an empty path:
+ </para>
+<programlisting role="XML">
+<parent-ref />
+</programlisting>
+ <para>
+ The following specifies that the portlet appears in the portal instance named <computeroutput>default</computeroutput>:
+ </para>
+<programlisting role="XML">
+<parent-ref>default</parent-ref>
+</programlisting>
+ <para>
+ The following specifies that the portlet appear in the portal instance named <computeroutput>default</computeroutput>, and on the page named <computeroutput>default</computeroutput>:
+ </para>
+<programlisting role="XML">
+<parent-ref>default.default</parent-ref>
+</programlisting>
+<programlisting><![CDATA[
+<!ELEMENT if-exists (#PCDATA)>]]>
+</programlisting>
+ <para>
+ The <computeroutput><if-exists></computeroutput> element defines the action to take if an instance with the same name already exists. Accepted values are <computeroutput>overwrite</computeroutput> and <computeroutput>keep</computeroutput>. The <computeroutput>overwrite</computeroutput> option destroys the existing object, and creates a new one based on the content of the deployment. The <computeroutput>keep</computeroutput> option matains the existing object deployment, or creates a new one if it does not exist.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT context (context-name,properties?,listener?,security-constraint?,portal*,
+(display-name* | (resource-bundle, supported-locale+)))>]]>
+</programlisting>
+ <para>
+ The context type of the portal object. A context type represent a node in a tree, which does not have a visual representation, and only exists under the root. A context can only have children that use the <emphasis>portal</emphasis> type.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT context-name (#PCDATA)>]]>
+</programlisting>
+ <para>
+ The context name.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT portal (portal-name,supported-modes,supported-window-states?,properties?,listener?,
+security-constraint?,page*, (display-name* | (resource-bundle, supported-locale+)))>]]>
+</programlisting>
+ <para>
+ A portal object that uses the <emphasis>portal</emphasis> type. A portal type represents a virtual portal, and can only have children that use the <emphasis>page</emphasis> type. In addition to the common portal object elements, it also allows you to declare modes and window states that are supported.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT portal-name (#PCDATA)>]]>
+</programlisting>
+ <para>
+ The portal name.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT supported-modes (mode*)>]]>
+</programlisting>
+ <para>
+ The <computeroutput><supported-modes></computeroutput> elements defines the supported modes of the portal. Accepted values are <computeroutput>view</computeroutput>, <computeroutput>edit</computeroutput>, and <computeroutput>help</computeroutput>.
+ </para>
+ <para>
+ The following is an example of the <computeroutput><supported-mode></computeroutput> and <computeroutput><mode></computeroutput> elements:
+ </para>
+<programlisting role="XML"><![CDATA[
+<supported-mode>
+ <mode>view</mode>
+ <mode>edit</mode>
+ <mode>help</mode>
+</supported-mode>]]>
+</programlisting>
+<programlisting><![CDATA[
+<!ELEMENT mode (#PCDATA)>]]>
+</programlisting>
+ <para>
+ The portlet mode value. If there are no declarations of modes or window states, the default values are <computeroutput>view</computeroutput>, <computeroutput>edit</computeroutput>, <computeroutput>help</computeroutput>, and <computeroutput>normal</computeroutput>, <computeroutput>minimized</computeroutput>, <computeroutput>maximized</computeroutput>, respectively.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT supported-window-states (window-state*)>]]>
+</programlisting>
+ <para>
+ Use the <computeroutput><supported-window-states></computeroutput> element to define the supported window states of the portal. The following is an example of the <computeroutput><supported-window-states></computeroutput> and <computeroutput><window-state></computeroutput> elements:
+ </para>
+<programlisting role="XML"><![CDATA[
+<supported-window-states>
+ <window-state>normal</window-state>
+ <window-state>minimized</window-state>
+ <window-state>maximized</window-state>
+</supported-window-states>]]>
+</programlisting>
+<programlisting><![CDATA[
+<!ELEMENT window-state (#PCDATA)>]]>
+</programlisting>
+ <para>
+ Use the <computeroutput><window-state></computeroutput> element to define a window states. Accepted values are <computeroutput>normal</computeroutput>, <computeroutput>minimized</computeroutput>, and <computeroutput>maximized</computeroutput>.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT page (page-name,properties?,listener?,security-constraint?,(page | window)*,
+(display-name* | (resource-bundle, supported-locale+)))>]]>
+</programlisting>
+ <para>
+ A portal object that uses the <emphasis>page</emphasis> type. A page type represents a page, and can only have children that use the <emphasis>page</emphasis> and <emphasis>window</emphasis> types. The children windows are the windows of the page, and the children pages are the subpages of the page.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT page-name (#PCDATA)>]]>
+</programlisting>
+ <para>
+ The page name.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT window (window-name,(instance-ref|content),region,height,initial-window-state?,
+initial-mode?,properties?,listener?, (display-name* | (resource-bundle, supported-locale+)))>]]>
+</programlisting>
+ <para>
+ A portal object that uses the <emphasis>window</emphasis> type. A window type represents a window. Besides the common properties, a window has content, and belongs to a region on the page.
+ </para>
+ <para>
+ The <computeroutput><instance-ref></computeroutput> and <computeroutput><content></computeroutput> elements, configured in the <filename>WEB-INF/*-object.xml</filename> files, define the content of a window. The <computeroutput><content></computeroutput> element is generic, and describes any kind of content. The <computeroutput><instance-ref></computeroutput> element is a shortcut to define the content-type of the portlet, which points to a portlet instance. The value of <computeroutput><instance-ref></computeroutput> must match the value of one of the <computeroutput><instance-id></computeroutput> elements in the <filename>WEB-INF/portlet-instances.xml</filename> file.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT window-name (#PCDATA)>]]>
+</programlisting>
+ <para>
+ The window name value.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT instance-ref (#PCDATA)>]]>
+</programlisting>
+ <para>
+ Define the content of the window as a reference to a portlet instance. This value is the ID of a portlet instance, and must much the value of one of the <computeroutput><instance-id></computeroutput> elements in the <filename>WEB-INF/portlet-instances.xml</filename> file. The following is an example of the <computeroutput><instance-ref></computeroutput> element:
+ </para>
+<programlisting role="XML">
+<instance-ref>MyPortletInstance</instance-ref>
+</programlisting>
+<programlisting><![CDATA[
+<!ELEMENT region (#PCDATA)>]]>
+</programlisting>
+ <para>
+ The region the window belongs to. The <computeroutput><region></computeroutput> element specifies where the window appears on the page.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT height (#PCDATA)>]]>
+</programlisting>
+ <para>
+ The height of the window in a particular region.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT listener (#PCDATA)>]]>
+</programlisting>
+ <para>
+ Define a listener for a portal object. This value is the ID of the listener.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT content (content-type,content-uri)>]]>
+</programlisting>
+ <para>
+ Define the content of a window in a generic manner. The content is defined by the type of content, and a URI, which acts as an identifier for the content. The following is an example of the <computeroutput><content></computeroutput> element, which is configured in the <filename>WEB-INF/*-object.xml</filename> files:
+ </para>
+<programlisting role="XML"><![CDATA[
+<content>
+ <content-type>portlet</content-type>
+ <content-uri>MyPortletInstance</content-uri>
+</content>
+
+<content>
+ <content-type>cms</content-type>
+ <content-uri>/default/index.html</content-uri>
+</content>]]>
+</programlisting>
+<programlisting><![CDATA[
+<!ELEMENT content-type (#PCDATA)>]]>
+</programlisting>
+ <para>
+ The content type of the window. The <computeroutput><content-type></computeroutput> element specifies the content to display, for example, a <computeroutput>portlet</computeroutput>.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT content-uri (#PCDATA)>]]>
+</programlisting>
+ <para>
+ The content URI of the window. The <computeroutput><content-uri></computeroutput> element specifies which content to display, for example, a portlet instance. To display a file from the CMS, use the <computeroutput><content-uri></computeroutput> element to define the full path to that file in the CMS.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT properties (property*)>]]>
+</programlisting>
+ <para>
+ A set of generic properties for the portal object. The <computeroutput><properties></computeroutput> elements contain definitions specific to a portal object.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT property (name,value)>]]>
+</programlisting>
+ <para>
+ A generic string property. The following table lists accepted values. This table is not exhaustive:
+ <table>
+ <title>Properties</title>
+ <tgroup cols="2" align="left" colsep="1" rowsep="1">
+ <colspec colname="name"/>
+ <colspec colname="description"/>
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><computeroutput>layout.id</computeroutput></entry>
+ <entry>Defines the layout to use for the portal object and sub-objects if they do not override the value.</entry>
+ </row>
+ <row>
+ <entry><computeroutput>theme.id</computeroutput></entry>
+ <entry>Defines the theme used for the portal object and sub-objects if they do not override the value.</entry>
+ </row>
+ <row id="xml.default.objectname.property">
+ <entry><computeroutput>portal.defaultObjectName</computeroutput></entry>
+ <entry>Defines the default child object. If applied to a <literal>context</literal>, it defines the default portal. If applied to a <literal>portal</literal>, it defines the default portal page.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT name (#PCDATA)>]]>
+</programlisting>
+ <para>
+ A name value.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT value (#PCDATA)>]]>
+</programlisting>
+ <para>
+ A value.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT security-constraint (policy-permission*)>]]>
+</programlisting>
+ <para>
+ The <computeroutput><security-constraint></computeroutput> element is a container for <computeroutput><policy-permission></computeroutput> elements. The following is an example of the <computeroutput><security-constraint></computeroutput> and <computeroutput><policy-permission></computeroutput> elements:
+ </para>
+<programlisting role="XML"><![CDATA[
+<security-constraint>
+ <policy-permission>
+ <role-name>User</role-name>
+ <action-name>view</action-name>
+ </policy-permission>
+</security-constraint>
+
+<security-constraint>
+ <policy-permission>
+ <unchecked/>
+ <action-name>view</action-name>
+ </policy-permission>
+</security-constraint>]]>
+</programlisting>
+<programlisting><![CDATA[
+<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>]]>
+</programlisting>
+ <para>
+ The <computeroutput><policy-permission></computeroutput> element is secures a specific portlet instance based on a user's role.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT action-name (#PCDATA)>]]>
+</programlisting>
+ <para>
+ The <computeroutput><action-name></computeroutput> element defines the access rights given to the role defined. Accepted values are:
+ </para>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <computeroutput>view</computeroutput>: users can view the page.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <computeroutput>viewrecursive</computeroutput>: users can view the page and child pages.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <computeroutput>personalize</computeroutput>: users are able personalize the page's theme.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <computeroutput>personalizerecursive</computeroutput>: users are able personalize the page and child pages themes.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT unchecked EMPTY>]]>
+</programlisting>
+ <para>
+ If present, the <computeroutput><unchecked></computeroutput> element defines that anyone can view the instance.
+ </para>
+<programlisting><![CDATA[
+<!ELEMENT role-name (#PCDATA)>]]>
+</programlisting>
+ <para>
+ The <computeroutput><role-name></computeroutput> element defines a role that the security constraint applies to. The following example only allows users that are part of the <computeroutput>EXAMPLEROLE</computeroutput> role to access the instance:
+ </para>
+<programlisting><![CDATA[
+<role-name>EXAMPLEROLE</role-name>]]>
+</programlisting>
+ </section>
+ <section>
+ <title>The JBoss Portal App DTD</title>
+ <para>
+ The following items refer to elements found in the JBoss Portal App DTD, <filename>$JBOSS_HOME/server/<replaceable>configuration</replaceable>/jboss-portal.sar/dtd/jboss-app_<replaceable>version_number</replaceable>.dtd</filename>:
+ </para>
+<programlisting><![CDATA[
+<Element <![CDATA[<!ELEMENT jboss-app (app-name?)>]]>
+</programlisting>
+<programlisting><![CDATA[
+<!DOCTYPE jboss-app PUBLIC
+ "-//JBoss Portal//DTD JBoss Web Application 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-app_2_6.dtd">]]>
+</programlisting>
+<programlisting><![CDATA[
+<!ELEMENT app-name (#PCDATA)>]]>
+</programlisting>
+ <para>
+ When a web application is deployed, the context path under which it is deployed
+ is taken as the application name. The application name value in the <computeroutput><app-name></computeroutput> element overrides it. When a component references a portlet, it needs to reference the application too, and if the portlet application WAR file is renamed,
+ the reference is no longer valid; therefore, the <computeroutput><app-name></computeroutput> element is used to have an application name that does not depend upon the context path, under which the application is deployed.
+ </para>
+ </section>
+ </section>
+ <section id="descriptors_portlet">
+ <title>Portlet Descriptors</title>
+ <para>
+ The following sections describe the descriptors that define portal objects, such as portals, pages, portlet instances, windows, and portlets. Refer to <xref linkend="tutorials_tutorials"/> and <xref linkend="desc_examples"/> for examples on using these descriptors within a portlet application.
+ </para>
+ <section id="desc_objectxml">
+ <title><filename>*-object.xml</filename> Descriptors</title>
+ <para>
+ The <filename>*-object.xml</filename> descriptors define portal instances, pages, windows, and the window layout. As well, themes and layouts for specific portal instances, pages, and windows, can be defined. The following example defines a portlet window being added to the <computeroutput>default</computeroutput> page, in the <computeroutput>default</computeroutput> portal. For advanced functionality using these descriptors, refer to <xref linkend="desc_examples"/>:
+ </para>
+ <programlisting role="XML"><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portal Object 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
+<deployments>
+ <deployment>
+ <parent-ref>default.default</parent-ref>
+ <if-exists>overwrite</if-exists>
+ <window>
+ <window-name>HelloWorldJSPPortletWindow</window-name>
+ <instance-ref>HelloWorldJSPPortletInstance</instance-ref>
+ <region>center</region>
+ <height>1</height>
+ </window>
+ </deployment>
+</deployments>]]></programlisting>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <programlisting><![CDATA[<deployments>...</deployments>]]></programlisting>
+ </para>
+ <para>
+ The <computeroutput><deployments></computeroutput> element encapsulates the entire document, and is a container for <computeroutput><deployment></computeroutput> elements. Multiple deployments can be specified within the <computeroutput><deployments></computeroutput> element.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <programlisting><![CDATA[<deployment>...</deployment>]]></programlisting>
+ </para>
+ <para>
+ The <computeroutput><deployment></computeroutput> element specifies object deployments, such as portals, pages, windows, and so on.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <programlisting><![CDATA[<if-exists>...</if-exists>]]></programlisting>
+ </para>
+ <para>
+ The <computeroutput><if-exists></computeroutput> element defines the action to take if an instance with the same name already exists. Accepted values are <computeroutput>overwrite</computeroutput> and <computeroutput>keep</computeroutput>. The <computeroutput>overwrite</computeroutput> option destroys the existing object, and creates a new one based on the content of the deployment. The <computeroutput>keep</computeroutput> option maintains the existing object deployment, or creates a new one if it does not exist.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <programlisting><![CDATA[<parent-ref>...</parent-ref>]]></programlisting>
+ </para>
+ <para>
+ The <computeroutput><parent-ref></computeroutput> element contains a reference to the parent object. The naming convention for naming objects is to concatenate the names of the path to the object, and separate the names using a period. If the path is empty, the empty string must be used. The <computeroutput><parent-ref></computeroutput> element tells the portal where the portlet appears. The syntax for the <computeroutput><parent-ref></computeroutput> element is <computeroutput><replaceable>portal-instance</replaceable>.<replaceable>portal-page</replaceable></computeroutput>.
+ </para>
+ <para>
+ In the example above, a window is defined, and assigned to <computeroutput>default.default</computeroutput>. This means the window appears on the <computeroutput>default</computeroutput> page, in the <computeroutput>default</computeroutput> portal.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <programlisting><![CDATA[<window>...</window>]]></programlisting>
+ </para>
+ <para>
+ The <computeroutput><window></computeroutput> element defines a portlet window. The <computeroutput><window></computeroutput> element requires an <computeroutput><instance-ref></computeroutput> element, which assigns a portal instance to a window.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <programlisting><![CDATA[<window-name>...</window-name>]]></programlisting>
+ </para>
+ <para>
+ The <computeroutput><window-name></computeroutput> element defines the <emphasis role="bold">unique name</emphasis> given to a portlet window. This can be named anything.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <programlisting><![CDATA[<instance-ref>...</instance-ref>]]></programlisting>
+ </para>
+ <para>
+ The <computeroutput><instance-ref></computeroutput> elements define the portlet instances that windows represent. This value is the ID of a portlet instance, and must match the value of one of the <computeroutput><instance-id></computeroutput> elements in the <filename>WEB-INF/portlet-instances.xml</filename> file.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+<programlisting><![CDATA[
+<region>...</region>
+<height>...</height>]]></programlisting>
+ </para>
+ <para>
+ The <computeroutput><region></computeroutput> and <computeroutput><height></computeroutput> elements define where the window appears within the page layout. The <computeroutput><region></computeroutput> element specifies where the window appears on the page. The <computeroutput><region></computeroutput> element often depends on other regions defined in the portal layout. The <computeroutput><height></computeroutput> element can be assigned a value between one and <replaceable>X</replaceable>.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>The previous <filename>*-object.xml</filename> example makes reference to items found in other descriptor files. The following diagram illustrates the relationship between the <filename>portlet.xml</filename>, <filename>portlet-instances.xml</filename>, and <filename>*-object.xml</filename> descriptors:
+ </para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/tutorials/first_portlet/desc_relationship.png" valign="middle" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>
+ <note>
+ <title>Are <filename>*-object.xml</filename> descriptors required?</title>
+ <para>
+ Technically, they are not. The portal object hierarchy, such as creating portals, pages, instances, and organizing them on the page, can be defined using the management portlet, which is accessible to JBoss Portal administrators.
+ </para>
+ </note>
+ </para>
+ </section>
+ <section id="desc_instancesxml">
+ <title>The <filename>portlet-instances.xml</filename> Descriptor</title>
+ <para>
+ The <filename>portlet-instances.xml</filename> descriptor is JBoss Portal specific, and allows developers to instantiate one-or-many instances of one-or-many portlets. The benefit of this allows one portlet to be instantiated several times, with different preference parameters. The following example instantiates two separate instances of the <computeroutput>NewsPortlet</computeroutput>, both using different parameters. One instance draws feeds from Red Hat announcements, and the other from McDonalds announcements:
+ </para>
+ <para>
+<programlisting><![CDATA[
+<?xml version="1.0" standalone="yes"?>
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
+<deployments>
+ <deployment>
+ <instance>
+ <instance-id>NewsPortletInstance1</instance-id>
+ <portlet-ref>NewsPortlet</portlet-ref>
+ <preferences>
+ <preference>
+ <name>expires</name>
+ <value>180</value>
+ </preference>
+ <preference>
+ <name>RssXml</name>
+ <value>http://finance.yahoo.com/rss/headline?s=rhat</value>
+ </preference>
+ </preferences>
+ <security-constraint>
+ <policy-permission>
+ <action-name>view</action-name>
+ <unchecked/>
+ </policy-permission>
+ </security-constraint>
+ </instance>
+ </deployment>
+ <deployment>
+ <instance>
+ <instance-id>NewsPortletInstance2</instance-id>
+ <portlet-ref>NewsPortlet</portlet-ref>
+ <preferences>
+ <preference>
+ <name>expires</name>
+ <value>180</value>
+ </preference>
+ <preference>
+ <name>RssXml</name>
+ <value>http://finance.yahoo.com/rss/headline?s=mcd</value>
+ </preference>
+ </preferences>
+ <security-constraint>
+ <policy-permission>
+ <action-name>view</action-name>
+ <unchecked/>
+ </policy-permission>
+ </security-constraint>
+ </instance>
+ </deployment>
+</deployments>
+]]></programlisting>
+ </para>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <programlisting><![CDATA[<deployments>...</deployments>]]></programlisting>
+ </para>
+ <para>
+ The <computeroutput><deployments></computeroutput> element encapsulates the entire document, and is a container for <computeroutput><deployment></computeroutput> elements. Multiple deployments can be specified within the <computeroutput><deployments></computeroutput> element.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+<programlisting><![CDATA[
+<deployment>
+ <instance>...</instance>
+</deployment>]]></programlisting>
+ </para>
+ <para>
+ The <computeroutput><deployment></computeroutput> element, and the embedded <computeroutput><instance></computeroutput> element, specify a portlet instance. The <computeroutput><deployment></computeroutput> element specifies object deployments, such as portals, pages, windows, and so on. The <computeroutput><instance></computeroutput> element creates instances of portlets. The portlet will only be created and configured if the portlet is present, and if an instance with the same name does not already exist.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <programlisting><![CDATA[<instance-id>...</instance-id>]]></programlisting>
+ </para>
+ <para>
+ The <computeroutput><instance-id></computeroutput> elements defines a <emphasis role="bold">unique name</emphasis> given to an instance of a portlet. The <computeroutput><instance-id></computeroutput> value can be named anything, but it must match the value of one of the <computeroutput><instance-ref></computeroutput> elements in the <filename>WEB-INF/*-object.xml</filename> file.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <programlisting><![CDATA[<portlet-ref>...</portlet-ref>]]></programlisting>
+ </para>
+ <para>
+ The <computeroutput><portlet-ref></computeroutput> element defines the portlet that an instance represents. The <computeroutput><portlet-ref></computeroutput> value must match the <computeroutput><portlet-name></computeroutput> given in the <filename>WEB-INF/portlet.xml</filename> file.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+<programlisting><![CDATA[
+<preferences>
+ <preference>...</preference>
+</preferences>]]></programlisting>
+ </para>
+ <para>
+ The <computeroutput><preference></computeroutput> element configures a preference as a key-value pair. This value can be composed of a single string value, for example, the preference <emphasis>fruit</emphasis> can have the <emphasis>apple</emphasis> value. As well, this value can be composed of multiple strings, for example, the preference <emphasis>fruits</emphasis> can have values of <emphasis>apple</emphasis>, <emphasis>orange</emphasis>, and <emphasis>kiwi</emphasis>:
+ </para>
+ <para>
+<programlisting><![CDATA[
+<preferences>
+ <preference>
+ <name>fruits</name>
+ <value>apple</value>
+ <value>orange</value>
+ <value>kiwi</value>
+ </preference>
+</preferences>
+]]></programlisting>
+ </para>
+ <para>
+ The <computeroutput><preference></computeroutput> element configures one preference, which is part of a set of preferences. Use the <computeroutput><preferences></computeroutput> element to define a set of preferences.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+<programlisting><![CDATA[<security-constraint>
+ <policy-permission>
+ <action-name>viewrecursive</action-name>
+ <unchecked/>
+ </policy-permission>
+</security-constraint>]]></programlisting>
+ </para>
+ <para>
+ The <computeroutput><security-constraint></computeroutput> element is a container for <computeroutput><policy-permission></computeroutput> elements. This example demonstrates the <computeroutput><security-constraint></computeroutput> and <computeroutput><policy-permission></computeroutput> elements.
+ </para>
+ <para>
+ The <computeroutput><action-name></computeroutput> element defines the access rights given to the role defined. Accepted values are:
+ </para>
+ <para>
+ <itemizedlist>
+ <listitem override="bullet">
+ <para>
+ <computeroutput>view</computeroutput>: users can view the page.
+ </para>
+ </listitem>
+ <listitem override="bullet">
+ <para>
+ <computeroutput>viewrecursive</computeroutput>: users can view the page and child pages.
+ </para>
+ </listitem>
+ <listitem override="bullet">
+ <para>
+ <computeroutput>personalize</computeroutput>: users are able personalize the page's theme.
+ </para>
+ </listitem>
+ <listitem override="bullet">
+ <para>
+ <computeroutput>personalizerecursive</computeroutput>: users are able personalize the page and child pages themes.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ You must define a role that the security constraint will apply to:
+ </para>
+ <para>
+ <itemizedlist>
+ <listitem override="bullet">
+ <para>
+ <computeroutput>unchecked</computeroutput>: anyone can view the page.
+ </para>
+ </listitem>
+ <listitem override="bullet">
+ <para>
+ <computeroutput><role-name>EXAMPLEROLE</role-name></computeroutput>: only allow users that are part of the <computeroutput>EXAMPLEROLE</computeroutput> role to access the instance.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+</itemizedlist>
+</para>
+ <para>
+ The previous <filename>portlet-instances.xml</filename> example makes reference to items found in other descriptor files. The following diagram illustrates the relationship between the <filename>portlet.xml</filename>, <filename>portlet-instances.xml</filename>, and <filename>*-object.xml</filename> descriptors:
+ </para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/tutorials/first_portlet/desc_relationship.png" valign="middle" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <note>
+ <title>Is the <filename>portlet-instances.xml</filename> descriptor required?</title>
+ <para>
+ Technically, it is not. The portal object hierarchy, such as creating portals, pages, instances, and organizing them on the page, can be defined using the management portlet, which is accessible to JBoss Portal administrators.
+ </para>
+ </note>
+ </section>
+ <section>
+ <title>The <filename>jboss-portlet.xml</filename> Descriptor</title>
+ <para>
+ The <filename>jboss-portlet.xml</filename> descriptor allows you to use JBoss-specific functionality within your portlet application. This descriptor is covered by the <ulink url="http://www.jcp.org/en/jsr/detail?id=168">JSR-168 Portlet Specification</ulink>, and is normally packaged inside your portlet WAR file, alongside the other descriptors in these sections.
+ </para>
+ <section>
+ <title>Injecting Header Content</title>
+ <para>
+ The following example injects a specific style sheet, <computeroutput>/images/management/management.css</computeroutput>, allowing the portlet to leverage a specific style:
+ </para>
+ <para>
+<programlisting><![CDATA[
+<?xml version="1.0" standalone="yes"?>
+<!DOCTYPE portlet-app PUBLIC
+ "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
+<portlet-app>
+ <portlet>
+ <portlet-name>ManagementPortlet</portlet-name>
+ <header-content>
+ <link rel="stylesheet" type="text/css" href="/images/management/management.css"
+ media="screen"/>
+ </header-content>
+ </portlet>
+</portlet-app>]]>
+</programlisting>
+ </para>
+ <para>
+ Use the <computeroutput><header-content></computeroutput> and <computeroutput><link></computeroutput> elements to specify a style sheet.
+ </para>
+ </section>
+ <section>
+ <title>Injecting Services in the portlet Context</title>
+ <para>
+ The following example injects the <computeroutput>UserModule</computeroutput> service as an attribute to the portlet context:
+ </para>
+ <para>
+<programlisting><![CDATA[
+<?xml version="1.0" standalone="yes"?>
+<!DOCTYPE portlet-app PUBLIC
+ "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
+<portlet-app>
+ <service>
+ <service-name>UserModule</service-name>
+ <service-class>org.jboss.portal.identity.UserModule</service-class>
+ <service-ref>:service=Module,type=User</service-ref>
+ </service>
+</portlet-app>]]>
+</programlisting>
+ </para>
+ <para>
+ This allows the portlet to leverage the service, for example:
+ </para>
+ <para>
+<programlisting><![CDATA[
+UserModule userModule = (UserModule) getPortletContext().getAttribute("UserModule");
+String userId = request.getParameters().getParameter("userid");
+User user = userModule.findUserById(userId);]]>
+</programlisting>
+ </para>
+ </section>
+ <section>
+ <title>Defining extra portlet Information</title>
+ <para>
+ As of JBoss Portal 2.6.3, icons can be defined for a portlet by using the <computeroutput><icon></computeroutput>, <computeroutput><small-icon></computeroutput>, and <computeroutput><large-icon></computeroutput> elements:
+ </para>
+ <para>
+<programlisting><![CDATA[
+<?xml version="1.0" standalone="yes"?>
+<!DOCTYPE portlet-app PUBLIC
+ "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
+<portlet-app>
+ <portlet>
+ <portlet-name>ManagementPortlet</portlet-name>
+ <portlet-info>
+ <icon>
+ <small-icon>/images/smallIcon.png</small-icon>
+ <large-icon>/images/largeIcon.png</small-icon>
+ </icon>
+ </portlet-info>
+ </portlet>
+</portlet-app>]]>
+</programlisting>
+ </para>
+ <para>
+ References to icons can be absolute, for example, <emphasis>http://www.example.com/images/smallIcon.png</emphasis>, or relative to the web application context, for example, <computeroutput>/images/smallIcon.png</computeroutput>. Icons can be used by different parts of the portlet user interface.
+ </para>
+ </section>
+ <section>
+ <title>Portlet Session Replication in a Clustered Environment</title>
+
+ <para>
+ For information about portlet session replication in clustered environments, refer to <xref linkend="portlet_session_replication"/>.
+ </para>
+ <para>
+ <note>
+ <title>Is the <filename>jboss-portlet.xml</filename> descriptor required?</title>
+ <para>
+ Technically, it is not; however, it may be required to access JBoss-specific functionality that is not covered by the Portlet specification.
+ </para>
+ </note>
+ </para>
+ </section>
+ </section>
+ <section>
+ <title>The <filename>portlet.xml</filename> Descriptor</title>
+ <para>
+ The <filename>portlet.xml</filename> descriptor is the standard portlet descriptor covered by the <ulink url="http://www.jcp.org/en/jsr/detail?id=168">JSR-168 Portlet Specification</ulink>. Developers are strongly encouraged to read the <ulink url="http://www.jcp.org/en/jsr/detail?id=168">JSR-168 Portlet Specification</ulink> items covering the correct use of this descriptor, as it is only covered briefly in these sections. Normally the <filename>portlet.xml</filename> descriptor is packaged inside your portlet WAR file, alongside the other descriptors in these sections. The following example is a modified version of the JBoss Portal UserPortlet definition:
+ </para>
+ <para>
+<programlisting><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app
+ xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
+ http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0">
+ <portlet>
+ <description>Portlet providing user login/logout and profile management</description>
+ <portlet-name>UserPortlet</portlet-name>
+ <display-name>User Portlet</display-name>
+ <portlet-class>org.jboss.portal.core.portlet.user.UserPortlet</portlet-class>
+ <init-param>
+ <description>Initialize the portlet with a default page to render</description>
+ <name>>default-view</name>
+ <value>/WEB-INF/jsf/objects.xhtml</value>
+ </init-param>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <supported-locale>en</supported-locale>
+ <supported-locale>fr</supported-locale>
+ <supported-locale>es</supported-locale>
+ <resource-bundle>Resource</resource-bundle>
+ <portlet-info>
+ <title>User portlet</title>
+ </portlet-info>
+ </portlet>
+</portlet-app>]]>
+</programlisting>
+ </para>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <programlisting><![CDATA[<portlet-app>...</portlet-app>]]></programlisting>
+ </para>
+ <para>
+ The <computeroutput><portlet-app></computeroutput> element encapsulates the entire document. Multiple portlets can be specified using the <computeroutput><portlet-app></computeroutput> element.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <programlisting><![CDATA[<portlet>...</portlet>]]></programlisting>
+ </para>
+ <para>
+ The <computeroutput><portlet></computeroutput> element defines one portlet that is deployed within this archive.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <programlisting><![CDATA[<description>...</description>]]></programlisting>
+ </para>
+ <para>
+ The <computeroutput><description></computeroutput> element is a verbal description of the portlet's function.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <programlisting><![CDATA[<portlet-name>...</portlet-name>]]></programlisting>
+ </para>
+ <para>
+ The <computeroutput><portlet-name></computeroutput> element defines the portlet name. It does not have to be the class name.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <programlisting><![CDATA[<portlet-class>...</portlet-class>]]></programlisting>
+ </para>
+ <para>
+ The <computeroutput><portlet-class></computeroutput> element defines the Fully Qualified Name (FQN) of the portlet class.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <programlisting><![CDATA[
+<init-param>
+ <name>...</name>
+ <value>...</value>
+</init-param>]]></programlisting>
+ </para>
+ <para>
+ The <computeroutput><init-param></computeroutput> element specifies initialization parameters to create an initial state inside your portlet class. This is usually used in the portlet's <emphasis>init()</emphasis> method, but not necessarily. Unlike a preference, an init-parameter is data that does not change at runtime and does not go into a database. If the value is changed in the descriptor, the change takes immediate effect after re-deploying the portlet. Multiple <computeroutput><init-param></computeroutput> elements can be used.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <programlisting><![CDATA[<supports>...</supports>]]></programlisting>
+ </para>
+ <para>
+ The <computeroutput><supports></computeroutput> element declares all of the markup types that a portlet supports. Use the <computeroutput><mime-type></computeroutput> element to declare supported capabilities, for example, if the only outputs are text and HTML, use <computeroutput><mime-type>text/html</mime-type></computeroutput>. Use the <computeroutput><portlet-mode></computeroutput> element to define the supported portlet modes for the portlet. For example, all portlets must support the <computeroutput>view</computeroutput> portlet mode, which is defined using <computeroutput><portlet-mode>view</portlet-mode></computeroutput>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <programlisting><![CDATA[<supported-locale>...</supported-locale>]]></programlisting>
+ </para>
+ <para>
+ The <computeroutput><supported-locale></computeroutput> elements advertise the supported locales for the portlet. Use multiple <computeroutput><supported-locale></computeroutput> elements to specify multiple locales.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <programlisting><![CDATA[<resource-bundle>...</resource-bundle>]]></programlisting>
+ </para>
+ <para>
+ The <computeroutput><resource-bundle></computeroutput> element specifies the resource bundle that contains the localized information for the specified locales.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <programlisting><![CDATA[
+<portlet-info>
+ <title>...</title>
+</portlet-info>]]></programlisting>
+ </para>
+ <para>
+ The <computeroutput><title></computeroutput> element defines the portlet's title, which is displayed in the portlet window's title bar.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ <warning>
+ <title>The <filename>portlet.xml</filename> Example</title>
+ <para>
+ This <filename>portlet.xml</filename> example is not a replacement for what is covered in the <ulink url="http://www.jcp.org/en/jsr/detail?id=168">JSR-168 Portlet Specification</ulink>.
+ </para>
+ </warning>
+ </para>
+ </section>
+ </section>
+ <section id="portaldescriptors">
+ <title>JBoss Portal Descriptors</title>
+ <para>
+ This section describes Datasource descriptors, which are required for JBoss Portal to communicate with a database, and briefly covers the <filename>jboss-portal.sar/conf/config.xml</filename> descriptor, which can be used for configuring logging, and configuring which page a user goes to when they log in.
+ </para>
+ <section id="descriptor_ds">
+ <title>Datasource Descriptors (<filename>portal-*-ds.xml</filename>)</title>
+ <para>
+ JBoss Portal requires a Datasource descriptor to be deployed alongside the <filename>jboss-portal.sar</filename>, in order to communicate with a database. This section explains where to obtain template Datasource descriptors, how to compile them from source, and how to configure them for your installation. For an in-depth introduction to datasources, refer to the JBoss AS documentation online on the <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfigDataSources">JBoss Datasource Wiki page</ulink>.
+ </para>
+ <section>
+ <title>Datasource Descriptors included in Binary releases</title>
+ <para>
+ Several template Datasource descriptors are included in the binary and bundled distributions of JBoss Portal. They are commonly located in the <filename>jboss-portal-<replaceable>version</replaceable>/setup/</filename> directory:
+ </para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/setup/package.png" valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>
+ The <filename>jboss-portal-<replaceable>version</replaceable>/setup/</filename> directory contains sample Datasource descriptors for the MySQL, Microsoft SQL Server, PostgreSQL, and Oracle databases, which can be customized for your own database:
+ </para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/setup/dsfiles.png" valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ </section>
+ <section>
+ <title>Building Datasource Descriptors from Source</title>
+ <para>
+ To build the Datasource descriptors from source:
+ </para>
+ <para>
+ <orderedlist>
+ <listitem>
+ <para>
+ Obtain the JBoss Portal source code: <xref linkend="install_source"/>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Configure the <computeroutput>JBOSS_HOME</computeroutput> environment variable: <xref linkend="install_source_env"/>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Change into the <filename>JBOSS_PORTAL_SOURCE_DIRECTORY/build/</filename> directory. To build the JBoss Portal source code on Linux, run the <command>sh build.sh deploy</command> command, or, if you are running Windows, run the <command>build.bat deploy</command> command. If this is the first build, third-party libraries are obtained from an online repository, so you must be connected to the Internet. After building, if the <filename>JBOSS_PORTAL_SOURCE_DIRECTORY/thirdparty/</filename> directory does not exist, it is created, and populated with the files required for later steps. For further details, refer to <xref linkend="building_deploying_from_source"/>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Change into the <filename>JBOSS_PORTAL_SOURCE_DIRECTORY/core/</filename> directory, and run the <command>sh build.sh datasource</command> command, or, if you are running Windows, run the <command>build.bat datasource</command> command:
+ </para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" valign="middle" fileref="images/setup/build_ds.png" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <para>
+ Note: if the JBoss Portal source was not built as per step 3, the <command>sh build.sh datasource</command> and <command>build.bat datasource</command> commands fail with an error, such as the following:
+ </para>
+ <para>
+<programlisting><![CDATA[
+BUILD FAILED
+java.io.FileNotFoundException: /jboss-portal-2.6.3.GA-src/core/../thirdparty/libraries.ent
+(No such file or directory)]]>
+</programlisting>
+ </para>
+ <para>
+ The datasource build process produces the following directory and file structure, with the Datasource descriptors in the <filename>JBOSS_PORTAL_SOURCE_DIRECTORY/core/output/resources/setup</filename> directory:
+ </para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" valign="middle" fileref="images/setup/build_ds_dir.png"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>
+ The following is an example Datasource descriptor for a PostgreSQL database:
+ </para>
+ <para>
+<programlisting><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<datasources>
+ <local-tx-datasource>
+ <jndi-name>PortalDS</jndi-name>
+ <connection-url>jdbc:postgresql:jbossportal</connection-url>
+ <driver-class>org.postgresql.Driver</driver-class>
+ <user-name>portal</user-name>
+ <password>portalpassword</password>
+ </local-tx-datasource>
+</datasources>]]>
+</programlisting>
+ </para>
+ <para>
+ Make sure the <computeroutput>user-name</computeroutput>, <computeroutput>password</computeroutput>, <computeroutput>connection-url</computeroutput>, and <computeroutput>driver-class</computeroutput>, are correct for your chosen database.
+ </para>
+ </section>
+ </section>
+ <section id="descriptor_debug">
+ <title>Portlet Debugging (<filename>jboss-portal.sar/conf/config.xml</filename>)</title>
+ <para>
+ By default, JBoss Portal is configured to display all errors. This behavior can be configured by modifying the <filename>jboss-portal.sar/conf/config.xml</filename> file:
+ </para>
+ <para>
+<programlisting><![CDATA[
+<!-- When a window has restrictedaccess : show or hide values are permitted -->
+<entry key="core.render.window_access_denied">show</entry>
+<!-- When a window is unavailable : show or hide values are permitted -->
+<entry key="core.render.window_unavailable">show</entry>
+<!-- When a window produces an error : show, hide or message_only values are permitted -->
+<entry key="core.render.window_error">message_only</entry>
+<!-- When a window produces an internal error : show, hide are permitted -->
+<entry key="core.render.window_internal_error">show</entry>
+<!-- When a window is not found : show or hide values are permitted -->
+<entry key="core.render.window_not_found">show</entry>]]>
+</programlisting>
+ </para>
+ <para>
+ For these parameters, accepted values are <computeroutput>show</computeroutput> and <computeroutput>hide</computeroutput>. Depending on the setting, and the actual error, either an error message is displayed, or a full stack trace within the portlet window occurs. Additionally, the <computeroutput>core.render.window_error</computeroutput> property supports the <computeroutput>message_only</computeroutput> value. The <computeroutput>message_only</computeroutput> value will only display an error message, whereas the <computeroutput>show</computeroutput> value will, if available, display the full stack trace.
+ </para>
+ </section>
+ <section>
+ <title>Log in to Dashboard</title>
+ <para>
+ By default, when a user logs in they are forwarded to the default page of the default portal. In order to
+ forward a user to their Dashboard, set the <computeroutput>core.login.namespace</computeroutput> value to <computeroutput>dashboard</computeroutput> in the <filename>jboss-portal.sar/conf/config.xml</filename> file:
+ </para>
+ <para>
+<programlisting><![CDATA[
+<!-- Namespace to use when logging-in, use "dashboard" to directly
+log-in the dashboard otherwise use "default" -->
+<entry key="core.login.namespace">dashboard</entry>
+]]></programlisting>
+ </para>
+ </section>
+ </section>
+ <section id="desc_examples">
+ <title>Descriptor Examples</title>
+ <section id="desc_example_page">
+ <title>Defining a new Portal Page</title>
+ <para>
+ The sample application descriptor in this section creates a new page, <computeroutput>MyPage</computeroutput>, in a portal. To illustrate this example, download the <ulink url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles/HelloWorl...">HelloWorldPortalPage</ulink> portlet. To use the HelloWorldPortalPage portlet:
+ </para>
+ <para>
+ <orderedlist>
+ <listitem>
+ <para>
+ Download the <ulink url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles/HelloWorl...">HelloWorldPortalPage</ulink> portlet.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Unzip the <filename>HelloWorldPortalPage</filename> ZIP file.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ To expand the WAR file, which gives you access to the XML descriptors, change into the <filename>HelloWorldPortalPage/</filename> directory, and run the <command>ant explode</command> command.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ If you did not expand the <filename>helloworldportalpage.war</filename> file, copy the <filename>helloworldportalpage.war</filename> file into the correct JBoss AS or JBoss EAP <filename>deploy/</filename> directory. If you expanded the <filename>helloworldportalpage.war</filename> file, copy the <filename>HelloWorldPortalPage/output/lib/exploded/helloworldportalpage.war/</filename> directory into the correct JBoss AS or JBoss EAP <filename>deploy/</filename> directory. For example, if you are using the <computeroutput>default</computeroutput> JBoss AS profile, copy the WAR file or the expanded directory into the <filename>$JBOSS_HOME/server/default/deploy/</filename> directory.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <para>
+ The HelloWorldPortalPage portlet is hot-deployable, so the JBoss EAP or JBoss AS server does not have to be restarted after deploying the HelloWorldPortalPage portlet. The following is an example of the <filename>HelloWorldPortalPage/WEB-INF/helloworld-object.xml</filename> descriptor:
+ </para>
+ <para>
+<programlisting><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portal Object 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
+<deployments>
+ <deployment>
+ <if-exists>overwrite</if-exists>
+ <parent-ref>default</parent-ref>
+ <properties/>
+ <page>
+ <page-name>MyPage</page-name>
+ <window>
+ <window-name>HelloWorldPortletPageWindow</window-name>
+ <instance-ref>HelloWorldPortletPageInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ <security-constraint>
+ <policy-permission>
+ <unchecked/>
+ <action-name>viewrecursive</action-name>
+ </policy-permission>
+ </security-constraint>
+ </page>
+ </deployment>
+</deployments>]]>
+</programlisting>
+ </para>
+ <para>
+ A depoloyment is composed of a <computeroutput><deployments></computeroutput> element, which is a container for <computeroutput><deployment></computeroutput> elements. In the previous example, a page is defined, the portlet is placed as a window on a page, and an instance of the portlet is created. The Mangement portlet (bundled with JBoss Portal) can modify portal instances, page position, and so on.
+ </para>
+ <para>
+ The following list describes elements in a <filename>*-object.xml</filename> file:
+ </para>
+ <para>
+ <itemizedlist>
+ <listitem>
+<programlisting>
+<if-exists>
+</programlisting>
+ <para>
+ The <computeroutput><if-exists></computeroutput> element defines the action to take if an instance with the same name already exists. Accepted values are <computeroutput>overwrite</computeroutput> and <computeroutput>keep</computeroutput>. The <computeroutput>overwrite</computeroutput> option destroys the existing object, and creates a new one based on the content of the deployment. The <computeroutput>keep</computeroutput> option matains the existing object deployment, or creates a new one if it does not exist.
+ </para>
+ </listitem>
+ <listitem>
+<programlisting>
+<parent-ref>
+</programlisting>
+ <para>
+ The <computeroutput><parent-ref></computeroutput> element contains a reference to the parent object. The naming convention for naming objects is to concatenate the names of the path to the object, and separate the names using a period. If the path is empty, the empty string must be used. The <computeroutput><parent-ref></computeroutput> element tells the portal where the portlet appears. The syntax for the <computeroutput><parent-ref></computeroutput> element is <computeroutput><replaceable>portal-instance</replaceable>.<replaceable>portal-page</replaceable></computeroutput>.
+ </para>
+ </listitem>
+ <listitem>
+<programlisting>
+<properties>
+</programlisting>
+ <para>
+ A set of generic properties for the portal object. The <computeroutput><properties></computeroutput> elements contains definitions specific to a page. This is commonly used to define the specific theme and layout to use. If not defined, the default portal theme and layout are used.
+ </para>
+ </listitem>
+ <listitem>
+<programlisting>
+<page>
+</programlisting>
+ <para>
+ The start of a page definition. Among others, the <computeroutput><page></computeroutput> element is a container for the <computeroutput><page-name></computeroutput>, <computeroutput><window></computeroutput>, and <computeroutput><security-constraint></computeroutput> elements.
+ </para>
+ </listitem>
+ <listitem>
+<programlisting>
+<page-name>
+</programlisting>
+ <para>
+ The page name.
+ </para>
+ </listitem>
+ <listitem>
+<programlisting>
+<window>
+</programlisting>
+ <para>
+ The <computeroutput><window></computeroutput> element defines a portlet window. The <computeroutput><window></computeroutput> element requires an <computeroutput><instance-ref></computeroutput> element, which assigns a portal instance to a window.
+ </para>
+ </listitem>
+ <listitem>
+<programlisting>
+<window-name>
+</programlisting>
+ <para>
+ The <computeroutput><window-name></computeroutput> element defines the <emphasis role="bold">unique name</emphasis> given to a portlet window. This can be named anything.
+ </para>
+ </listitem>
+ <listitem>
+<programlisting>
+<instance-ref>
+</programlisting>
+ <para>
+ The <computeroutput><instance-ref></computeroutput> elements define the portlet instances that windows represent. This value is the ID of a portlet instance, and must match the value of one of the <computeroutput><instance-id></computeroutput> elements in the <filename>WEB-INF/portlet-instances.xml</filename> file.
+ </para>
+ </listitem>
+ <listitem>
+<programlisting>
+<region>...</region>
+<height>...</height>
+</programlisting>
+ <para>
+ The <computeroutput><region></computeroutput> and <computeroutput><height></computeroutput> elements define where the window appears within the page layout. The <computeroutput><region></computeroutput> element specifies where the window appears on the page. The <computeroutput><region></computeroutput> element often depends on other regions defined in the portal layout. The <computeroutput><height></computeroutput> element can be assigned a value between one and <replaceable>X</replaceable>.
+ </para>
+ </listitem>
+ <listitem>
+<programlisting>
+<instance>
+</programlisting>
+ <para>
+ The <computeroutput><instance></computeroutput> element creates instances of portlets. The portlet will only be created and configured if the portlet is present, and if an instance with the same name does not already exist.
+ </para>
+ </listitem>
+ <listitem>
+<programlisting>
+<instance-name>
+</programlisting>
+ <para>
+ The <computeroutput><instance-name></computeroutput> element maps to the <computeroutput><instance-ref></computeroutput> element.
+ </para>
+ </listitem>
+ <listitem>
+<programlisting>
+<component-ref>
+</programlisting>
+ <para>
+ The <computeroutput><component-ref></computeroutput> element takes the name of the application, followed by the name of the portlet, as defined in the <filename>WEB-INF/portlet.xml</filename> file.
+ </para>
+ </listitem>
+ </itemizedlist>
+</para>
+<para>
+ The <computeroutput><security-constraint></computeroutput> element is a container for <computeroutput><policy-permission></computeroutput> elements. The following is an example of the <computeroutput><security-constraint></computeroutput> and <computeroutput><policy-permission></computeroutput> elements:
+</para>
+<para>
+<programlisting><![CDATA[
+<security-constraint>
+ <policy-permission>
+ <role-name>User</role-name>
+ <action-name>view</action-name>
+ </policy-permission>
+</security-constraint>
+
+<security-constraint>
+ <policy-permission>
+ <unchecked/>
+ <action-name>view</action-name>
+ </policy-permission>
+</security-constraint>]]>
+</programlisting>
+</para>
+<para>
+<programlisting>
+<action-name>
+</programlisting>
+ </para>
+ <para>
+ The <computeroutput><action-name></computeroutput> element defines the access rights given to the role defined. Accepted values are:
+ </para>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <computeroutput>view</computeroutput>: users can view the page.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <computeroutput>viewrecursive</computeroutput>: users can view the page and child pages.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <computeroutput>personalize</computeroutput>: users are able personalize the page's theme.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <computeroutput>personalizerecursive</computeroutput>: users are able personalize the page and child pages themes.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+<programlisting>
+<unchecked/>
+</programlisting>
+ </para>
+ <para>
+ If present, the <computeroutput><unchecked></computeroutput> element defines that anyone can view the instance.
+ </para>
+ <para>
+<programlisting>
+<role-name>
+</programlisting>
+ </para>
+ <para>
+ The <computeroutput><role-name></computeroutput> element defines a role that the security constraint will apply to. The following example only allows users that are part of the <computeroutput>EXAMPLEROLE</computeroutput> role to access the instance:
+ </para>
+ <para>
+<programlisting>
+<role-name>EXAMPLEROLE</role-name>
+</programlisting>
+ </para>
+ </section>
+ <section id="desc_example_portal">
+ <title>Defining a new Portal Instance</title>
+ <para>
+ The sample application descriptor in this section creates a new portal instance, <computeroutput>HelloPortal</computeroutput>, that contains two pages. To illustrate this example, download the <ulink url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles/HelloWorl...">HelloWorldPortal</ulink> portlet. To use the HelloWorldPortal portlet:
+ </para>
+ <para>
+ <orderedlist>
+ <listitem>
+ <para>
+ Download the <ulink url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles/HelloWorl...">HelloWorldPortal</ulink> portlet.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Unzip the <filename>HelloWorldPortal</filename> ZIP file.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ To expand the WAR file, which gives you access to the XML descriptors, change into the <filename>HelloWorldPortal/</filename> directory, and run the <command>ant explode</command> command.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ If you did not expand the <filename>helloworldportal.war</filename> file, copy the <filename>helloworldportal.war</filename> file into the correct JBoss AS or JBoss EAP <filename>deploy/</filename> directory. If you expanded the <filename>helloworldportal.war</filename> file, copy the <filename>HelloWorldPortal/output/lib/exploded/helloworldportal.war/</filename> directory into the correct JBoss AS or JBoss EAP <filename>deploy/</filename> directory. For example, if you are using the <computeroutput>default</computeroutput> JBoss AS profile, copy the WAR file or the expanded directory into the <filename>$JBOSS_HOME/server/default/deploy/</filename> directory.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <para>
+ The HelloWorldPortal portlet is hot-deployable, so the JBoss EAP or JBoss AS server does not have to be restarted after deploying the HelloWorldPortal portlet. The following is an example of the <filename>HelloWorldPortal/WEB-INF/helloworld-object.xml</filename> descriptor:
+ </para>
+ <para>
+<programlisting><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portal Object 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
+<deployments>
+ <deployment>
+ <parent-ref/>
+ <if-exists>overwrite</if-exists>
+ <portal>
+ <portal-name>HelloPortal</portal-name>
+ <supported-modes>
+ <mode>view</mode>
+ <mode>edit</mode>
+ <mode>help</mode>
+ </supported-modes>
+ <supported-window-states>
+ <window-state>normal</window-state>
+ <window-state>minimized</window-state>
+ <window-state>maximized</window-state>
+ </supported-window-states>
+ <properties>
+ <!-- Set the layout for the default portal -->
+ <!-- see also portal-layouts.xml -->
+ <property>
+ <name>layout.id</name>
+ <value>generic</value>
+ </property>
+ <!-- Set the theme for the default portal -->
+ <!-- see also portal-themes.xml -->
+ <property>
+ <name>theme.id</name>
+ <value>renaissance</value>
+ </property>
+ <!-- set the default render set name (used by the render tag in layouts) -->
+ <!-- see also portal-renderSet.xml -->
+ <property>
+ <name>theme.renderSetId</name>
+ <value>divRenderer</value>
+ </property>
+ </properties>
+ <security-constraint>
+ <policy-permission>
+ <action-name>personalizerecursive</action-name>
+ <unchecked/>
+ </policy-permission>
+ </security-constraint>
+ <page>
+ <page-name>default</page-name>
+ <security-constraint>
+ <policy-permission>
+ <action-name>viewrecursive</action-name>
+ <unchecked/>
+ </policy-permission>
+ </security-constraint>
+ <window>
+ <window-name>MyPortletWindow</window-name>
+ <instance-ref>MyPortletInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ </page>
+ </portal>
+ </deployment>
+ <deployment>
+ <parent-ref>HelloPortal</parent-ref>
+ <if-exists>overwrite</if-exists>
+ <page>
+ <page-name>foobar</page-name>
+ <security-constraint>
+ <policy-permission>
+ <action-name>viewrecursive</action-name>
+ <unchecked/>
+ </policy-permission>
+ </security-constraint>
+ <window>
+ <window-name>MyPortletWindow</window-name>
+ <instance-ref>MyPortletInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ </page>
+ </deployment>
+</deployments>]]>
+</programlisting>
+ </para>
+ <para>
+ When deployed, this example registers a new portal instance, <computeroutput>HelloPortal</computeroutput>, that contains two pages. To view the default page in the <computeroutput>HelloPortal</computeroutput> instance, navigate to <ulink url="http://localhost:8080/portal/portal/HelloPortal"/>, and for the second page, <ulink url="http://localhost:8080/portal/portal/HelloPortal/foobar"/>.
+ </para>
+ <para>
+ <note>
+ <title>Portal Instance <computeroutput>default</computeroutput> Page</title>
+ <para>
+ For a portal instance to be accessible via a Web browser, you must define a default page.
+ </para>
+ </note>
+ </para>
+ </section>
+ </section>
+</chapter>
+ <chapter id="urls">
+ <!--<chapterinfo>
+ <author>
+ <firstname>Julien</firstname>
+ <surname>Viet</surname>
+ </author>
+ <author>
+ <firstname>Thomas</firstname>
+ <surname>Heute</surname>
+ </author>
+ <author>
+ <firstname>Roy</firstname>
+ <surname>Russo</surname>
+ </author>
+ </chapterinfo>-->
+ <title>Portal URLs</title>
+ <section>
+ <title>Introduction to Portals</title>
+ <para>
+ Portal URLs are often very complicated; however, it is possible to setup entry points in portals that follow simple patterns.
+ </para>
+ <para>
+ Each portal container can contain multiple portals. Within a given portal, windows are organized into pages, with a page being a collection of windows associated to a name:
+ </para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/tutorials/SpecPortalDef.png" valign="middle" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>
+ Before reading the following sections, be familiar with how to define pages and portal. Refer to <xref linkend="desc_example_page"/> for details.
+ </para>
+ </section>
+ <section>
+ <title>Accessing a Portal</title>
+ <para>
+ The <computeroutput>default</computeroutput> portal is used when no portal is specified. How selection is done:
+ </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ <computeroutput>/portal/</computeroutput> points to the default page of the default portal.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <computeroutput>/portal/<replaceable>portal-name</replaceable>/</computeroutput> points to the default page of the <replaceable>portal-name</replaceable> portal.
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <note><title>Note</title><para>The default page or portal can be specified either by using the admin portlet or by using the XML descriptors as explained in the <xref linkend="xml.default.objectname.property"/>.</para></note>
+
+
+ </section>
+ <section>
+ <title>Accessing a Page</title>
+ <para>
+ Each portal can have multiple pages, with each portal having a default page. When a portal is selected, a page must be used, and all windows in that page are rendered. The page selection mechanism is as follows:
+ </para>
+ <para>
+ <computeroutput>/portal/default/<replaceable>page-name</replaceable></computeroutput> renders the <replaceable>page-name</replaceable> page.
+ </para>
+ </section>
+ <section>
+ <title>Accessing CMS Content</title>
+ <para>
+ The <emphasis>CMSPortlet</emphasis> delivers content transparently, without modifying the displayed URL. It is desirable to display binary content, such as GIF, JPEG, PDF, ZIP, and so on, outside of the confines of the portal. For example, <computeroutput>/content/default/images/jboss_logo.gif</computeroutput> displays the <computeroutput>jboss_logo.gif</computeroutput> file outside of the portal.
+ </para>
+ <para>
+ To display content outside of the portal, the portal interprets any path beginning with <computeroutput>/content</computeroutput> as a request for CMS content. As long as the <computeroutput><mime-type></computeroutput> is not <computeroutput>text/html</computeroutput>, or <computeroutput>text/text</computeroutput>, and the path to the content begins with <computeroutput>/content</computeroutput>, the content is rendered independently, outside of the portal.
+ </para>
+ </section>
+ <!--
+ <section>
+ <title>Advanced portal urls</title>
+ <para>JBoss Portal can consume and produce URLs in a very flexible manner. Consuming means
+ that an URL is accepted by the portal, translated into some action and send a response to the
+ browser. Producing means to create an URL for a particular action when the portal needs one.
+ This part is an advanced topic explaining the internal mechanisms developped in JBoss Portal to
+ produce and consumer URLs. It should be readen with care as it exposes internals of JBoss Portal
+ that may change in later releases of the product.</para>
+ <para>JBoss Portal url handling mechanism is based on several design patterns.</para>
+ <section>
+ <title>Portal Commands</title>
+ <para></para>
+ </section>
+ <section>
+ <title>Portal urls</title>
+ <para>At runtime portal commands are converted back and forth into portal urls. Creation
+ of urls and decoding of urls is now known at compile time, otherwise that would lead
+ to a very inflexible portal since changing the behavior would imply to update the source
+ code and recompile the portal, that would not be an acceptable solution. There is
+ a well known design pattern which provides an elegant and powerful solution to this problem and
+ is called Chain of Responsibility.</para>
+ <para>Portal commands have a state which parameterizes them. For instance there is a command
+ called <emphasis>ViewPageCommand</emphasis> which displays a portal page in the browser. The state
+ of that command consist in the id of the page. There is a bidirectionnal mapping between portal urls
+ and portal commands. Portal commands are created from URL using a service called <emphasis>CommandFactory</emphasis>,
+ which takes a request object and provides a portal command. Conversely, portal urls are created from
+ portal commands using a service called <emphasis>URLFactory</emphasis>.</para>
+ <para>The task of decoding urls is performed by a set of command factories which are wired
+ together in the configuration file. We can dist</para>
+ </section>
+ </section>
+ -->
+</chapter>
+ <chapter id="coordination">
+ <!--<chapterinfo>
+ <author>
+ <firstname>Boleslaw</firstname>
+ <surname>Dawidowicz</surname>
+ </author>
+ </chapterinfo>-->
+ <title>JBoss Portal Explicit Coordination</title>
+ <section>
+ <title>Explicit vs implicit coordination</title>
+ <para>
+ Portlet 2.0 coordination features are mediated by the portal between several
+ portlet windows, therefore the portal at runtime needs to be able to define
+ relationships between windows. Relationship can be established from an implicit
+ model (i.e a set of predicates applied on some state that will answer TRUE/FALSE
+ to the question are the portlet windows foo and bar in a relationship) or from an
+ explicit model (that states that foo and bar have a relationship). The implicit
+ model is very good for defining default configuration as it does not require much
+ configuration but is not able to cover the exceptional case, that's why we need
+ to combine it with an explicit model that will take precedence over the implicit
+ model, it is the well known principle of convention over configuration.
+ </para>
+ <para>
+ Currently all explicit coordination happens only in the scope of the same page.
+ </para>
+ </section>
+ <section>
+ <title>Bindings and wirings</title>
+
+ <section>
+ <title>Event wiring</title>
+
+ <para>
+ Wires JSR-286 events. With implicit wirings the event producer and the
+ consumer declares the same event namespace and local name to get event
+ delivered in the scope of the same page. With explicit wiring any pairs of
+ Window:Event can be connected.
+ </para>
+ </section>
+ <section>
+ <title>Parameter binding</title>
+
+ <para>
+ Binds JSR-286 shared parameters. With implicit binding parameters with the
+ same public name are shared. With explicit binding any public parameters can
+ share values. Windows for which such binding applies are explicitly defined.
+ </para>
+ </section>
+ <section>
+ <title>Alias binding</title>
+
+ <para>
+ Explicit alias binding define a name of page scoped parameter that will apply
+ value to specified portlet windows public parameters.
+ </para>
+
+ <programlisting><![CDATA[http://localhost:8080/portal/portal/default/Coordination+Samples?aliasBinding1=someValue]]></programlisting>
+ </section>
+ </section>
+ <section>
+ <title>Coordination configuration</title>
+
+ <para>
+ Configuration takes place in -object.xml file. The <coordination> tag
+ can be used in both <page> and <portal> tags. When used in
+ <portal> tag only <implicit-mode> tag can be defined for wirings
+ and bindings:
+ </para>
+
+ <programlisting role="XML"><![CDATA[<portal>
+
+ ...
+
+ <coordination>
+ <bindings>
+ <implicit-mode>TRUE</implicit-mode>
+ </bindings>
+ <wirings>
+ <implicit-mode>FALSE</implicit-mode>
+ </wirings>
+ </coordination>
+
+</portal>]]></programlisting>
+ <para>
+ When used within the <page> tag coordination event wirings and bindings
+ can be defined:</page></para>
+
+ <programlisting role="XML"><![CDATA[<coordination>
+
+ <wirings>
+ <implicit-mode>TRUE</implicit-mode>
+ <event-wiring>
+ <name>eventWiring1</name>
+ <sources>
+ <window-coordination>
+ <window-name>ShoppingCatalogPortletWindow1</window-name>
+ <qname>{urn:jboss:portal:samples:event}CartEvent</qname>
+ </window-coordination>
+ </sources>
+ <destinations>
+ <window-coordination>
+ <window-name>ShoppingCartPortletWindow2</window-name>
+ <qname>{urn:jboss:portal:samples:event}CartEvent</qname>
+ </window-coordination>
+ <window-coordination>
+ <window-name>ShoppingCartPortletWindow3</window-name>
+ <qname>{urn:jboss:portal:samples:event}CartEvent</qname>
+ </window-coordination>
+ </destinations>
+ </event-wiring>
+ <event-wiring>
+ <name>eventWiring2</name>
+ <sources>
+ <window-coordination>
+ <window-name>ShoppingCatalogPortletWindow2</window-name>
+ <qname>{urn:jboss:portal:samples:event}CartEvent</qname>
+ </window-coordination>
+ </sources>
+ <destinations>
+ <window-coordination>
+ <window-name>ShoppingCartPortletWindow1</window-name>
+ <qname>{urn:jboss:portal:samples:event}CartEvent</qname>
+ </window-coordination>
+ <window-coordination>
+ <window-name>ShoppingCartPortletWindow4</window-name>
+ <qname>{urn:jboss:portal:samples:event}CartEvent</qname>
+ </window-coordination>
+ </destinations>
+ </event-wiring>
+ </wirings>
+
+
+ <bindings>
+ <implicit-mode>FALSE</implicit-mode>
+
+ <parameter-binding>
+ <id>parameterBinding1</id>
+ <window-coordination>
+ <window-name>SomePortletWindow1</window-name>
+ <qname>foo</qname>
+ </window-coordination>
+ <window-coordination>
+ <window-name>SomePortletWindow2</window-name>
+ <qname>foo</qname>
+ </window-coordination>
+ <window-coordination>
+ <window-name>SomePortletWindow3</window-name>
+ <qname>foo</qname>
+ </window-coordination>
+ </parameter-binding>
+
+ <parameter-binding>
+ <id>parameterBinding2</id>
+ <window-coordination>
+ <window-name>SomePortletWindow1</window-name>
+ <qname>bar1</qname>
+ </window-coordination>
+ <window-coordination>
+ <window-name>SomePortletWindow2</window-name>
+ <qname>{urn:jboss:portal:samples:daa1}daa1</qname>
+ </window-coordination>
+ </parameter-binding>
+
+ <alias-binding>
+ <id>aliasBinding1</id>
+ <qname>foo</qname>
+ </alias-binding>
+
+ <alias-binding>
+ <id>aliasBinding2</id>
+ <qname>bar1</qname>
+ <qname>{urn:jboss:portal:samples:daa2}daa2</qname>
+ </alias-binding>
+
+ </bindings>
+</coordination>]]></programlisting>
+
+ <section>
+ <title><implicit-mode></title>
+
+ <para>
+ This tag can be applied for both <bindings> and <wirings>
+ tags. It defines if implicit coordination is enabled or disabled for
+ this given portal object. Value of this setting is cascaded to all
+ children in portal object tree unless overwritten somewhere in the
+ hierarchy. If no <implicit-mode> is defined in portal object tree
+ default value is TRUE.
+ </para>
+ </section>
+ </section>
+ <section>
+ <title>Coordination Samples</title>
+ <para>
+ JBoss Portal comes with several examples in 'Coordination Samples' page. Its good
+ to follow them looking at the configuration file that can be found in
+ portal-coordination-samples.war/WEB-INF/default-object.xml
+ </para>
+ </section>
+</chapter>
+ <chapter id="errorhandling">
+ <!-- <chapterinfo>
+ <author>
+ <firstname>Julien</firstname>
+ <surname>Viet</surname>
+ </author>
+ </chapterinfo>-->
+ <title>Error Handling Configuration</title>
+ <para>
+ The JBoss Portal request pipeline allows fine-grained, dynamic configuration of how JBoss Portal behaves when errors occur during runtime.
+ </para>
+ <section>
+ <title>Error Types</title>
+ <para>There are several types of errors that can occur during a request:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>Access denied</emphasis>: the user does not have the required permissions to access the resource.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>Error</emphasis>: an anticipated error, such as when a portlet throws an exception.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>Internal error</emphasis>: an unexpected error.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>Resource not found</emphasis>: the resource was not found.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>Resource unavailable</emphasis>: the resource was found, but was not serviceable.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ <section>
+ <title>Control Policies</title>
+ <para>If an error occurs, the request control-flow changes according to the configuration. This configuration is known as the <emphasis>control policy</emphasis>.
+ </para>
+ <section>
+ <title>Policy Delegation and Cascading</title>
+ <para>
+ When a control policy is invoked, the response sent by the control flow can be changed. If the control policy ignores the error, the error is handled by the next policy. If the control policy provides a new response, the next policy is not invoked, since the new response is not an error.
+ </para>
+ <para>
+ If a portlet in a page produces an exception, the following reactions are possible:
+ </para>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ the error is displayed in the window.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ the window is removed from the aggregation.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ a portal error page is displayed.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ a HTTP 500 error response is sent to the Web browser.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ <section>
+ <title>Default Policy</title>
+ <para>The default policy applies when errors are not handled by another level. By default, errors are translated
+ into the most appropriate HTTP response:
+ </para>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Access denied: <computeroutput>HTTP 403 Forbidden</computeroutput>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Error: <computeroutput>HTTP 500 Internal Server Error</computeroutput>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Internal error: <computeroutput>HTTP 500 Internal Server Error</computeroutput>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Resource not found: <computeroutput>HTTP 404 Not Found</computeroutput>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Resource unavailable: <computeroutput>HTTP 404 Not Found</computeroutput>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ <section>
+ <title>Portal Policy</title>
+ <para>
+ The portal error-policy controls the response sent to the Web browser when an error occurs. A default error policy exists, which can be configured per portal. If an error occurs, the policy can either handle a redirect to a JSP page, or ignore it. If the error is ignored, it is handled by the default policy, otherwise a JSP page is invoked with the appropriate request attributes, allowing page customization.
+ </para>
+ </section>
+ <section>
+ <title>Page Policy</title>
+ <para>
+ The window error-policy controls how pages react to aggregation errors. Most of the time pages are an aggregation of several portlet windows, and the action to take when an error occurs differs from other policies. When an error occurs, the policy can either handle it, or ignore it. If the error is ignored, it is handled by the portal policy. Possible actions taken after such errors are:
+ </para>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ remove the window from the aggregation.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ replace the markup of the window using a redirect to a JSP page.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+ <section>
+ <title>Configuration using XML Descriptors</title>
+ <para>
+ Different policies are configured using portal object properties, allowing the error-handling policy for objects to be configured in XML descriptors -- the <filename>*-object.xml</filename> files -- for a portal deployment.
+ </para>
+ <section>
+ <title>Portal Policy Properties</title>
+ <para>
+ A set of properties configure the the behavior of the portal policy. These properties are only taken into account for objects that use the <emphasis>portal</emphasis> type. The following table represents possible portal-policy properties:
+ </para>
+
+ <table frame="all"><title/>
+ <tgroup cols="3" align="left" colsep="1">
+ <colspec colname="c1"/>
+ <colspec colname="c2"/>
+ <colspec colname="c3"/>
+ <thead>
+ <row>
+ <entry align="center">Property Name</entry>
+ <entry align="center">Description</entry>
+ <entry align="center">Possible Values</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry align="center"><computeroutput>control.portal.access_denied</computeroutput></entry>
+ <entry align="center">when access is denied</entry>
+ <entry align="center"><computeroutput>ignore</computeroutput> and <computeroutput>jsp</computeroutput></entry>
+ </row>
+ <row>
+ <entry align="center"><computeroutput>control.portal.unavailable</computeroutput></entry>
+ <entry align="center">when a resource is unavailable</entry>
+ <entry align="center"><computeroutput>ignore</computeroutput> and <computeroutput>jsp</computeroutput></entry>
+ </row>
+ <row>
+ <entry align="center"><computeroutput>control.portal.not_found</computeroutput></entry>
+ <entry align="center">when a resource is not found</entry>
+ <entry align="center"><computeroutput>ignore</computeroutput> and <computeroutput>jsp</computeroutput></entry>
+ </row>
+ <row>
+ <entry align="center"><computeroutput>control.portal.internal_error</computeroutput></entry>
+ <entry align="center">when an unexpected error occurs</entry>
+ <entry align="center"><computeroutput>ignore</computeroutput> and <computeroutput>jsp</computeroutput></entry>
+ </row>
+ <row>
+ <entry align="center"><computeroutput>control.portal.error</computeroutput></entry>
+ <entry align="center">when an expected error occurs</entry>
+ <entry align="center"><computeroutput>ignore</computeroutput> and <computeroutput>jsp</computeroutput></entry>
+ </row>
+ <row>
+ <entry align="center"><computeroutput>control.portal.resource_uri</computeroutput></entry>
+ <entry align="center">the path to the JSP used for redirections</entry>
+ <entry align="center">a valid path to a JSP located in the <filename>portal-core.war/</filename> directory</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+
+ <para>
+ The following portal configuration demonstrates the use of portal-policy properties:
+ </para>
+ <para>
+<programlisting><![CDATA[
+<portal>
+ <portal-name>MyPortal</portal-name>
+ ...
+ <properties>
+ <property>
+ <name>control.portal.access_denied</name>
+ <value>ignore</value>
+ </property>
+ <property>
+ <name>control.portal.unavailable</name>
+ <value>ignore</value>
+ </property>
+ <property>
+ <name>control.portal.not_found</name>
+ <value>ignore</value>
+ </property>
+ <property>
+ <name>control.portal.internal_error</name>
+ <value>jsp</value>
+ </property>
+ <property>
+ <name>control.portal.error</name>
+ <value>jsp</value>
+ </property>
+ <property>
+ <name>control.portal.resource_uri</name>
+ <value>/WEB-INF/jsp/error/portal.jsp</value>
+ </property>
+ ...
+ </properties>
+ ...
+</portal>
+]]></programlisting>
+ </para>
+ </section>
+ <section>
+ <title>Page Policy Properties</title>
+ <para>
+ A set of properties configure the behavior of the page policy. These properties are only taken into account for objects that use the <emphasis>portal</emphasis> type. The following table represents possible page-policy properties:
+ </para>
+ <para>
+ <table frame="all"><title/>
+ <tgroup cols="3" align="left" colsep="1">
+ <colspec colname="c1"/>
+ <colspec colname="c2"/>
+ <colspec colname="c3"/>
+ <thead>
+ <row>
+ <entry align="center">Property name</entry>
+ <entry align="center">Description</entry>
+ <entry align="center">Possible values</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry align="center"><computeroutput>control.page.access_denied</computeroutput></entry>
+ <entry align="center">when access is denied</entry>
+ <entry align="center"><computeroutput>ignore</computeroutput>, <computeroutput>jsp</computeroutput> and <computeroutput>hide</computeroutput></entry>
+ </row>
+ <row>
+ <entry align="center"><computeroutput>control.page.unavailable</computeroutput></entry>
+ <entry align="center">when a resource is unavailable</entry>
+ <entry align="center"><computeroutput>ignore</computeroutput>, <computeroutput>jsp</computeroutput> and <computeroutput>hide</computeroutput></entry>
+ </row>
+ <row>
+ <entry align="center"><computeroutput>control.page.not_found</computeroutput></entry>
+ <entry align="center">when a resource is not found</entry>
+ <entry align="center"><computeroutput>ignore</computeroutput>, <computeroutput>jsp</computeroutput> and <computeroutput>hide</computeroutput></entry>
+ </row>
+ <row>
+ <entry align="center"><computeroutput>control.page.internal_error</computeroutput></entry>
+ <entry align="center">when an unexpected error occurs</entry>
+ <entry align="center"><computeroutput>ignore</computeroutput>, <computeroutput>jsp</computeroutput> and <computeroutput>hide</computeroutput></entry>
+ </row>
+ <row>
+ <entry align="center"><computeroutput>control.page.error</computeroutput></entry>
+ <entry align="center">when an expected error occurs</entry>
+ <entry align="center"><computeroutput>ignore</computeroutput>, <computeroutput>jsp</computeroutput> and <computeroutput>hide</computeroutput></entry>
+ </row>
+ <row>
+ <entry align="center"><computeroutput>control.page.resource_uri</computeroutput></entry>
+ <entry align="center">the path to the JSP used for redirections</entry>
+ <entry align="center"><computeroutput>ignore</computeroutput>, <computeroutput>jsp</computeroutput> and <computeroutput>hide</computeroutput></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </para>
+ <para>
+ The following page configuration demonstrates the use of page-policy properties:
+ </para>
+ <para>
+<programlisting><![CDATA[
+<page>
+ <page-name>MyPortal</page-name>
+ ...
+ <properties>
+ <property>
+ <name>control.page.access_denied</name>
+ <value>hide</value>
+ </property>
+ <property>
+ <name>control.page.unavailable</name>
+ <value>hide</value>
+ </property>
+ <property>
+ <name>control.page.not_found</name>
+ <value>hide</value>
+ </property>
+ <property>
+ <name>control.page.internal_error</name>
+ <value>jsp</value>
+ </property>
+ <property>
+ <name>control.page.error</name>
+ <value>jsp</value>
+ </property>
+ <property>
+ <name>control.page.resource_uri</name>
+ <value>/WEB-INF/jsp/error/page.jsp</value>
+ </property>
+ ...
+ </properties>
+ ...
+</page>
+]]></programlisting>
+ </para>
+ <para>
+ <note>
+ <title>Page Property Inheritance for Objects</title>
+ <para>
+ When page properties are configured for objects that use the <emphasis>portal</emphasis> type, the properties are inherited by pages in that portal.
+ </para>
+ </note>
+ </para>
+</section>
+ </section>
+ <section>
+ <title>Using <trademark class="trade">JSP</trademark> to Handle Errors</title>
+ <para>
+ As described in previous sections, error handling can be redirected to a <trademark class="trade">JSP</trademark> page. Two pages can be created to handle errors: one for the portal level, and the other for the page level. Portal level error-handling requires a page that produces a full page, and page-level handling requires a page that produces markup, but only for a window. When the page is invoked, a set of request attributes are passed. The following table represents possible request attributes:
+ </para>
+ <para>
+ <table frame="all"><title/>
+ <tgroup cols="3" align="left" colsep="1">
+ <colspec colname="c1"/>
+ <colspec colname="c2"/>
+ <colspec colname="c3"/>
+ <thead>
+ <row>
+ <entry align="center">Attribute Name</entry>
+ <entry align="center">Attribute Description</entry>
+ <entry align="center">Attribute Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry align="center"><computeroutput>org.jboss.portal.control.ERROR_TYPE</computeroutput></entry>
+ <entry align="center">the error type</entry>
+ <entry align="center">possible values are <computeroutput>ACCESS_DENIED</computeroutput>, <computeroutput>UNAVAILABLE</computeroutput>, <computeroutput>ERROR</computeroutput>, <computeroutput>INTERNAL_ERROR</computeroutput>, and <computeroutput>NOT_FOUND</computeroutput></entry>
+ </row>
+ <row>
+ <entry align="center"><computeroutput>org.jboss.portal.control.CAUSE</computeroutput></entry>
+ <entry align="center">a cause which is thrown, that can be null</entry>
+ <entry align="center">the object is a subclass of <computeroutput>java.lang.Throwable</computeroutput></entry>
+ </row>
+ <row>
+ <entry align="center"><computeroutput>org.jboss.portal.control.MESSAGE</computeroutput></entry>
+ <entry align="center">an error message that can be null</entry>
+ <entry align="center">text</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </para>
+ <para>
+ <note>
+ <title><trademark class="trade">JSP</trademark> Location</title><para>
+ The JavaServer Pages must be located in the <filename>jboss-portal.sar/portal-core.war/</filename> web application.</para>
+ </note>
+ </para>
+ </section>
+ <section>
+ <title>Configuration using the Portal Management Application</title>
+ <para>
+ The error handling policy can be configured via the portal management application. To access the portal management application:
+ </para>
+ <para>
+ <orderedlist>
+ <listitem>
+ <para>
+ Use a Web browser to navigate to <ulink url="http://localhost:8080/portal"/>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click the <guibutton>Login</guibutton> button on the top right-hand of the welcome page, and log in as the <option>admin</option> user.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click the <guibutton>Admin</guibutton> tab on the top right-hand of the welcome page. Four tabs will appear on the left-hand side of the page.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click the <guibutton>Admin</guibutton> tab to open the portal management application, and then click the <guibutton>Portal Objects</guibutton> tab to display available portals.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <para>
+ Configuration options are available as part of the properties for each configuration level. You can specify the default error handling policy (at the root of the portal object hierarchy) for each portal, or each page, by clicking on the <guibutton>Properties</guibutton> button for each page or portal:
+ </para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/errorhandling/errorHandling_management.png" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>
+ As well, you can specify how dashboards should behave with respect to error handling, by clicking on the <guibutton>Dashboards</guibutton> tab in the portal management application:
+ </para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/errorhandling/errorHandlingUI.png" align="center" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>
+ The page specified with <computeroutput>On error redirect to this resource</computeroutput> is used when the <option>Redirect to the specified resource</option> action is selected for an error type, such as <computeroutput>When access to the page is denied</computeroutput>. After making changes, click the <guibutton>Update</guibutton> button for settings to take effect.
+ </para>
+ </section>
+</chapter>
+ <chapter id="contentintegration">
+<!-- <chapterinfo>
+ <author>
+ <firstname>Julien</firstname>
+ <surname>Viet</surname>
+ </author>
+ <author>
+ <firstname>Thomas</firstname>
+ <surname>Heute</surname>
+ </author>
+ </chapterinfo>-->
+ <title>Content Integration</title>
+ <para>Since JBoss Portal 2.6 it is possible to provide an easy integration of content within the portal. Up to the 2.4 version
+ content integration had to be done by configuring a portlet to show some content from an URI and then place that
+ portlet on a page. The new content integration capabilities allows to directly configure a page window with the content URI by
+ removing the need to configure a portlet for that purpose.</para>
+ <note><title>Note</title><para>We do not advocate to avoid the usage portlet preferences, we rather advocate that content configuration managed at the portal level
+ simplifies the configuration: it helps to make content a first class citizen of the portal instead of having an intermediary
+ portlet that holds the content for the portal. The portlet preferences can still be used to configure how content is displayed
+ to the user.</para></note>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/content/before.png" scalefit="1"/>
+ </imageobject>
+
+ </mediaobject>
+ <para>The portal uses portlets to configure content</para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/content/after.png" scalefit="1"/>
+ </imageobject>
+
+ </mediaobject>
+ <para>The portal references directly the content and use portlet to interact with content</para>
+
+ <section>
+ <title>Window content</title>
+ <para>The content of a window is defined by
+ <itemizedlist>
+ <listitem><para>The content URI which is the resource that the window is pointing to. It is an arbitrary string that
+ the portal cannot interpret and is left up to the content provider to interpret.</para></listitem>
+ <listitem><para>The window content type which defines how the portal interpret the window content
+ <itemizedlist>
+ <listitem><para>The default content type is for portlets and has the value <emphasis>portlet</emphasis>. In this
+ case the content URI is the portlet instance id.</para></listitem>
+ <listitem><para>The CMS content type allows to integrate content from the CMS at the page and it has the value
+ <emphasis>cms</emphasis>. For that content type, the content URI is the CMS file path.</para></listitem>
+ </itemizedlist></para>
+ </listitem>
+ <listitem><para>The content parameters which are a set of additional key/value string pairs holding state that is interpreted
+ by the content provider.</para></listitem>
+ </itemizedlist>
+ </para>
+ <para>At runtime when the portal needs to render a window it delegates the production of markup to a content provider.
+ The portal comes with a preconfigured set of providers which handles the portlet and the cms content types. The most
+ natural way to plug a content provider in the portal is to use a JSR 286 Portlet. Based on a few carefully chosen conventions
+ it is possible to provide an efficient content integration with the benefit of using standards and without requiring
+ the usage of a proprietary API.</para>
+ </section>
+ <section>
+ <title>Content customization</title>
+ <para>Content providers must be able to allow the user or administrator to chose content from the external resource
+ it integrates in the portal in order to properly configure a portal window. A few interactions between the portal, the content
+ provider and the portal user are necessary to achieve that goal. Here again it is possible to provide content
+ customization using a JSR 286 Portlet. For that purpose two special portlet modes called
+ <emphasis>edit_content</emphasis> and <emphasis>select_content</emphasis> has been introduced. It signals to the portlet
+ that it is selecting or editing the content portion of the state of a portlet. <emphasis>select_content</emphasis> is
+ used to select a new content to put in a window while <emphasis>edit_content</emphasis> is used to modify the previously
+ defined content, often the two modes will display the same thing. The traditional edit mode is not used because the edit mode
+ is more targeted to configure how the portlet shows content to the end user rather than what content it shows.</para>
+<mediaobject>
+<imageobject>
+ <imagedata align="center" fileref="images/content/cms.png" scalefit="1"/>
+ </imageobject>
+</mediaobject>
+ <para>Example of content customization - CMS Portlet</para>
+ </section>
+ <section>
+ <title>Content Driven Portlet</title>
+ <para>Portlet components are used to integrate content into the portal. It relies on a few conventions which allow
+ the portal and the portlet to communicate.
+ </para>
+ <section>
+ <title>Displaying content</title>
+ <para>At runtime the portal will call the portlet with the view mode when it displays content. It will send
+ information about the content to display using the public render parameter <emphasis>urn:jboss:portal:content uri</emphasis> to the portlet. Therefore the portlet has
+ just to read the render parameters and use them to properly display the content in the portlet. The public render parameters
+ values are the key/value pairs that form the content properties and the resource URI of the content to display.</para>
+ </section>
+ <section>
+ <title>Configuring content</title>
+ <para>As explained before, the portal will call the portlet using the <emphasis>edit_content</emphasis> mode.
+ In that mode the portlet and the portal will communicate using either action or render parameters. We have two use cases
+ which are:
+ <itemizedlist>
+ <listitem><para>The portal needs to configure a new content item for a new window. In that use case the portal will not send special
+ render parameters to the portlet and the initial set of render parameters will be empty. The portlet can
+ then use render parameters in order to provide navigation in the content repository. For example the portlet
+ can navigate the CMS tree and store the current CMS path in the render parameters. Whenever the portlet has decided
+ to tell the portal that content has been selected by the user it needs to trigger a JSR-286 event with the uri and eventual parameters as payload.</para>
+ </listitem>
+ <listitem><para>The second use case happens when the portal needs to edit existing content. In such situation
+ everything works as explained before except that the initial set of render parameters of the portlet
+ will be prepopulated with the content uri URI and parameters.</para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ <section>
+ <title>Step by step example of a content driven portlet</title>
+ <para/>
+ <section>
+ <title>The Portlet skeleton</title>
+ <para>Here is the base skeleton of the content portlet. The FSContentDrivenPortlet shows the files which are
+ in the war file in which the portlet is deployed. The arbitrary name <emphasis>filesystem</emphasis>
+ will be the content type interpreted by the portlet.
+ </para>
+ <programlisting><![CDATA[
+public class FSContentDrivenPortlet extends GenericPortlet
+{
+
+ /** The edit_content mode. */
+ public static final PortletMode EDIT_CONTENT_MODE = new PortletMode("edit_content");
+
+ ...
+
+}
+]]></programlisting>
+ </section>
+ <section>
+ <title>Overriding the dispatch method</title>
+ <para>First the <emphasis>doDispatch(RenderRequest req, RenderResponse resp)</emphasis> is overridden in order
+ to branch the request flow to a method that will take care of displaying the editor.</para>
+ <programlisting><![CDATA[
+protected void doDispatch(RenderRequest req, RenderResponse resp)
+ throws PortletException, PortletSecurityException, IOException
+{
+ if (EDIT_CONTENT_MODE.equals(req.getPortletMode()))
+ {
+ doEditContent(req, resp);
+ }
+ else
+ {
+ super.doDispatch(req, resp);
+ }
+}
+]]></programlisting>
+ </section>
+ <section>
+ <title>Utilities methods</title>
+ <para>The portlet also needs a few utilities methods which take care of converting content URI to a file
+ back and forth. There is also an implementation of a file filter that keep only text files and avoid the
+ WEB-INF directory of the war file for security reasons.</para>
+ <programlisting><![CDATA[
+protected File getFile(String contentURI) throws IOException
+{
+ String realPath = getPortletContext().getRealPath(contentURI);
+ if (realPath == null)
+ {
+ throw new IOException("Cannot access war file content");
+ }
+ File file = new File(realPath);
+ if (!file.exists())
+ {
+ throw new IOException("File " + contentURI + " does not exist");
+ }
+ return file;
+}
+]]></programlisting>
+ <programlisting><![CDATA[
+ protected String getContentURI(File file) throws IOException
+ {
+ String rootPath = getPortletContext().getRealPath("/");
+ if (rootPath == null)
+ {
+ throw new IOException("Cannot access war file content");
+ }
+
+ // Make it canonical
+ rootPath = new File(rootPath).getCanonicalPath();
+
+ // Get the portion of the path that is significant for us
+ String filePath = file.getCanonicalPath();
+ return filePath.length() >=
+ rootPath.length() ? filePath.substring(rootPath.length()) : null;
+ }
+]]></programlisting>
+ <programlisting><![CDATA[
+ private final FileFilter filter = new FileFilter()
+ {
+ public boolean accept(File file)
+ {
+ String name = file.getName();
+ if (file.isDirectory())
+ {
+ return !"WEB-INF".equals(name);
+ }
+ else if (file.isFile())
+ {
+ return name.endsWith(".txt");
+ }
+ else
+ {
+ return false;
+ }
+ }
+ };
+]]></programlisting>
+ </section>
+ <section>
+ <title>The editor</title>
+ <para>The editor is probably the longest part of the portlet. It tries to stay simple though and goes directly
+ to the point.</para>
+ <mediaobject> <imageobject>
+ <imagedata align="center" fileref="images/content/fs1.png" scalefit="1"/>
+ </imageobject></mediaobject>
+ <para>Content editor of FSContentDrivenPortlet in action</para>
+ <programlisting><![CDATA[
+protected void doEditContent(RenderRequest req, RenderResponse resp)
+ throws PortletException, PortletSecurityException, IOException
+{
+ String uri = req.getParameter("current_uri");
+ if (uri == null)
+ {
+ // Get the uri value optionally provided by the portal
+ uri = req.getParameter("uri");
+ }
+
+ // Get the working directory directory
+ File workingDir = null;
+ String currentFileName = null;
+ if (uri != null)
+ {
+ workingDir = getFile(uri).getParentFile();
+ currentFileName = getFile(uri).getName();
+ }
+ else
+ {
+ // Otherwise try to get the current directory we are browsing,
+ // if no current dir exist we use the root
+ String currentDir = req.getParameter("current_dir");
+ if (currentDir == null)
+ {
+ currentDir = "/";
+ }
+ workingDir = getFile(currentDir);
+ }
+
+ // Get the parent path
+ String parentPath = getContentURI(workingDir.getParentFile());
+
+ // Get the children of the selected file, we use a filter
+ // to retain only text files and avoid WEB-INF dir
+ File[] children = workingDir.listFiles(filter);
+
+ // Configure the response
+ resp.setContentType("text/html");
+ PrintWriter writer = resp.getWriter();
+
+ //
+ writer.print("Directories:<br/>");
+ writer.print("<ul>");
+ PortletURL choseDirURL = resp.createRenderURL();
+ if (parentPath != null)
+ {
+ choseDirURL.setParameter("current_dir", parentPath);
+ writer.print("<li><a href=\"" + choseDirURL + "\">..</a></li>");
+ }
+ for (int i = 0;i < children.length;i++)
+ {
+ File child = children[i];
+ if (child.isDirectory())
+ {
+ choseDirURL.setParameter("current_dir", getContentURI(child));
+ writer.print("<li><a href=\"" + choseDirURL + "\">" + child.getName() +
+ "</a></li>");
+ }
+ }
+ writer.print("</ul><br/>");
+
+ //
+ writer.print("Files:<br/>");
+ writer.print("<ul>");
+ PortletURL selectFileURL = resp.createActionURL();
+ selectFileURL.setParameter("content.action.select", "select");
+ for (int i = 0;i < children.length;i++)
+ {
+ File child = children[i];
+ if (child.isFile())
+ {
+ selectFileURL.setParameter("current_uri", getContentURI(child));
+ if (child.getName().equals(currentFileName))
+ {
+ writer.print("<li><b>" + child.getName() + "</b></li>");
+ }
+ else
+ {
+ writer.print("<li><a href=\"" + selectFileURL + "\">" + child.getName() + "</a></li>");
+ }
+ }
+ }
+ writer.print("</ul><br/>");
+
+ //
+ writer.close();
+}
+]]></programlisting>
+ </section>
+ <section>
+ <title>Viewing content at runtime</title>
+ <para>Last but not least the portlet needs to implement the <emphasis>doView(RenderRequest req, RenderResponse resp)</emphasis>
+ method in order to display the file that the portal window wants to show.</para>
+ <programlisting><![CDATA[
+protected void doView(RenderRequest req, RenderResponse resp)
+ throws PortletException, PortletSecurityException, IOException
+{
+ // Get the URI provided by the portal
+ String uri = req.getParameter("uri");
+
+ // Configure the response
+ resp.setContentType("text/html");
+ PrintWriter writer = resp.getWriter();
+
+ //
+ if (uri == null)
+ {
+ writer.print("No selected file");
+ }
+ else
+ {
+ File file = getFile(uri);
+ FileInputStream in = null;
+ try
+ {
+ in = new FileInputStream(file);
+ FileChannel channel = in.getChannel();
+ byte[] bytes = new byte[(int)channel.size()];
+ ByteBuffer buffer = ByteBuffer.wrap(bytes);
+ channel.read(buffer);
+ writer.write(new String(bytes, 0, bytes.length, "UTF8"));
+ }
+ catch (FileNotFoundException e)
+ {
+ writer.print("No such file " + uri);
+ getPortletContext().log("Cannot find file " + uri, e);
+ }
+ finally
+ {
+ if (in != null)
+ {
+ in.close();
+ }
+ }
+ }
+
+ //
+ writer.close();
+}
+]]></programlisting>
+ </section>
+ <section>
+ <title>Hooking the portlet into the portal</title>
+
+ <mediaobject><imageobject>
+ <imagedata align="center" fileref="images/content/fs2.png" scalefit="1"/>
+ </imageobject></mediaobject>
+
+<para>Management portlet with <emphasis>filesystem</emphasis> content type enabled</para>
+
+ <para>Finally we need to make the portal aware of the fact that the portlet can edit and interpret content. For that
+ we need a few descriptors. The <emphasis>portlet.xml</emphasis> descriptor will define our portlet, the
+ <emphasis>portlet-instances.xml</emphasis> will create a single instance of our portlet. The
+ <emphasis>web.xml</emphasis> descriptor will contain a servlet context listener that will hook the content
+ type in the portal content type registry.</para>
+ <para>First, we need to define the portlet's particular event and render parameters:</para>
+ <programlisting><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+
+ <portlet>
+ <description>File System Content Driven Portlet</description>
+ <portlet-name>FSContentDrivenPortlet</portlet-name>
+ <display-name>File System Content Driven Portlet</display-name>
+ <portlet-class>org.jboss.portal.core.samples.basic.FSContentDrivenPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>EDIT_CONTENT</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>File Portlet</title>
+ <keywords>sample,test</keywords>
+ </portlet-info>
+ <supported-public-render-parameter>uri</supported-public-render-parameter>
+ <supported-publishing-event xmlns:x="urn:jboss:portal:content">x:select</supported-publishing-event>
+ </portlet>
+
+ <public-render-parameter>
+ <identifier>uri</identifier>
+ <qname xmlns:c="urn:jboss:portal:content">c:uri</qname>
+ </public-render-parameter>
+
+ <event-definition>
+ <qname xmlns:x="urn:jboss:portal:content">x:select</qname>
+ <value-type>java.lang.String</value-type>
+ </event-definition>
+
+</portlet-app>
+]]></programlisting>
+ <para>Note that here we need to use a JSR-286 portlet, this portlet will use the event <emphasis>urn:jboss:portal:content select</emphasis> and have a payload of type
+ <emphasis>java.lang.String</emphasis>. This event will be used to tell the portal the URI selected by the user. This same portlet will also be in charge of
+ rendering the content based on that URI, it will then also need to access the public render parameter qualified with the name: <emphasis>urn:jboss:portal:content uri</emphasis>.
+ </para>
+ <para>The portlet.xml descriptor</para>
+ <programlisting><![CDATA[
+<deployments>
+ ...
+ <deployment>
+ <instance>
+ <instance-id>FSContentDrivenPortletInstance</instance-id>
+ <portlet-ref>FSContentDrivenPortlet</portlet-ref>
+ </instance>
+ </deployment>
+ ...
+</deployments
+]]></programlisting>
+ <para>The portlet-instances.xml descriptor</para>
+ <programlisting><![CDATA[
+<web-app>
+ ...
+ <context-param>
+ <param-name>org.jboss.portal.content_type</param-name>
+ <param-value>filesystem</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.jboss.portal.portlet_instance</param-name>
+ <param-value>FSContentDrivenPortletInstance</param-value>
+ </context-param>
+ <listener>
+ <listener-class>org.jboss.content.ContentTypeRegistration</listener-class>
+ </listener>
+ ...
+</web-app>
+]]></programlisting>
+ <para>The web.xml descriptor</para>
+ <warning><title>Caution</title><para>You don't need to add the listener class into your war file. As it is provided by the portal
+ it will always be available.</para></warning>
+ </section>
+ </section>
+ <!--
+ <section>
+ <title>Passing parameters along the URI</title>
+ <para>In simple cases like in the example, it was enough to pass a URI, in some cases it can be helpful to pass
+ other parameters, to do so, instead of having a payload of type <emphasis>java.lang.String</emphasis>,
+ simply use the following class: <emphasis>org.jboss.portal.api.content.SelectedContent</emphasis>.
+ </para>
+ </para>
+ </section>
+ -->
+ </section>
+ <section>
+ <title>Configuring window content in deployment descriptor</title>
+ <para>How to create a portlet that will enable configuration of content at runtime has been covered above, however
+ it is also possible to configure content in deployment descriptors. With our previous example it would give
+ the following snippet placed in a <emphasis>*-portal.xml</emphasis> file:
+ </para>
+ <programlisting><![CDATA[
+<window>
+<window-name>MyWindow</window-name>
+<content>
+ <content-type>filesystem</content-type>
+ <content-uri>/dir1/foo.txt</content-uri>
+</content>
+<region>center</region>
+<height>1</height>
+</window>
+]]></programlisting>
+ <mediaobject><imageobject>
+ <imagedata align="center" fileref="images/content/fs3.png"/>
+ </imageobject></mediaobject>
+ <para>Final effect - portal window with FSContentDrivenPortlet</para>
+ <note><title>Note</title><para>How to configure CMS file this way is covered in the CMS chapter: <xref linkend="configuration-cms_content"/></para></note>
+ </section>
+</chapter>
+ <chapter id="widgets">
+ <!-- <chapterinfo>
+ <author>
+ <firstname>Emanuel</firstname>
+ <surname>Muckenhuber</surname>
+ </author>
+ </chapterinfo>-->
+ <title>Widget Integration</title>
+ <section>
+ <title>Introduction</title>
+ <para>JBoss Portal supports the integration of Google gadgets and Netvibes (<ulink url="http://dev.netvibes.com/doc/uwa_specification">UWA</ulink> compatible)
+ widgets out of the box. This integration allows you to display the content of the widget within a portlet.
+ Both types can be added in the administration interface by editing the 'Page Layout' of a page or in the configuration of the users dashboard
+ when selecting the appropriate 'Content type'.
+ </para>
+ </section>
+ <section>
+ <title>Widget portlet configuration</title>
+ <para>It is possible to modify certain behavior of caching and fetching widgets by changing the init-param values of the portlet.</para>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para><emphasis role="bold">connectionTimeout</emphasis>.
+
+ Connection timeout used for the directory lookup in milliseconds.
+ </para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">widgetExpiration</emphasis>.
+
+ Time in minutes for which a widget should be cached. After this time the cached widget information will be deleted and
+ fetched again when the information are needed.
+ </para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">queryExpiration</emphasis>.
+
+ Times in minutes for which a directory query should be cached. After this time the cached query information will be deleted.
+ </para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">fetchWidgetsOnDirectoryLookup</emphasis>.
+
+ This parameter defines if all widgets from a directory lookup should be fetched at the time of the query or not.
+ The default values is false. This means that widgets are only fetched on demand - when the information is really needed.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ The parameter for both widget types can be changed identically in either:
+ <itemizedlist>
+ <listitem><para><emphasis>jboss-portal.sar/portal-widget.war/WEB-INF/portlet.xml</emphasis> (for google gadgets)</para></listitem>
+ <listitem><para>or <emphasis>jboss-portal.sar/portal-widget-netvibes.war/WEB-INF/portlet.xml</emphasis> (for netvibes widgets).</para></listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ <programlisting><![CDATA[...
+ <portlet>
+ ...
+ <init-param>
+ <name>connectionTimeout</name>
+ <value>5000</value>
+ </init-param>
+ <init-param>
+ <name>widgetExpiration</name>
+ <value>360</value>
+ </init-param>
+ <init-param>
+ <name>queryExpiration</name>
+ <value>60</value>
+ </init-param>
+ <init-param>
+ <name>fetchWidgetsOnDirectoryLookup</name>
+ <value>false</value>
+ </init-param>
+ ...
+ </portlet>
+...]]></programlisting>
+ </para>
+ <para>
+ For Netvibes widgets it is also possible to define a init-param called <emphasis role="bold">defaultHeight</emphasis> to set a specific
+ default height if no height attribute is defined by the widget itself. The default value is 250.
+ </para>
+ </section>
+</chapter>
+ <chapter id="portletmodes">
+ <!-- <chapterinfo>
+ <author>
+ <firstname>Julien</firstname>
+ <surname>Viet</surname>
+ </author>
+ </chapterinfo>-->
+ <title>Portlet Modes</title>
+ <para>JBoss Portal supports the standard portlet modes defined by the JSR-168 specification which are <emphasis>view</emphasis>,
+ <emphasis>edit</emphasis> and <emphasis>help</emphasis>. In addition of that it also supports the <emphasis>admin</emphasis>
+ portlet mode.
+ </para>
+ <section>
+ <title>Admin Portlet Mode</title>
+ <para>The admin mode defines a mode for the portlet which allows the administration of the portlet. Access to this mode
+ is only granted to users having an appropriate role. In order to grant admin access to a portlet, the user must have a role which
+ grants him the <emphasis>admin</emphasis> action permission on the portlet instance. This can be done in the
+ instance deployment descriptor or using the administation portlet of the portal. </para>
+ <section>
+ <title>Portlet configuration</title>
+ <para>In order to be able to use the admin mode, the portlet must declare it in the portlet deployment descriptor.</para>
+ <programlisting><![CDATA[
+<portlet-app>
+ ...
+ <portlet>
+ ...
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>admin</portlet-mode>
+ </supports>
+ ...
+ </portlet>
+ ...
+ <custom-portlet-mode>
+ <name>admin</name>
+ </custom-portlet-mode>
+ ...
+</portlet-app>
+]]></programlisting>
+ </section>
+ <section>
+ <title>Declarative instance security configuration</title>
+ <para>The following example shows the configuration of a portlet instance that grants the admin action permission
+ to the <emphasis>Admin</emphasis> security role. It also grants the view action permission to all users.
+ </para>
+<programlisting><![CDATA[
+...
+<instance>
+ <instance-id>ModePortletInstance</instance-id>
+ <portlet-ref>ModePortlet</portlet-ref>
+ <security-constraint>
+ <policy-permission>
+ <action-name>admin</action-name>
+ <role-name>Admin</role-name>
+ </policy-permission>
+ <policy-permission>
+ <action-name>view</action-name>
+ <unchecked/>
+ </policy-permission>
+ </security-constraint>
+</instance>
+...
+]]></programlisting>
+ </section>
+ <section>
+ <title>Instance security configuration with the administration portlet</title>
+ <para>At runtime the security configuration section of the administration portlet can be used to grant or revoke
+ the admin access. It can be done by clicking the security action of the portlet instance and then use the
+ security editor.</para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/portletmodes/editor.png"/>
+ </imageobject>
+ </mediaobject>
+ <para>Edit the security instance configuration</para>
+
+ </section>
+ </section>
+</chapter>
+ <chapter id="portal_api">
+<!-- <chapterinfo>
+ <author>
+ <firstname>Julien</firstname>
+ <surname>Viet</surname>
+ </author>
+ <author>
+ <firstname>Thomas</firstname>
+ <surname>Heute</surname>
+ </author>
+ </chapterinfo>-->
+ <title>Portal API</title>
+ <section>
+ <title>Introduction</title>
+
+ <para>JBoss Portal provides an Application Programming Interface (API) which allows to write code
+ that interacts with the portal. The life time and validity of the API is tied to the major version which means
+ that no changes should be required when code is written against the API provided by the JBoss Portal
+ 2.x versions and used in a later version of JBoss Portal 2.x.</para>
+
+ <para>The Portal API package prefix is <emphasis>org.jboss.portal.api</emphasis>. All of the classes that are part
+ of this API are prefixed with this package name except for the <emphasis>org.jboss.portal.Mode</emphasis>
+ and <emphasis>org.jboss.portal.WindowState</emphasis> classes. These two classes were defined before the official
+ Portal API framework was created and so the names have been maintained for backward compatibility.</para>
+ <para>The Portlet API defines two classes that represent a portion of the visual state of a Portlet which
+ are <emphasis>javax.portlet.PortletMode</emphasis> and <emphasis>javax.portlet.WindowState</emphasis>. Likewise
+ the Portal API defines similar classes named <emphasis>org.jboss.portal.Mode</emphasis> and
+ <emphasis>org.jboss.portal.WindowState</emphasis> which offer comparable characteristics, the main differences are:</para>
+
+ <itemizedlist>
+ <listitem><para>Usage of factory methods to obtain instances.</para></listitem>
+ <listitem><para>Classes implements the <emphasis>java.io.Serializable</emphasis> interface.</para></listitem>
+ </itemizedlist>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/portalapi/Mode.png"/>
+ </imageobject>
+ </mediaobject>
+ <para>The Mode class</para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/portalapi/WindowState.png"/>
+ </imageobject>
+
+ </mediaobject>
+
+ <para>The WindowState class</para>
+
+ <note><para>In the Portal API, the <emphasis>Mode</emphasis> interface is named like this because it does
+ represent the mode of some visual object. The Portlet API names it <emphasis>PortletMode</emphasis> because
+ it makes the assumption that the underlying object is of type Portlet.</para></note>
+ </section>
+ <section>
+ <title>Portlet to Portal communication</title>
+ <para>There are times when a portlet needs to signal the portal or share information with it. The portal is the only authority
+ to decide if it will take into account that piece of information or ignore it. In JBoss Portal we use as much as possible the
+ mechanisms offered by the portlet spec to achieve that communication.</para>
+ <section>
+ <title>Requesting a sign out</title>
+ <para>
+ If a portlet desires to sign out the user, it can let the portal know by triggering a JSR-286 portlet event.
+ To do so, simply defines the event "signOut" in the namespace "urn:jboss:portal" as a publishing event.
+ In the action phase of the portlet, trigger the event, as a payload you can specify a redirection URL. If the payload is null,
+ it will redirect the user to the default page of the default portal.
+ See the following snippet to use in the action phase, it will ask the portal to sign out the user and redirect him to the JBoss
+ Portal blog:
+ <programlisting role="java"><![CDATA[QName name = new QName("urn:jboss:portal", "signOut");
+response.setEvent(name, "http://blog.jboss-portal.org"); ]]></programlisting>
+ </para>
+ </section>
+ <section>
+ <title>Setting up the web browser title</title>
+ <para>
+ The JSR-286 specification introduced a new phase for setting up the HTML headers. It is commonly used to add stylesheets
+ and javascript to the page. An extension of it for JBoss Portal lets you define the web browser title.
+ To define the web browser title, a portlet simply needs to define a new header element "title". This could be done by a portlet overriding
+ the method <literal>doHeaders(RenderRequest req, RenderResponse resp)</literal> to add such an element.
+ <programlisting role="java"><![CDATA[public void doHeaders(RenderRequest req, RenderResponse resp)
+{
+ Element element = resp.createElement("title");
+ element.setTextContent("My new web browser title");
+ resp.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, element);
+}]]></programlisting>
+ <warning><para>It several portlets on a page defines a web browser title, only one of them will be displayed.
+ We can consider that the title to be displayed will be randomly chosen.</para></warning>
+ </para>
+ </section>
+ </section>
+ <section>
+ <title>Portal URL</title>
+ <para>The Portal API defines the <emphasis>org.jboss.portal.api.PortalURL</emphasis> interface to represent
+ URL managed by the portal.</para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/portalapi/PortalURL.png"/>
+ </imageobject>
+ </mediaobject>
+ <para>The PortalURL interface</para>
+
+ <itemizedlist>
+ <listitem><para>The <emphasis>setAuthenticated(Boolean wantAuthenticated)</emphasis> methods defines if the
+ URL requires the authentication of the user. If the argument value is true then the user must be authenticated
+ to access the URL, if the argument value is false then the user should not be authenticated. Finally if the argument value is
+ null then it means that the URL authenticated mode should reuse the current mode.</para></listitem>
+ <listitem><para>The <emphasis>setSecure(Boolean wantSecure)</emphasis> methods defines the same as above but for the
+ transport guarantee offered by the underlying protocol which means most of the time the secure HTTP protocol (HTTPS).</para></listitem>
+ <listitem><para>The <emphasis>setRelative(boolean relative)</emphasis> defines the output format of the URL and
+ whether the created URL will be an URL relative to the same web server or will be the full URL.</para></listitem>
+ <listitem><para>The <emphasis>toString()</emphasis> method will create the URL as a string.</para></listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>Portal session</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/portalapi/PortalSession.png"/>
+ </imageobject>
+ </mediaobject>
+ <para>The PortalSession interface</para>
+
+ <para>It is possible to have access to a portion of the portal session to store objects. The <emphasis>org.jboss.portal.api.session.PortalSession</emphasis>
+ interface defines its API and is similar to the <emphasis>javax.servlet.http.HttpSession</emphasis> except that it does
+ not offer methods to invalidate the session as the session is managed by the portal.
+ </para>
+ </section>
+
+ <section>
+ <title>Portal runtime context</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/portalapi/PortalRuntimeContext.png"/>
+ </imageobject>
+ </mediaobject>
+ <para>The PortalRuntimeContext interface</para>
+
+ <para>The <emphasis>org.jboss.portal.api.PortalRuntimeContext</emphasis> gives access to state or operations
+ associated at runtime with the current user of the portal. The <emphasis>String getUserId()</emphasis> retrieve
+ the user id and can return null if no user is associated with the context. It also gives access to the
+ <emphasis>PortalSession</emphasis> instance associated with the current user. Finally it gives access to the
+ <emphasis>NavigationalStateContext</emphasis> associated with the current user.</para>
+ </section>
+
+ <section>
+ <title>Portal nodes</title>
+ <para>The portal structure is a tree formed by nodes. It is possible to programmatically access the portal tree in order to
+ </para>
+ <itemizedlist>
+ <listitem><para>discover the tree structure of the portal</para></listitem>
+ <listitem><para>create URL that will render the different portal nodes</para></listitem>
+ <listitem><para>access the properties of a specific node</para></listitem>
+ </itemizedlist>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/portalapi/PortalNode.png"/>
+ </imageobject>
+ </mediaobject>
+ <para>The PortalNode interface</para>
+
+ <para>As usual with tree structures, the main interface to study is the <emphasis>org.jboss.portal.api.node.PortalNode</emphasis>. That interface
+ is intentionally intended for obtaining useful information from the tree. It is not possible to use it to modify
+ the tree shape because it is not intended to be a management interface.</para>
+ <programlisting><![CDATA[
+public interface PortalNode
+{
+ int getType();
+ String getName();
+ String getDisplayName(Locale locale);
+ Map getProperties();
+ PortalNodeURL createURL(PortalRuntimeContext portalRuntimeContext);
+ ...
+}
+]]></programlisting>
+ <para>The interface offers methods to retrieve informations for a given node such as the node type, the node name
+ or the properties of the node. The noticeable node types are:</para>
+ <itemizedlist>
+ <listitem><para>PortalNode.TYPE_PORTAL : the node represents a portal</para></listitem>
+ <listitem><para>PortalNode.TYPE_PAGE : the node represents a portal page</para></listitem>
+ <listitem><para>PortalNode.TYPE_WINDOW : the node represents a page window</para></listitem>
+ </itemizedlist>
+ <para>The <emphasis>org.jboss.portal.api.node.PortalNodeURL</emphasis> is an extension of the <emphasis>PortalURL</emphasis> interface
+ which adds additional methods useful for setting parameters on the URL. There are no guarantees that the
+ portal node will use the parameters. So far portal node URL parameters are only useful for nodes of type
+ <emphasis>PortalNode.TYPE_WINDOW</emphasis> and they should be treated as portlet render parameters in the case of
+ the portlet is a local portlet and is not a remote portlet. The method that creates portal node URL requires
+ as parameter an instance of <emphasis>PortalRuntimeContext</emphasis>.</para>
+ <para>The interface also offers methods to navigate the node hierarchy:</para>
+ <programlisting><![CDATA[
+public interface PortalNode
+{
+ ...
+ PortalNode getChild(String name);
+ Collection getChildren();
+ PortalNode getRoot();
+ PortalNode getParent();
+ ...
+}
+]]></programlisting>
+ </section>
+ <section>
+ <title>Portal navigational state</title>
+ <para>The navigational state is a state managed by the portal that associates to each user the state triggered
+ by its navigation. A well known part of the navigational state are the render parameters provided at runtime
+ during the call of the method <emphasis>void render(RenderRequest req, RenderResponse resp)</emphasis>. The portal
+ API offers an interface to query and update the navigational state of the portal. For now the API only exposes
+ mode and window states of portal nodes of type window.</para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/portalapi/NavigationalStateContext.png"/>
+ </imageobject>
+ </mediaobject>
+ <para>The NavigationalStateContext interface</para>
+
+ </section>
+ <section>
+ <title>Portal events</title>
+ <para>Portal events are a powerful mechanism to be aware of what is happening in the portal at runtime. The base
+ package for event is <emphasis>org.jboss.portal.api.event</emphasis> and it contains the common event classes
+ and interfaces.
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/portalapi/PortalEvent.png"/>
+ </imageobject>
+ </mediaobject>
+ <para>The PortalEvent class</para>
+
+ <para>The <emphasis>org.jboss.portal.api.event.PortalEvent</emphasis> abstract class is the base class for
+ all kind of portal events.
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/portalapi/PortalEventContext.png"/>
+ </imageobject>
+ </mediaobject>
+ <para>The PortalEventContext interface</para>
+
+ <para>
+ The <emphasis>org.jboss.portal.api.event.PortalEventContext</emphasis> interface defines the context in which
+ an event is created and propagated. It allows retrieval of the <emphasis>PortalRuntimeContext</emphasis> which
+ can in turn be used to obtain the portal context.
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/portalapi/PortalEventListener.png"/>
+ </imageobject>
+ </mediaobject>
+ <para>The PortalEventListener interface</para>
+
+ <para>
+ The <emphasis>org.jboss.portal.api.event.PortalEventListener</emphasis> interface defines the contract that
+ class can implement in order to receive portal event notifications. It contains the method
+ <emphasis>void onEvent(PortalEvent event)</emphasis> called by the portal framework.
+ </para>
+ <para>
+ Listeners declaration requires a service to be deployed in JBoss that will instantiate the service implementation
+ and register it with the service registry. We will see how to achieve that in the example section of this chapter.
+ </para>
+ <note>
+ <para>The event propagation model uses one instance of a listener class to receive all portal events that
+ may be routed to that class when appropriate. Therefore implementors needs to be aware of that model
+ and must provide <emphasis role="bold">thread safe</emphasis> implementations.</para>
+ </note>
+ <section>
+ <title>Portal node events</title>
+ <para>Portal node events extend the abstract portal event framework in order to provide notifications
+ about user interface events happening at runtime. For instance when the portal renders a page or a window,
+ a corresponding event will be fired.</para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/portalapi/PortalNodeEvent.png" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ <para>The portal node event class hierarchy</para>
+
+ <para>The <emphasis>org.jboss.portal.api.node.event.PortalNodeEvent</emphasis> class extends the
+ <emphasis>org.jboss.portal.api.node.PortalEvent</emphasis> class and is the base class for all events
+ of portal nodes. It defines a single method <emphasis>PortalNode getNode()</emphasis> which can be
+ used to retrieve the node targetted by the event.</para>
+ <para>The <emphasis>org.jboss.portal.api.node.event.WindowEvent</emphasis> is an extension for portal nodes
+ of type window. It provides access to the mode and window state of the window. It has 3 subclasses which
+ represent different kind of event that can target windows.</para>
+ <para>The <emphasis>org.jboss.portal.api.node.event.WindowNavigationEvent</emphasis> is fired when the
+ window navigational state changes. For a portlet it means that the window is targetted by an URL of type
+ render.</para>
+ <para>The <emphasis>org.jboss.portal.api.node.event.WindowActionEvent</emphasis> is fired when the
+ window is targetted by an action. For a portlet it means that the window is targetted by an URL of type
+ action.</para>
+ <para>The <emphasis>org.jboss.portal.api.node.event.WindowRenderEvent</emphasis> is fired when the
+ window is going to be rendered by the portal.</para>
+ <para>The <emphasis>org.jboss.portal.api.node.event.PageEvent</emphasis> is an extension for portal nodes
+ of type page.</para>
+ <para>The <emphasis>org.jboss.portal.api.node.event.PageRenderEvent</emphasis> is fired when the
+ page is going to be rendered by the portal.</para>
+ <section>
+ <title>Portal node event propagation model</title>
+ <para>
+ A portal node event is fired when an event of interest happens to a portal node of the portal tree. The
+ notification model is comparable to the <ulink url="http://en.wikipedia.org/wiki/DOM_Events#Event_flow">bubbling propagation model </ulink>
+ defined by the DOM specification. When an event is fired, the event is propagated in the hierarchy from the most
+ inner node where the event happens to the root node of the tree.
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/portalapi/eventpropagation.png"/>
+ </imageobject>
+ </mediaobject>
+ <para>The portal node event propagation model</para>
+
+
+ </section>
+ <section>
+ <title>Portal node event listener</title>
+ <para>The <emphasis>org.jboss.portal.api.node.event.PortalNodeEventListener</emphasis> interface should
+ be used instead of the too generic <emphasis>org.jboss.portal.api.event.PortalEventListener</emphasis> when
+ it comes down of listening portal node events. Actually it does not replace it, the <emphasis>PortalEventListener</emphasis>
+ interface semantic allows only traditional event delivering. The <emphasis>PortalNodeEventListener</emphasis>
+ interface is designed to match the bubbling effect during an event delivery.</para>
+ <para>The <emphasis>PortalNodeEvent onEvent(PortalNodeEventContext context, PortalNodeEvent event)</emphasis>
+ method declares a <emphasis>PortalNodeEvent</emphasis> as return type. Commonly the method returns null;
+ however, a returned PortalNodeEvent replaces the event in the listeners subsequently called during
+ the event bubbling process.
+ </para>
+ </section>
+ <section>
+ <title>Portal node event context</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/portalapi/PortalNodeEventContext.png"/>
+ </imageobject>
+ </mediaobject>
+ <para>The PortalNodeEventContext interface</para>
+
+ <para>The <emphasis>org.jboss.portal.api.node.event.PortalNodeEventContext</emphasis> interface extends
+ the <emphasis>PortalEventContext</emphasis> interface and plays an important role
+ in the event delivery model explained in the previous section. That interface gives full control over the
+ delivery of the event to ascendant nodes in the hierarchy, even more it gives the possibility to replace
+ the current event being delivered by a new event that will be transformed into the corresponding portal
+ behavior. However there are no guarantees that the portal will turn the returned event into a portal
+ behavior, here the portal provides a best effort policy, indeed sometime it is not possible to achieve
+ the substitution of one event by another.</para>
+ <para>Here the simplest implementation of a listener that does nothing except than correctly passing
+ the control to a parent event listener if there is one.</para>
+ <programlisting><![CDATA[
+public PortalNodeEvent onEvent(PortalNodeEventContext context, PortalNodeEvent event)
+{
+ return context.dispatch();
+}
+]]></programlisting>
+ <para>The method <emphasis>PortalNode getNode()</emphasis> returns the current node being selected
+ during the event bubbler dispatching mechanism.</para>
+ </section>
+ </section>
+ <section>
+ <title>Portal session events</title>
+ <para>The life cycle of the session of the portal associated with the user can also raise events. This kind of
+ event is not bound to a portal node since it is triggered whenever a portal session is created or destroyed</para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/portalapi/PortalSessionEvent.png"/>
+ </imageobject>
+ </mediaobject>
+ <para>The PortalSessionEvent class</para>
+
+ <para>There are two different types of events:
+ <itemizedlist>
+ <listitem><para>org.jboss.portal.api.session.event.PortalSessionEvent.SESSION_CREATED, fired when a new portal session is created</para></listitem>
+ <listitem><para>org.jboss.portal.api.session.event.PortalSessionEvent.SESSION_DESTROYED, fired when a new portal session is destroyed</para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ <section>
+ <title>Portal user events</title>
+ <para>The life cycle of the portal user can also raise events such as its authentication. A subclass of the wider scope UserEvent class is
+ provided and triggers events whenever a user signs in or out. The UserEvent object gives access to the user name of the logged-in user through
+ the method <emphasis>String getId()</emphasis>.</para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/portalapi/user.event.png"/>
+ </imageobject>
+
+ </mediaobject>
+ <para>The UserEvent class and UserAuthenticationEvent sub-classes</para>
+
+ <para>The UserAuthenticationEvent triggers two events that can be catched:
+ <itemizedlist>
+ <listitem><para>org.jboss.portal.api.session.event.UserAuthenticationEvent.SIGN_IN, fired when a portal user signs in</para></listitem>
+ <listitem><para>org.jboss.portal.api.session.event.UserAuthenticationEvent.SIGN_OUT, fired when a portal user signs out</para></listitem>
+ </itemizedlist>
+ </para>
+ <para>Based on the UserEvent class other custom user related events could be added like one that would trigger when a new user is
+ being registered</para>
+ </section>
+ </section>
+ <section>
+ <title>Examples</title>
+ <para>The events mechanism is quite powerful, in this section of the chapter we will see few simple examples to explain how
+ it works.</para>
+ <section>
+ <title>UserAuthenticationEvent example</title>
+ <para>In this example, we will create a simple counter of the number of logged-in registered users. In order to
+ do that we just need to keep track of Sign-in and Sign-out events.</para>
+ <para>First, let's write our listener. It just a class that will implement <emphasis>org.jboss.portal.api.event.PortalEventListener</emphasis> and
+ its unique method <emphasis>void onEvent(PortalEventContext eventContext, PortalEvent event)</emphasis>. Here is such an example:
+ <programlisting role="java"><![CDATA[
+package org.jboss.portal.core.portlet.test.event;
+
+import[...]
+
+public class UserCounterListener implements PortalEventListener
+{
+
+ /** Thread-safe long */
+ private final SynchronizedLong counter = new SynchronizedLong(0);
+
+ /** Thread-safe long */
+ private final SynchronizedLong counterEver = new SynchronizedLong(0);
+
+ public void onEvent(PortalEventContext eventContext, PortalEvent event)
+ {
+ if (event instanceof UserAuthenticationEvent)
+ {
+ UserAuthenticationEvent userEvent = (UserAuthenticationEvent)event;
+ if (userEvent.getType() == UserAuthenticationEvent.SIGN_IN)
+ {
+ counter.increment();
+ counterEver.increment();
+ }
+ else if (userEvent.getType() == UserAuthenticationEvent.SIGN_OUT)
+ {
+ counter.decrement();
+ }
+ System.out.println("Counter : " + counter.get());
+ System.out.println("Counter ever: " + counterEver.get());
+ }
+ }
+}
+ ]]></programlisting>
+ On this method we simply filter down to UserAuthenticationEvent then depending on the type of authentication event we update the
+ counters. <emphasis>counter</emphasis> keeps track of the registered and logged-in users, while counterEver only counts the number of
+ times people logged-in the portal.</para>
+ <para>Now that the Java class has been written we need to register it so that it can be called when the events are triggered. To do
+ so we need to register it as an MBean. It can be done by editing the sar descriptor file:
+ <emphasis>YourService.sar/META-INF/jboss-service.xml</emphasis> so that it looks like the following:
+ <programlisting><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean
+ code="org.jboss.portal.core.event.PortalEventListenerServiceImpl"
+ name="portal:service=ListenerService,type=counter_listener"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends
+ optional-attribute-name="Registry"
+ proxy-type="attribute">portal:service=ListenerRegistry</depends>
+ <attribute name="RegistryId">counter_listener</attribute>
+ <attribute name="ListenerClassName">
+ org.jboss.portal.core.portlet.test.event.UserCounterListener
+ </attribute>
+ </mbean>
+</server>
+ ]]></programlisting>
+ This snippet can be kept as it is, providing you change the values:
+ <itemizedlist>
+ <listitem>
+ <para><emphasis role="bold">name:</emphasis> Must follow the pattern: portal:service=ListenerService,type={{UNIQUENAME}}</para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">RegistryId:</emphasis> Must match the type (here: counter_listener)</para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">ListenerClassName:</emphasis> Full path to the listener
+ (here: org.jboss.portal.core.portlet.test.event.UserCounterListener).</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>That's it - we now have a user counter that will display it states each time a user logs-in our logs-out.</para>
+ </section>
+ <section>
+ <title>Achieving Inter Portlet Communication with the events mechanism</title>
+ <para>The first version of the Portlet Specification (JSR 168), regretfully, did not cover interaction between
+ portlets. The side-effect of diverting the issue to the subsequent release of the specification, has
+ forced portal vendors to each craft their own proprietary API to achieve inter portlet communication. Here we will
+ see how we can use the event mechanism to pass parameters from one portlet to the other (and only to the other portlet).</para>
+ <para>The overall scenario will be that Portlet B will need to be updated based on some parameter set on Portlet A.
+ To achieve that we will use a portal node event.</para>
+ <para>Portlet A is a simple Generic portlet that has a form that sends a color name:
+ <programlisting><![CDATA[
+public class PortletA extends GenericPortlet
+{
+ protected void doView(RenderRequest request, RenderResponse response)
+ throws PortletException, PortletSecurityException, IOException
+ {
+ response.setContentType("text/html");
+ PrintWriter writer = response.getWriter();
+ writer.println("<form action=\"" + response.createActionURL() + "\" method=\"post\">");
+ writer.println("<select name=\"color\">");
+ writer.println("<option>blue</option>");
+ writer.println("<option>red</option>");
+ writer.println("<option>black</option>");
+ writer.println("</select>");
+ writer.println("<input type=\"submit\"/>");
+ writer.println("</form>");
+ writer.close();
+ }
+}
+ ]]></programlisting>
+ </para>
+ <para>The other portlet (Portlet B) that will receive parameters from Portlet A is also a simple Generic portlet:
+ <programlisting><![CDATA[
+public class PortletB extends GenericPortlet
+{
+
+ public void processAction(ActionRequest request, ActionResponse response)
+ throws PortletException, PortletSecurityException, IOException
+ {
+ String color = request.getParameter("color");
+ if (color != null)
+ {
+ response.setRenderParameter("color", color);
+ }
+ }
+
+ protected void doView(RenderRequest request, RenderResponse response)
+ throws PortletException, PortletSecurityException, IOException
+ {
+ String color = request.getParameter("color");
+ response.setContentType("text/html");
+ PrintWriter writer = response.getWriter();
+ writer.println("<div" +
+ (color == null ? "" : " style=\"color:" + color + ";\"") +
+ ">some text in color</div>");
+ writer.close();
+ }
+
+ // Inner listener explained after
+}
+ ]]></programlisting>
+ </para>
+ <para>With those two portlets in hands, we just want to pass parameters from Portlet A to Portlet B (the color in
+ as a request parameter in our case). In order to achieve this goal, we will write an inner Listener in Portlet B
+ that will be triggered on any WindowActionEvent of Portlet A. This listener will create a new WindowActionEvent
+ on the window of Portlet B.
+ <programlisting role="java"><![CDATA[
+public static class Listener implements PortalNodeEventListener
+{
+ public PortalNodeEvent onEvent(PortalNodeEventContext context, PortalNodeEvent event)
+ {
+ PortalNode node = event.getNode();
+ // Get node name
+ String nodeName = node.getName();
+ // See if we need to create a new event or not
+ WindowActionEvent newEvent = null;
+ if (nodeName.equals("PortletAWindow") && event instanceof WindowActionEvent)
+ {
+ // Find window B
+ WindowActionEvent wae = (WindowActionEvent)event;
+ PortalNode windowB = node.resolve("../PortletBWindow");
+ if (windowB != null)
+ {
+ // We can redirect
+ newEvent = new WindowActionEvent(windowB);
+ newEvent.setParameters(wae.getParameters());
+
+ newEvent.setMode(wae.getMode());
+ newEvent.setWindowState(WindowState.MAXIMIZED);
+
+ // Redirect to the new event
+ return newEvent;
+ }
+ }
+ // Otherwise bubble up
+ return context.dispatch();
+ }
+}
+ ]]></programlisting>
+ </para>
+ <para>
+ It is important to note here some of the important items in this listener class.
+ Logic used to determine if the requesting node was Portlet A.:
+ <programlisting>nodeName.equals("PortletAWindow")</programlisting>
+ </para>
+ <para>
+ Get the current window object so we can dispatch the event to it:
+ <programlisting>PortalNode windowB = node.resolve("../PortletBWindow");</programlisting>
+ </para>
+ <para>
+ Set the original parameter from Portlet A, so Portlet B can access them in its processAction():
+ <programlisting>newEvent.setParameters(wae.getParameters());</programlisting>
+ </para>
+ <!--
+ <para>
+ Modify Portlet B windowmode and/or windowstate (ie, Maximize and place in Edit Mode):
+ <programlisting>
+newEvent.setMode(wae.getMode()); // Mode.EDIT;
+newEvent.setWindowState(wae.getWindowState()); // WindowState.MAXIMIZED</programlisting>
+ </para>
+ -->
+ <para>
+ We still need to register our listener as an mbean:
+ <programlisting role="xml">
+<![CDATA[<mbean
+ code="org.jboss.portal.core.event.PortalEventListenerServiceImpl"
+ name="portal:service=ListenerService,type=test_listener"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends
+ optional-attribute-name="Registry"
+ proxy-type="attribute">portal:service=ListenerRegistry</depends>
+ <attribute name="RegistryId">test_listener</attribute>
+ <attribute name="ListenerClassName">
+ org.jboss.portal.core.samples.basic.event.PortletB$Listener
+ </attribute>
+</mbean>]]></programlisting>
+ For node events, we also need to declare on which node we want to listen, this is done by modifying
+ the <literal>*-object.xml</literal> that defines your portal nodes. In this example we want to trigger
+ the listener each time the window containing the portlet A is actioned. We can add the <literal>listener</literal>
+ tag to specify that out listener with <literal>RegistryId</literal>=test_listener should be triggered
+ on events on the embedding object.
+ <programlisting>
+<![CDATA[...
+ <window>
+ <window-name>PortletAWindow</window-name>
+ <instance-ref>PortletAInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
+ <listener>test_listener</listener>
+ </window>
+...]]>
+ </programlisting>
+ Of course we could have added it at the page level instead of the window level. Note that a unique listener
+ can be specified, the event mechanism is primarily done to let the developer change the navigation state of the
+ portal, this example being a nice side-effect of this feature.
+ </para>
+ <note><para>The portlet 2.0 specification (JSR 286) will cover Inter Portlet Communication so that portlets using it
+ can work with different portal vendors.</para></note>
+ </section>
+ <section>
+ <title>Link to other pages</title>
+ <para>Linking to some other pages or portals is also out of the scope of the portlet
+ specification. As seen previously JBoss Portal offers an API in order to create links
+ to other portal nodes. The JBoss request gives access to the current window node from
+ which we can navigate from.</para>
+ <programlisting role="java">
+<![CDATA[
+// Get the ParentNode. Since we are inside a Window, the Parent is the Page
+PortalNode thisNode = req.getPortalNode().getParent();
+
+// Get the Node in the Portal hierarchy tree known as "../default"
+PortalNode linkToNode = thisNode.resolve("../default");
+
+// Create a RenderURL to the "../default" Page Node
+PortalNodeURL pageURL = resp.createRenderURL(linkToNode);
+
+// Output the Node's name and URL for users
+html.append("Page: " + linkToNode.getName() + " -> ");
+html.append("<a href=\"" + pageURL.toString() + "\">" + linkToNode.getName() + "</a>");
+ ]]></programlisting>
+ <para>From this, it is easy to create a menu or sitemap, the <emphasis>List getChildren()</emphasis>
+ method will return all the child nodes on which the user has the view right access.</para>
+ </section>
+ <section>
+ <title>Samples</title>
+ <para>Those examples are available in the core-samples package in the sources of JBoss Portal.
+ There are more examples of events usage in the samples delivered with JBoss Portal. One of them
+ shows the usage of a portal node event to only have one window in normal mode at a time in a region.
+ Anytime another window is being put in normal mode, all the other windows of the same regions
+ are automatically minimized.</para>
+ </section>
+ </section>
+</chapter>
+ <chapter id="clustering">
+ <!--<chapterinfo>
+ <author>
+ <firstname>Julien</firstname>
+ <surname>Viet</surname>
+ </author>
+ <author>
+ <firstname>Roy</firstname>
+ <surname>Russo</surname>
+ </author>
+ </chapterinfo>-->
+ <title>Clustering Configuration</title>
+ <para>This section covers configuring JBoss Portal for a clustered environment.</para>
+ <section>
+ <title>Introduction</title>
+ <para>JBoss Portal leverages various clustered services that are found in JBoss Application Server. This section briefly details how each is leveraged:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">JBoss Cache:</emphasis>
+ Used to replicate data among the different hibernate session factories that are deployed in
+ each node of the cluster.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">JBoss HA Singleton:</emphasis>
+ <orderedlist>
+ <listitem><para>Used to make the deployer a singleton on the cluster, in order to avoid
+ concurrency issues when
+ deploying the various *-object.xml files. Without that, each node would try to create the
+ same objects in the database when it deploys an archive containing such descriptors.</para></listitem>
+ <listitem><para>Used with JCR. The Apache Jackrabbit server is not able to run in a cluster
+ by itself, therefore we make a singleton on the cluster. This provides HA-CMS, which is
+ similar to the current HA JBossMQ provided in JBoss AS.</para></listitem>
+ </orderedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">HA-JNDI:</emphasis>
+ Used to replicate a proxy that will talk to the HA CMS on the cluster.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">Http Session Replication:</emphasis>
+ Used to replicate the portal and the portlet sessions.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">JBoss SSO:</emphasis>
+ Used to replicate the user identity, an authenticated user does not have to login again when failover occurs.
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <note><title>Note</title><para>JBoss Clustering details can be found in the
+ <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossHA">Wiki</ulink>
+ or the
+ <ulink url="http://labs.jboss.com/jbossas/docs/">clustering documentation</ulink>.</para>
+ </note>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/clustering/overview.png" scalefit="1"/>
+ </imageobject></mediaobject>
+ </section>
+ <section>
+ <title>Considerations</title>
+ <para>When you want to run JBoss Portal on a cluster there are a few things to keep in mind:
+ <itemizedlist>
+ <listitem><para>Deploy the portal under the <emphasis role="bold">all</emphasis> application server configuration as it contains the clustering services that is leveraged by JBoss Portal.</para></listitem>
+ <listitem><para>All the portal instances have to use the same datasource : the database is used to store the portal
+ persistent state like pages. If you don't use a shared database then you will have consistency problems.</para></listitem>
+ </itemizedlist></para>
+ </section>
+
+ <section>
+ <title>JBoss Portal Clustered Services</title>
+
+ <section id="PortalSessionReplication">
+ <title>Portal Session Replication</title>
+ <para>The portal associates with each user a http session in order to keep specific objects such as:
+ <itemizedlist>
+ <listitem><para>Navigational state : this is mainly the state of different portlet windows that the user will manipulate
+ during its interactions with the portal. For instance a maximized portlet window with specific render parameters.</para></listitem>
+ <listitem><para>WSRP objects : the WSRP protocol can require to provide specific cookies during interactions with a remote
+ portlet.</para></listitem>
+ </itemizedlist>
+ Replicating the portal session ensures that this state will be kept in sync on the cluster, e.g The user will see exactly
+ the same portlet window on every node of the cluster. The activation of the portal session replication is made through the
+ configuration of the web application that is the main entry point of the portal. This setting is available in the file
+ <emphasis>jboss-portal.sar/portal-server.war/WEB-INF/web.xml</emphasis></para>
+ <para>
+ <programlisting><![CDATA[
+<web-app>
+ <description>JBoss Portal</description>
+ <!-- Comment/Uncomment to enable portal session replication -->
+ <distributable/>
+ ...
+</web-app>
+]]></programlisting>
+ </para>
+ </section>
+
+ <section>
+ <title>Hibernate clustering</title>
+ <para>JBoss Portal leverages hibernate for its database access. In order to improve performances it uses
+ the caching features provided by hibernate. On a cluster the cache needs to be replicated in order
+ to avoid state inconsistencies. Hibernate is configured with JBoss Cache which performs that synchronization transparently.
+ Therefore the different hibernate services must be configured to use JBoss Cache. The following hibernate configurations
+ needs to use a replicated JBoss Cache :
+ <itemizedlist>
+ <listitem><para><emphasis>jboss-portal.sar/conf/hibernate/user/hibernate.cfg.xml</emphasis></para></listitem>
+ <listitem><para><emphasis>jboss-portal.sar/conf/hibernate/instances/hibernate.cfg.xml</emphasis></para></listitem>
+ <listitem><para><emphasis>jboss-portal.sar/conf/hibernate/portal/hibernate.cfg.xml</emphasis></para></listitem>
+ <listitem><para><emphasis>jboss-portal.sar/conf/hibernate/portlet/hibernate.cfg.xml</emphasis></para></listitem>
+ </itemizedlist>
+ The cache configuration should look like :
+ <programlisting><![CDATA[
+<!--
+ | Uncomment in clustered mode : use transactional replicated cache
+ -->
+ <property name="cache.provider_class">org.jboss.portal.core.hibernate.JMXTreeCacheProvider
+ </property>
+ <property name="cache.object_name">portal:service=TreeCacheProvider,type=hibernate
+ </property>
+
+<!--
+ | Comment in clustered mode
+ <property name="cache.provider_configuration_file_resource_path">
+ conf/hibernate/instance/ehcache.xml</property>
+ <property name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
+-->
+]]></programlisting>
+ Also we need to ensure that the cache is deployed by having in the file <emphasis>jboss-portal.sar/META-INF/jboss-service.xml</emphasis>
+ the cache service uncommented :
+ <programlisting><![CDATA[
+<!--
+ | Uncomment in clustered mode : replicated cache for hibernate
+ -->
+ <mbean
+ code="org.jboss.cache.TreeCache"
+ name="portal:service=TreeCache,type=hibernate">
+ <depends>jboss:service=Naming</depends>
+ <depends>jboss:service=TransactionManager</depends>
+ <attribute name="TransactionManagerLookupClass">
+ org.jboss.cache.JBossTransactionManagerLookup</attribute>
+ <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
+ <attribute name="CacheMode">REPL_SYNC</attribute>
+ <attribute name="ClusterName">portal.hibernate</attribute>
+ </mbean>
+
+ <mbean
+ code="org.jboss.portal.core.hibernate.JBossTreeCacheProvider"
+ name="portal:service=TreeCacheProvider,type=hibernate">
+ <depends optional-attribute-name="CacheName">portal:service=TreeCache,type=hibernate
+ </depends>
+ </mbean>
+]]></programlisting>
+ More information can be found <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossCacheHibernate">here</ulink>.
+ </para>
+ </section>
+
+ <section>
+ <title>Identity clustering</title>
+ <para>JBoss Portal leverages the servlet container authentication for its own authentication mechanism. When
+ the user is authenticated on one particular node he will have to reauthenticate again if a different
+ node of the cluster (during a failover for instance) is used. This is valid only for the <emphasis>FORM</emphasis>
+ based authentication which is the default form of authentication that JBoss Portal uses. Fortunately JBoss
+ provides transparent reauthentication of the user called JBoss clustered SSO. Its configuration can be found
+ in <literal>$JBOSS_HOME/server/all/deploy/jboss-web.deployer/server.xml</literal> and you will need to
+ uncomment the following valve:
+ <programlisting><![CDATA[<Valve className="org.jboss.web.tomcat.service.sso.ClusteredSingleSignOn" />]]></programlisting>
+
+ More information can be found <ulink url="http://www.jboss.org/wiki/Wiki.jsp?page=SingleSignOn">here</ulink>.
+ </para>
+ </section>
+
+ <section>
+ <title>CMS clustering</title>
+ <para>The CMS backend storage relies on the Apache Jackrabbit project. Jackrabbit does not support clustering out of the box.
+ So the portal run the Jackrabbit service on one node of the cluster using the
+ <ulink url="http://www.onjava.com/pub/a/onjava/2003/08/20/jboss_clustering.html">HA-Singleton</ulink> technology.
+ The file <emphasis>jboss-portal.sar/portal-cms.sar/META-INF/jboss-service.xml</emphasis> contains the configuration. We will
+ not reproduce it in this documentation as the changes are quite complex and numerous. Access from all nodes of the cluster
+ is provided by a proxy bound in HA-JNDI. In order to avoid any bottleneck JBoss Cache is leveraged to cache CMS content cluster
+ wide.</para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/clustering/cms.png"/>
+ </imageobject></mediaobject>
+ </section>
+
+ </section>
+
+ <section>
+ <title>Setup</title>
+ <para>We are going to outline how to setup a two node cluster on the same machine in order to test JBoss Portal HA. The only
+ missing part from the full fledged setup is the addition of a load balancer in front of Apache Tomcat. However a lot of documentation
+ exist on the subject. A detailed step by step setup of Apache and mod_jk is available from the
+ <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingMod_jk1.2WithJBoss">JBoss Wiki</ulink>.</para>
+ <para>As we need two application servers running at the same time, we must avoid any conflict. For instance we will
+ need Apache Tomcat to bind its socket on two different ports otherwise a network conflict will occur. We will leverage
+ the service binding manager <ulink url="http://docs.jboss.org/jbossas/jboss4guide/r3/html/ch10.html">this chapter</ulink> of
+ the JBoss AS documentation.</para>
+ <para>The first step is to copy the <emphasis>all</emphasis> configuration of JBoss into two separate
+ configurations that we name <emphasis>ports-01</emphasis> and <emphasis>ports-02</emphasis> :
+ <programlisting><![CDATA[
+>cd $JBOSS_HOME/server
+>cp -r all ports-01
+>cp -r all ports-02
+]]></programlisting>
+ </para>
+ <para>Edit the file <emphasis>$JBOSS_HOME/server/ports-01/conf/jboss-service.xml</emphasis> and uncomment
+ the service binding manager :
+ <programlisting><![CDATA[
+<mbean code="org.jboss.services.binding.ServiceBindingManager"
+ name="jboss.system:service=ServiceBindingManager">
+ <attribute name="ServerName">ports-01</attribute>
+ <attribute name="StoreURL">
+ ${jboss.home.url}/docs/examples/binding-manager/sample-bindings.xml</attribute>
+ <attribute name="StoreFactoryClassName">org.jboss.services.binding.XMLServicesStoreFactory</attribute>
+</mbean>
+]]></programlisting>
+ </para>
+ <para>Edit the file <emphasis>$JBOSS_HOME/server/ports-02/conf/jboss-service.xml</emphasis>, uncomment
+ the service binding manager and change the value <emphasis>ports-01</emphasis> into <emphasis>ports-02</emphasis>:
+ <programlisting><![CDATA[
+<mbean code="org.jboss.services.binding.ServiceBindingManager"
+ name="jboss.system:service=ServiceBindingManager">
+ <attribute name="ServerName">ports-02</attribute>
+ <attribute name="StoreURL">
+ ${jboss.home.url}/docs/examples/binding-manager/sample-bindings.xml</attribute>
+ <attribute name="StoreFactoryClassName">
+ org.jboss.services.binding.XMLServicesStoreFactory</attribute>
+</mbean>]]></programlisting>
+ </para>
+ <para>Setup a database that will be shared by the two nodes and obviously we cannot use
+ an embedded database. For instance using postgresql we would need to copy the file <emphasis>portal-postgresql-ds.xml</emphasis>
+ into <emphasis>$JBOSS_HOME/server/ports-01/deploy</emphasis> and <emphasis>$JBOSS_HOME/server/ports-02/deploy</emphasis>.
+ </para>
+ <para>Copy JBoss Portal HA to the deploy directory of the two configurations.</para>
+
+ <!-- adding instruction about jboss cache versioning -->
+ <formalpara>
+ <title>JBoss Cache</title>
+ <para>
+ To improve CMS performance JBoss Cache is leveraged to cache the content cluster wide.
+ We recommend that you use the following version of JBoss Cache for best performance:
+ </para>
+</formalpara>
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>JBoss Cache 1.4.0.SP1 and above</emphasis></para>
+ </listitem>
+ <listitem><para>
+ <emphasis>JGroups 2.2.7 or 2.2.8</emphasis></para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ When building from source the following command:
+ <literal>{core}/build.xml deploy-ha</literal> automatically upgrades your JBoss Cache version.
+ </para>
+ <para>
+ <emphasis>Alternative:</emphasis>
+ If upgrading your JBoss Cache version is not an option, the following configuration
+ change is needed in the
+ <literal>jboss-portal-ha.sar/portal-cms.sar/META-INF/jboss-service.xml</literal>.
+ Replace the following configuration in the
+ <emphasis>cms.pm.cache:service=TreeCache</emphasis>
+ Mbean:
+ </para>
+ <programlisting role="XML"><![CDATA[
+<!--
+ Configuring the PortalCMSCacheLoader
+ CacheLoader configuration for 1.4.0
+-->
+<attribute name="CacheLoaderConfiguration">
+ <config>
+ <passivation>false</passivation>
+ <preload></preload>
+ <shared>false</shared>
+ <cacheloader>
+ <class>org.jboss.portal.cms.hibernate.state.PortalCMSCacheLoader</class>
+ <properties></properties>
+ <async>false</async>
+ <fetchPersistentState>false</fetchPersistentState>
+ <ignoreModifications>false</ignoreModifications>
+ </cacheloader>
+ </config>
+</attribute>]]>
+ </programlisting>
+ <para>
+ with the following configuration:
+ </para>
+ <programlisting role="XML"><![CDATA[
+<!--
+ Configuring the PortalCMSCacheLoader
+ CacheLoader configuratoon for 1.2.4SP2
+-->
+<attribute name="CacheLoaderClass">org.jboss.portal.cms.hibernate.state.PortalCMSCacheLoader
+</attribute>
+<attribute name="CacheLoaderConfig" replace="false"></attribute>
+<attribute name="CacheLoaderPassivation">false</attribute>
+<attribute name="CacheLoaderPreload"></attribute>
+<attribute name="CacheLoaderShared">false</attribute>
+<attribute name="CacheLoaderFetchTransientState">false</attribute>
+<attribute name="CacheLoaderFetchPersistentState">false</attribute>
+<attribute name="CacheLoaderAsynchronous">false</attribute>]]></programlisting>
+
+<para>Finally we can start both servers, open two shells and execute :
+ <programlisting><![CDATA[
+>cd $JBOSS_HOME/bin
+>sh run.sh -c ports-01
+]]></programlisting>
+ <programlisting><![CDATA[
+>cd $JBOSS_HOME/bin
+>sh run.sh -c ports-02
+]]></programlisting>
+ </para>
+ </section>
+
+ <section id="portlet_session_replication">
+ <title>Portlet Session Replication</title>
+ <para>Web containers offer the capability to replicate sessions of web applications. In the context of a portal using portlets the use case is different. The portal itself is a web application
+ that benefits of web application session replication. We have to make the distinction between local or remote portlets :
+ <itemizedlist>
+ <listitem><para>Local portlets are web applications deployed in the same virtual machine as the portal
+ web application. At runtime the access to a portlet is done using the mechanism of request dispatching. The portlet
+ session is actually a mere wrapper of the underlying http session of the web application in which the portlet
+ is deployed.</para></listitem>
+<listitem><para>Remote portlets are accessed using a web service, we will not cover the replication in this chapter.</para></listitem>
+ </itemizedlist></para>
+ <para>The servlet specification is very loose on the subject of replication and does not state anything about
+ the replication of sessions during a dispatched request. JBoss Portal offers a portlet session replication
+ mechanism that leverages the usage of the portal session instead which has several advantages
+ </para>
+ <itemizedlist>
+ <listitem><para>Replicate only the portlet that requires it.</para></listitem>
+ <listitem><para>Portal session replication is just web application replication and is very standard.</para></listitem>
+ </itemizedlist>
+ <para>There are, however, some limitations. For example, you can only replicate portlet-scoped attributes of a portlet
+ session. This means that any application-scoped attribute are not replicated.</para>
+ <section>
+ <title>JBoss Portal configuration</title>
+ <para>The mandatory step to make JBoss Portal able to replicate portlet sessions is to configure
+ the portal web application to be distributed as explained in <xref linkend="PortalSessionReplication"/></para>
+ </section>
+ <section>
+ <title>Portlet configuration</title>
+ <para>In order to activate portlet session replication you need to:</para>
+ <itemizedlist>
+ <listitem><para>Add a Portal-specific listener class to the <literal>/WEB-INF/web.xml</literal> file of your portlet web application</para></listitem>
+ <listitem><para>Configure your portlet to be distributed in the <literal>/WEB-INF/jboss-portlet.xml</literal> file</para></listitem>
+ </itemizedlist>
+
+ <programlisting><![CDATA[
+<web-app>
+ ...
+ <listener>
+ <listener-class> org.jboss.portal.portlet.session.SessionListener </listener-class>
+ </listener>
+ ...
+</web-app>
+]]></programlisting>
+
+ <para>Example web.xml</para>
+
+<programlisting><![CDATA[
+<portlet-app>
+ ...
+ <portlet>
+ <portlet-name>YourPortlet</portlet-name>
+ ...
+ <session-config>
+ <distributed>true</distributed>
+ </session-config>
+ ...
+ </portlet>
+ ...
+</portlet-app>
+]]></programlisting>
+
+ <para>Configure YourPortlet to be replicated in jboss-portlet.xml</para>
+
+ </section>
+ <section>
+ <title>Limitations</title>
+ <para>As we noted above there are advantages as well as limitations to the clustering configuration</para>
+ <itemizedlist>
+ <listitem><para>You can only replicate portlet scoped attributes of a portlet. The main reason of this
+ is to keep consistency with the session state. If accessing a portlet would trigger replication
+ of application scoped attribute during the rendering of a page then another portlet on the same
+ page could use this attribute for generating its markup. Then the state seen by this second portlet
+ would not necessarily be the same depending on the order in which the portlets on this page are rendered.</para></listitem>
+<listitem><para>Mutable objects need an explicit call to <emphasis>setAttribute(String name, Object value)</emphasis>
+ on the portlet session object in order to trigger replication by the container.</para></listitem>
+ </itemizedlist>
+ <para>
+ <programlisting><![CDATA[
+public void processAction(ActionRequest req, ActionResponse resp)
+ throws PortletException, IOException
+{
+ ...
+ if ("addItem".equals(action))
+ {
+ PortletSession session = req.getPortletSession();
+ ShoppingCart cart = (PortletSession)session.getAttribute("cart");
+ cart.addItem(item);
+
+ // Perform an explicit set in order to signal to the container that the object
+ // state has changed
+ session.setAttribute("cart", cart);
+ }
+ ...
+}
+]]></programlisting>
+ </para>
+ </section>
+ </section>
+</chapter>
+ <chapter id="wsrp">
+<!-- <chapterinfo>
+ <author>
+ <firstname>Julien</firstname>
+ <surname>Viet</surname>
+ </author>
+ <author>
+ <firstname>Chris</firstname>
+ <surname>Laprun</surname>
+ </author>
+ </chapterinfo>-->
+
+ <title>Web Services for Remote Portlets (WSRP)</title>
+
+ <section>
+ <title>Introduction</title>
+ <para>The Web Services for Remote Portlets specification defines a web service interface for accessing and
+ interacting with interactive presentation-oriented web services. It has been produced through the efforts of
+ the Web Services for Remote Portlets (WSRP) OASIS Technical Committee. It is based on the requirements
+ gathered and on the concrete proposals made to the committee.
+ </para>
+
+ <para>Scenarios that motivate WSRP functionality include:
+ <itemizedlist>
+ <listitem><para>Content hosts, such as portal servers, providing Portlets as presentation-oriented web services
+ that can be used by aggregation engines.</para>
+ </listitem>
+ <listitem><para>Aggregating frameworks, including portal servers, consuming presentation-oriented web services
+ offered by content providers and integrating them into the framework.</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>More information on WSRP can be found on the
+ <ulink url="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=wsrp">official website for WSRP</ulink>.
+ We suggest reading the <ulink url="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=wsrp">primer
+ </ulink> for a good, albeit technical, overview of WSRP.
+ </para>
+ </section>
+
+ <section id="wsrp_support">
+ <title>Level of support in JBoss Portal</title>
+ <para>The WSRP Technical Committee defined
+ <ulink url="http://www.oasis-open.org/committees/download.php/3073">WSRP Use Profiles</ulink>
+ to help with WSRP interoperability. We will refer to terms defined in that document in
+ this section.
+ </para>
+
+ <para>JBoss Portal provides a Simple level of support for our WSRP Producer except that out-of-band registration
+ is not currently handled. We support in-band registration and persistent local state (which are
+ defined at the Complex level).
+ </para>
+
+ <para>On the Consumer side, JBoss Portal provides a Medium level of support for WSRP, except that we only handle
+ HTML markup (as Portal itself doesn't handle other markup types). We do support explicit portlet cloning and
+ we fully support the PortletManagement interface.
+ </para>
+
+ <para>As far as caching goes, we have Level 1 Producer and Consumer. We support Cookie handling properly on the
+ Consumer and our Producer requires initialization of cookies (as we have found that it improved interoperabilty
+ with some consumers). We don't support custom window states or modes, as Portal doesn't either. We do, however,
+ support CSS on both the Producer (though it's more a function of the portlets than inherent Producer
+ capability) and Consumer.
+ </para>
+
+ <para>While we provide a complete implementation of WSRP 1.0, we do need to go through the
+ <ulink url="http://www.oasis-open.org/committees/download.php/6018">Conformance statements</ulink>
+ and perform more interoperability testing (an area that needs to be better supported by the WSRP Technical
+ Committee and Community at large).
+ </para>
+ </section>
+
+ <section>
+ <title>Deploying JBoss Portal's WSRP services</title>
+ <para>
+ JBoss Portal provides a complete support of WSRP 1.0 standard interfaces and offers both consumer and producer
+ services. WSRP support is provided by the <filename>portal-wsrp.sar</filename> service archive, included in
+ the main <filename>jboss-portal.sar</filename> service archive, if you've obtained JBoss Portal from a binary
+ distribution. If you don't intend on using WSRP, we recommend that you remove <filename>portal-wspr.sar</filename>
+ from the main <filename>jboss-portal.sar</filename> service archive.
+ </para>
+ <para>If you've obtained the source distribution of JBoss Portal, you need to build and deploy the WSRP service
+ separately. Please follow the instructions on how to install
+ <ulink url="http://docs.jboss.com/jbportal/v2.6/reference-guide/en/html/installation....">JBoss
+ Portal from the sources</ulink>. Once this is done, navigate to
+ <filename>JBOSS_PORTAL_HOME_DIRECTORY/wsrp</filename> and type: <command>build deploy</command>
+ At the end of the build process, <filename>portal-wsrp.sar</filename> is copied to
+ <filename>JBOSS_HOME/server/default/deploy</filename>.
+ </para>
+
+ <section id="wsrp-ports">
+ <title>Considerations to use WSRP when running Portal on a non-default port or hostname</title>
+ <para>If you have modified the port number on which Portal runs or bound your Application Server to a specific
+ host name, you will also need
+ <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=WSRPChangePorts">update the port and/or hostname
+ information for WSRP</ulink> as found on
+ <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossPortal">JBoss Portal's wiki</ulink>.
+ </para>
+ </section>
+
+ <section>
+ <title>Considerations to use WSRP with SSL</title>
+ <para>It is possible to use WSRP over SSL for secure exchange of data. Please refer to the
+ <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=WSRPUseSSL">instructions</ulink>
+ on how to do so from
+ <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossPortal">JBoss Portal's wiki</ulink>.
+ </para>
+ </section>
+ </section>
+
+ <section>
+ <title>Making a portlet remotable</title>
+ <para>JBoss Portal does <emphasis role="bold">NOT</emphasis>, by default, expose local portlets for consumption by
+ remote WSRP consumers. In order to make a portlet remotely available, it must be made "remotable" by adding a
+ <literal>remotable</literal> element to the <filename>jboss-portlet.xml</filename> deployment descriptor for
+ that portlet. If a <filename>jboss-portlet.xml</filename> file does not exist, one must be added to the
+ <filename>WEB-INF</filename> folder of the web application containing the portlet.
+ </para>
+ <para>In the following example, the "BasicPortlet" portlet is specified as being remotable. The
+ <literal>remotable</literal> element is optional.
+ </para>
+
+ <programlisting><![CDATA[
+<?xml version="1.0" standalone="yes"?>
+<!DOCTYPE portlet-app PUBLIC "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
+<portlet-app>
+ <portlet>
+ <portlet-name>BasicPortlet</portlet-name>
+ <remotable>true</remotable>
+ </portlet>
+</portlet-app>]]></programlisting>
+
+ <para>
+ It is also possible to specify that all the portlets declared within a given <filename>jboss-portlet.xml</filename>
+ file have a specific "remotable" status by default. This is done by adding a single <literal>remotable</literal>
+ element to the root <literal>portlet-app</literal> element. Usually, this feature will be used to remotely expose
+ several portlets without having to specify the status for all the declared portlets. Let's look at an example:
+ </para>
+
+ <programlisting><![CDATA[
+<?xml version="1.0" standalone="yes"?>
+<!DOCTYPE portlet-app PUBLIC
+ "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
+<portlet-app>
+ <remotable>true</remotable>
+ <portlet>
+ <portlet-name>RemotelyExposedPortlet</portlet-name>
+ ...
+ </portlet>
+ <portlet>
+ <portlet-name>NotRemotelyExposedPortlet</portlet-name>
+ <remotable>false</remotable>
+ ...
+ </portlet>
+</portlet-app>]]>
+ </programlisting>
+
+
+ <para>
+ In the example above, we defined two portlets with a default "remotable" status set to true. This means that
+ all portlets defined in this descriptor are, by default, exposed remotely by JBoss Portal's WSRP producer.
+ Note, however, that it is possible to override the default behavior by adding a <literal>remotable</literal>
+ element to a portlet description. In that case, the "remotable" status defined by the portlet takes precedence
+ over the default. In the example above, the <literal>RemotelyExposedPortlet</literal> inherits the "remotable"
+ status defined by default since it does not specify a <literal>remotable</literal> element in its description.
+ The <literal>NotRemotelyExposedPortlet</literal>, however, overrides the default behavior and is not remotely
+ exposed. Note that in the absence of a top-level <literal>remotable</literal> element, portlets are NOT
+ remotely exposed.
+ </para>
+ </section>
+
+ <section>
+ <title>Consuming JBoss Portal's WSRP portlets from a remote Consumer</title>
+ <para>WSRP Consumers vary a lot as far as how they are configured. Most of them require that you either specify
+ the URL for the Producer's WSDL definition or the URLs for the individual endpoints. Please refer to your
+ Consumer's documentation for specific instructions. For instructions on how to do so in JBoss Portal, please
+ refer to <xref linkend="consumer_configuration"/>.
+ </para>
+ <para>
+ JBoss Portal's Producer is automatically set up when you deploy a portal instance with the WSRP service.
+ You can access the WSDL file at
+ <filename>http://{hostname}:{port}/portal-wsrp/MarkupService?wsdl</filename>. You can access the endpoint URLs
+ at:
+ <itemizedlist>
+ <listitem><para>
+ <filename>http://{hostname}:{port}/portal-wsrp/ServiceDescriptionService</filename></para>
+ </listitem>
+ <listitem><para>
+ <filename>http://{hostname}:{port}/portal-wsrp/MarkupService</filename></para>
+ </listitem>
+ <listitem><para>
+ <filename>http://{hostname}:{port}/portal-wsrp/RegistrationService</filename></para>
+ </listitem>
+ <listitem>
+ <para><filename>http://{hostname}:{port}/portal-wsrp/PortletManagementService</filename></para>
+ </listitem>
+ </itemizedlist>
+ The default hostname is <literal>localhost</literal> and the default port is 8080.
+ </para>
+ </section>
+
+ <section id="consumer_configuration">
+ <title>Consuming remote WSRP portlets in JBoss Portal</title>
+ <section>
+ <title>Overview</title>
+ <para>
+ To be able to consume WSRP portlets exposed by a remote producer, JBoss Portal's WSRP consumer needs to know
+ how to access that remote producer. One can configure access to a remote producer using WSRP Producer
+ descriptors. Alternatively, a portlet is provided to configure remote producers.
+ </para>
+ <para>
+ Once a remote producer has been configured, it can be made available
+ in the list of portlet providers in the Management portlet on the Admin page of JBoss Portal. You can then
+ examine the list of portlets that are exposed by this producer and configure the portlets just like you
+ would for local portlets.
+ </para>
+ <para>
+ JBoss Portal's default configuration exposes some of the sample portlets for remote consumption. As a way to
+ test the WSRP service, a default consumer has been configured to consume these portlets. To make sure that
+ the service indeed works, check that there is a portlet provider with the
+ <literal>self</literal>
+ identifier in the portlet providers list in the Management portlet of the Admin page. All local portlets
+ marked as remotable are exposed as remote portlets via the
+ <literal>self</literal>
+ portlet
+ provider so that you can check that they work as expected with WSRP. The
+ <filename>portal-wsrp.sar</filename>
+ file contains a WSRP Producer descriptor (<filename>default-wsrp.xml</filename>) that configures this
+ default producer. This file can be edited or removed if needed.
+ </para>
+ </section>
+
+ <section>
+ <title>Configuring a remote producer walk-through</title>
+ <para>
+ Let's work through the steps of defining access to a remote producer so that its portlets can be
+ consumed within JBoss Portal. We will configure access to BEA's public WSRP producer. We will first examine
+ how to do so using the configuration portlet. We will then show how the same result can be accomplish with
+ a producer descriptor.
+ </para>
+
+ <section id="consumer_gui">
+ <title>Using the configuration portlet</title>
+ <para>
+ As of Portal 2.6, a configuration portlet is provided to configure access to remote WSRP Producers
+ grahically. You can access it at
+ <filename>http://{hostname}:{port}/portal/auth/portal/admin/WSRP</filename>
+ or by logging in as a Portal administrator and clicking on the WSRP tab in the Admin portal. If all went
+ well, you should see something similar to this:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/wsrp/config_init.png" align="center" valign="middle" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ This screen presents all the configured producers associated with their status and possible actions on
+ them. A Consumer can be active or inactive. Activating a Consumer means that it is ready to act as a
+ portlet provider. Deactivating it will remove it from the list of available portlet providers. Note also
+ that a Consumer can be marked as requiring refresh meaning that the information held about it might not
+ be up to date and refreshing it from the remote Producer might be a good idea. This can happen for
+ several reasons: the service description for that remote Producer has not been fetched yet, the cached
+ version has expired or modifications have been made to the configuration that could potentially
+ invalidate it, thus requiring re-validation of the information.
+ </para>
+
+ <para>
+ Next, we create a new Consumer which we will call<literal>bea</literal>. Type "<literal>bea</literal>" in
+ the
+ "Create a consumer named:" field then click on "Create consumer":
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/wsrp/config_create.png" align="center" valign="middle" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ You should now see a form allowing you to enter/modify the information about the Consumer.
+ Set the cache expiration value to 300 seconds and enter the WSDL URL for the producer in the text field
+ and press the "Refresh & Save" button:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/wsrp/config_usewsdl.png" align="center" valign="middle" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ This will retrieve the service description associated with the Producer which WSRP is described by the
+ WSDL file found at the URL you just entered. In our case, querying the service description will allow us
+ to learn that the Producer requires registration and that it expects a value for the registration
+ property named <literal>registration/consumerRole</literal>:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/wsrp/config_refresh.png" align="center" valign="middle" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ <note><title>Note</title><para>At this point, there is no automated way to learn about which possible values (if any) are
+ expected by the remote Producer. In the case of BEA's public producer, the possible values are
+ indicated in the registration property description. This is not always the case... Please refer to
+ the specific Producer's documentation.</para>
+ </note>
+ Enter "<literal>public</literal>" as the value for the registration property and press "Save &
+ Refresh" once more. You should now
+ see something similar to:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/wsrp/config_end.png" align="center" valign="middle" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ The Consumer for the <literal>bea</literal> Producer should now be available as a portlet provider and
+ is ready to be used.
+ </para>
+ <para>
+ A producer is configured, by default, by retrieving the producer's information via a WSDL URL. There are
+ rare cases, however, where URLs need to be provided for each of the producer's end points. You can do
+ exactly that by unchecking the "Use WSDL?" checkbox, as is the case for the <literal>self</literal>
+ producer:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/wsrp/config_self.png" align="center" valign="middle" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ </section>
+
+ <section>
+ <title>Using a WSRP Producer XML descriptor</title>
+
+ <para>We will create a <filename>public-bea-wsrp.xml</filename> descriptor. Note that the actual name does not
+ matter as long as it ends with <filename>-wsrp.xml</filename>:
+ </para>
+ <programlisting role="XML"><![CDATA[
+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-wsrp-consumer_2_6.dtd">
+<deployments>
+ <deployment>
+ <wsrp-producer id="bea" expiration-cache="300">
+ <endpoint-wsdl-url>http://wsrp.bea.com:7001/producer/producer?WSDL</endpoint-wsdl-url>
+ <registration-data>
+ <property>
+ <name>registration/consumerRole</name>
+ <lang>en</lang>
+ <value>public</value>
+ </property>
+ </registration-data>
+ </wsrp-producer>
+ </deployment>
+</deployments>]]></programlisting>
+ <para>
+ This producer descriptor gives access to BEA's public WSRP producer. We will look at the details of the different elements later. Note for now the <literal>producer-id</literal> element with a "<literal>bea</literal>" value. Put this file in the deploy directory and start the server (with JBoss Portal and its WSRP service deployed).
+ </para>
+ <para>
+ <note><title>Note</title><para>A DTD and an XML Schema for WSRP Producer XML descriptors are available in
+ <filename>jboss-portal.sar/portal-wsrp.sar/dtd/jboss-wsrp-consumer_2_6.dtd</filename> and
+ <filename>jboss-portal.sar/portal-wsrp.sar/xsd/jboss-wsrp-consumer_2_6.xsd</filename></para>
+ </note>
+ </para>
+ </section>
+
+ <section>
+ <title>Configuring access to a remote portlet</title>
+ <para>
+ Let's now look at the Admin page and the Management portlet. Click on the "Portlet definitions" tab at
+ the
+ top. Once this is done, look at the list of available portlet providers. If all went well,
+ you should see something similar to this:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/wsrp/portlets.png" align="center" valign="middle" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>
+ We have 3 available portlet providers:
+ <literal>local, self</literal>
+ and<literal>bea</literal>. The
+ <literal>local</literal>
+ portlet provider exposes all the portlets deployed in this particular instance of Portal. As
+ explained above, the
+ <literal>self</literal>
+ provider refers to the default WSRP consumer bundled with Portal that consumes
+ the portlets exposed by the default WSRP producer. The
+ <literal>bea</literal>
+ provider corresponds to BEA's public producer
+ we just configured. Select it and click on "View portlets". You should now see something similar to:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/wsrp/bea.png" align="center" valign="middle" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>
+ From there on out, you should be able to configure WSRP portlets just as any other. In particular, you
+ can create an instance of one of the remote portlets offered by BEA's public producer just like you would
+ create an instance of a local portlet and then assign it to a window in a page. If you go to that page,
+ you should see something similar to below for this portlet:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/wsrp/result.png" align="center" valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ </section>
+ </section>
+
+ <section>
+ <title>WSRP Producer descriptors</title>
+
+ <para>
+ A WSRP Producer descriptor is an XML file which name ends in <filename>-wsrp.xml</filename> and
+ which can be dropped in the deploy directory of the JBoss application server or nested in .sar files. It is
+ possible to configure access to several different producers within a single descriptor or use one file per
+ producer, depending on your needs. An XML Schema for the WSRP Producer descriptor format can be found at
+ <filename>jboss-portal.sar/portal-wsrp.sar/xsd/jboss-wsrp-consumer_2_6.xsd</filename>, while a (legacy) DTD
+ can be found at <filename>jboss-portal.sar/portal-wsrp.sar/dtd/jboss-wsrp-consumer_2_6.dtd</filename>.
+
+ <note><title>Note</title><para>It is important to note how WSRP Producer descriptors are processed. They are read the first time the
+ WSRP service starts and the associated information is then put in the Portal database. Subsequent launch
+ of the WSRP service will use the database-stored information for all producers which identifier is
+ already known to Portal. More specifically, all the descriptors are scanned for producer identifiers.
+ Any identifier that is already known will be bypassed and the configuration associated with this remote
+ producer in the database will be used. If a producer identifier is found that wasn't already in the
+ database, that producer information will be processed and recorded in the database. Therefore, if you
+ wish to delete a producer configuration, you need to delete the associated information in the database
+ (this can be accomplished using the configuration portlet as we saw in <xref linkend="consumer_gui"/>)
+ <emphasis>AND</emphasis> remove the associated information in any WSRP Producer descriptor (if such
+ information exists) as the producer will be re-created the next time the WSRP is launched if that
+ information is not removed.</para>
+ </note>
+ </para>
+
+ <section>
+ <title>Required configuration information</title>
+
+ <para>Let's now look at which information needs to be provided to configure access to a remote producer.
+ </para>
+
+ <para>First, we need to provide an identifier for the producer we are configuring so that we can refer to it
+ afterwards. This is accomplished via the mandatory
+ <literal>id</literal>
+ attribute of the
+ <literal><wsrp-producer></literal>
+ element.
+ </para>
+
+ <para>JBoss Portal also needs to learn about the remote producer's endpoints to be able to connect to the
+ remote web services and perform WSRP invocations. Two options are currently supported to provide this
+ information:
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem><para>You can provide the URLs for each of the different WSRP interfaces offered by the remote
+ producer via the
+ <literal><endpoint-config></literal>
+ element and its
+ <literal><service-description-url></literal>,
+ <literal><markup-url></literal>,
+ <literal><registration-url></literal>
+ and
+ <literal><portlet-management-url></literal>
+ children. These URLs are
+ producer-specific so you will need to refer to your producer documentation or WSDL file to
+ determine
+ the appropriate values.</para>
+ </listitem>
+ <listitem><para>Alternatively, and this is the easiest way to configure your producer, you can provide a URL
+ pointing to the WSDL description of the producer's WSRP services. This is accomplished via the
+ <literal><endpoint-wsdl-url></literal>
+ element. JBoss Portal will then
+ heuristically determine, from the information contained in the WSDL file, how to connect
+ appropriately
+ to the remote WSRP services.
+ <note><title>Note</title><para>It is important to note that, when using this method, JBoss Portal will try to match a port
+ name to an interface based solely on the provided name. There are no standard names for these
+ ports so it is possible (though rare) that this matching process fails. In this case, you should
+ look at the WSDL file and provide the endpoint URLs manually, as per the previous method.</para>
+ </note></para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>Both the
+ <literal>id</literal>
+ attribute and either
+ <literal><endpoint-config></literal>
+ or
+ <literal><endpoint-wsdl-url></literal>
+ elements
+ are required for a functional remote producer configuration.
+ </para>
+ </section>
+
+ <section>
+ <title>Optional configuration</title>
+ <para>It is also possible to provide addtional configuration, which, in some cases, might be important to
+ establish a proper connection to the remote producer.
+ </para>
+
+ <para>One such optional configuration concerns caching. To prevent useless roundtrips between the local
+ consumer and the remote producer, it is possible to cache some of the information sent by the producer
+ (such
+ as the list of offered portlets) for a given duration. The rate at which the information is refreshed is
+ defined by the
+ <literal>expiration-cache</literal>
+ attribute of the
+ <literal><wsrp-producer></literal>
+ element which specifies the
+ refreshing period in seconds. For example, providing a value of 120 for expiration-cache means that the
+ producer information will not be refreshed for 2 minutes after it has been somehow accessed. If no value
+ is provided, JBoss Portal will always access the remote producer regardless of whether the remote
+ information has changed or not. Since, in most instances, the information provided by the producer does
+ not
+ change often, we recommend that you use this caching facility to minimize bandwidth usage.
+ </para>
+
+ <para>Additionally, some producers require consumers to register with them before authorizing them to access
+ their offered portlets. If you know that information beforehand, you can provide the required registration
+ information in the producer configuration so that the Portal consumer can register with the remote
+ producer when required.
+ <note><title>Note</title><para>At this time, though, only simple String properties are supported and it is not possible to
+ configure complex registration data. This should however be sufficient for most cases.</para>
+ </note>
+ </para>
+
+ <para>Registration configuration is done via the
+ <literal><registration-data></literal>
+ element. Since JBoss Portal can generate the mandatory information for you, if the remote producer does
+ not
+ require any registration properties, you only need to provide an empty
+ <literal><registration-data></literal>
+ element. Values for the registration properties
+ required by the remote producer can be provided via
+ <literal><property></literal>
+ elements. See the example below for more details. Additionally, you can override the default consumer
+ name
+ automatically provided by JBoss Portal via the
+ <literal><consumer-name></literal>
+ element. If you choose to provide a consumer name, please remember that this should uniquely identify
+ your
+ consumer.
+ </para>
+ </section>
+ </section>
+
+ <section>
+ <title>Examples</title>
+
+ <para>
+ Here is the configuration of the <literal>self</literal> producer as found in
+ <filename>default-wsrp.xml</filename> with a cache expiring every five minutes:
+ </para>
+
+
+ <programlisting><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-wsrp-consumer_2_6.dtd">
+
+<deployments>
+ <deployment>
+ <wsrp-producer id="self" expiration-cache="300">
+ <!--
+ we need to use the individual endpoint configuration because the configuration via
+ wsdl forces an immediate attempt to access the web service description which is not
+ available yet at this point of deployment
+ -->
+ <endpoint-config>
+ <service-description-url>
+ http://localhost:8080/portal-wsrp/ServiceDescriptionService
+ </service-description-url>
+ <markup-url>http://localhost:8080/portal-wsrp/MarkupService</markup-url>
+ <registration-url>
+ http://localhost:8080/portal-wsrp/RegistrationService
+ </registration-url>
+ <portlet-management-url>
+ http://localhost:8080/portal-wsrp/PortletManagementService
+ </portlet-management-url>
+ </endpoint-config>
+ <registration-data/>
+ </wsrp-producer>
+ </deployment>
+</deployments>]]>
+ </programlisting>
+
+
+ <para>Here is an example of a WSRP descriptor with a 2 minute caching time and manual definition of the
+ endpoint URLs:
+ </para>
+
+
+ <programlisting><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-wsrp-consumer_2_6.dtd">
+
+<deployments>
+ <deployment>
+ <wsrp-producer id="MyProducer" expiration-cache="120">
+ <endpoint-config>
+ <service-description-url>
+ http://www.someproducer.com/portal-wsrp/ServiceDescriptionService
+ </service-description-url>
+ <markup-url>
+ http://www.someproducer.com/portal-wsrp/MarkupService
+ </markup-url>
+ <registration-url>
+ http://www.someproducer.com/portal-wsrp/RegistrationService
+ </registration-url>
+ <portlet-management-url>
+ http://www.someproducer.com/portal-wsrp/PortletManagementService
+ </portlet-management-url>
+ </endpoint-config>
+ </wsrp-producer>
+ </deployment>
+</deployments>]]></programlisting>
+
+
+ <para>Here is an example of a WSRP descriptor with endpoint definition via remote WSDL file, registration
+ data and cache expiring every minute:
+ </para>
+
+
+ <programlisting><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-wsrp-consumer_2_6.dtd">
+
+<deployments>
+ <deployment>
+ <wsrp-producer id="AnotherProducer" expiration-cache="60">
+ <endpoint-wsdl-url>http://example.com/producer/producer?WSDL</endpoint-wsdl-url>
+ <registration-data>
+ <property>
+ <name>property name</name>
+ <lang>en</lang>
+ <value>property value</value>
+ </property>
+ </registration-data>
+ </wsrp-producer>
+ </deployment>
+</deployments>]]></programlisting>
+
+ </section>
+ </section>
+
+ <section>
+ <title>Consumers maintenance</title>
+
+ <section>
+ <title>Modifying a currently held registration</title>
+
+ <section>
+ <title>Registration modification for service upgrade</title>
+ <para>
+ Producers often offer several levels of service depending on consumers' subscription levels (for
+ example).
+ This is implemented at the WSRP level with the registration concept: producers assert which level of
+ service to provide to consumers based on the values of given registration properties.
+ </para>
+ <para>
+ It is therefore sometimes necessary to modify the registration that concretizes the service agreement
+ between a consumer and a producer. An example of easily available producer offering different level of
+ services is BEA's public producer. We configured access to that producer in
+ <xref linkend="consumer_gui"/>.
+ If you recall, the producer was requiring registration and required a value to be provided for the
+ <literal>registration/consumerRole</literal>
+ property. The description of that property indicated that
+ three values were possible: <literal>public</literal>, <literal>partner</literal> or
+ <literal>insider</literal> each corresponding to a different service level. We registered using the
+ <literal>public</literal> service level. This gave us access to three portlets as shown here:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/wsrp/bea.png" align="center" valign="middle" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>
+ Suppose now that we would like to upgrade our service level to the "insider" level. We will need to
+ tell BEA's producer that our registration data has been modified. Let's see how to do this. Assuming you
+ have configured access to the producer as previously described, please go to the configuration screen for
+ the <literal>bea</literal> producer and modify the value of the <literal>registration/consumerRole</literal>
+ to <literal>insider</literal> instead of <literal>public</literal>:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/wsrp/modify_reg_start.png" align="center" valign="middle" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ Now click on "Update properties" to save the change. A "Modify registration" button should now appear to
+ let you send this new data to the remote producer:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/wsrp/modify_reg_modify.png" align="center" valign="middle" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ Click on this new button and, if everything went well and your updated registration has been accepted by
+ the remote producer, you should see something similar to:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/wsrp/modify_reg_end.png" align="center" valign="middle" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ You can now check the list of available portlets from the <literal>bea</literal> provider and verify that
+ new portlets are now available:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/wsrp/bea_insider.png" align="center" valign="middle" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+
+ </section>
+
+ <section id="reg_mod_error">
+ <title>Registration modification on producer error</title>
+
+ <para>
+ It can also happen that a producer administrator decided to require more information from registered
+ consumers. In this case, invoking operations on the producer will fail with an
+ <literal>OperationFailedFault</literal>. JBoss Portal will attempt to help you in this
+ situation. Let's walk through an example using the <literal>self</literal> producer. Let's assume that
+ registration is required without any registration properties (as is the case by default). If you go to
+ the configuration screen for this producer, you should see:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/wsrp/config_self.png" align="center" valign="middle" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+
+ Now suppose that the administrator of the producer now requires a value to be provided for an
+ <literal>email</literal> registration property. We will actually see how to do perform this operation
+ in JBoss Portal when we examine how to configure Portal's producer in <xref linkend="producer_config"/>.
+ Operations with this producer will now fail. If you suspect that a registration modification is required,
+ you should go to the configuration screen for this remote producer and refresh the information held by
+ the consumer by pressing "Refresh & Save":
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/wsrp/modify_reg_self.png" align="center" valign="middle" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+
+ As you can see, the configuration screen now shows the currently held registration information and
+ the expected information from the producer. Enter a value for the <literal>email</literal> property
+ and then click on "Modify registration". If all went well and the producer accepted your new registration
+ data, you should see something similar to:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/wsrp/modify_reg_self_end.png" align="center" valign="middle" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+
+ <note><title>Note</title><para>As of WSRP 1, it is rather difficult to ascertain for sure what caused an
+ <literal>OperationFailedFault</literal> as it is the generic exception returned by
+ producers if something didn't quite happen as expected during a method invocation. This means that
+ <literal>OperationFailedFault</literal> can be caused by several different reasons, one
+ of them being a request to modify the registration data. Please take a look at the log files to see
+ if you can gather more information as to what happened. WSRP 2 introduces an exception that is
+ specific to a request to modify registrations thus reducing the ambiguity that currently exists.</para>
+ </note>
+ </para>
+ </section>
+ </section>
+
+ <section>
+ <title>Consumer operations</title>
+ <para>
+ Several operations are available from the consumer list view of the WSRP configuration portlet:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/wsrp/consumer_operations.png" align="center" valign="middle" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>
+ The available operations are:
+ <itemizedlist>
+ <listitem><para>Configure: displays the consumer details and allows user to edit them</para></listitem>
+ <listitem>
+ <para>Refresh: forces the consumer to retrieve the service description from the remote producer to refresh
+ the local information (offered portlets, registration information, etc.)</para>
+ </listitem>
+ <listitem><para>
+ Activate/Deactivate: activates/deactivates a consumer, governing whether it will be available to
+ provide portlets and receive portlet invocations</para>
+ </listitem>
+ <listitem><para>
+ Register/Deregister: registers/deregisters a consumer based on whether registration is required
+ and/or acquired</para>
+ </listitem>
+ <listitem><para>Delete: destroys the consumer, after deregisterting it if it was registered</para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section>
+ <title>Erasing local registration data</title>
+ <para>
+ There are rare cases where it might be required to erase the local information without being able to
+ deregister first. This is the case when a consumer is registered with a producer that has been modified by
+ its administrator to not require registration anymore. If that ever was to happen (most likely, it won't),
+ you can erase the local registration information from the consumer so that it can resume interacting with
+ the remote producer. To do so, click on "Erase local registration" button next to the registration context
+ information on the consumer configuration screen:
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/wsrp/erase_registration.png" align="center" valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ <para>
+ <emphasis>Warning:</emphasis> This operation is dangerous as it can result in inability to interact with the remote producer if invoked when not required. A warning screen will be displayed to give you a chance to change your mind:
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/wsrp/erase_registration_warning.png" align="center" valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ </section>
+ </section>
+
+ <section id="producer_config">
+ <title>Configuring JBoss Portal's WSRP Producer</title>
+ <section>
+ <title>Overview</title>
+ <para>
+ You can configure the behavior of Portal's WSRP Producer by using the WSRP administration interface, which
+ is the preferred way, or by editing the <filename>conf/config.xml</filename> file found in
+ <filename>portal-wsrp.sar</filename>. Several aspects can be modified with respects to whether
+ registration is required for consumers to access the Producer's services. An XML Schema for the configuration
+ format is available at <filename>jboss-portal.sar/portal-wsrp.sar/xsd/jboss-wsrp-producer_2_6.xsd</filename>,
+ while a (legacy) DTD is available at
+ <filename>jboss-portal.sar/portal-wsrp.sar/dtd/jboss-wsrp-producer_2_6.dtd</filename>
+ </para>
+ </section>
+ <section>
+ <title>Default configuration</title>
+ <para>
+ The default producer configuration is to require that consumers register with it before providing access its
+ services but does not require any specific registration properties (apart from what is mandated by the
+ WSRP standard). It does, however, require consumers to be registered before sending them a full service
+ description. This means that our WSRP producer will not provide the list of offered portlets and other
+ capabilities to unregistered consumers. The producer also uses the default
+ <classname>RegistrationPolicy</classname> paired with the default
+ <classname>RegistrationPropertyValidator</classname>. We will look into property
+ validators in greater detail later in <xref linkend="registration-configuration"/>. Suffice to say for now
+ that this allows users to customize how Portal's WSRP Producer decides whether a given registration property
+ is valid or not.
+ </para>
+ <para>
+ JBoss Portal 2.6.3 introduces a web interface to configure the producer's behavior. You can access it
+ by clicking on the "Producer Configuration" tab of the "WSRP" page of the "admin" portal. Here's what you
+ should see with the default configuration:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/wsrp/producer_default.png" align="center" valign="middle" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ As would be expected, you can specify whether or not the producer will send the full service description to
+ unregistered consumers, and, if it requires registration, which <classname>RegistrationPolicy</classname> to
+ use (and, if needed, which <classname>RegistrationPropertyValidator</classname>), along with required
+ registration property description for which consumers must provide acceptable values to successfully
+ register.
+ </para>
+ </section>
+
+ <section id="registration-configuration">
+ <title>Registration configuration</title>
+ <para>
+ In order to require consumers to register with Portal's producer before interacting with it, you need to
+ configure Portal's behavior with respect to registration. Registration is optional, as are registration
+ properties. The producer can require registration without requiring consumers to pass any registration
+ properties as is the case in the default configuration. Let's configure our producer starting with a blank
+ state:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/wsrp/producer_blank.png" align="center" valign="middle" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ We will allow unregistered consumers to see the list of offered portlets so we leave the first checkbox
+ ("Access to full service description requires consumers to be registered.") unchecked. We will, however,
+ specify that consumers will need to be registered to be able to interact with our producer. Check the second
+ checkbox ("Requires registration. Modifying this information will trigger invalidation of consumer
+ registrations."). The screen should now refresh and display:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/wsrp/producer_registration.png" align="center" valign="middle" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ You can specify the fully-qualified name for your <classname>RegistrationPolicy</classname> and
+ <classname>RegistrationPropertyValidator</classname> there. We will keep the default value. See
+ <xref linkend="custom_registration"/> for more details. Let's add, however, a registration property called
+ <literal>email</literal>. Click "Add property" and enter the appropriate information in the fields,
+ providing a description for the registration property that can be used by consumers to figure out its
+ purpose:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/wsrp/producer_email.png" align="center" valign="middle" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ Press "Save" to record your modifications.
+
+ <note><title>Note</title><para>
+ At this time, only String (xsd:string) properties are supported. If your application requires more
+ complex properties, please let us know.</para>
+ </note>
+
+ <note><title>Note</title><para>
+ If consumers are already registered with the producer, modifying the configuration of required
+ registration
+ information will trigger the invalidation of held registrations, requiring consumers to modify their
+ registration before being able to access the producer again. We saw the consumer side of that process
+ in <xref linkend="reg_mod_error"/>.</para>
+ </note>
+ </para>
+
+ <section id="custom_registration">
+ <title>Customization of Registration handling behavior</title>
+ <para>
+ Registration handling behavior can be customized by users to suit their Producer needs. This is
+ accomplished by providing an implementation of the
+ <classname>RegistrationPolicy</classname>
+ interface. This interface defines methods that are called by Portal's Registration service so that
+ decisions can be made appropriately. A default registration policy that provides basic
+ behavior is provided and should be enough for most user needs.
+ </para>
+ <para>
+ While the default registration policy provides default behavior for most registration-related aspects,
+ there is still one aspect that requires configuration: whether a given value for a registration property
+ is acceptable by the WSRP Producer. This is accomplished by plugging a
+ <classname>RegistrationPropertyValidator</classname>
+ in the default registration policy. This allows users to define their own validation mechanism.
+ </para>
+ <para>
+ Please refer to the <trademark class="trade">Javadoc</trademark> for <classname>org.jboss.portal.registration.RegistrationPolicy</classname>
+ and <classname>org.jboss.portal.Registration.policies.RegistrationPropertyValidator</classname> for more
+ details on what is expected of each method.
+ </para>
+ <para>Defining a registration policy is required for the producer to be correctly configured. This is
+ accomplished by specifying the qualified class name of the registration policy. Since we anticipate that
+ most users will use the default registration policy, it is possible to provide the class
+ name of your custom property validator instead to customize the default registration policy behavior.
+ Note that property validators are only used by the default policy.
+
+ <note><title>Note</title><para>Since the policy or the validator are defined via their class name and dynamically loaded, it is
+ important that you make sure that the identified class is available to the application server. One way
+ to accomplish that is to deploy your policy implementation as JAR file in your AS instance deploy
+ directory. Note also that, since both policies and validators are dynamically instantiated, they must
+ provide a default, no-argument constructor.</para>
+ </note>
+ </para>
+ </section>
+ </section>
+ <section id="strict-mode">
+ <title>WSRP validation mode</title>
+ <para>The lack of conformance kit and the wording of the WSRP specification leaves room for differing
+ interpretations, resulting in interoperability issues. It is therefore possible to encounter issues when
+ using consumers from different vendors. We have experienced such issues and have introduced a way to relax
+ the validation that our WSRP producer performs on the data provided by consumers to help with
+ interoperability by accepting data that would normally be invalid. Note that we only relax our validation
+ algorithm on aspects of the specification that are deemed harmless such as invalid language codes.
+ </para>
+ <para>
+ By default, the WSRP producer is configured in strict mode. If you experience issues with a given consumer,
+ you might want to try to relax the validation mode. This is accomplished by unchecking the "Use strict WSRP
+ compliance." checkbox on the Producer configuration screen.
+ </para>
+ </section>
+
+ </section>
+</chapter>
+ <chapter id="security">
+ <!-- <chapterinfo>
+ <author>
+ <firstname>Roy</firstname>
+ <surname>Russo</surname>
+ </author>
+ <author>
+ <firstname>Julien</firstname>
+ <surname>Viet</surname>
+ </author>
+ </chapterinfo>-->
+ <title>Security</title>
+ <section id="securing_objects">
+ <title>Securing Portal Objects</title>
+ <para>
+ This section describes how to secure portal objects (portal instances, pages, and portlet instances), using the
+ JBoss
+ Portal *-object.xml descriptor OR portlet-instances.xml descriptor. View the User Guide for information on how
+ to secure objects using the
+ Management Portlet.
+ </para>
+ <para>Securing portal objects declaratively, is done through the *-object.xml (
+ <xref linkend="desc_objectxml"/>
+ ), for Portal Instances and Pages, or the portlet-instances.xml (
+ <xref linkend="desc_instancesxml"/>
+ ) for Portlet Instances. The portion you will be adding to each object is denoted by the
+ <emphasis><security-constraint></emphasis>
+ tag:
+ <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portal Object 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
+<deployments>
+ <deployment>
+ <parent-ref>default</parent-ref>
+ <if-exists>overwrite</if-exists>
+ <properties/>
+ <page>
+ <page-name>MyPage</page-name>
+ <window>
+ <window-name>HelloWorldPortletPageWindow</window-name>
+ <instance-ref>HelloWorldPortletPageInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ <security-constraint>
+ <policy-permission>
+ <action-name>viewrecursive</action-name>
+ <unchecked/>
+ </policy-permission>
+ </security-constraint>
+ </page>
+ </deployment>
+</deployments>]]></programlisting>
+ </para>
+ <para>The basic principle of the security mechanism is that everything is restricted unless you grant privileges.
+ You grant privilege on a portal node by adding a security constraint as explained here:
+
+ <programlisting><![CDATA[<security-constraint>
+ <policy-permission>
+ <unchecked/>
+ <action-name>viewrecursive</action-name>
+ </policy-permission>
+</security-constraint>]]></programlisting>
+ The example above will grant the view privilege to anyone (unchecked role) to the current object and any
+ child object recursively.</para>
+ <para>
+ The security contraint portion is worth taking a look at, in an isolated fashion. It allows you to
+ secure a specific window/page/portal-instance based on a user's role.
+ </para>
+ <para>
+ <emphasis role="bold">Role definition:</emphasis>
+ You must define a role that this security constraint will apply to. Possible values are:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para> <emphasis role="bold"><unchecked/></emphasis>
+ Anyone can view this page.</para>
+ </listitem>
+ <listitem>
+ <para> <emphasis role="bold"><role-name>SOMEROLE</role-name></emphasis>
+ Access to this page is limited to the defined role.</para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ <emphasis role="bold">Access Rights:</emphasis>
+ You must define the access rights given to the role defined. Possible values are:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para> <emphasis role="bold">view</emphasis>
+ Users can view the page.</para>
+ </listitem>
+ <listitem>
+ <para> <emphasis role="bold">viewrecursive</emphasis>
+ Users can view the page and child pages.</para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">personalize</emphasis>
+ Users are able to personalize the page's theme.</para>
+ </listitem>
+ <listitem>
+ <para> <emphasis role="bold">personalizerecursive</emphasis>
+ Users are able to personalize the page AND its children's pages themes.</para>
+ </listitem>
+ </itemizedlist>
+
+ <note>
+ <title>Restricting access</title>
+ <para>Out of the box the default portal as a viewrecursive right for all the users, it means that whenever a page
+ is added, this page will be seen by any user. To restrict access to this page, the default portal security constraint
+ must be changed from viewrecursive to view, and viewrecursive security constraints must be added to its children
+ so that they can be viewed except the one you want to restrict access to.</para>
+ </note>
+ <para>
+ We provide three live samples of this descriptor, here
+ <xref linkend="desc_instancesxml"/>
+ ,
+ <xref linkend="desc_example_page"/>
+ ,and
+ <xref linkend="desc_example_portal"/>
+ </para>
+ </section>
+
+ <section id="security.security_cms">
+ <title>Securing the Content Management System</title>
+ <para>
+ The JBoss Portal CMS system consists of a directory structure of Files organized unto their respective Folders. Both Files and Folders are
+ considered to be CMS resources that can be secured based on portal Roles and/or Users.
+ </para>
+ <para>
+ The following features are supported by the fine grained security system of Portal CMS:
+ <itemizedlist>
+ <listitem><para>
+ You can associate "Read", "Write", and "Manage" Permissions at the CMS node level. (Both Files and Folders are treated as CMS nodes)</para>
+ </listitem>
+ <listitem>
+ <para>The Permissions are propagated recursively down a folder hierarchy</para>
+ </listitem>
+ <listitem>
+ <para> Any Permissions specified explicitly on the CMS Node overrides the policy inherited via recursive propagation</para>
+ </listitem>
+ <listitem>
+ <para>You can manage the Permissions using the CMS Admin GUI tool via the newly added "Secure Node" feature</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ <table frame="all">
+ <title> Portal CMS Permission Matrix: </title>
+ <tgroup cols="3" align="left" colsep="1">
+
+ <thead>
+ <row>
+ <entry align="center">Permissions</entry>
+ <entry align="center">Allowed Actions</entry>
+ <entry align="center">Implies</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry> Read </entry>
+ <entry> Read Contents of Folder, File and its versions </entry>
+ <entry> N/A </entry>
+ </row>
+ <row>
+ <entry> Write</entry>
+ <entry> Create and Update new Folder and File </entry>
+ <entry> Read Access </entry>
+ </row>
+ <row>
+ <entry> Manage </entry>
+ <entry> Delete/Copy/Move/Rename Folders and Files</entry>
+ <entry> Read and Write Access </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </para>
+ <section id="security.security_cms_configuration">
+ <title>CMS Security Configuration</title>
+ <para>
+ The configuration for the CMS Security service is specified in the
+ <literal>jboss-portal.sar/portal-cms.sar/META-INF/jboss-service.xml</literal>
+ file. The portion of the configuration relevant for securing the CMS service is listed as follows:
+ <programlisting>
+ <![CDATA[
+ <!-- CMS Authorization Security Service -->
+ <mbean
+ code="org.jboss.portal.cms.security.AuthorizationManagerImpl"
+ name="portal:service=AuthorizationManager,type=cms"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <attribute name="JNDIName">java:portal/cms/AuthorizationManager</attribute>
+ <depends optional-attribute-name="Provider" proxy-type="attribute">
+ portal:service=AuthorizationProvider,type=cms
+ </depends>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.cms.security.AuthorizationProviderImpl"
+ name="portal:service=AuthorizationProvider,type=cms"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <!--
+ NOTE: cmsRootUserName denotes a single Portal user that has access to everything in the CMS. Denote this user
+ carefully and should be synonymous to the 'root' user in UNIX operating systems. By default: this value is the built-in
+ 'admin' user account. This can be changed to any other user account registered in your Portal
+ -->
+ <attribute name="CmsRootUserName">admin</attribute>
+ <depends optional-attribute-name="IdentityServiceController" proxy-type="attribute">portal:service=Module,type=IdentityServiceController</depends>
+ </mbean>
+ <!-- ACL Security Interceptor -->
+ <mbean
+ code="org.jboss.portal.cms.impl.interceptors.ACLInterceptor"
+ name="portal:service=Interceptor,type=Cms,name=ACL"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <attribute name="JNDIName">java:/portal/cms/ACLInterceptor</attribute>
+ <attribute name="CmsSessionFactory">java:/portal/cms/CMSSessionFactory</attribute>
+ <attribute name="IdentitySessionFactory">java:/portal/IdentitySessionFactory</attribute>
+ <attribute name="DefaultPolicy">
+ <policy>
+ <!-- permissions on the root cms node -->
+ <criteria name="path" value="/">
+ <permission name="cms" action="read">
+ <role name="Anonymous"/>
+ </permission>
+ <permission name="cms" action="write">
+ <role name="User"/>
+ </permission>
+ <permission name="cms" action="manage">
+ <role name="Admin"/>
+ </permission>
+ </criteria>
+ <!-- permissions on the default cms node -->
+ <criteria name="path" value="/default">
+ <permission name="cms" action="read">
+ <role name="Anonymous"/>
+ </permission>
+ <permission name="cms" action="write">
+ <role name="User"/>
+ </permission>
+ <permission name="cms" action="manage">
+ <role name="Admin"/>
+ </permission>
+ </criteria>
+ <!-- permissions on the private/protected node -->
+ <criteria name="path" value="/default/private">
+ <permission name="cms" action="manage">
+ <role name="Admin"/>
+ </permission>
+ </criteria>
+ </policy>
+ </attribute>
+ <depends optional-attribute-name="AuthorizationManager" proxy-type="attribute">
+ portal:service=AuthorizationManager,type=cms
+ </depends>
+ <depends>portal:service=Hibernate,type=CMS</depends>
+ <depends>portal:service=Module,type=IdentityServiceController</depends>
+ </mbean>]]>
+ </programlisting>
+ </para>
+ <section id="security.security_cms_configuration_superuser">
+ <title>CMS Super User</title>
+ <para>
+ A CMS Super User is a designated Portal User Account that has access to all resources/functions in the CMS. It is a concept similar to the
+ super user concept in a Linux and UNIX security systems. This account should be carefully used and properly protected. By default, JBoss Portal designates the
+ built-in 'admin' user account as a CMS Super User. This can be changed by modifying the <emphasis>cmsRootUserName</emphasis> value in the
+ <literal>jboss-portal.sar/portal-cms.sar/META-INF/jboss-service.xml</literal> configuration.
+ <programlisting>
+ <![CDATA[
+ <mbean
+ code="org.jboss.portal.cms.security.AuthorizationProviderImpl"
+ name="portal:service=AuthorizationProvider,type=cms"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <!--
+ NOTE: cmsRootUserName denotes a single Portal user that has access to everything in the CMS. Denote this user
+ carefully and should be synonymous to the 'root' user in UNIX operating systems. By default: this value is the built-in
+ 'admin' user account. This can be changed to any other user account registered in your Portal
+ -->
+ <attribute name="CmsRootUserName">admin</attribute>
+ <depends optional-attribute-name="IdentityServiceController" proxy-type="attribute">portal:service=Module,type=IdentityServiceController</depends>
+ </mbean>
+ ]]>
+ </programlisting>
+ </para>
+ </section>
+ <section id="security.security_cms_configuration_securityconsole">
+ <title>CMS Security Console</title>
+ <para>
+ The CMS Security Console is used to assign proper permissions to all the nodes/content in the CMS. Besides protection on CMS content, this console itself
+ needs to be secured against unauthorized acceess. Currently, the console can be accessed only by Portal users that are members of the specified Role. By default,
+ JBoss Portal uses the built-in <emphasis>Admin</emphasis> role to allow access to this security console. This can be customized by modifying the value of
+ <emphasis>defaultAdminRole</emphasis> option specified in <literal>jboss-portal.sar/conf/identity/standardidentity-config.xml</literal>
+ </para>
+ </section>
+ </section>
+ </section>
+
+ <section id="security.security_authentication">
+ <title>Authentication with JBoss Portal</title>
+ <para>JBoss Portal relies on Java Platform, Enterprise Edition (Java EE) for the authentication of users. The Java EE authentication has its advantages and drawbacks. The main motivation for using Java EE security is the integration with the application server and the operational environment in which the portal is deployed. The servlet layer provides already the authentication functionality and obviously it is not a responsibility of the portal. Whenever a user is authenticated by the servlet layer its security identity is propagated throughout the call stack in the different layers of the Java EE stack. The weaknesses are the lack of an explicit logout mechanism and the lack of dynamicity in the mapping of URL as security resources. However JBoss Portal improves that behavior when it is possible to do so.</para>
+ <section>
+ <title>Authentication configuration</title>
+ <para>JBoss Portal can be seen before all as a web application and therefore inherits all the configuration mechanisms
+ related to web applications. The main entry point of the whole portal is the <emphasis>jboss-portal.sar/portal-server.war</emphasis>
+ deployment which is the web application that defines and maps the portal servlet. Here you can configure various things
+ <itemizedlist>
+ <listitem><para>In the <emphasis>WEB-INF/web.xml</emphasis> you can change the authentication mode. The default
+ authentication mechanism uses the form based authentication, however you can change it to any of the
+ mechanism provided by the servlet specification.</para></listitem>
+<listitem><para>In the <emphasis>WEB-INF/jboss-web.xml</emphasis> you can change the security domain used by the portal.
+ The default security domain used by the portal is <emphasis>java:/jaas/portal</emphasis>. That setting is specific
+ to the JBoss Application Server and how it binds the Java EE security to the operational environment. A security domain
+ is a scope defined at the Application Server Level and defines usually a JAAS authentication stack. The portal
+ security domain authentication stack is defined in the <emphasis>jboss-portal.sar/conf/login-config.xml</emphasis>
+ and is dynamically deployed with the portal. The JBoss Application Server documentation is certainly the best
+ reference for that topic.</para>
+ </listitem>
+ <listitem><para>The files <emphasis>login.jsp</emphasis> and <emphasis>error.jsp</emphasis> represent the pages used
+ the form based authentication process. More information can be found in any good servlet documentation.</para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ <section>
+ <title>The portal servlet</title>
+ <para>The portal defines a single servlet to take care of all portal requests. The class name of that servlet is
+ <emphasis>org.jboss.portal.server.servlet.PortalServlet</emphasis>. That servlet needs to be declared two times with different
+ configurations otherwise the portal would not be able to know about some request details which are importants.
+ <itemizedlist>
+ <listitem><para><emphasis>PortalServletWithPathMapping</emphasis> is used for path mapping mappings.</para></listitem>
+ <listitem><para><emphasis>PortalServletWithDefaultServletMapping</emphasis> is used for the default servlet mapping.</para></listitem>
+ </itemizedlist>
+ The portal servlet is mapped four times with different semantics, the differences between the semantics are related to the transport layer.
+ Each one of those for mappings will have the same request meaning for the portal beside the transport aspect. By default
+ those mappings are
+ <itemizedlist>
+ <listitem><para><emphasis>/*</emphasis> : the default access, does not define any security constraint. This is the default
+ access that everybody uses.</para></listitem>
+ <listitem><para><emphasis>/sec/*</emphasis> : the secured access, requires https usage. It is triggered when
+ a portlet is defined as secure or when a secure portlet link is created. It requires the configuration
+ of the https connector in JBoss Web. The JBoss Application Server documentation provides more information
+ about it.</para></listitem>
+<listitem><para><emphasis>/auth/*</emphasis> : the authenticated access, requires the user to be authenticated
+ to be used.</para></listitem>
+<listitem><para><emphasis>/authsec/*</emphasis> : combine the two previous options into a single one.</para></listitem>
+ </itemizedlist>
+ Usually ones should not care much about those mappings as the portal will by itself switch to the most appropriate mapping.
+ </para>
+ </section>
+ </section>
+
+ <section id="security_authorization">
+ <title>Authorization with JBoss Portal</title>
+ <para>JBoss Portal defines a framework for authorization. The default implementation of that framework is based on
+ the Java Authorization Contract for Containers (JACC) which is implemented by <trademark class="trade">J2EE</trademark> 1.4 Application Servers. This section of
+ the documentation focuses on defining the framework and its usage and is not an attempt to define what authorization
+ is or is not because it is out of scope of this context. Instead we will try to straightforwardly describe the
+ framework and how it is used. No specific knowledge is expected about JACC although it is a recommended read.</para>
+ <section>
+ <title>The portal permission</title>
+ <para>The <emphasis>org.jboss.portal.security.PortalPermission</emphasis> object is used to describe a permission for the portal. It extends the <emphasis>java.security.Permission</emphasis>
+ class and any permission checked in the portal should extend the <emphasis>PortalPermission</emphasis> as well. That permission
+ adds two fields to the <emphasis>Permission</emphasis> class
+ <itemizedlist>
+ <listitem><para>uri : is a string which represents an URI of the resource described by the permission.</para></listitem>
+ <listitem><para>collection : an object of class <emphasis>org.jboss.portal.security.PortalPermissionCollection</emphasis> which
+ is used when the permission act as a container for other permissions. If that object exists then the uri field should be null
+ as a portal permission represents an uri or acts as a container in an exclusive manner.</para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ <section>
+ <title>The authorization provider</title>
+ <para>
+ The <emphasis>org.jboss.portal.security.spi.provider.AuthorizationDomain</emphasis> is an interface which provides access to several services.
+ <programlisting>
+public interface AuthorizationDomain
+{
+ String getType();
+ DomainConfigurator getConfigurator();
+ PermissionRepository getPermissionRepository();
+ PermissionFactory getPermissionFactory();
+}
+ </programlisting>
+ <itemizedlist>
+ <listitem><para><emphasis>org.jboss.portal.security.spi.provider.DomainConfigurator</emphasis> provides configuration access
+ to an authorization domain. The authorization schema is very simple as it consists of bindings between URI, roles and permissions.</para></listitem>
+ <listitem><para><emphasis>org.jboss.portal.security.spi.provider.PermissionRepository</emphasis> provides runtime access to the authorization
+ domain. Usually it is used to retrieve the permissions for a specific role and URI. It is used at runtime by the framework
+ to take security decisions.</para></listitem>
+<listitem><para><emphasis>org.jboss.portal.security.spi.provider.PermissionFactory</emphasis> is a factory to instantiate permissions
+ for the specific domain. It is used at runtime to create permissions objects of the appropriate type by the security framework.</para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ <section>
+ <title>Making a programmatic security check</title>
+ <para>Making a security check is an easy thing as it consists in creating a permission of the appropriate type and
+ make a check against the <emphasis>org.jboss.portal.spi.auth.PortalAuthorizationManager</emphasis> service. That
+ service is used by the portal to make security checks. It is connected to the different authorization providers
+ in order to take decisions at runtime based on the type of the permission. Access to that service is done
+ through the <emphasis>org.jboss.portal.spi.auth.PortalAuthorizationManagerFactory</emphasis>. The factory
+ is a portal service which is usually injected in other services like that</para>
+ <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ ...
+ <mbean
+ code='MyService"
+ name="portal:service=MyService">
+ <depends
+ optional-attribute-name="PortalAuthorizationManagerFactory"
+ proxy-type="attribute">portal:service=PortalAuthorizationManagerFactory</depends>
+ ...
+ </mbean>
+ ...
+</server>]]></programlisting>
+ <para>It can be injected in the servlet context of a war file in the file <emphasis>WEB-INF/jboss-portlet.xml</emphasis></para>
+ <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE portlet-app PUBLIC
+ "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
+<portlet-app>
+ ...
+ <service>
+ <service-name>PortalAuthorizationManagerFactory</service-name>
+ <service-class>
+ org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory
+ </service-class>
+ <service-ref>:service=PortalAuthorizationManagerFactory</service-ref>
+ </service>
+ ...
+</portlet-app>]]></programlisting>
+ <para>Here is an example of how a security check is made for a specific page</para>
+ <programlisting>
+PortalAuthorizationManager pam = factory.getManager();
+PortalObjectId id = page.getId();
+PortalObjectPermission perm = new PortalObjectPermission(id, PortalObjectPermission.VIEW_MASK);
+if (pam.checkPermission(perm) == false)
+{
+ System.out.println("Current user is not authorized to view page " + id);
+}</programlisting>
+ </section>
+ <section>
+ <title>Configuring an authorization domain</title>
+ <para>Configuring a domain can be done through the <emphasis>DomainConfigurator</emphasis> interface</para>
+ <programlisting>
+public interface DomainConfigurator
+{
+ Set getSecurityBindings(String uri);
+ void setSecurityBindings(String uri, Set securityBindings)
+ throws SecurityConfigurationException;
+ void removeSecurityBindings(String uri) throws SecurityConfigurationException;
+}</programlisting>
+ <para>The various methods of that interface allows to configure security bindings for a given resource where
+ a resource is naturally identified by an URI. The <emphasis>org.jboss.portal.security.RoleSecurityBinding</emphasis>
+ object is an object which encapsulate a role name and a set of actions bound to this role.
+ </para>
+ <programlisting>
+RoleSecurityBinding binding1 = new RoleSecurityBinding(Collections.singleton("view"), "Admin");
+RoleSecurityBinding binding2 = new RoleSecurityBinding(Collections.singleton("view"), "User");
+Set bindings = new HashSet();
+bindings.add(binding1);
+bindings.add(binding2);
+configurator.setSecurityBinding(pageURI, bindings); </programlisting>
+ </section>
+ </section>
+</chapter>
+ <chapter id="identity">
+ <!-- <chapterinfo>
+ <author>
+ <firstname>Boleslaw</firstname>
+ <surname>Dawidowicz</surname>
+ </author>
+ </chapterinfo>-->
+ <title>JBoss Portal Identity Management</title>
+ <para>This chapter addresses identity management in JBoss Portal 2.6</para>
+ <section id="management_api">
+ <title>Identity management API</title>
+ <para>Since JBoss Portal 2.6 there are 4 identity services and 2 identity related interfaces. The goal of
+ having such a fine grained API is to enable flexible implementations based on different
+ identity storage like relational databases or LDAP servers. The Membership service takes care of managing the relationship
+ between user objects and role objects. The User Profile service is responsible for managing the profile of a user,
+ it has database and LDAP implementations as well as a mode that combines data from both.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ The <emphasis role="bold">org.jboss.portal.identity.User</emphasis>
+ interface represents a user and exposes the following operations:
+
+ <programlisting><![CDATA[
+ /** The user identifier. */
+ public Object getId();
+
+ /** The user name. */
+ public String getUserName();
+
+ /** Set the password using proper encoding. */
+ public void updatePassword(String password);
+
+ /** Return true if the password is valid. */
+ public boolean validatePassword(String password);
+ ]]></programlisting>
+ <warning>
+ <para>
+ Important Note! The proper usage of getId() method is:
+ </para>
+ <programlisting><![CDATA[
+// Always use it like this:
+user.getId().toString();
+
+// Do not use it like this:
+
+// We would get a Long object if we are using the database implementation
+(Long)user.getId();
+
+// We would get a String with an LDAP server
+(String)user.getId();
+]]></programlisting>
+ <para>
+ This is because the ID value depends on the User implementation. It'll probably be String object with the LDAP implementation and a Long object with the database implementation but it could be something else if one has chosen to make its own implementation.
+ </para>
+ </warning>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The <emphasis role="bold">org.jboss.portal.identity.Role</emphasis> interface represents a Role
+ and exposes the following operations:
+
+ <programlisting><![CDATA[
+/** The role identifier. */
+public Object getId();
+
+/** The role name used in security rules. This name can not be modified */
+public String getName();
+
+/** The role display name used on screens. This name can be modified */
+public String getDisplayName();
+
+/** */
+public void setDisplayName(String name);
+]]></programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The <emphasis role="bold">org.jboss.portal.identity.UserModule</emphasis>
+ interface exposes operations for users management:
+
+ <programlisting><![CDATA[
+/**Retrieve a user by its name.*/
+User findUserByUserName(String userName)
+ throws IdentityException, IllegalArgumentException, NoSuchUserException;
+
+/**Retrieve a user by its id.*/
+User findUserById(Object id)
+ throws IdentityException, IllegalArgumentException, NoSuchUserException;
+
+/**Retrieve a user by its id.*/
+User findUserById(String id)
+ throws IdentityException, IllegalArgumentException, NoSuchUserException;
+
+/** Creates a new user with the specified name.*/
+User createUser(String userName, String password)
+ throws IdentityException, IllegalArgumentException;
+
+/** Remove a user.*/
+void removeUser(Object id)
+ throws IdentityException, IllegalArgumentException;
+
+/** Get a range of users.*/
+Set findUsers(int offset, int limit)
+ throws IdentityException, IllegalArgumentException;
+
+/** Get a range of users.*/
+Set findUsersFilteredByUserName(String filter, int offset, int limit)
+ throws IdentityException, IllegalArgumentException;
+
+/**Returns the number of users.*/
+int getUserCount() throws IdentityException, IllegalArgumentException;
+]]></programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The <emphasis role="bold">org.jboss.portal.identity.RoleModule</emphasis>
+ interface exposes operations for roles management:
+
+ <programlisting><![CDATA[
+/** Retrieves a role by its name*/
+Role findRoleByName(String name)
+ throws IdentityException, IllegalArgumentException;
+
+/**Retrieve a collection of role from the role names.*/
+Set findRolesByNames(String[] names)
+ throws IdentityException, IllegalArgumentException;
+
+/** Retrieves a role by its id.*/
+Role findRoleById(Object id)
+ throws IdentityException, IllegalArgumentException;
+
+/** Retrieves a role by its id.*/
+Role findRoleById(String id)
+ throws IdentityException, IllegalArgumentException;
+
+/** Create a new role with the specified name.*/
+Role createRole(String name, String displayName)
+ throws IdentityException, IllegalArgumentException;
+
+/** Remove a role.*/
+void removeRole(Object id)
+ throws IdentityException, IllegalArgumentException;
+
+/** Returns the number of roles. */
+int getRolesCount()
+ throws IdentityException;
+
+/** Get all the roles */
+Set findRoles() throws IdentityException;
+]]></programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The <emphasis role="bold">MembershipModule</emphasis>
+ interface exposes operations for obtaining or managing relationships beetween users and roles.
+ The role of this service is to decouple relationship information from user and roles.
+ Indeed while user role relationship is pretty straightforward with a relational database (using
+ a many to many relationship with an intermediary table), with an LDAP server there a different
+ ways to define relationships between users and roles.
+
+ <programlisting><![CDATA[
+/** Return the set of role objects that a given user has.*/
+Set getRoles(User user) throws IdentityException, IllegalArgumentException;
+
+Set getUsers(Role role) throws IdentityException, IllegalArgumentException;
+
+/** Creates a relationship beetween a role and set of users. Other roles that have
+ assotiontions with those users remain unaffected.*/
+void assignUsers(Role role, Set users) throws IdentityException, IllegalArgumentException;
+
+/** Creates a relationship beetween a user and set of roles. This operation will erase any
+ other assotientions beetween the user and roles not specified in the provided set.*/
+void assignRoles(User user, Set roles) throws IdentityException, IllegalArgumentException;
+
+/** Returns role members based on rolename - depreciated method ethod here only
+ for compatibility with old RoleModule interface */
+Set findRoleMembers(String roleName, int offset, int limit, String userNameFilter)
+ throws IdentityException, IllegalArgumentException;
+]]></programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The <emphasis role="bold">UserProfileModule</emphasis>
+ interface exposes operations to access and manage informations stored in User profile:
+
+ <programlisting><![CDATA[
+public Object getProperty(User user, String propertyName)
+ throws IdentityException, IllegalArgumentException;
+
+public void setProperty(User user, String name, Object property)
+ throws IdentityException, IllegalArgumentException;
+
+public Map getProperties(User user)
+ throws IdentityException, IllegalArgumentException;
+
+public ProfileInfo getProfileInfo()
+ throws IdentityException;
+]]></programlisting>
+ <warning>
+ <para>
+ UserProfileModule.getProperty() method returns an Object.
+ In most cases with DB backend it will always be String object. But normally you should check what
+ object will be retrieved using getProfileInfo() method.</para>
+ </warning>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The <emphasis role="bold">ProfileInfo</emphasis>
+ interface can be obtained using the
+ <emphasis role="bold">UserProfileModule</emphasis>
+ and exposes meta information of a profile:
+
+ <programlisting><![CDATA[
+/** Returns a Map o PropertyInfo objects describing profile properties */
+public Map getPropertiesInfo();
+
+public PropertyInfo getPropertyInfo(String name);
+]]></programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">PropertyInfo</emphasis>
+ interface expose methods to obtain information about accessible property in User profile
+
+ <programlisting><![CDATA[
+public static final String ACCESS_MODE_READ_ONLY = "read-only";
+public static final String ACCESS_MODE_READ_WRITE = "read-write";
+public static final String USAGE_MANDATORY = "mandatory";
+public static final String USAGE_OPTIONAL = "optional";
+public static final String MAPPING_DB_TYPE_COLUMN = "column";
+public static final String MAPPING_DB_TYPE_DYNAMIC = "dynamic";
+
+public String getName();
+
+public String getType();
+
+public String getAccessMode();
+
+public String getUsage();
+
+public LocalizedString getDisplayName();
+
+public LocalizedString getDescription();
+
+public String getMappingDBType();
+
+public String getMappingLDAPValue();
+
+public String getMappingDBValue();
+
+public boolean isMappedDB();
+
+public boolean isMappedLDAP();
+]]></programlisting>
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <section>
+ <title>How to obtain identity modules services ?</title>
+ <para>
+ The advocated way to get a reference to the identity modules is by using JNDI:
+ </para>
+ <programlisting>
+import org.jboss.portal.identity.UserModule;
+import org.jboss.portal.identity.RoleModule;
+import org.jboss.portal.identity.MembershipModule;
+import org.jboss.portal.identity.UserProfileModule;
+
+[...]
+
+(UserModule)new InitialContext().lookup("java:portal/UserModule");
+(RoleModule)new InitialContext().lookup("java:portal/RoleModule");
+(MembershipModule)new InitialContext().lookup("java:portal/MembershipModule");
+(UserProfileModule)new InitialContext().lookup("java:portal/UserProfileModule");</programlisting>
+ <para>
+ Another way to do this is, if you are fimiliar with JBoss Microkernel architecture is to
+ get the <emphasis role="bold">IdentityServiceController</emphasis>
+ mbean. You may want to inject it into your services like this:
+ </para>
+ <programlisting><![CDATA[
+<depends optional-attribute-name="IdentityServiceController" proxy-type="attribute">
+ portal:service=Module,type=IdentityServiceController
+</depends>]]></programlisting>
+ <para>
+ or simply obtain in your code by doing a lookup using
+ the <emphasis role="bold">portal:service=Module,type=IdentityServiceController</emphasis>
+ name. Please refer to the JBoss Application Server documentation if you want to learn more
+ about service MBeans. Once you obtained the object you can use it:
+ </para>
+
+ <programlisting>
+(UserModule)identityServiceController.getIdentityContext()
+ .getObject(IdentityContext.TYPE_USER_MODULE);
+
+(RoleModule)identityServiceController.getIdentityContext()
+ .getObject(IdentityContext.TYPE_ROLE_MODULE);
+
+(MembershipModule)identityServiceController.getIdentityContext()
+ .getObject(IdentityContext.TYPE_MEMBERSHIP_MODULE);
+
+(UserProfileModule)identityServiceController.getIdentityContext()
+ .getObject(IdentityContext.TYPE_USER_PROFILE_MODULE);
+ </programlisting>
+
+ </section>
+ <section>
+ <title>API changes since 2.4</title>
+ <para>Because in JBoss Portal 2.4 there were only
+ <emphasis role="bold">UserModule</emphasis>
+ ,
+ <emphasis role="bold">RoleModule</emphasis>
+ ,
+ <emphasis role="bold">User</emphasis>
+ and
+ <emphasis role="bold">Role</emphasis>
+ interfaces some API usages changed. Here are the most important changes you will need to aply to your
+ code while migrating your aplication to 2.6:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ For the <emphasis role="bold">User</emphasis> interface:
+
+ <programlisting><![CDATA[
+// Instead of: user.getEnabled()
+userProfileModule.getProperty(user, User.INFO_USER_ENABLED);
+
+// Instead of: user.setEnabled(value)
+userProfileModule.setProperty(user, User.INFO_USER_ENABLED, value);
+
+// In a similar way you should change rest of methods that are missing in User interface
+// in 2.6 by the call to the UserProfileModule
+
+// Instead of: user.getProperties()
+userProfileModule.getProperties(user);
+
+// Instead of: user.getGivenName()
+userProfileModule.getProperty(user, User.INFO_USER_NAME_GIVEN);
+
+// Instead of: user.getFamilyName()
+userProfileModule.getProperty(user, User.INFO_USER_NAME_FAMILY);
+
+// Instead of: user.getRealEmail()
+userProfileModule.getProperty(user, User.INFO_USER_EMAIL_REAL);
+
+// Instead of: user.getFakeEmail()
+userProfileModule.getProperty(user, User.INFO_USER_EMAIL_FAKE);
+
+// Instead of: user.getRegistrationDate()
+userProfileModule.getProperty(user, User.INFO_USER_REGISTRATION_DATE);
+
+// Instead of: user.getViewRealEmail()
+userProfileModule.getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL);
+
+// Instead of: user.getPreferredLocale()
+userProfileModule.getProperty(user, User.INFO_USER_LOCALE);
+
+// Instead of: user.getSignature()
+userProfileModule.getProperty(user, User.INFO_USER_SIGNATURE);
+
+// Instead of: user.getLastVisitDate()
+userProfileModule.getProperty(user, User.INFO_USER_LAST_LOGIN_DATE);]]></programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The <emphasis role="bold">RoleModule</emphasis> interface:
+
+ <programlisting><![CDATA[
+// Instead of
+// RoleModule.findRoleMembers(String roleName, int offset, int limit, String userNameFilter)
+// throws IdentityException;
+membershipModule.findRoleMembers(String roleName, int offset, int limit,
+ String userNameFilter)
+
+// Instead of
+// RoleModule.setRoles(User user, Set roles) throws IdentityException;
+membershipModule.assignRoles(User user, Set roles)
+
+// Instead of
+// RoleModule.getRoles(User user) throws IdentityException;
+membershipModule.getRoles(User user)]]></programlisting>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ </section>
+ <section>
+ <title>Identity configuration</title>
+ <para>In order to understand identity configuration you need to understand its architecture.
+ Different identity services like UserModule, RoleModule and etc are just plain Java classes that are instantiated and exposed
+ by the portal. So an *example* of UserModule service could be a plain Java bean object that would be:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para><emphasis role="bold">Instantiated</emphasis> using reflection</para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">Initialized/Started</emphasis> by invoking some methods</para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">Registered/Exposed</emphasis> using JNDI and/or mbeans (JBoss Microkernel) services, so other services of the portal can use it</para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">Managed</emphasis> in the matter of lifecycle - so it'll be stopped and unregistered during portal shutdown</para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ As you see from this point of view, configuration just specifies what Java class will be used and how it should be used by portal as a service.
+ </para>
+ <note><title>Note</title><para>We use JBoss Microcontainer internally to manage the sub system made of those components so if you are interested in implementing
+ custom services - look on the methods that are used by this framework.</para></note>
+
+ <para>
+ In JBoss Portal we provide a very flexible configuration. It is very easy to rearrange and customize services,
+ provide alternative implementations, extend the existing ones or provide a custom identity model.
+ </para>
+ <para>To grasp the full picture of the configuration of identity services let's start from its root
+ component. Whole configuration and setup of identity components is done by the
+ <emphasis role="bold">IdentityServiceController</emphasis> service. It brings to life and registers all other services
+ such as UserModule, RoleModule, MembershipModule and UserProfileModule.
+ <emphasis role="bold">IdentityServiceController</emphasis> is defined in
+ <emphasis>jboss-portal.sar/META-INF/jboss-service.xml</emphasis>
+ </para>
+
+ <programlisting><![CDATA[
+<mbean
+ code="org.jboss.portal.identity.IdentityServiceControllerImpl"
+ name="portal:service=Module,type=IdentityServiceController"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends>portal:service=Hibernate</depends>
+ <attribute name="JndiName">java:/portal/IdentityServiceController</attribute>
+ <attribute name="RegisterMBeans">true</attribute>
+ <attribute name="ConfigFile">conf/identity/identity-config.xml</attribute>
+ <attribute name="DefaultConfigFile">conf/identity/standardidentity-config.xml</attribute>
+</mbean>]]></programlisting>
+ <para>
+ We can specify a few options here:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">RegisterMBeans</emphasis> - defines if IdentityServiceController should
+ register components which are instantiated as mbeans
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">ConfigFile</emphasis> - defines the location of the main identity services configuration file. It describes and configures all the components like UserModule, RoleModule... that need to be instantiated
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">DefaultConfigFile</emphasis> - defines the location of the configuration file containing
+ the default values. For each component defined in <emphasis role="bold">ConfigFile</emphasis>, the IdentityServiceController
+ will obtain a set of default options from this file. That helps to keep the main main configuration file
+ simple, short and easy to read. Potentially it provides more powerful customizations.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <section>
+ <title>Main configuration file architecture (identity-config.xml)</title>
+ <para>
+ The file describing portal identity services contains three sections:
+ </para>
+ <programlisting><![CDATA[
+<identity-configuration>
+ <datasources>
+ <!-- Datasources section -->
+ <datasource> ... </datasource>
+ <datasource> ... </datasource>
+ ...
+ </datasources>
+ <modules>
+ <!-- Modules section -->
+ <module> ... </module>
+ <module> ... </module>
+ ...
+ </modules>
+ <options>
+ <!-- Options section -->
+ <option-group> ... </option-group>
+ <option-group> ... </option-group>
+ ...
+ </options>
+</identity-configuration>]]></programlisting>
+ <para>By default you can find it in <emphasis>jboss-portal.sar/conf/identity/identity-config.xml</emphasis></para>
+ <section>
+ <title>Datasources</title>
+ <para>This section defines datasource components. They will be processed and instantiated before components in
+ <emphasis role="bold">Module</emphasis> section, so they will be ready to serve them.</para>
+
+ <note><title>Note</title>
+ <para>This section isn't used with Database configuration as in JBoss Portal services exposing Hibernate
+ are defined separately. It is used by LDAP configuration and we will use it as an example</para>
+ </note>
+ <programlisting><![CDATA[
+<datasource>
+ <name>LDAP</name>
+ <service-name>portal:service=Module,type=LDAPConnectionContext</service-name>
+ <class>org.jboss.portal.identity.ldap.LDAPConnectionContext</class>
+ <config>
+ <option>
+ <name>host</name>
+ <value>jboss.com</value>
+ </option>
+ <option>
+ <name>port</name>
+ <value>10389</value>
+ </option>
+ <option>
+ <name>adminDN</name>
+ <value>cn=Directory Manager</value>
+ </option>
+ <option>
+ <name>adminPassword</name>
+ <value>xxxxx</value>
+ </option>
+
+ <!-- Other options here.... -->
+
+ </config>
+</datasource>]]></programlisting>
+<note>
+ <title>Note</title>
+ <para>If you look into JBoss Portal configuration files you will find that <![CDATA[<service-name/> and <class/>]]>
+ are specified in <emphasis role="bold">DefaultConfigFile</emphasis> and not in <emphasis role="bold">ConfigFile</emphasis>.
+ So here is how it works: those two will be picked up from default configuration. The same rule is effective
+ for the options - additional options will be picked up from default configuration. What is linking configuration in those two files
+ is the <emphasis role="bold"><![CDATA[<name>]]></emphasis> tag.</para>
+ </note>
+ </section>
+ <section>
+ <title>Modules</title>
+ <para>Modules are core service components like UserModule, RoleModule and etc. </para>
+ <programlisting><![CDATA[
+<module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>User</type>
+ <implementation>DB</implementation>
+
+ <!--name of service and class for creating mbean-->
+ <service-name>portal:service=Module,type=User</service-name>
+ <class>org.jboss.portal.identity.db.HibernateUserModuleImpl</class>
+
+ <!--set of options that are in the instantiated object-->
+ <config>
+ <option>
+ <name>sessionFactoryJNDIName</name>
+ <value>java:/portal/IdentitySessionFactory</value>
+ </option>
+ <option>
+ <name>jNDIName</name>
+ <value>java:/portal/UserModule</value>
+ </option>
+ </config>
+</module>]]></programlisting>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">implementation</emphasis> - defines the scope under which
+ the configuration for different implementations of modules <emphasis role="bold">type</emphasis>s resides.
+ It enables to define the default options of the configuration of the different implementations of
+ same module types in one configuration file.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">type</emphasis> - must be unique name across all modules defined in the main
+ configuration file. This is important as module will be stored with such name within IdentityContext
+ registry at runtime. Standard names are used (User, Role, Membership, UserProfile). Together with
+ <emphasis role="bold">implementation</emphasis> will create unique pair within file with default configuration values.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">service-name</emphasis> - will be used for the name when registered as an MBean.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">class</emphasis> - Java class that will be use to instantiate the module.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">config</emphasis> - contains options related to this module
+ </para>
+ </listitem>
+ </itemizedlist>
+ <note><title>Note</title><para>
+ Here you can easily see the whole idea about having two config files - main one and the one with default values.
+ The above code snippet with User module comes from <emphasis role="bold">standardidentity-config.xml</emphasis>, so the file
+ that defines default configuration values. Because of this in the main configuration file the definition of
+ User module will be as short as:
+ <programlisting><![CDATA[
+<module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>User</type>
+ <implementation>DB</implementation>
+ <config/>
+</module>]]></programlisting>
+ As you can see we specify only the type and the implementation - all the other values (service-name, class and set of options)
+ are read from default configuration. But remember that you can still overwrite any of those values in the
+ main config simply by overriding them.</para>
+ </note>
+
+ </section>
+ <section>
+ <title>Options</title>
+ <para>This section provides common options that are accessible by identity modules. We set options
+ here that may need to be shared. They are grouped, and can have many values:</para>
+ <programlisting><![CDATA[
+<options>
+<!--Common options section-->
+<option-group>
+ <group-name>common</group-name>
+ <option>
+ <name>userCtxDN</name>
+ <value>ou=People,dc=example,dc=com</value>
+ </option>
+ <option>
+ <name>uidAttributeID</name>
+ <value>uid</value>
+ </option>
+ <option>
+ <name>passwordAttributeID</name>
+ <value>userPassword</value>
+ </option>
+ <option>
+ <name>roleCtxDN</name>
+ <value>ou=Roles,dc=example,dc=com</value>
+ </option>
+ <option>
+ <name>ridAttributeId</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>roleDisplayNameAttributeID</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>membershipAttributeID</name>
+ <value>member</value>
+ </option>
+ <option>
+ <name>membershipAttributeIsDN</name>
+ <value>true</value>
+ </option>
+</option-group>
+<option-group>
+ <group-name>userCreateAttibutes</group-name>
+ <option>
+ <name>objectClass</name>
+ <value>top</value>
+ <value>uidObject</value>
+ <value>person</value>
+ <value>inetUser</value>
+ </option>
+ <!--Schema requires those to have initial value-->
+ <option>
+ <name>cn</name>
+ <value>none</value>
+ </option>
+ <option>
+ <name>sn</name>
+ <value>none</value>
+ </option>
+</option-group>]]></programlisting>
+ <note>
+ <title>Note</title><para>
+ In this section we use the same inheritance mechanism. When an option is not set, its value will be read
+ from the default config file. But this also means that you may need to overwrite some values that
+ are specific to your LDAP architecture. All the options will be described along with module implementations
+ that use them.</para>
+ </note>
+ </section>
+ </section>
+ </section>
+ <section id="user_profile_configuration">
+ <title>User profile configuration</title>
+ <para>UserProfileModule has additional configuration file that defines user properties. It is specified in configuration in:</para>
+ <programlisting>
+ <![CDATA[
+ <module>
+ <type>UserProfile</type>
+ <implementation>DELEGATING</implementation>
+
+ (...)
+
+ <config>
+
+ (...)
+
+ <option>
+ <name>profileConfigFile</name>
+ <value>conf/identity/profile-config.xml</value>
+ </option>
+ </config>
+ </module>
+ ]]>
+ </programlisting>
+ <para>This means that you can configure user profile in <emphasis>jboss-portal.sar/conf/identity/profile-config.xml</emphasis></para>
+
+ <programlisting>
+ <![CDATA[
+<profile>
+
+ <property>
+ <name>user.name.nickName</name>
+ <type>java.lang.String</type>
+ <access-mode>read-only</access-mode>
+ <usage>mandatory</usage>
+ <display-name xml:lang="en">Name</display-name>
+ <description xml:lang="en">The user name</description>
+ <mapping>
+ <database>
+ <type>column</type>
+ <value>jbp_uname</value>
+ </database>
+ </mapping>
+ </property>
+
+ <property>
+ <name>user.business-info.online.email</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>mandatory</usage>
+ <display-name xml:lang="en">Email</display-name>
+ <description xml:lang="en">The user real email</description>
+ <mapping>
+ <database>
+ <type>column</type>
+ <value>jbp_realemail</value>
+ </database>
+ <ldap>
+ <value>mail</value>
+ </ldap>
+ </mapping>
+ </property>
+
+ <property>
+ <name>portal.user.location</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Location</display-name>
+ <description xml:lang="en">The user location</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.location</value>
+ </database>
+ </mapping>
+ </property>
+
+ (...)
+
+</properties>
+ ]]>
+ </programlisting>
+ <para> Configuration file contains properties definition that can be retrieved using the <emphasis role="bold">PropertyInfo</emphasis> interface.
+ Each property used in portal has to be defined here.</para>
+
+<note><title>Note</title><para>Some information provided here can have a large impact on the behavior of the UserProfileModule. For instance
+ <emphasis>access-mode</emphasis> can be made read-only and the value provided in <emphasis>type</emphasis> will be checked
+ during <emphasis>setProperty()/getProperty()</emphasis> operations. On the other hand tags like <emphasis>usage</emphasis>,
+ <emphasis>description</emphasis> or <emphasis>display-name</emphasis> have mostly informational meaning at the moment and
+ are used by the management tools at runtime.</para></note>
+
+ <itemizedlist>
+ <listitem><para>
+ <emphasis role="bold">name</emphasis> - property name. This value will be used to refer to the property in <emphasis>UserProfileModule</emphasis></para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">type</emphasis> - Java type of property. This type will be checked when in <emphasis>UserProfileModule</emphasis>
+ methods invocation.</para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">access-mode</emphasis> - possible values are <emphasis>read-write</emphasis> and <emphasis>read-only</emphasis></para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis role="bold">usage</emphasis> - property usage can be <emphasis>mandatory</emphasis> or <emphasis>optional</emphasis>.</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis role="bold">display-name</emphasis> - property display name.</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis role="bold">description</emphasis> - description of property.</para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <emphasis role="bold">mapping</emphasis> - defines how property is mapped in the underlaying storage mechanism. It can be mapped in <emphasis>database</emphasis>
+ either as a <emphasis>column</emphasis> or <emphasis>dynamic</emphasis> value. It can also be mapped as <emphasis>ldap</emphasis> attribute.
+
+ <note><title>Note</title><para>In current implementation <emphasis>column</emphasis> and <emphasis>dynamic</emphasis> mappings have the same effect, as database mappings are defined in hibernate configuration.</para></note>
+
+ <note><title>Note</title>
+ <para>Property can have both <emphasis>ldap</emphasis> and <emphasis>database</emphasis> mappings. In such situation when LDAP support is enabled <emphasis>ldap</emphasis> mapping will take precedense. Also even when using LDAP some properties will be mapped to LDAP and some to database. Its because LDAP schema doesn't support all attributes proper to for portal properties. To solve this we have <emphasis role="bold">DelegatingUserProfileModuleImpl</emphasis> that will delegate method invocation to
+ <emphasis>ldap</emphasis> or <emphasis>database</emphasis> related <emphasis>UserProfile</emphasis> module. When <emphasis>LDAP</emphasis> support is enabled and property need to be stored in database user will be synchronized into database when needed. This behavior can be configured.</para>
+ </note>
+ </para>
+ </listitem>
+ </itemizedlist>
+
+
+ </section>
+
+ <section>
+ <title>Identity modules implementations</title>
+
+ <note><title>Note</title><para>Identity modules implementations related to LDAP are described in <xref linkend="ldap.ldap_identity_modules"/>.
+ </para></note>
+ <section>
+ <title>Database modules</title>
+ <para>JBoss portal comes with a set of database related identity modules implementations done using Hibernate - those are configured
+ by default. Those are not very
+ configurable in <emphasis>identity-config.xml</emphasis> file. The reason is that to keep backwards compatibility of database schema with previous
+ portal version, we reused most of hibernate implementation. If you want to tweak the hibernate mappings you should look into files in
+ <emphasis role="bold">jboss-portal.sar/conf/hibernate</emphasis>. Also those modules rely on hibernate <emphasis>SessionFactory</emphasis> components
+ that are created in <emphasis>SessionFactoryBinder</emphasis> mbeans defined in <emphasis>jboss-portal.sar/META-INF/jboss-service.xml</emphasis></para>
+ <para>Classes implementing identity modules:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">org.jboss.portal.identity.db.HibernateUserModuleImpl</emphasis> - implementaing <emphasis>UserModule</emphasis> interface</para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">org.jboss.portal.identity.db.HibernateRoleModuleImpl</emphasis> - implementaing <emphasis>RoleModule</emphasis> interface</para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">org.jboss.portal.identity.db.HibernateMembershipModuleImpl</emphasis> - implementaing <emphasis>MembershipModule</emphasis> interface</para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">org.jboss.portal.identity.db.HibernateUserProfileModuleImpl</emphasis> - implementing <emphasis>UserProfileModule</emphasis> interface</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>For each of those modules you can alter two config options:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>sessionFactoryJNDIName</emphasis> - JNDI name under which hibernate SessionFactory object is registered</para>
+ </listitem>
+ <listitem>
+ <para><emphasis>jNDIName</emphasis> - JNDI name under which this module should be registered</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ <section id="identity.management_api">
+ <title>Delegating UserProfile module</title>
+ <para>
+ Delegating UserProfileModule implementation has very specific role. When we use a storage mechanism like LDAP we may not be able to map all
+ user properties into LDAP attributes because of schema limitations. To solve this problem we still can use the database to store user properties
+ that do not exist in the LDAP schema.
+ The Delegating user profile module will recognize if a property is mapped as <emphasis role="bold">ldap</emphasis> or <emphasis role="bold">database</emphasis>
+ and delegate <emphasis>setProperty()/getProperty()</emphasis> method invocation to proper module implementation. This is implemented in
+ <emphasis role="bold">org.jboss.portal.identity.DelegatingUserProfileModuleImpl</emphasis>. If property is mapped either as
+ <emphasis role="bold">ldap</emphasis> and <emphasis role="bold">database</emphasis> the <emphasis role="bold">ldap</emphasis> mapping will
+ have higher priority.
+ </para>
+ <programlisting>
+ <![CDATA[
+<module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>UserProfile</type>
+ <implementation>DELEGATING</implementation>
+
+ <!--name of service and class for creating mbean-->
+ <service-name>portal:service=Module,type=UserProfile</service-name>
+ <class>org.jboss.portal.identity.DelegatingUserProfileModuleImpl</class>
+ <!--set of options that are set in instantiated object-->
+ <config>
+ <option>
+ <name>jNDIName</name>
+ <value>java:/portal/UserProfileModule</value>
+ </option>
+ <option>
+ <name>dbModuleJNDIName</name>
+ <value>java:/portal/DBUserProfileModule</value>
+ </option>
+ <option>
+ <name>profileConfigFile</name>
+ <value>conf/identity/profile-config.xml</value>
+ </option>
+ </config>
+</module>]]>
+ </programlisting>
+ <para>
+ Module options are:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis role="bold">dbModuleJNDIName</emphasis> - JNDI name under which database implementation of UserProfileModule is registered.</para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">ldapModuleJNDIName</emphasis> - JNDI name under which ldap implementation of UserProfileModule is registered.</para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">profileConfigFile</emphasis> - configuration file for user properties.</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ <section>
+ <title>Database UserProfile module implementation</title>
+ <para>Because of the behavior described in the previous section, database UserProfileModule requires some special features. If a user is present in
+ LDAP server but a writable property isn't mapped as an LDAP attribute, such property requires to be stored in the database. In order to achieve
+ such result the user need to be synchronized from LDAP into the database first.</para>
+ <para>Class <emphasis>org.jboss.portal.identity.db.HibernateUserProfileModuleImpl</emphasis> has additional synchronization features.
+ Here are the options: </para>
+
+ <itemizedlist>
+ <listitem><para>
+ <emphasis role="bold">synchronizeNonExistingUsers</emphasis> - when set to "true" if the user subject to the operation does not exist, then it will
+ created it in database. By default it is "true".</para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">acceptOtherImplementations</emphasis> - if set to "true" module will accept user objects other than
+ <emphasis>org.jboss.portal.identity.db.HibernateUserImpl</emphasis>. This is needed to enable cooperation with UserModule implementations other
+ than <emphasis>org.jboss.portal.identity.db.HibernateUserModuleImpl</emphasis>. The default value is set "true".</para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">defaultSynchronizePassword</emphasis> - if this option is set, the value will be used as a password for synchronized user.</para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">randomSynchronizePassword</emphasis> - if this option is set to "true" synchronized user will have random generated password. This is mostly used for the security reasons. Default value is "false".</para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">sessionFactoryJNDIName</emphasis> - JNDI name under which this user will be registered.</para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">profileConfigFile</emphasis> - file with user profile configuration. If this option is not set, and we use delegating UserProfileModule, profile configuration will be obtained from it.</para>
+ </listitem>
+ </itemizedlist>
+
+ </section>
+ </section>
+</chapter>
+ <chapter id="identityportlets">
+<!-- <chapterinfo>
+ <author>
+ <firstname>Emanuel</firstname>
+ <surname>Muckenhuber</surname>
+ </author>
+ </chapterinfo>-->
+ <title>JBoss Portal Identity Portlets</title>
+ <section id="identity_portlet_introduction">
+ <title>Introduction</title>
+ <para>
+ Since JBoss Portal 2.6.2 two new Identity Portlets are
+ shipped by default:
+ <itemizedlist>
+ <listitem>
+ <para>The User Portlet</para>
+ </listitem>
+ <listitem>
+ <para>The Identity Management Portlet</para>
+ </listitem>
+ </itemizedlist>
+ As the names indicate - the User Portlet is responsible for
+ actions related to the end user. Whereas the Identity Management
+ Portlet contains all the functionality for managing users and roles.
+ </para>
+<warning><title>Caution</title><para>
+The Identity portlets will evolve over time, therefore usage and configuration might change.</para>
+</warning>
+ <section>
+ <title>Features</title>
+ <para>
+ The identity portlets provide the following features:
+ <itemizedlist>
+ <listitem>
+ <para>Email verification: The users can receive an email with a link on which they must click to confirm the
+ creation of the new account. (Disabled by default,see <xref linkend="identity_portlet_configuration_jbpm"/>)</para>
+ </listitem>
+ <listitem>
+ <para>Captcha support: The users are prompted to copy letters from a deformed image. (Disabled by default, see <xref linkend="identity_portlet_configuration_captcha"/>)</para>
+ </listitem>
+ <listitem>
+ <para>Lost password: The users can receive a new password by email, any user with access to the admin portlet can also reset another user's password and send the new one by email in one click. (Disabled by default, see <xref linkend="identity_portlet_configuration_lost_password"/>)</para>
+ </listitem>
+ <listitem>
+ <para>jBPM based user registration: Several business processes are available out of the box (this includes administration approval), this can
+ be extended to custom ones. See <xref linkend="identity_portlet_configuration_jbpm"/>.</para>
+ </listitem>
+ <listitem>
+ <para>User and role management: Ability for the administrator to add and edit users as well as adding, </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+ <section>
+ <title>Configuration</title>
+ <para>
+ This section covers the configuration of the Identity
+ Portlets.
+ </para>
+ <section id="identity_portlet_configuration_captcha">
+ <title>Captcha support</title>
+ <para>
+ CAPTCHA is an acronym for <literal>Completely Automated Public
+ Turing test to tell Computers and Humans Apart</literal>. This is
+ providing a mechanism to prevent automated programs
+ from using different services. The User
+ Portlet uses JCaptcha to provide a challenge-response.
+ </para>
+ <note><para>By default the captcha service needs a XServer to
+ generate the images. For using the captcha service
+ without a XServer make sure you run the JVM with the
+ following option:
+ <programlisting>-Djava.awt.headless=true</programlisting></para>
+ </note>
+ <para/>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/identityportlets/user_register.png"/>
+ </imageobject>
+
+ </mediaobject>
+ <para>The registration page with captcha.</para>
+ <para>
+ The captcha support can be enabled by changing the
+ portlet preference 'captcha' to 'true'. If enabled,
+ captcha will be used for the registration and lost
+ password action.
+ </para>
+ <programlisting><![CDATA[...
+<portlet>
+...
+ <display-name>User portlet</display-name>
+...
+ <portlet-preferences>
+ <preference>
+ <name>captcha</name>
+ <value>true</value>
+ </preference>
+ </portlet-preferences>
+</portlet>
+...]]></programlisting>
+ </section>
+ <section id="identity_portlet_configuration_lost_password">
+ <title>Lost password</title>
+ <para>
+ The lost password feature enables the end user to reset
+ his password by entering his username.
+ </para>
+ <note>
+ <title>Note</title><para>This feature requires a properly configured MailModule. See <xref linkend="emailConfiguration"/>.</para>
+ </note>
+ <para/>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/identityportlets/lost_password.png"/>
+ </imageobject>
+
+ </mediaobject>
+ <para>
+ The lost password page with captcha enabled.
+ </para>
+ <para>
+ The lost password feature can be enabled by changing the
+ portlet preference 'lostPassword' to 'true'. If captcha
+ is enabled it will be also used for verifying the lost
+ password action.
+ </para>
+ <programlisting><![CDATA[...
+<portlet>
+...
+ <display-name>User portlet</display-name>
+...
+ <portlet-preferences>
+ <preference>
+ <name>lostPassword</name>
+ <value>true</value>
+ </preference>
+ </portlet-preferences>
+</portlet>
+...]]></programlisting>
+ </section>
+ <section id="identity_portlet_configuration_reset_password">
+ <title>Reset password</title>
+ <para>
+ The reset password feature is similar to the lost
+ password feature, but it is used in the User Management
+ Portlet to reset the password of a user. That means
+ changing the password of a user is slightly simplified,
+ because a random password will be generated and sent to
+ the users e-mail address.
+ </para>
+ <programlisting><![CDATA[...
+<portlet>
+...
+ <display-name>User management portlet</display-name>
+...
+ <portlet-preferences>
+ <preference>
+ <name>resetPassword</name>
+ <value>true</value>
+ </preference>
+ </portlet-preferences>
+</portlet>
+...]]></programlisting>
+ </section>
+ <section id="identity_portlet_configuration_jbpm">
+ <title>jBPM based user registration</title>
+ <para>
+ JBoss Portal supports three different subscription modes by default:
+ <itemizedlist>
+ <listitem>
+ <para>Automatic subscription (no jBPM required), the users can register and directly login.</para>
+ </listitem>
+ <listitem>
+ <para>E-Mail validation, the users need to click on a link sent by email before being able to login.</para>
+ </listitem>
+ <listitem>
+ <para>E-Mail validation and admin approval, the users need to validate their email, then an admin needs to
+ approve the newly created account.</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <note><title>Note</title><para>
+ The subscription mode has to be defined in the configuration file as explained here: <xref linkend="identity_portlet_configuration_file"/>.</para>
+ </note>
+ <warning><title>Caution</title><para>
+ Make sure that the application server is restarted after re-deploying the Identity Portlets. This is required to make sure that
+ the registration and approval process works properly! </para>
+ </warning>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/identityportlets/pending_users.png"/>
+ </imageobject>
+
+ </mediaobject>
+ <para>
+ Approve or reject pending registrations (<emphasis>jbp_identity_validation_approval_workflow</emphasis>).
+ </para>
+ </section>
+ <section id="identity_portlet_configuration_file">
+ <title>The configuration file</title>
+ <para>
+ The Identity Portlets use some metadata which can be
+ easily changed in the main configuration file, which is
+ located at <literal>jboss-portal.sar/portal-identity.sar/conf/identity-ui-configuration.xml</literal> as shown here:
+ </para>
+ <programlisting><![CDATA[<identity-ui-configuration>
+
+ <subscription-mode>automatic</subscription-mode>
+ <admin-subscription-mode>automatic</admin-subscription-mode>
+ <overwrite-workflow>false</overwrite-workflow>
+ <email-domain>jboss.org</email-domain>
+ <email-from>no-reply(a)jboss.com</email-from>
+ <password-generation-characters>a...Z</password-generation-characters>
+ <default-roles>
+ <role>User</role>
+ </default-roles>
+
+ <!-- user interface components -->
+ <ui-components>
+ <ui-component name="givenname">
+ <property-ref>user.name.given</property-ref>
+ </ui-component>
+ <ui-component name="familyname">
+ <property-ref>user.name.family</property-ref>
+ </ui-component>
+ ...
+</identity-ui-configuration>]]></programlisting>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ subscription-mode:
+ </emphasis>
+ defines the User Portlet registration process
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>automatic:</emphasis> no validation nor approval (default)</para>
+ </listitem>
+ <listitem><para>
+ <emphasis>jbp_identity_validation_workflow:</emphasis> e-mail validation, no approval</para>
+ </listitem>
+ <listitem><para>
+ <emphasis>jbp_identity_validation_approval_workflow:</emphasis> e-mail validation and approval</para>
+ </listitem>
+ <listitem><para>
+ <emphasis>custom:</emphasis> Take a look at Customizing the workflow</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ admin-subscription-mode:
+ </emphasis>
+ jBPM process used in the User Management Portlet for creating users
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>automatic:</emphasis>
+ no validation nor approval (default)</para>
+ </listitem>
+ <listitem><para>
+ <emphasis>jbp_identity_validation_workflow:</emphasis>
+ e-mail validation, no approval</para>
+ </listitem>
+ <listitem><para>
+ <emphasis>jbp_identity_validation_approval_workflow:</emphasis>
+ e-mail validation and approval</para>
+ </listitem>
+ <listitem><para>
+ <emphasis>custom:</emphasis>
+ Take a look at Customizing the
+ workflow</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ overwrite-workflow:
+ </emphasis>
+ if set to 'true' the workflow will be overwritten during the next startup (default: false)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ email-domain:
+ </emphasis>
+ e-mail domain used in the validation e-mail by the template (can be anything)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">email-from:</emphasis>
+ e-mail fro field used by the validation e-mail
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ password-generation-characters:
+ </emphasis>
+ characters to use to generate a random password
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ default-roles:
+ </emphasis>
+ one or more default roles
+ <itemizedlist>
+ <listitem><para>
+ available element: <emphasis role="bold">role</emphasis></para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ ui-components:
+ </emphasis>
+ Defines the available user interface components. Take a look at the next section
+ for further details.
+ </para>
+ </listitem>
+ </itemizedlist>
+ Due to the differentiation between subscription-mode and
+ admin-subscription-mode it is possible to require e-mail
+ validation and approval for new registrations and e-mail
+ validation only when a user is created in the user
+ management portlet.
+ </para>
+ </section>
+ <section>
+ <title>Customize e-mail templates</title>
+ <para>
+ The email templates can be found in the folder: <emphasis>portal-identity.sar/conf/templates/</emphasis>
+ </para>
+ <para>
+ New languages can be added by creating a new file like: <emphasis>emailTemplate_fr.tpl</emphasis>
+ </para>
+ </section>
+ </section>
+ <section id="identity_portlet_configuration_ui_components">
+ <title>User interface customization</title>
+ <para>
+ The following three examples describe common use cases for customizing the User Portlet.
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">Example 1:</emphasis>
+ Describes how to tag a input field as required
+ and add it to the registration page.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">Example 2:</emphasis>
+ Shows how to create a simple dropdown menu.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">Example 3:</emphasis>
+ Describes how to add new properties.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <note>
+ <title>Note</title><para>This is not a JavaServer Faces tutorial. Basic knowledge of
+ this technology is a precondition for customizing the User
+ Portlet Interface.</para>
+ </note>
+ <section id="identity_portlet_configuration_example1">
+ <title>Example 1: required fields</title>
+ <para>
+ This example explains how to change optional properties to
+ required properties, of course once this is done, we will also need to
+ add the corresponding fields in the registration page.
+ <!-- sbr/ -->
+ Here are the modifications in <emphasis>portal-identity.sar/conf/identity-ui-configuration.xml</emphasis>,
+ we simply changed the required element to true on our two fields corresponding to the given and family names.
+ </para>
+ <programlisting><![CDATA[<identity-ui-configuration>
+...
+ <!-- user interface components -->
+ ...
+ <ui-component name="givenname">
+ <property-ref>user.name.given</property-ref>
+ <required>true</required>
+ </ui-component>
+ <ui-component name="familyname">
+ <property-ref>user.name.family</property-ref>
+ <required>true</required>
+ </ui-component>
+ ...
+</identity-ui-configuration>]]></programlisting>
+ <para>
+ Now that we changed those values to "required" we need to give a chance to the user to enter those
+ values, here are the changes done in <emphasis>portal-identity.sar/portal-identity.war/WEB-INF/jsf/common/register.xhtml</emphasis>
+ </para>
+ <programlisting><![CDATA[
+...
+ <h:outputText value="#{bundle.IDENTITY_GIVENNAME}"/>
+ <h:inputText id="givenname" value="#{manager.uiUser.attribute.givenname}"
+ required="#{metadataservice.givenname.required}"/>
+ <h:panelGroup />
+ <h:message for="givenname" />
+
+ <h:outputText value="#{bundle.IDENTITY_FAMILYNAME}"/>
+ <h:inputText id="lastname" value="#{manager.uiUser.attribute.familyname}"
+ required="#{metadataservice.familyname.required}"/>
+ <h:panelGroup />
+ <h:message for="lastname"/>
+...]]></programlisting>
+ <para>
+ That's it - from now on the given name and family name will be
+ required on registration.
+ We dynamically obtain the values from the descriptor. Now if i just wanted to make them back to optional,
+ i would change the values only in the descriptor, letting the user enter or not those values.
+ </para>
+ </section>
+ <section id="identity_portlet_configuration_example2">
+ <title>
+ Example 2: dynamic values (dropdown menu with predefined values)
+ </title>
+ <para>
+ If the data to enter is a choice instead of a free-text value, you can also define those
+ in the descriptor like shown here:
+ </para>
+ <programlisting><![CDATA[<identity-ui-configuration>
+...
+ <!-- user interface components -->
+ ...
+ <ui-component name="interests">
+ <property-ref>portal.user.interests</property-ref>
+ <values>
+ <value key="board">snowboarding</value>
+ <value key="ski">skiing</value>
+ <value key="sledge">sledging</value>
+ </values>
+ </ui-component>
+ ...
+</identity-ui-configuration>]]></programlisting>
+ <para>
+ <emphasis>
+ In portal-identity.sar/portal-identity.war/WEB-INF/jsf/common/profile.xhtml
+ </emphasis>
+ - change inputText to a selectOneMenu:
+ </para>
+ <programlisting><![CDATA[
+ ...
+ <h:outputText value="#{bundle.IDENTITY_INTERESTS}"/>
+ <h:selectOneMenu id="interests" value="#{manager.uiUser.attribute.interests}"
+ required="#{metadataservice.interests.required}">
+ <f:selectItems value="#{metadataservice.interests.values}" />
+ </h.selectOneMenu>
+ <h:panelGroup />
+ <h:message for="interests"/>
+...
+]]></programlisting>
+ <para>
+ For localizing dynamic values it is also possible to use the resource bundle.
+ This can be done by adding the key with a prefix (to i.e. <emphasis>Identity.properties</emphasis>) like in the following listing.
+ The key will be stored in the users property and is used to identify the element. The value of the configuration file will only be used if no localization information is found.
+ </para>
+ <programlisting><![CDATA[
+...
+IDENTITY_DYNAMIC_VALUE_BOARD=localized snowboarding
+IDENTITY_DYNAMIC_VALUE_SKI=localized skiing
+IDENTITY_DYNAMIC_VALUE_SLEDGE=localized sledging
+...
+]]></programlisting>
+ <note>
+ <para>If the value is not required a blank element will be
+ added at the top.</para>
+ </note>
+ </section>
+ <section id="identity_portlet_configuration_example3">
+ <title>Example 3: adding new properties</title>
+ <note>
+ <title>Note</title><para>Please make sure you read at least the section about
+ user profile configuration: <xref linkend="user_profile_configuration"/>, to add a new value on
+ the interface it also has to be defined in your model, as shown on Step 1.</para>
+ </note>
+ <para>
+ <emphasis role="bold">step 1:</emphasis>
+ add a new property to <emphasis>profile-config.xml</emphasis> e.g. a dynamic property called gender:
+ </para>
+ <programlisting><![CDATA[
+...
+ <property>
+ <name>user.gender</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Gender</display-name>
+ <description xml:lang="en">The gender</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>user.gender</value>
+ </database>
+ </mapping>
+ </property>
+...
+]]></programlisting>
+ <note>
+ <title>Note</title><para>It is recommended to use the 'User Information Attribute Names' from the <ulink url="http://jcp.org/en/jsr/detail?id=168">Portlet Specification</ulink> for defining properties.</para>
+ </note>
+ <para>
+ <emphasis role="bold">step 2:</emphasis>
+ add the property to the identity-ui-configuration: (<emphasis>portal-identity.sar/conf/identity-ui-configuration.xml</emphasis>)
+ </para>
+ <programlisting><![CDATA[
+...
+ <ui-component name="gender">
+ <property-ref>user.gender</property-ref>
+ <required>true</required>
+ <values>
+ <value key="male">Male</value>
+ <value key="female">Female</value>
+ </values>
+ </ui-component>
+...
+]]></programlisting>
+ <note>
+ <title>Note</title><para>The property-ref must match a property from the
+ <emphasis>profile-config.xml</emphasis>.</para>
+ </note>
+ <para>
+ <emphasis role="bold">step 3:</emphasis>
+ add your custom ui-component to the profile page: (<emphasis>portal-identity.sar/portal-identity.war/WEB-INF/jsf/profile.xhtml</emphasis>)
+ </para>
+ <programlisting><![CDATA[
+...
+ <h:outputText value="#{bundle.IDENTITY_GENDER}"/>
+ <h:selectOneMenu id="gender" value="#{manager.uiUser.attribute.gender}"
+ required="#{metadataservice.gender.required}">
+ <f:selectItems value="#{metadataservice.gender.values}" />
+ </h.selectOneMenu>
+ <h:panelGroup />
+ <h:message for="gender"/>
+...
+]]></programlisting>
+
+<note><title>Note</title><para>Don't forget to add the localization elements.</para></note>
+
+</section>
+ <section>
+ <title>Illustration</title>
+ <para>
+
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/identityportlets/illustration.png" scalefit="1"/>
+ </imageobject>
+
+ </mediaobject>
+ <para>
+ Illustration of the relationship between the
+ configuration files.
+ </para>
+ <para>
+ The JSF-View in more detail:
+<itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold"> manager.uiUser.attribute:</emphasis>
+ manages and stores the dynamic properties
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">examples:</emphasis> <emphasis>manager.uiUser.attribute.gender</emphasis>,
+ <emphasis>manager.uiUser.attribute.interests</emphasis>
+ <programlisting><![CDATA[<h:inputText id="gender" value="#{manager.uiUser.attribute.gender}" />]]></programlisting>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ metadataservice
+ </emphasis>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ required
+ </emphasis>
+ - references the required attribute from the ui-component<!-- sbr/ -->
+ example: <emphasis>metadataservice.gender.required</emphasis>
+ <programlisting><![CDATA[<h:inputText id="gender" value="#{manager.uiUser.attribute.gender}" required="#{metadataservice.gender.required}"/>]]></programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ values
+ </emphasis>
+ - references the values list from the ui-component<!-- sbr/ -->
+ example: <emphasis>metadataservice.gender.values</emphasis>
+ <programlisting><![CDATA[<h:selectOneMenu id="interests" value="#{manager.uiUser.attribute.interests}">
+ <f:selectItems value="#{metadataservice.interests.values}" />
+</h:selectOneMenu>]]></programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ validator
+ </emphasis>
+ - references the name of a registered JSF validator<!-- sbr/ -->
+ example:<emphasis>metadataservice.gender.validator</emphasis>
+ - the first validator of the validator list<!-- sbr/ -->
+ example: <emphasis>metadataservice.gender.validators[0]</emphasis>
+ - the validator list with an index<!-- sbr/ -->
+ <programlisting><![CDATA[<f:validator validatorId="#{metadataservice.gender.validator}"/>]]></programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ converter
+ </emphasis>
+ - references the name of a registered JSF converter<!-- sbr/ -->
+ example: <emphasis>metadataservice.gender.converter</emphasis>
+ <programlisting><![CDATA[<f:converter converterId="#{metadataservice.gender.converter}"/>]]></programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ readOnly
+ </emphasis>
+ - references the access-mode of <emphasis>profile-config.xml</emphasis><!-- sbr/ -->
+ possible usage i.e. in <emphasis>/WEB-INF/jsf/common/profile.xhtml</emphasis>
+ <programlisting><![CDATA[<h:inputText value="#{manager.uiUser.attribute.nickname}" disabled="#{metadataservice.nickname.readOnly}" />]]></programlisting>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <warning>
+ <para>The values of the profile-config.xml have a higher
+ priority than the values in the user portlet
+ configuration. That means if the 'usage' is 'mandatory'
+ in <emphasis>profile-config.xml</emphasis>
+ and 'required' is 'false' it will be overwritten by the
+ value from the profile config!</para>
+ </warning>
+ </section>
+ <section>
+ <title>Customizing the View Profile page</title>
+ <para>
+ By default not all values of the user profile will be displayed on the <emphasis>View profile</emphasis> page. For customization it is possible
+ to add further properties to the page by editing the file: <emphasis>portal-identity.sar/portal-identity.war/WEB-INF/jsf/profile/viewProfile.xhtml</emphasis>
+ </para>
+ </section>
+ </section>
+ <section>
+ <title>Customizing the workflow</title>
+ <note><para>For more details about jBPM please read the <ulink url="http://docs.jboss.com/jbpm/v3/userguide/index.html">jBPM documentation</ulink></para></note>
+ <para>
+ The process definitions are located in:
+ <emphasis>portal-identity.sar/conf/processes</emphasis>. To create a custom workflow, you can extend the existing process description file: <emphasis>custom.xml</emphasis>.
+ </para>
+ <para>
+ Available variables in the business process:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">name:</emphasis>
+ portalURL
+ <!-- sbr/ -->
+ <emphasis role="bold">type:</emphasis>
+ <emphasis>java.lang.String</emphasis>
+ <!-- sbr/ -->
+ <emphasis role="bold">description:</emphasis>
+ represents the full url of the portal e.g.
+ <emphasis>
+ http://localhost:8080/portal
+ </emphasis>
+ <!-- sbr/ -->
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">name:</emphasis>
+ locale
+ <!-- sbr/ -->
+ <emphasis role="bold">type:</emphasis>
+ <emphasis>java.util.Locale</emphasis>
+ <!-- sbr/ -->
+ <emphasis role="bold">description:</emphasis>
+ the requested locale at registration
+ <!-- sbr/ -->
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">name:</emphasis>
+ email
+ <!-- sbr/ -->
+ <emphasis role="bold">type:</emphasis>
+ <emphasis>java.lang.String</emphasis>
+ <!-- sbr/ -->
+ <emphasis role="bold">description:</emphasis>
+ the e-mail address of the user in case of registration.<!-- sbr/ -->
+ In case of changing the e-mail the new e-mail address.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">name:</emphasis>
+ user
+ <!-- sbr/ -->
+ <emphasis role="bold">type:</emphasis>
+ <emphasis>
+ org.jboss.portal.core.identity.services.workflow.UserContainer
+ </emphasis>
+ <!-- sbr/ -->
+ <emphasis role="bold">description:</emphasis>
+ Seralizable Object containing user information through the jBPM process <!-- sbr/ -->
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">name:</emphasis>
+ validationHash
+ <!-- sbr/ -->
+ <emphasis role="bold">type:</emphasis>
+ <emphasis>java.lang.String</emphasis>
+ <!-- sbr/ -->
+ <emphasis role="bold">description:</emphasis>
+ hash used for the validation part. Only available after executing SendValidationEmailAction<!-- sbr/ -->
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <note><title>Note</title><para>
+ Make sure that the filename and the process name match! e.g.
+ <emphasis>conf/processes/custom.xml</emphasis>
+ and process-definition name="custom".</para>
+ </note>
+ <para>
+ When using a custom workflow it is possible to customize the
+ status message after registering in the locale bundle: ( e.g.
+ <emphasis>portal-identity.sar/conf/bundles/Identity.properties</emphasis>)
+ </para>
+ <programlisting><![CDATA[
+
+IDENTITY_VERIFICATION_STATUS_REGISTER_CUSTOM=Customized message here
+
+]]></programlisting>
+ <section>
+ <title>Duration of process validity</title>
+ <para>
+ By default requests (e.g. e-mail validation and registrations) expire after some time in the validation state.
+ Therefore it is not required to add additional maintenance mechanism to invalidate a request. The default expiration time is 2 days,
+ but is quite easy to change the timing by editing the <emphasis>duedate</emphasis> attribute in the process definition.
+ changes in: <emphasis>portal-identity.sar/conf/processes/*.xml</emphasis>
+ </para>
+ <programlisting><![CDATA[<process-definition>
+...
+ <state name="validate_email">
+ <timer name="time_to_expire" duedate="2 days" transition="timedOut" />
+ </state>
+...
+</process-definition>]]></programlisting>
+
+ <para>
+ For further information take a look at the <ulink url="http://docs.jboss.com/jbpm/v3/userguide/index.html">jBPM documentation</ulink> on <emphasis>Duration</emphasis>.
+ </para>
+ </section>
+</section>
+ <section>
+ <title>Disabling the Identity Portlets</title>
+ <para>
+ Due to the fact that the former user portlets are still
+ included in JBoss Portal 2.6.2 it is possible to activate
+ it in the Portal Admin interface, by using the PortletInstances:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>UserPortletInstance:</emphasis> The former user portlet</para>
+ </listitem>
+ <listitem><para>
+ <emphasis>RolePortletInstance:</emphasis> The former role managment portlet</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <section>
+ <title>Enabling the Identity Portlets</title>
+ <para>
+ When migrating from former versions of JBoss Portal the Identity User Portlets won't be displayed by default,
+ but windows can be created on basis of the existing Portlet Instances which are deployed by default. (The instances
+ names being <literal>IdentityUserPortletInstance</literal> and <literal>IdentityAdminPortletInstance</literal>.)
+ </para>
+ </section>
+ </section>
+</chapter>
+ <chapter id="authentication">
+ <!-- <chapterinfo>
+ <author>
+ <firstname>Boleslaw</firstname>
+ <surname>Dawidowicz</surname>
+ </author>
+ </chapterinfo>-->
+ <title>Authentication and Authorization</title>
+ <para>This chapter describes the authentication mechanisms in JBoss Portal</para>
+ <section id="authentication_in_portal">
+ <title>Authentication in JBoss Portal</title>
+ <para>JBoss Portal is heavily standard based so it leverages <emphasis>Java Authentication and Authorization Service (JAAS)</emphasis>
+ in JBoss Application Server. Because of this it can be configured in a very flexible manner and other
+ authentication solutions can be plugged in easily.
+ To better understand authentication mechanisms in JBoss Portal please refer to
+ <xref linkend="security.security_authentication"/>.
+ To learn more about JAAS look for proper documentation on
+ <ulink url="http://java.sun.com/javase/6/docs/technotes/guides/security/">Java Security</ulink> website.
+ To learn more about security in JBoss Application Server please read
+ <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossSX">JBossSX</ulink> documentation.
+ </para>
+ <section id="authentication_configuration">
+ <title>Configuration</title>
+ <para>You can configure the JAAS authentication stack in <emphasis>jboss-portal.sar/conf/login-config.xml</emphasis>.
+ It is important to remember that authorization in portal starts at the JAAS level -
+ configured <emphasis>LoginModule</emphasis>s apply proper <emphasis>Principal</emphasis> objects representing
+ the roles of authenticated user. As you can see in <emphasis>jboss-portal.sar/portal-server.war/WEB-INF/web.xml</emphasis> portal
+ servlet is secured with specified role ("<emphasis>Authenticated</emphasis>"). In the default portal configuration
+ this role is dynamically added by <emphasis>IdentityLoginModule</emphasis>. If you reconfigure the default JAAS authentication
+ chain with other <emphasis>LoginModule</emphasis> implementations, you should remember that you must deal with that
+ security constraints in order to be able to access portal. For example if you place only one <emphasis>LoginModule</emphasis>
+ that will authenticate users against LDAP server you may consider adding all users in your LDAP tree to such role.
+ </para>
+ </section>
+ </section>
+ <section id="portal_login_modules">
+ <title>JAAS Login Modules</title>
+ <para>JBoss Portal comes with a few implementations of JAAS <emphasis>LoginModule</emphasis> interface</para>
+ <section>
+ <title>org.jboss.portal.identity.auth.IdentityLoginModule</title>
+ <para>This is the standard portal LoginModule implementation that uses portal identity modules in order to search users and roles.
+ By default it is the only configured LoginModule in the portal authentication stack. Its behavior can be altered with the following options:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis role="bold">userModuleJNDIName</emphasis> - JNDI name of portal UserModule.</para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">roleModuleJNDIName</emphasis> - JNDI name of portal RoleModule.</para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">membershipModuleJNDIName</emphasis> - JNDI name of portal MembershipModule.</para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">additionalRole</emphasis> - additional user <emphasis>Principal</emphasis> that will be added to user <emphasis>Subject</emphasis>.
+ This is important as in default portal configuration it is the role that portal servlet is secured with.</para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">havingRole</emphasis> - only users belonging to role specified with this option will be authenticated.</para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">unauthenticatedIdentity</emphasis> - the principal to use when a null username and password are seen.</para>
+ </listitem>
+ </itemizedlist>
+ <note><title>Note</title><para>IdentityLoginModule extends org.jboss.security.auth.spi.UsernamePasswordLoginModule so if you are familiar with JBossSX you can apply
+ few other options like "password-stacking". Please refer to JBossSX documentation.</para></note>
+ </para>
+ </section>
+ <section>
+ <title>org.jboss.portal.identity.auth.DBIdentityLoginModule</title>
+ <para>This <emphasis>LoginModule</emphasis> implementation extends JBossSX <emphasis>org.jboss.security.auth.spi.DatabaseServerLoginModule</emphasis> and can be
+ used to authenticate against Database. The main purpose of this module is to be configured directly against portal database (instead of using portal identity
+ modules like in IdentityLoginModule). So if you are using custom LoginModule implementation you can place this module with "sufficient" flag. This can
+ be extremely useful. For example if you authenticate against LDAP server using JBossSX <emphasis>LdapLoginModule</emphasis> you can
+ fallback to users present in portal database and not present in LDAP like "admin" user. Please look into
+ <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=DatabaseServerLoginModule">this</ulink> wiki page to learn more about
+ <emphasis>DatabaseServerLoginModule</emphasis> configuration</para>
+ <para>
+ Options are:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis role="bold">dsJndiName</emphasis> - The name of the DataSource of the database containing the Principals and Roles tables</para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">principalsQuery</emphasis> - The prepared statement query, equivalent to: <emphasis>"select Password from Principals where PrincipalID=?"</emphasis></para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">rolesQuery</emphasis> - The prepared statement query, equivalent to: <emphasis>"select Role, RoleGroup from Roles where PrincipalID=?"</emphasis></para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">hashAlgorithm</emphasis> - The name of the <emphasis>java.security.MessageDigest</emphasis> algorithm to use to hash the password.
+ There is no default so this option must be specified to enable hashing. When hashAlgorithm is specified, the clear text password obtained from the <emphasis>CallbackHandler</emphasis>
+ is hashed before it is passed to UsernamePasswordLoginModule.validatePassword as the inputPassword argument. The expectedPassword as stored in the users.properties
+ file must be comparably hashed.</para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">hashEncoding</emphasis> - The string format for the hashed pass and st be either "base64" or "hex". Base64 is the default.</para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">additionalRole</emphasis> - additional user <emphasis>Principal</emphasis> that will be added to user <emphasis>Subject</emphasis>.</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Configuration using portal database will look like this:
+ <programlisting>
+ <![CDATA[
+<login-module code = "org.jboss.portal.identity.auth.DBIdentityLoginModule"
+ flag="sufficient">
+ <module-option name="dsJndiName">java:/PortalDS</module-option>
+ <module-option name="principalsQuery">
+ SELECT jbp_password FROM jbp_users WHERE jbp_uname=?
+ </module-option/>
+ <module-option name="rolesQuery">
+ SELECT jbp_roles.jbp_name, 'Roles' FROM jbp_role_membership INNER JOIN
+ jbp_roles ON jbp_role_membership.jbp_rid = jbp_roles.jbp_rid INNER JOIN jbp_users ON
+ jbp_role_membership.jbp_uid = jbp_users.jbp_uid WHERE jbp_users.jbp_uname=?
+ </module-option>
+ <module-option name="hashAlgorithm">MD5</module-option>
+ <module-option name="hashEncoding">HEX</module-option>
+ <module-option name="additionalRole">Authenticated</module-option>
+</login-module>
+ ]]>
+ </programlisting>
+
+ <note><title>Note</title><para>SQL query should be in single line. This code snipped was formatted like this only to fit documentation page.</para></note>
+ </para>
+ </section>
+ <section>
+ <title>org.jboss.portal.identity.auth.SynchronizingLdapLoginModule</title>
+ <para>
+ This module can be used instead of the IdentityLoginModule to bind to LDAP.
+ <emphasis>org.jboss.portal.identity.auth.SynchronizingLDAPLoginModule</emphasis> class is a wrapper around
+ <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=LdapLoginModule">LdapLoginModule</ulink> from JBossSX.
+ It extends it so all configuration that can be applied to <emphasis>LdapExtLoginModule</emphasis> remains valid here. For a user that
+ was authenticated successfully it will try to call the identity modules from portal, then check if such user
+ exists or not, and if does not exist it will try to create it. Then for all roles assigned to this authenticated principal it will
+ try to check and create them using identity modules. This behavior can be altered using following options:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis role="bold">userModuleJNDIName</emphasis> - JNDI name of portal UserModule. This option is <emphasis>obligatory</emphasis>
+ if <emphasis>synchronizeIdentity</emphasis> option is set to <emphasis>true</emphasis></para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">roleModuleJNDIName</emphasis> - JNDI name of portal RoleModule. This option is <emphasis>obligatory</emphasis>
+ if <emphasis>synchronizeIdentity</emphasis> and <emphasis>synchronizeRoles</emphasis> options are set to <emphasis>true</emphasis></para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">membershipModuleJNDIName</emphasis> - JNDI name of portal MembershipModule. This option is <emphasis>obligatory</emphasis>
+ if <emphasis>synchronizeIdentity</emphasis> and <emphasis>synchronizeRoles</emphasis> options are set to <emphasis>true</emphasis></para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">userProfileModuleJNDIName</emphasis> - JNDI name of portal UserProfileModule. This option is <emphasis>obligatory</emphasis>
+ if <emphasis>synchronizeIdentity</emphasis> option is set to <emphasis>true</emphasis></para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">synchronizeIdentity</emphasis> - if set to <emphasis>true</emphasis> module will check if
+ successfully authenticated user exist in portal and if not it will try to create it. If user exists module will update its password
+ to the one that was just validated.</para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">synchronizeRoles</emphasis> - if set to <emphasis>true</emphasis> module will iterate over all roles assigned to
+ authenticated user and for each it will try to check if such role exists in portal and if not it will try to create it. This option is
+ checked only if <emphasis>synchronizeIdentity</emphasis> is set to true;</para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">additionalRole</emphasis> - module will add this role name to the group of principals assigned to the authenticated user.</para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">defaultAssignedRole</emphasis> - if <emphasis>synchronizeIdentity</emphasis> is set to true, module will try to assign
+ portal role with such name to the authenticated user. If such role doesn't exist in portal, module will try to create it. </para>
+ </listitem>
+ </itemizedlist>
+ For obvious reasons this is designed to use with portal identity modules configured with DB and not LDAP</para>
+ </section>
+ <section>
+ <title>org.jboss.portal.identity.auth.SynchronizingLdapExtLoginModule</title>
+ <para>All options that apply for <emphasis>SynchronizingLdapLoginModule</emphasis> also apply here. It's the same kind of wrapper
+ made around <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=LdapExtLoginModule">LdapExtLoginModule</ulink> from JBossSX.
+ Sample configuration can look like this:</para>
+ <programlisting><![CDATA[
+ <login-module code="org.jboss.portal.identity.auth.SynchronizingLDAPExtLoginModule"
+ flag="required">
+ <module-option name="synchronizeIdentity">true</module-option>
+ <module-option name="synchronizeRoles">true</module-option>
+ <module-option name="additionalRole">Authenticated</module-option>
+ <module-option name="defaultAssignedRole">User</module-option>
+ <module-option name="userModuleJNDIName">java:/portal/UserModule</module-option>
+ <module-option name="roleModuleJNDIName">java:/portal/RoleModule</module-option>
+ <module-option name="membershipModuleJNDIName">java:/portal/MembershipModule
+ </module-option>
+ <module-option name="userProfileModuleJNDIName">java:/portal/UserProfileModule
+ </module-option>
+ <module-option name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory
+ </module-option>
+ <module-option name="java.naming.provider.url">ldap://example.com:10389/
+ </module-option>
+ <module-option name="java.naming.security.authentication">simple</module-option>
+ <module-option name="bindDN">cn=Directory Manager</module-option>
+ <module-option name="bindCredential">secret</module-option>
+ <module-option name="baseCtxDN">ou=People,dc=example,dc=com</module-option>
+ <module-option name="baseFilter">(uid={0})</module-option>
+ <module-option name="rolesCtxDN">ou=Roles,dc=example,dc=com</module-option>
+ <module-option name="roleFilter">(member={1})</module-option>
+ <module-option name="roleAttributeID">cn</module-option>
+ <module-option name="roleRecursion">-1</module-option>
+ <module-option name="searchTimeLimit">10000</module-option>
+ <module-option name="searchScope">SUBTREE_SCOPE</module-option>
+ <module-option name="allowEmptyPasswords">false</module-option>
+</login-module>]]>
+ </programlisting>
+ </section>
+ <section id="authentication.synchronizing_login_module">
+ <title>org.jboss.portal.identity.auth.SynchronizingLoginModule</title>
+ <para>
+ This module is designed to provide synchronization support for any other LoginModule placed in the authentication stack.
+ It leverages the fact that in JAAS authentication process occurs in two phases. In first phase when login() method is invoked
+ it always returns "true". Because of this behavior <emphasis>SynchronizingLoginModule</emphasis> should be always used with
+ "optional" flag.
+ More over it should be placed after the module we want to leverage as a source for synchronization and that module should have "required" flag set.
+ During the second phase when commit() method is invoked it gets user <emphasis>Subject</emphasis> and its <emphasis>Principal</emphasis>s
+ and tries to synchronize them into storage configured for portal identity modules. For this purposes such options are supported:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis role="bold">userModuleJNDIName</emphasis> - JNDI name of portal UserModule. This option is <emphasis>obligatory</emphasis>
+ if <emphasis>synchronizeIdentity</emphasis> option is set to <emphasis>true</emphasis></para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">roleModuleJNDIName</emphasis> - JNDI name of portal RoleModule. This option is <emphasis>obligatory</emphasis>
+ if <emphasis>synchronizeIdentity</emphasis> and <emphasis>synchronizeRoles</emphasis> options are set to <emphasis>true</emphasis></para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">membershipModuleJNDIName</emphasis> - JNDI name of portal MembershipModule. This option is <emphasis>obligatory</emphasis>
+ if <emphasis>synchronizeIdentity</emphasis> and <emphasis>synchronizeRoles</emphasis> options are set to <emphasis>true</emphasis></para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">userProfileModuleJNDIName</emphasis> - JNDI name of portal UserProfileModule. This option is <emphasis>obligatory</emphasis>
+ if <emphasis>synchronizeIdentity</emphasis> option is set to <emphasis>true</emphasis></para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">synchronizeIdentity</emphasis> - if set to <emphasis>true</emphasis> module will check if
+ successfully authenticated user exist in portal and if not it will try to create it. If user exists module will update its password
+ to the one that was just validated.</para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">synchronizeRoles</emphasis> - if set to <emphasis>true</emphasis> module will iterate over all roles assigned to
+ authenticated user and for each it will try to check if such role exists in portal and if not it will try to create it. This option is
+ checked only if <emphasis>synchronizeIdentity</emphasis> is set to true;</para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">additionalRole</emphasis> - module will add this role name to the group of principals assigned to the authenticated user.</para>
+ </listitem>
+ <listitem><para>
+ <emphasis role="bold">defaultAssignedRole</emphasis> - if <emphasis>synchronizeIdentity</emphasis> is set to true, module will try to assign
+ portal role with such name to the authenticated user. If such role doesn't exist in portal, module will try to create it.</para>
+ </listitem>
+ </itemizedlist>
+ <note><title>Note</title><para>Example of usage in LDAP authentication can be found in <xref linkend="ldap.synchronizing"/>.</para></note>
+ </para>
+ </section>
+ </section>
+</chapter>
+ <chapter id="ldap">
+<!-- <chapterinfo>
+ <author>
+ <firstname>Boleslaw</firstname>
+ <surname>Dawidowicz</surname>
+ </author>
+ </chapterinfo>-->
+ <title>LDAP</title>
+ <para>This chapter describes how to setup LDAP support in JBoss Portal</para>
+ <note><title>Note</title>
+ <para>To be able to fully understand this chapter you should also read <xref linkend="identity"/> and
+ <xref linkend="authentication"/> before. </para></note>
+ <section>
+ <title>How to enable LDAP usage in JBoss Portal</title>
+ <para>We'll describe here the simple steps that you will need to perform to enable LDAP support in JBoss Portal.
+ For additional information you need to read more about configuration of identity and specific implementations of identity modules</para>
+ <para>There are two ways to achieve this:</para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">jboss-portal.sar/META-INF/jboss-service.xml</emphasis>
+ in section:
+ </para>
+ <programlisting><![CDATA[
+<mbean
+ code="org.jboss.portal.identity.IdentityServiceControllerImpl"
+ name="portal:service=Module,type=IdentityServiceController"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends>portal:service=Hibernate</depends>
+ <attribute name="JndiName">java:/portal/IdentityServiceController</attribute>
+ <attribute name="RegisterMBeans">true</attribute>
+ <attribute name="ConfigFile">conf/identity/identity-config.xml</attribute>
+ <attribute name="DefaultConfigFile">conf/identity/standardidentity-config.xml</attribute>
+</mbean>]]></programlisting>
+ <para>
+ change
+ <emphasis role="bold">identity-config.xml</emphasis>
+ to
+ <emphasis role="bold">ldap_identity-config.xml</emphasis>
+ </para>
+ </listitem>
+ <listitem>
+ <para>Swap the names or content of files in
+ <emphasis role="bold">jboss-portal.sar/conf/identity/identity-config.xml</emphasis>
+ and
+ <emphasis role="bold">jboss-portal.sar/conf/identity/ldap_identity-config.xml</emphasis>
+
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ After doing one of the above changes you need to edit configuration file that you choose to
+ use (identity-config.xml or ldap_identity-config.xml) and configure LDAP connection options in section:
+ </para>
+ <programlisting><![CDATA[
+<datasource>
+ <name>LDAP</name>
+ <config>
+ <option>
+ <name>host</name>
+ <value>jboss.com</value>
+ </option>
+ <option>
+ <name>port</name>
+ <value>10389</value>
+ </option>
+ <option>
+ <name>adminDN</name>
+ <value>cn=Directory Manager</value>
+ </option>
+ <option>
+ <name>adminPassword</name>
+ <value>qpq123qpq</value>
+ </option>
+ </config>
+</datasource>]]></programlisting>
+ <para>
+ You also need to specify options for your LDAP tree (described in configuration documentation) like those:
+ </para>
+ <programlisting><![CDATA[
+<option-group>
+ <group-name>common</group-name>
+ <option>
+ <name>userCtxDN</name>
+ <value>ou=People,dc=portal26,dc=jboss,dc=com</value>
+ </option>
+ <option>
+ <name>roleCtxDN</name>
+ <value>ou=Roles,dc=portal26,dc=jboss,dc=com</value>
+ </option>
+</option-group>]]></programlisting>
+
+ <note><title>Note</title><para>
+ Under <emphasis role="bold">PORTAL_SOURCES/identity/src/resources/example/</emphasis> you can find a sample ldif that
+ you can use to populate LDAP server and quickly start playing with it.</para>
+ </note>
+
+ </section>
+ <section>
+ <title>Configuration of LDAP connection</title>
+ <section>
+ <title>Connection Pooling</title>
+ <para>JBoss Portal uses <ulink url="http://java.sun.com/products/jndi/tutorial/ldap/connect/pool.html">connection pooling</ulink> provided by <ulink url="http://java.sun.com/products/jndi/">JNDI</ulink>, and is enabled by default. Use the following options to configure connection pooling settings:</para>
+ <programlisting><![CDATA[
+<datasource>
+ <name>LDAP</name>
+ <config>
+ ...
+ <!-- com.sun.jndi.ldap.connect.pool -->
+ <option>
+ <name>pooling</name>
+ <value>true</value>
+ </option>
+
+ <!-- com.sun.jndi.ldap.connect.pool.protocol -->
+ <option>
+ <name>poolingProtocol</name>
+ <value>plain ssl</value>
+ </option>
+
+ <!-- com.sun.jndi.ldap.connect.pool.timeout -->
+ <option>
+ <name>poolingTimeout</name>
+ <value>300000</value>
+ </option>
+
+ <!-- com.sun.jndi.ldap.connect.pool.debug -->
+ <option>
+ <name>pooling</name>
+ <value> ... </value>
+ </option>
+
+ <!-- com.sun.jndi.ldap.connect.pool.initsize -->
+ <option>
+ <name>poolingInitsize</name>
+ <value> ... </value>
+ </option>
+
+ <!-- com.sun.jndi.ldap.connect.pool.maxsize -->
+ <option>
+ <name>poolingMaxsize</name>
+ <value> ... </value>
+ </option>
+
+ <!-- com.sun.jndi.ldap.connect.pool.prefsize -->
+ <option>
+ <name>poolingPrefsize</name>
+ <value> ... </value>
+ </option>
+
+ ...
+ </config>
+</datasource>]]></programlisting>
+ <para>
+ Remember, as it is described in the <ulink url="http://java.sun.com/products/jndi/tutorial/ldap/connect/config.html">JNDI documentation</ulink>, these options are system properties, not environment properties, and as such, they affect all connection pooling requests in the <trademark class="trade">Java runtime environment</trademark>.
+ </para>
+
+ </section>
+ <section>
+ <title>SSL</title>
+ <para>The setup is very similar to the one described in LdapLoginModule <ulink url="http://www.jboss.org/wiki/Wiki.jsp?page=LdapLoginModule">wiki page</ulink></para>
+ <para>You need to modify your identity configuration file and add "protocol"</para>
+ <programlisting><![CDATA[
+<datasource>
+ <name>LDAP</name>
+ <config>
+ ...
+ <option>
+ <name>protocol</name>
+ <value>ssl</value>
+ </option>
+ ...
+ </config>
+</datasource>]]></programlisting>
+ <para>
+ Then you need to have LDAP server certificate imported into your keystore. You can use following command:
+ <programlisting>keytool -import -file ldapcert.der -keystore ldap.truststore</programlisting>
+ </para>
+ <para>
+ Now you need to change the settings to use the alternative truststore. That can be done in the properties-service.xml in deploy directory:
+ <programlisting><![CDATA[
+<attribute name="Properties">
+ javax.net.ssl.trustStore=../some/path/to/ldap.truststore
+ javax.net.ssl.trustStorePassword=somepw
+</attribute>]]></programlisting>
+ </para>
+ </section>
+ <section>
+ <title>ExternalContext</title>
+ <para>Instead of configuring your own connection you can use JNDI context federation mechanism in JBoss Application Server. Configuration of
+ ExternalContext is described in <ulink url="http://docs.jboss.com/jbossas/guides/j2eeguide/r2/en/html_single/#d0e6877">JBoss Application Server documentation</ulink></para>
+ <para>When you have ExternalContext configured you can use it in JBoss Portal by providing proper JNDI name in the configuration:
+ <programlisting><![CDATA[
+<datasource>
+ <name>LDAP</name>
+ <config>
+ <option>
+ <name>externalContextJndiName</name>
+ <value>external/ldap/jboss</value>
+ </option>
+ </config>
+</datasource>]]></programlisting>
+<note><title>Note</title><para>When using "externalContextJndiName" you don't need to specify any other option for this datasource</para></note>
+ </para>
+ </section>
+ </section>
+ <section id="ldap.ldap_identity_modules">
+ <title>LDAP Identity Modules</title>
+ <para>JBoss Portal comes with base LDAP implementation of all identity modules.</para>
+ <section>
+ <title>Common settings</title>
+ <para>For all modules you can set two config options:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis role="bold">jNDIName</emphasis> - JNDI name under which this module will be registered</para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">connectionJNDIName</emphasis> - JNDI name under which LDAP datasource is registered </para>
+ </listitem>
+ </itemizedlist>
+ <note><title>Note</title><para>Most configuration of LDAP identity modules is done in <emphasis>options</emphasis> section by adding module specific options
+ in <emphasis>"common"</emphasis> option-group or in other module specific groups.</para></note>
+ </para>
+ </section>
+ <section>
+ <title>UserModule</title>
+ <para>
+ <table frame="all">
+ <title>Comparision of UserModule implementations</title>
+ <tgroup cols="3" align="left" colsep="1">
+ <colspec colname="c1"/>
+ <colspec colname="c2"/>
+ <colspec colname="c3"/>
+ <thead>
+ <row>
+ <entry align="center" morerows="1">Features</entry>
+ <entry align="center" namest="c2" nameend="c3">UserModule</entry>
+ </row>
+ <row>
+ <entry align="center">LDAPUserModuleImpl</entry>
+ <entry align="center">LDAPExtUserModuleImpl</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>User creation</entry>
+ <entry align="center">X</entry>
+ <entry align="center">-</entry>
+ </row>
+ <row>
+ <entry>User removal</entry>
+ <entry align="center">X</entry>
+ <entry align="center">-</entry>
+ </row>
+ <row>
+ <entry>User search</entry>
+ <entry align="center">Flat - one level scope</entry>
+ <entry align="center">Flexible filter - sub tree scope</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </para>
+ <section>
+ <title>LDAPUserModuleImpl</title>
+ <para>This is the base implementation of LDAP <emphasis>UserModule</emphasis>. It supports user creation, but will retrieve users and create them
+ in strictly specified place in LDAP tree.</para>
+ <para>To enable it in your configuration you should have:
+ <programlisting><![CDATA[
+<module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>User</type>
+ <implementation>LDAP</implementation>
+ <config/>
+</module>]]></programlisting>
+ </para>
+ <para>org.jboss.portal.identity.ldap.LDAPUserModuleImpl configuration option-groups options:
+ </para>
+ <itemizedlist>
+ <listitem><para>
+ <emphasis role="bold">common</emphasis>:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis role="bold">userCtxDN</emphasis> - DN that will be used as context for user searches</para>
+ </listitem>
+ <listitem>
+ <para> <emphasis role="bold">uidAttributeID</emphasis> - attribute name under which user name is specified. Default value is "uid"</para>
+ </listitem>
+ <listitem>
+ <para> <emphasis role="bold">passwordAttributeID</emphasis> - attribute name under which user password is specified. Default value is "userPassword"</para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">principalDNPrefix</emphasis> and <emphasis role="bold">principalDNSuffix</emphasis></para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">searchTimeLimit</emphasis> - The timeout in milliseconds for the user searches. Defaults to 10000 (10 seconds).</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para> <emphasis role="bold">userCreateAttibutes</emphasis>: This option-group defines a set of ldap attributes that will be set on user entry creation.
+ Option name will be used as attribute name, and option values as attribute values. This enables to fulfill LDAP schema requirements.</para>
+ </listitem>
+ </itemizedlist>
+
+ <para> Example configuration:
+ <programlisting>
+ <![CDATA[
+<option-group>
+ <group-name>common</group-name>
+ <option>
+ <name>userCtxDN</name>
+ <value>ou=People,o=portal,dc=my-domain,dc=com</value>
+ </option>
+ <option>
+ <name>uidAttributeID</name>
+ <value>uid</value>
+ </option>
+ <option>
+ <name>passwordAttributeID</name>
+ <value>userPassword</value>
+ </option>
+</option-group>
+<option-group>
+ <group-name>userCreateAttibutes</group-name>
+ <option>
+ <name>objectClass</name>
+ <!--This objectclasses should work with Red Hat Directory-->
+ <value>top</value>
+ <value>person</value>
+ <value>inetOrgPerson</value>
+ </option>
+ <!--Schema requires those to have initial value-->
+ <option>
+ <name>cn</name>
+ <value>none</value>
+ </option>
+ <option>
+ <name>sn</name>
+ <value>none</value>
+ </option>
+</option-group>]]></programlisting>
+
+ </para>
+ </section>
+ <section>
+ <title>LDAPExtUserModuleImpl</title>
+ <para>Aim of this implementation is to give more flexibility for users retrieval. You can specify LDAP filter
+ that will be used for searches. This module doesn't support user creation and removal</para>
+ <para>To enable it in your configuration you should have:
+ <programlisting><![CDATA[
+<module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>User</type>
+ <implementation>LDAP</implementation>
+ <class>org.jboss.portal.identity.ldap.LDAPExtUserModuleImpl</class>
+ <config/>
+</module]]>
+ </programlisting>
+ </para>
+ <para>org.jboss.portal.identity.ldap.LDAPExtUserModuleImpl configuration option-groups options:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis role="bold">common</emphasis>:
+ <itemizedlist>
+ <listitem>
+ <para> <emphasis role="bold">userCtxDN</emphasis> - DN that will be used as context for user searches. More than one value can be specified.</para>
+ </listitem>
+ <listitem>
+ <para> <emphasis role="bold">userSearchFilter</emphasis> - ldap filter to search users with. {0} will be substitute with user name. Example filter can look like this:
+ "(uid={0})". This substituion behavior comes from the standard <emphasis>DirContext.search(Name, String, Object, SearchControls cons)</emphasis> method</para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">uidAttributeID</emphasis> - attribute name under which user name is specified. Default value is "uid"</para>
+ </listitem>
+ <listitem>
+ <para> <emphasis role="bold">searchTimeLimit</emphasis> - The timeout in milliseconds for the user searches. Defaults to 10000 (10 seconds).</para>
+ </listitem>
+ <!--<listitem>
+ <emphasis role="bold">searchScope</emphasis> - Sets the search scope to one of the strings. The default is SUBTREE_SCOPE.
+ <itemizedlist>
+ <listitem>
+ <emphasis role="bold">OBJECT_SCOPE</emphasis> - only search the named users context.
+ </listitem>
+ <listitem>
+ <emphasis role="bold">ONELEVEL_SCOPE</emphasis> - search directly under the named users context.
+ </listitem>
+ <listitem>
+ <emphasis role="bold">SUBTREE_SCOPE</emphasis> - If the users context is not a <emphasis>DirContext</emphasis>, search only the object.
+ If the users context is a <emphasis>DirContext</emphasis>, search the subtree rooted at the named object, including the named object itself.
+ </listitem>
+ </itemizedlist>
+ </listitem>-->
+ </itemizedlist>
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ </para>
+ </section>
+ </section>
+ <section>
+ <title>RoleModule</title>
+ <para>
+ <table frame="all">
+ <title>Comparision of RoleModule implementations</title>
+ <tgroup cols="3">
+
+ <thead>
+ <row>
+ <entry align="center">Features</entry>
+ <entry align="center">RoleModule</entry>
+ </row>
+ <row>
+ <entry align="center">LDAPRoleModuleImpl</entry>
+ <entry align="center">LDAPExtRoleModuleImpl</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>Role creation</entry>
+ <entry align="center">X</entry>
+ <entry align="center">-</entry>
+ </row>
+ <row>
+ <entry>Role removal</entry>
+ <entry align="center">X</entry>
+ <entry align="center">-</entry>
+ </row>
+ <row>
+ <entry>Role search</entry>
+ <entry align="center">Flat - one level scope</entry>
+ <entry align="center">Flexible filter - sub tree scope</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </para>
+ <section>
+ <title>LDAPRoleModuleImpl</title>
+ <para>This is the base implementation of LDAP <emphasis>RoleModule</emphasis>. It supports user creation, but will retrieve roles and create them
+ in strictly specified place in LDAP tree.</para>
+ <para>To enable it in your configuration you should have:
+ <programlisting><![CDATA[
+<module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>Role</type>
+ <implementation>LDAP</implementation>
+ <config/>
+</module>]]>
+ </programlisting>
+ </para>
+ <para>org.jboss.portal.identity.ldap.LDAPRoleModuleImpl configuration option-groups options:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis role="bold">common</emphasis>:
+ <itemizedlist>
+ <listitem>
+ <para><emphasis role="bold">roleCtxDN</emphasis> - DN that will be used as context for role searches.</para>
+ </listitem>
+ <listitem>
+ <para> <emphasis role="bold">ridAttributeID</emphasis> - attribute name under which role name is specified. Default value is "cn".</para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">roleDisplayNameAttributeID</emphasis> - attribute name under which role display name is specified. Default value is "cn".</para>
+ </listitem>
+ <listitem>
+ <para> <emphasis role="bold">searchTimeLimit</emphasis> - The timeout in milliseconds for the roles searches. Defaults to 10000 (10 seconds).</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ <section>
+ <title>LDAPExtRoleModuleImpl</title>
+ <para>Aim of this implementation is to give more flexibility for roles retrieval. You can specify LDAP filter
+ that will be used for searches. This module doesn't support role creation and removal.</para>
+ <para>This module doesn't support role creation and removal</para>
+ <para>To enable it in your configuration you should have:</para>
+ <programlisting><![CDATA[
+<module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>Role</type>
+ <implementation>LDAP</implementation>
+ <class>org.jboss.portal.identity.ldap.LDAPExtRoleModuleImpl</class>
+ <config/>
+</module>]]>
+ </programlisting>
+
+ <para>org.jboss.portal.identity.ldap.LDAPExtRoleModuleImpl configuration option-groups options:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para> <emphasis role="bold">common</emphasis>:
+ <itemizedlist>
+ <listitem>
+ <para> <emphasis role="bold">roleCtxDN</emphasis> - DN that will be used as context for role searches. More than one value can be specified.</para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">roleSearchFilter</emphasis> - ldap filter to search roles with. {0} will be substitute with role name. Example filter can look like this:
+ "(cn={0})". This substituion behavior comes from the standard <emphasis>DirContext.search(Name, String, Object, SearchControls cons)</emphasis> method.</para>
+ </listitem>
+ <listitem>
+ <para> <emphasis role="bold">ridAttributeID</emphasis> - attribute name under which role name is specified. Default value is "cn".</para>
+ </listitem>
+ <listitem>
+ <para> <emphasis role="bold">roleDisplayNameAttributeID</emphasis> - attribute name under which role display name is specified. Default value is "cn".</para>
+ </listitem>
+ <listitem>
+ <para> <emphasis role="bold">searchTimeLimit</emphasis> - The timeout in milliseconds for the roles searches. Defaults to 10000 (10 seconds).</para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">searchScope</emphasis> - Sets the search scope to one of the strings. The default is SUBTREE_SCOPE.
+ <itemizedlist>
+ <listitem>
+ <para><emphasis role="bold">OBJECT_SCOPE</emphasis> - only search the named roles context.</para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">ONELEVEL_SCOPE</emphasis> - search directly under the named roles context.</para>
+ </listitem>
+ <listitem>
+ <para> <emphasis role="bold">SUBTREE_SCOPE</emphasis> - If the roles context is not a <emphasis>DirContext</emphasis>, search only the object.
+ If the roles context is a <emphasis>DirContext</emphasis>, search the subtree rooted at the named object, including the named object itself.</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </itemizedlist>
+
+
+ <note><title>Note</title><para>In <emphasis>UserModule</emphasis> there are two methods that handle offset/limit (pagination) behavior.
+ <programlisting>
+ <![CDATA[
+/** Get a range of users.*/
+Set findUsers(int offset, int limit) throws IdentityException, IllegalArgumentException;
+
+/** Get a range of users.*/
+Set findUsersFilteredByUserName(String filter, int offset, int limit)
+ throws IdentityException, IllegalArgumentException;
+ ]]>
+ </programlisting>
+ Pagination support is not widely implemented in LDAP servers. Because <emphasis>UserModule</emphasis>
+ implementations rely on JNDI and are targetted to be LDAP server agnostic those methods aren't very effecient.
+ As long as you don't rely on portal user management and use dedicated tools for user provisioning it
+ shouldn't bother you. Otherwise you should consider extending the implementation and providing
+ solution dedicated to your LDAP server.</para>
+ </note>
+ </section>
+ </section>
+ <section>
+ <title>MembershipModule</title>
+ <para>
+ <table frame="all">
+ <title>Comparision of MembershipModule implementations</title>
+ <tgroup cols="3" align="left">
+
+ <thead>
+ <row>
+ <entry align="center">Features</entry>
+ <entry align="center">MembershipModule</entry>
+ </row>
+ <row>
+ <entry align="center">LDAPStaticGroupMembershipModuleImpl</entry>
+ <entry align="center">LDAPStaticRoleMembershipModuleImpl</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>Role assignment stored in LDAP role entry</entry>
+ <entry align="center">X</entry>
+ <entry align="center">-</entry>
+ </row>
+ <row>
+ <entry>Role assignment stored in LDAP user entry</entry>
+ <entry align="center">-</entry>
+ <entry align="center">X</entry>
+ </row>
+ <row>
+ <entry>User/Role relationship creation</entry>
+ <entry align="center">X</entry>
+ <entry align="center">X</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </para>
+ <section>
+ <title>LDAPStaticGroupMembershipModuleImpl</title>
+ <para>This module support tree shape where role entries keep information about users that are their members.</para>
+ <para>To enable it in your configuration you should have:
+ <programlisting><![CDATA[
+<module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>Membership</type>
+ <implementation>LDAP</implementation>
+ <config/>
+</module>]]>
+ </programlisting>
+ </para>
+ <para>org.jboss.portal.identity.ldap.LDAPStaticGroupMembershipModuleImpl configuration option-groups options:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis role="bold">common</emphasis>:
+ <itemizedlist>
+ <listitem>
+ <para> <emphasis role="bold">membershipAttributeID</emphasis> - LDAP attribute that defines member users ids. This will be used to retrieved users from role entry.</para>
+ </listitem>
+ <listitem>
+ <para> <emphasis role="bold">membershipAttributeIsDN</emphasis> - defines if values of attribute defined in <emphasis>membershipAttributeID</emphasis> are fully qualified
+ LDAP DNs.</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ <section>
+ <title>LDAPStaticRoleMembershipModuleImpl</title>
+ <para>This module support tree shape where user entries keep information about roles that they belong to.</para>
+ <para>To enable it in your configuration you should have:
+ <programlisting><![CDATA[
+<module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>Membership</type>
+ <implementation>LDAP</implementation>
+ <class>org.jboss.portal.identity.ldap.LDAPStaticRoleMembershipModuleImpl</class>
+ <config/>
+</module>]]>
+ </programlisting>
+ </para>
+ <para>org.jboss.portal.identity.ldap.LDAPStaticRoleMembershipModuleImpl configuration option-groups options:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis role="bold">common</emphasis>:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis role="bold">membershipAttributeID</emphasis> - LDAP attribute that defines role ids that user belongs to. This will be used to retrieved roles
+ from user entry.</para>
+ </listitem>
+ <listitem>
+ <para> <emphasis role="bold">membershipAttributeIsDN</emphasis> - defines if values of attribute defined in <emphasis>membershipAttributeID</emphasis> are fully qualified
+ LDAP DNs.</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+ <section>
+ <title>UserProfileModule</title>
+ <section>
+ <title>LDAPUserProfileModuleImpl</title>
+ <para>This is standard implementation that enables to retrieve user properties from atributes in LDAP entries.</para>
+ <para>To enable it in your configuration you should have:
+ <programlisting><![CDATA[
+<module>
+ <type>UserProfile</type>
+ <implementation>DELEGATING</implementation>
+ <config>
+ <option>
+ <name>ldapModuleJNDIName</name>
+ <value>java:/portal/LDAPUserProfileModule</value>
+ </option>
+ </config>
+</module>
+<module>
+ <type>DBDelegateUserProfile</type>
+ <implementation>DB</implementation>
+ <config>
+ <option>
+ <name>randomSynchronizePassword</name>
+ <value>true</value>
+ </option>
+ </config>
+</module>
+<module>
+ <type>LDAPDelegateUserProfile</type>
+ <implementation>LDAP</implementation>
+ <config/>
+</module>]]>
+ </programlisting>
+ <note><title>Note</title><para>Using such configuration you will have LDAP MembershipModule along with DB MembershipModule and Delegating MembershipModule. Please read
+ <xref linkend="identity.management_api"/> to see why this is important.</para>
+ </note>
+ </para>
+ <para>org.jboss.portal.identity.ldap.LDAPUserModuleImpl configuration option-groups options:
+ <itemizedlist>
+ <listitem>
+ <para><emphasis role="bold">common</emphasis>:
+ <itemizedlist>
+ <listitem>
+ <para> <emphasis role="bold">profileConfigFile</emphasis> - file with user profile configuration. If this option is not set, and we use delegating UserProfileModule,
+ profile configuration will be obtained from it.</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+ </section>
+ <section>
+ <title>LDAP server tree shapes</title>
+ <para>JBoss Portal supports full user/role management for simple LDAP tree shapes. Some more flexible
+ trees can be supported by <emphasis>LdapExtUserModuleImpl</emphasis> and <emphasis>LdapExtRoleModuleImpl</emphasis>
+ - but without user/role creation and removal capabilities.
+ However if you have complex LDAP tree you should consider using
+ <xref linkend="authentication.synchronizing_login_module"/> described in
+ <xref linkend="authentication"/> along with dedicated tools for user
+ provisioning provided with LDAP server.</para>
+ <para>
+ In following subsections we will describe two base LDAP tree shapes along with example LDIFs and portal
+ identity modules configurations. Those two examples differ only by using different <emphasis>MembershipModule</emphasis>
+ implementations and describe only tree shapes with supported user/role creation and removal capabilities.
+ </para>
+ <section>
+ <title>Keeping users membership in role entries</title>
+ <para>In this example, information about users/roles assignment is stored in roles entries using LDAP
+ "<emphasis>member</emphasis>". Of course any other attribute that comes with schema can be used for this.</para>
+ <para>Example tree shape in LDAP browser
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" valign="middle" fileref="images/ldap/tree1-1.png" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" valign="middle" fileref="images/ldap/tree1-2.png" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <section>
+ <title>Example LDIF</title>
+ <para>
+ <programlisting><![CDATA[
+dn: dc=example,dc=com
+objectclass: top
+objectclass: dcObject
+objectclass: organization
+dc: example
+o: example
+
+dn: ou=People,dc=example,dc=com
+objectclass: top
+objectclass: organizationalUnit
+ou: People
+
+dn: uid=user,ou=People,dc=example,dc=com
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: person
+uid: user
+cn: JBoss Portal user
+sn: user
+userPassword: user
+mail: email(a)email.com
+
+dn: uid=admin,ou=People,dc=example,dc=com
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: person
+uid: admin
+cn: JBoss Portal admin
+sn: admin
+userPassword: admin
+mail: email(a)email.com
+
+dn: ou=Roles,dc=example,dc=com
+objectclass: top
+objectclass: organizationalUnit
+ou: Roles
+
+dn: cn=User,ou=Roles,dc=example,dc=com
+objectClass: top
+objectClass: groupOfNames
+cn: User
+description: the JBoss Portal user group
+member: uid=user,ou=People,dc=example,dc=com
+
+dn: cn=Admin,ou=Roles,dc=example,dc=com
+objectClass: top
+objectClass: groupOfNames
+cn: Echo
+description: the JBoss Portal admin group
+member: uid=admin,ou=People,dc=example,dc=com]]></programlisting>
+ </para>
+ </section>
+ <section>
+ <title>Example identity configuration</title>
+ <para>
+ <programlisting><![CDATA[
+ <modules>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>User</type>
+ <implementation>LDAP</implementation>
+ <config/>
+ </module>
+ <module>
+ <type>Role</type>
+ <implementation>LDAP</implementation>
+ <config/>
+ </module>
+ <module>
+ <type>Membership</type>
+ <implementation>LDAP</implementation>
+ <config/>
+ </module>
+ <module>
+ <type>UserProfile</type>
+ <implementation>DELEGATING</implementation>
+ <config>
+ <option>
+ <name>ldapModuleJNDIName</name>
+ <value>java:/portal/LDAPUserProfileModule</value>
+ </option>
+ </config>
+ </module>
+ <module>
+ <type>DBDelegateUserProfile</type>
+ <implementation>DB</implementation>
+ <config>
+ <option>
+ <name>randomSynchronizePassword</name>
+ <value>true</value>
+ </option>
+ </config>
+ </module>
+ <module>
+ <type>LDAPDelegateUserProfile</type>
+ <implementation>LDAP</implementation>
+ <config/>
+ </module>
+</modules>
+
+<options>
+ <option-group>
+ <group-name>common</group-name>
+ <option>
+ <name>userCtxDN</name>
+ <value>ou=People,dc=example,dc=com</value>
+ </option>
+ <option>
+ <name>roleCtxDN</name>
+ <value>ou=Roles,dc=example,dc=com</value>
+ </option>
+ </option-group>
+ <option-group>
+ <group-name>userCreateAttibutes</group-name>
+ <option>
+ <name>objectClass</name>
+ <!--This objectclasses should work with Red Hat Directory-->
+ <value>top</value>
+ <value>person</value>
+ <value>inetOrgPerson</value>
+ </option>
+ <!--Schema requires those to have initial value-->
+ <option>
+ <name>cn</name>
+ <value>none</value>
+ </option>
+ <option>
+ <name>sn</name>
+ <value>none</value>
+ </option>
+ </option-group>
+ <option-group>
+ <group-name>roleCreateAttibutes</group-name>
+ <!--Schema requires those to have initial value-->
+ <option>
+ <name>cn</name>
+ <value>none</value>
+ </option>
+ <!--Some directory servers require this attribute to be valid DN-->
+ <!--For safety reasons point to the admin user here-->
+ <option>
+ <name>member</name>
+ <value>uid=admin,ou=People,dc=example,dc=com</value>
+ </option>
+ </option-group>
+</options>]]></programlisting>
+ </para>
+ </section>
+
+ </section>
+ <section>
+ <title>Keeping users membership in user entries</title>
+ <para>In this example, information about users/roles assignment is stored in user entries using LDAP
+ "<emphasis>memberOf</emphasis>". Of course any other attribute that comes with schema can be used for this.</para>
+ <para>Example tree shape in LDAP browser
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" valign="middle" fileref="images/ldap/tree2-3.png" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" valign="middle" fileref="images/ldap/tree2-4.png" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <section>
+ <title>Example LDIF</title>
+ <para>
+ <programlisting><![CDATA[
+dn: dc=example,dc=com
+objectclass: top
+objectclass: dcObject
+objectclass: organization
+dc: example
+o: example
+
+dn: o=example2,dc=example,dc=com
+objectclass: top
+objectclass: organization
+o: example2
+
+dn: ou=People,o=example2,dc=example,dc=com
+objectclass: top
+objectclass: organizationalUnit
+ou: People
+
+dn: uid=admin,ou=People,o=example2,dc=example,dc=com
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: inetUser
+uid: admin
+cn: JBoss Portal admin
+sn: admin
+userPassword: admin
+mail: email(a)email.com
+memberOf: cn=Admin,ou=Roles,o=example2,dc=example,dc=com
+
+dn: uid=user,ou=People,o=example2,dc=example,dc=com
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: inetUser
+uid: user
+cn: JBoss Portal user
+sn: user
+userPassword: user
+mail: email(a)email.com
+memberOf: cn=User,ou=Roles,o=example2,dc=example,dc=com
+
+dn: ou=Roles,o=example2,dc=example,dc=com
+objectclass: top
+objectclass: organizationalUnit
+ou: Roles
+
+dn: cn=User,ou=Roles,o=example2,dc=example,dc=com
+objectClass: top
+objectClass: organizationalRole
+cn: User
+description: the JBoss Portal user group
+
+dn: cn=Admin,ou=Roles,o=example2,dc=example,dc=com
+objectClass: top
+objectClass: organizationalRole
+cn: Echo
+description: the JBoss Portal admin group]]></programlisting>
+ </para>
+ </section>
+ <section>
+ <title>Example identity configuration</title>
+ <para>
+ <programlisting><![CDATA[
+ <modules>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>User</type>
+ <implementation>LDAP</implementation>
+ <config/>
+ </module>
+ <module>
+ <type>Role</type>
+ <implementation>LDAP</implementation>
+ <config/>
+ </module>
+ <module>
+ <type>Membership</type>
+ <implementation>LDAP</implementation>
+ <class>org.jboss.portal.identity.ldap.LDAPStaticRoleMembershipModuleImpl</class>
+ <config/>
+ </module>
+ <module>
+ <type>UserProfile</type>
+ <implementation>DELEGATING</implementation>
+ <config>
+ <option>
+ <name>ldapModuleJNDIName</name>
+ <value>java:/portal/LDAPUserProfileModule</value>
+ </option>
+ </config>
+ </module>
+ <module>
+ <type>DBDelegateUserProfile</type>
+ <implementation>DB</implementation>
+ <config>
+ <option>
+ <name>randomSynchronizePassword</name>
+ <value>true</value>
+ </option>
+ </config>
+ </module>
+ <module>
+ <type>LDAPDelegateUserProfile</type>
+ <implementation>LDAP</implementation>
+ <config/>
+ </module>
+</modules>
+
+<options>
+ <option-group>
+ <group-name>common</group-name>
+ <option>
+ <name>userCtxDN</name>
+ <value>ou=People,dc=example,dc=com</value>
+ </option>
+ <option>
+ <name>roleCtxDN</name>
+ <value>ou=Roles,dc=example,dc=com</value>
+ </option>
+ <option>
+ <name>membershipAttributeID</name>
+ <value>memberOf</value>
+ </option>
+ </option-group>
+ <option-group>
+ <group-name>userCreateAttibutes</group-name>
+ <option>
+ <name>objectClass</name>
+ <!--This objectclasses should work with Red Hat Directory-->
+ <value>top</value>
+ <value>person</value>
+ <value>inetOrgPerson</value>
+ </option>
+ <!--Schema requires those to have initial value-->
+ <option>
+ <name>cn</name>
+ <value>none</value>
+ </option>
+ <option>
+ <name>sn</name>
+ <value>none</value>
+ </option>
+ </option-group>
+ <option-group>
+ <group-name>roleCreateAttibutes</group-name>
+ <!--Schema requires those to have initial value-->
+ <option>
+ <name>cn</name>
+ <value>none</value>
+ </option>
+ <!--Some directory servers require this attribute to be valid DN-->
+ <!--For safety reasons point to the admin user here-->
+ <option>
+ <name>member</name>
+ <value>uid=admin,ou=People,dc=example,dc=com</value>
+ </option>
+ </option-group>
+</options>]]></programlisting>
+ </para>
+ </section>
+ </section>
+ </section>
+ <section id="ldap.synchronizing">
+ <title>Synchronizing LDAP configuration</title>
+ <para>
+ Like it was described in previous section, you can meet some limitations in identity modules support for more
+ complex LDAP tree shapes. To workaround this you can use identity synchronization on JAAS level. JBoss Portal comes with
+ <xref linkend="authentication.synchronizing_login_module"/> that can be easily
+ configured with other authentication solutions that support JAAS framework. Here we want to provide a simple
+ example on how it can be integrated with
+ <emphasis><ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=LdapExtLoginModule">LdapExtLoginModule</ulink>
+ from <emphasis>JBossSX</emphasis> framework.</emphasis>
+ </para>
+ <para>
+ First of all portal identity modules should be configured to work with portal database - default configuration.
+ This is important as we will leverage them, and we want to synchronize users identity into default portal storage
+ mechanism. So lets look at simple configuration that should take place in
+ <emphasis>jboss-portal.sar/conf/login-config.xml</emphasis>
+ <programlisting><![CDATA[
+<policy>
+ <!-- For the JCR CMS -->
+ <application-policy name="cms">
+ <authentication>
+ <login-module code="org.apache.jackrabbit.core.security.SimpleLoginModule"
+ flag="required"/>
+ </authentication>
+ </application-policy>
+
+ <application-policy name="portal">
+ <authentication>
+
+ <login-module code="org.jboss.security.auth.spi.LdapExtLoginModule" flag="required">
+ <module-option name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory
+ </module-option>
+ <module-option name="java.naming.provider.url">ldap://example.com:10389/
+ </module-option>
+ <module-option name="java.naming.security.authentication">simple</module-option>
+ <module-option name="bindDN">cn=Directory Manager</module-option>
+ <module-option name="bindCredential">lolo</module-option>
+ <module-option name="baseCtxDN">ou=People,dc=example,dc=com</module-option>
+ <module-option name="baseFilter">(uid={0})</module-option>
+ <module-option name="rolesCtxDN">ou=Roles,dc=example,dc=com</module-option>
+ <module-option name="roleFilter">(member={1})</module-option>
+ <module-option name="roleAttributeID">cn</module-option>
+ <module-option name="roleRecursion">-1</module-option>
+ <module-option name="searchTimeLimit">10000</module-option>
+ <module-option name="searchScope">SUBTREE_SCOPE</module-option>
+ <module-option name="allowEmptyPasswords">false</module-option>
+ </login-module>
+
+ <login-module code="org.jboss.portal.identity.auth.SynchronizingLoginModule"
+ flag="optional">
+ <module-option name="synchronizeIdentity">true</module-option>
+ <module-option name="synchronizeRoles">true</module-option>
+ <module-option name="additionalRole">Authenticated</module-option>
+ <module-option name="defaultAssignedRole">User</module-option>
+ <module-option name="userModuleJNDIName">java:/portal/UserModule</module-option>
+ <module-option name="roleModuleJNDIName">java:/portal/RoleModule</module-option>
+ <module-option name="membershipModuleJNDIName">java:/portal/MembershipModule
+ </module-option>
+ <module-option name="userProfileModuleJNDIName">java:/portal/UserProfileModule
+ </module-option>
+ </login-module>
+
+ </authentication>
+ </application-policy>
+</policy>]]></programlisting>
+ </para>
+ <para>
+ Few things are important in this configuration:
+ <itemizedlist>
+ <listitem><para><emphasis>LdapExtLoginModule</emphasis> has <emphasis>flag="required"</emphasis> set
+ which means that if this single <emphasis>LoginModule</emphasis> return <emphasis>fail</emphasis>
+ from authentication request whole process will fail. <emphasis>SynchronizingLoginModule</emphasis>
+ has <emphasis>flag="optional"</emphasis>. Such combination is critical as
+ <emphasis>SynchronizingLoginModule</emphasis> always authenticates user sucessfully no matter what
+ credentials were provided. You always must have at least one <emphasis>LoginModule</emphasis> that you
+ will rely on.</para>
+ </listitem>
+ <listitem>
+ <para><emphasis>SynchronizingLoginModule</emphasis> is always the <emphasis>last</emphasis> one in whole
+ authentication chain. This is because in <emphasis>commit</emphasis> phase it will take users
+ <emphasis>Subject</emphasis> and its <emphasis>Principals</emphasis> (roles) assigned by previous
+ <emphasis>LoginModule</emphasis>s and try to synchronize them. Roles assigned to authenticated user by
+ <emphasis>LoginModule</emphasis>s after it won't be handled.</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ <section>
+ <title>Supported LDAP servers</title>
+ <para>LDAP servers support depends on few conditions. In most cases they differ in schema support - various objectClass
+ objects are not present by default in server schema. Sometimes it can be workarounded by manually
+ extending schema.</para>
+ <para>
+ Servers can be
+ <itemizedlist>
+ <listitem><para><emphasis>Supported</emphasis></para></listitem>
+ <listitem><para><emphasis>Not Supported</emphasis></para></listitem>
+ <listitem><para><emphasis>Experimental</emphasis> - implementation can work with such server but it's not well tested so shouldn't be considered for production.</para></listitem>
+ </itemizedlist>
+ </para>
+ <table frame="all">
+ <title>Support of identity modules with different LDAP servers</title>
+ <tgroup cols="8" align="left" colsep="1">
+ <colspec colname="c1"/>
+ <colspec colname="c2"/>
+ <colspec colname="c3"/>
+ <colspec colname="c4"/>
+ <colspec colname="c5"/>
+ <colspec colname="c6"/>
+ <colspec colname="c7"/>
+ <colspec colname="c8"/>
+ <thead>
+ <row>
+ <entry align="center" morerows="1">LDAP Server</entry>
+ <entry align="center" namest="c2" nameend="c3">UserModule</entry>
+ <entry align="center" namest="c4" nameend="c5">RoleModule</entry>
+ <entry align="center" namest="c6" nameend="c7">MembershipModule</entry>
+ <entry align="center">UserProfileModule</entry>
+ </row>
+ <row>
+ <entry>LDAPUserModuleImpl</entry>
+ <entry>LDAPExtUserModuleImpl</entry>
+ <entry>LDAPRoleModuleImpl</entry>
+ <entry>LDAPExtRoleModuleImpl</entry>
+ <entry>LDAPStaticGroupMembershipModuleImpl</entry>
+ <entry>LDAPStaticRoleMembershipModuleImpl</entry>
+ <entry>LDAPUserProfileModuleImpl</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>Red Hat Directory Server</entry>
+ <entry align="center"><emphasis>Supported</emphasis></entry>
+ <entry align="center"><emphasis>Supported</emphasis></entry>
+ <entry align="center"><emphasis>Supported</emphasis></entry>
+ <entry align="center"><emphasis>Supported</emphasis></entry>
+ <entry align="center"><emphasis>Supported</emphasis></entry>
+ <entry align="center"><emphasis>Supported</emphasis></entry>
+ <entry align="center"><emphasis>Supported</emphasis></entry>
+ </row>
+ <row>
+ <entry>OpenDS</entry>
+ <entry align="center"><emphasis>Supported</emphasis></entry>
+ <entry align="center"><emphasis>Supported</emphasis></entry>
+ <entry align="center"><emphasis>Supported</emphasis></entry>
+ <entry align="center"><emphasis>Supported</emphasis></entry>
+ <entry align="center"><emphasis>Supported</emphasis></entry>
+ <entry align="center"><emphasis>Not Supported</emphasis></entry>
+ <entry align="center"><emphasis>Supported</emphasis></entry>
+ </row>
+ <row>
+ <entry>OpenLDAP</entry>
+ <entry align="center"><emphasis>Supported</emphasis></entry>
+ <entry align="center"><emphasis>Supported</emphasis></entry>
+ <entry align="center"><emphasis>Supported</emphasis></entry>
+ <entry align="center"><emphasis>Supported</emphasis></entry>
+ <entry align="center"><emphasis>Supported</emphasis></entry>
+ <entry align="center"><emphasis>Not Supported</emphasis></entry>
+ <entry align="center"><emphasis>Supported</emphasis></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+</chapter>
+ <chapter id="sso">
+<!-- <chapterinfo>
+ <author>
+ <firstname>Boleslaw</firstname>
+ <surname>Dawidowicz</surname>
+ </author>
+ <author>
+ <firstname>Sohil</firstname>
+ <surname>Shah</surname>
+ </author>
+ </chapterinfo>-->
+ <title>Single Sign On</title>
+ <para>This chapter describes how to setup SSO in JBoss Portal</para>
+ <section>
+ <title>Overview of SSO in portal</title>
+ <para>Portal as an integration and aggregation platform provides some form of SSO by itself. When you log into
+ the portal you gain access to many systems through portlets using a single identity. Still in many cases you
+ need to integrate the portal infrastructure with other SSO enabled systems. There are many different Identity Management
+ solutions on the market. In most cases each SSO framework provides its own way to plug into Java EE application. For custom configurations
+ you need to have a good understanding of <xref linkend="identity"/> and <xref linkend="authentication"/> authentication mechanisms.</para>
+ </section>
+
+ <section>
+ <title>Using an Apache Tomcat Valve</title>
+ <para>JBoss Application Server embeds Apache Tomcat as the default servlet container. Tomcat provides a builtin SSO support
+ using a valve. The Single Sign On Valve caches credentials on the server side, and then invisibly authenticate users when they
+ reach different web applications. Credentials are stored in a host-wide session which means that SSO will be effective throughout the session.
+ </para>
+ <section>
+ <title>Enabling the Apache Tomcat SSO Valve</title>
+ <para>
+ To enable SSO valve in Apache Tomcat you should uncomment the following line
+ <programlisting><![CDATA[<Valve className=’org.apache.catalina.authenticator.SingleSignOn’/>]]></programlisting>
+ in the <literal>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml</literal> file.
+ More information can be found <ulink url="http://www.jboss.org/wiki/Wiki.jsp?page=SingleSignOn">here</ulink>.
+ </para>
+ </section>
+ <section>
+ <title>Example of usage</title>
+ <para>
+ Lets look a little bit closer and configure SSO between portal and other web application. As an example
+ we'll use <emphasis>jmx-console</emphasis> web-app that comes with every JBoss Application Server installation.
+ You can find more information on how to secure <emphasis>jmx-console</emphasis> in <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=SecureTheJmxConsole">JBoss AS wiki</ulink>.
+ </para>
+ <orderedlist>
+ <listitem>
+ <para>Take a clean install of <emphasis>JBoss Application Server</emphasis></para>
+ </listitem>
+ <listitem>
+ <para>Edit <emphasis>$JBOSS_HOME/server/default/deploy/jmx-console.war/WEB-INF/web.xml</emphasis> file and make sure it contains following content:</para>
+ <programlisting>
+ <![CDATA[
+<security-constraint>
+ <web-resource-collection>
+ <web-resource-name>HtmlAdaptor</web-resource-name>
+ <description>An example security config that only allows users with the
+ role JBossAdmin to access the HTML JMX console web application
+ </description>
+ <url-pattern>/*</url-pattern>
+ <http-method>GET</http-method>
+ <http-method>POST</http-method>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>Admin</role-name>
+ </auth-constraint>
+</security-constraint>
+
+<security-constraint>
+ <web-resource-collection>
+ <web-resource-name>Public</web-resource-name>
+ <url-pattern>/public/*</url-pattern>
+ <http-method>GET</http-method>
+ <http-method>POST</http-method>
+ </web-resource-collection>
+</security-constraint>
+
+<login-config>
+ <auth-method>BASIC</auth-method>
+ <realm-name>jmx-console</realm-name>
+</login-config>
+
+<security-role>
+ <role-name>Admin</role-name>
+</security-role>]]>
+ </programlisting>
+ <para>This will secure <emphasis>jmx-console</emphasis> web application using BASIC browser authentication and restrict access for
+ users with <emphasis>Admin</emphasis> role only.</para>
+ </listitem>
+ <listitem>
+ <para>
+ Edit <emphasis>$JBOSS_HOME/server/default/conf/props/jmx-console-roles.properties</emphasis> file and make it contain:
+
+ <programlisting>
+ <![CDATA[
+admin=JBossAdmin,HttpInvoker,Admin]]>
+ </programlisting>
+
+ This file is a simple identity store for this web application authentication. It will make user <emphasis>admin</emphasis> belongs to <emphasis>Admin</emphasis> role.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Deploy JBoss Portal</para>
+ </listitem>
+ <listitem>
+ <para>Run JBoss Application Server</para>
+ </listitem>
+ <listitem>
+ <para>Now you can check that when you go to
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>http://localhost:8080/portal</emphasis></para>
+ </listitem>
+ <listitem>
+ <para> <emphasis>http://localhost:8080/jmx-console</emphasis></para>
+ </listitem>
+ </itemizedlist>
+ you need to authenticate separately into each of those web applications.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Shutdown Application Server</para>
+ </listitem>
+ <listitem>
+ <para>
+ Uncomment the following line
+ <programlisting><![CDATA[<Valve className=’org.apache.catalina.authenticator.SingleSignOn’/>]]></programlisting>
+ in the <literal>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml</literal> file.
+ More information can be found <ulink url="http://www.jboss.org/wiki/Wiki.jsp?page=SingleSignOn">here</ulink>.
+ </para>
+ <para>
+ Run JBoss Application Server.
+ </para>
+ </listitem>
+ </orderedlist>
+ <para>
+ Now if you log into portal as user <emphasis>admin</emphasis> with password <emphasis>admin</emphasis>, you won't
+ be asked for credentials when accessing <emphasis>jmx-console</emphasis>. This should work in both directions.
+ </para>
+ <note><title>Note</title><para>Please note that in this example <emphasis>jmx-console</emphasis> uses <emphasis>BASIC</emphasis> authentication method.
+ This means that user credentials are cached on the client side by browser and passed on each request. Once authenticated to clear
+ authentication cache you may need to restart browser.</para></note>
+ </section>
+ </section>
+ <section>
+ <title>CAS - Central Authentication Service</title>
+ <para>This Single Sign On plugin enables seamless integration between JBoss Portal and the CAS Single Sign On Framework.
+ Details about CAS can be found <ulink url="http://www.ja-sig.org/products/cas/">here</ulink></para>
+ <section>
+ <title>Integration steps</title>
+ <note><title>Note</title><para>The steps below assume that CAS server and JBoss Portal will be deployed on the same JBoss Application Server instance.
+ CAS will be configured to leverage identity services exposed by JBoss Portal to perform authentication. Procedure may be
+ slightly different for other deployment scenarios. Both JBoss Portal and CAS will need to be configured to authenticate against
+ same database or LDAP server. Please see CAS documentation to learn how to setup it up against proper identity store.</para></note>
+<note><title>Note</title><para>Configuration below assumes that JBoss Application Server is HTTPS enabled and operates on standard ports: 80 (for HTTP) and 443 (for HTTPS).</para></note>
+
+ <orderedlist>
+ <listitem>
+ <para>Install CAS server (v 3.0.7). This should be as simple as deploying single <emphasis>cas.war</emphasis> file.</para>
+ </listitem>
+ <listitem>
+ <para> Copy <emphasis>portal-identity-lib.jar</emphasis> and <emphasis>portal-identity-sso-lib.jar</emphasis> files from
+ <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/lib</emphasis> to
+ <emphasis>$JBOSS_HOME/server/default/deploy/cas.war/WEB-INF/lib</emphasis>.</para>
+ </listitem>
+ <listitem>
+ <para> Edit <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/portal-server.war/WEB-INF/context.xml</emphasis> file and enable proper Apache Tomcat Valve
+ by uncommenting following lines:
+ <programlisting>
+ <![CDATA[
+<Valve className="org.jboss.portal.identity.sso.cas.CASAuthenticationValve"
+ casLogin="https://localhost/cas/login"
+ casValidate="https://localhost/cas/serviceValidate"
+ casServerName="localhost"
+ authType="FORM"
+/>
+ ]]>
+ </programlisting>
+ Update valve options as follow:
+ <itemizedlist>
+ <listitem>
+ <para> <emphasis>casLogin: </emphasis> URL of your CAS Authentication Server</para>
+ </listitem>
+ <listitem>
+ <para> <emphasis>casValidate: </emphasis> URL of your CAS Authentication Server validation service</para>
+ </listitem>
+ <listitem>
+ <para> <emphasis>casServerName:</emphasis> the hostname:port combination of your CAS Authentication Server</para>
+ </listitem>
+ </itemizedlist>
+ <note><title>Note</title><para>CAS client requires to use SSL connection. To learn how to setup JBoss Application Server to use HTTPS see here</para></note>
+ </para>
+ </listitem>
+ <listitem>
+ <para> Copy <emphasis>casclient.jar</emphasis> into <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/lib</emphasis>.
+ You can download this file from CAS homepage or from JBoss repository under <emphasis>http://repository.jboss.com/cas/3.0.7/lib/</emphasis>
+ <note><title>Note</title><para>The CAS engine does not accept self-signed SSL certificates. This requirement is fine for production use where a production
+ level SSL certificate is available. However, for testing purposes, this can get a little annoying. Hence, if you are having this issue,
+ you can use <emphasis>casclient-lenient.jar</emphasis> instead.</para></note>
+ </para>
+ </listitem>
+ <listitem>
+ <para> Edit <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/META-INF/jboss-service.xml</emphasis> file and uncomment following lines:
+ <programlisting>
+ <![CDATA[
+<mbean
+ code="org.jboss.portal.identity.sso.cas.CASAuthenticationService"
+ name="portal:service=Module,type=CASAuthenticationService"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends>portal:service=Module,type=IdentityServiceController</depends>
+ <attribute name="HavingRole"></attribute>
+</mbean>
+ ]]>
+ </programlisting>
+ This will expose special service in JBoss Portal that can be leveraged by CAS AuthenticationHandler if the server is deployed on the same
+ application server instance. This AuthenticationHandler will be enabled in next 2 steps.</para>
+ </listitem>
+ <listitem>
+ <para> Edit <emphasis>$JBOSS_HOME/server/default/deploy/cas.war/WEB-INF/deployerConfigContext.xml</emphasis> and add following line in the
+ <emphasis>authenticationHandlers</emphasis> section:
+ <programlisting>
+ <![CDATA[
+<bean class="org.jboss.portal.identity.sso.cas.CASAuthenticationHandler" />
+ ]]>
+ </programlisting>
+ This can replace default <emphasis>SimpleTestUsernamePasswordAuthenticationHandler</emphasis> so whole part of this config file can look
+ as follows:
+
+ <programlisting>
+ <![CDATA[<property name="authenticationHandlers">
+ <list>
+ <!--
+ | This is the authentication handler that authenticates services by means of callback via SSL, thereby validating
+ | a server side SSL certificate.
+ +-->
+ <bean
+ class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler">
+ <property
+ name="httpClient"
+ ref="httpClient" />
+ </bean>
+
+ <!--
+ | This is the authentication handler declaration that every CAS deployer will need to change before deploying CAS
+ | into production. The default SimpleTestUsernamePasswordAuthenticationHandler authenticates UsernamePasswordCredentials
+ | where the username equals the password. You will need to replace this with an AuthenticationHandler that implements your
+ | local authentication strategy. You might accomplish this by coding a new such handler and declaring
+ | edu.someschool.its.cas.MySpecialHandler here, or you might use one of the handlers provided in the adaptors modules.
+ +-->
+ <bean class="org.jboss.portal.identity.sso.cas.CASAuthenticationHandler" />
+ </list>
+</property>]]>
+ </programlisting>
+ </para>
+ </listitem>
+ </orderedlist>
+
+ <para>
+ To test the integration:
+ <itemizedlist>
+ <listitem><para>Go to your portal. Typically, http://localhost:8080/portal</para></listitem>
+ <listitem><para>Click on the "Login" link on the main portal page</para></listitem>
+ <listitem><para>This should bring up the CAS Authentication Server's login screen instead of the default JBoss Portal login screen</para></listitem>
+ <listitem><para>Input your portal username and password. For built-in portal login try user:user or admin:admin</para></listitem>
+ <listitem><para>If login is successful, you should be redirected back to the portal with the appropriate user logged in</para></listitem>
+ </itemizedlist>
+ </para>
+
+ </section>
+ </section>
+ <section>
+ <title><trademark class="trade">Java</trademark> Open Single Sign-On (JOSSO)</title>
+ <para>JBoss Portal enables seamless integration with JOSSO server. More details on JOSSO can be found
+ <ulink url="http://www.josso.org/">here</ulink></para>
+ <note><title>Note</title><para>The steps below assume that JOSS server and JBoss Portal will be deployed on the same JBoss Application Server instance.
+ JOSSO will be configured to leverage identity services exposed by JBoss Portal to perform authentication. Procedure may be
+ slightly different for other deployment scenarios. Both JBoss Portal and JOSSO will need to be configured to authenticate against
+ same database or LDAP server. Please see JOSSO documentation to learn how to setup it up against proper identity store.</para></note>
+<note><title>Note</title><para>Configuration below assumes that JOSSO is already installed and deployed in the JBoss Application Server. This involves adding proper jar files
+ into the classpath and altering several configuration files (adding Apache Tomcat Valves, security realm and specific JOSSO configuration files).
+ For JBoss setup please refer to JOSSO <ulink url="http://www.josso.org/jboss4-howto.html">documentation</ulink></para></note>
+ <section>
+ <title>Integration steps</title>
+
+ <para>
+ <orderedlist>
+ <listitem>
+ <para> Copy <emphasis>portal-identity-lib.jar</emphasis> and <emphasis>portal-identity-sso-lib.jar</emphasis> files from
+ <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/lib</emphasis> to
+ <emphasis>$JBOSS_HOME/server/default/deploy/josso.ear/josso.war/WEB-INF/lib</emphasis>.</para>
+ </listitem>
+ <listitem>
+ <para> Edit <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/portal-server.war/WEB-INF/context.xml</emphasis> file and enable proper Apache Tomcat Valve
+ by uncommenting following lines:
+ <programlisting>
+ <![CDATA[
+<Valve className="org.jboss.portal.identity.sso.josso.JOSSOLogoutValve"/>
+ ]]>
+</programlisting></para>
+ </listitem>
+ <listitem>
+ <para>Edit <emphasis>$JBOSS_HOME/server/default/config/josso-agent-config.xml</emphasis> and mapping for portal web application:
+ <programlisting>
+ <![CDATA[
+<partner-apps>
+
+ ...
+
+ <partner-app>
+ <context>/portal</context>
+ </partner-app>
+
+ ...
+
+ </partner-apps>
+ ]]>
+ </programlisting>
+ Complete config file can look as follows:
+ <programlisting>
+ <![CDATA[
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<agent>
+ <class>org.josso.jb4.agent.JBossCatalinaSSOAgent</class>
+ <gatewayLoginUrl>http://localhost:8080/josso/signon/login.do</gatewayLoginUrl>
+ <gatewayLogoutUrl>http://localhost:8080/josso/signon/logout.do</gatewayLogoutUrl>
+ <service-locator>
+ <class>org.josso.gateway.WebserviceGatewayServiceLocator</class>
+ <endpoint>localhost:8080</endpoint>
+ </service-locator>
+ <partner-apps>
+ <partner-app>
+ <context>/partnerapp</context>
+ </partner-app>
+ <partner-app>
+ <context>/portal</context>
+ </partner-app>
+ </partner-apps>
+</agent>
+ ]]>
+</programlisting></para>
+ </listitem>
+ <listitem>
+ <para> Edit <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/portal-server.war/login.jsp</emphasis> and
+ <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/portal-server.war/erros.jsp</emphasis> and uncomment following line:
+ <programlisting>
+ <![CDATA[
+<%
+ response.sendRedirect(request.getContextPath() + "/josso_login/");
+%>
+ ]]>
+ </programlisting>
+ (make sure to remove java style comment '/* */' - not the xml one).</para>
+ </listitem>
+ <listitem>
+ <para> Edit <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/META-INF/jboss-service.xml</emphasis> file and uncomment following lines:
+ <programlisting>
+ <![CDATA[
+<mbean
+ code="org.jboss.portal.identity.sso.josso.JOSSOIdentityServiceImpl"
+ name="portal:service=Module,type=JOSSOIdentityService"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends>portal:service=Module,type=IdentityServiceController</depends>
+</mbean>
+ ]]>
+ </programlisting>
+ This will expose a special service in JBoss Portal that can be leveraged by JOSSO Credential and Identity Stores if the server is deployed on the same
+ application server instance.</para>
+ </listitem>
+ <listitem>
+ <para> Edit <emphasis>$JBOSS_HOME/server/default/deploy/josso.ear/josso.war/WEB-INF/classes/josso-gateway-config.xml</emphasis> and configure following elements:
+ <itemizedlist>
+ <listitem>
+ <para> <emphasis>Credential Store: </emphasis>
+ <programlisting>
+ <![CDATA[
+<!-- Basic Authentication Scheme -->
+<authentication-scheme>
+ <name>basic-authentication</name>
+ <class>org.josso.auth.scheme.BindUsernamePasswordAuthScheme</class>
+
+ <!-- ================================================= -->
+ <!-- JBoss Portal Credential Store -->
+ <!-- ================================================= -->
+ <credential-store>
+ <class>org.jboss.portal.identity.sso.josso.JOSSOIdentityStore</class>
+ </credential-store>
+
+
+ <!-- ================================================= -->
+ <!-- Credential Store Key adapter -->
+ <!-- ================================================= -->
+ <credential-store-key-adapter>
+ <class>org.josso.gateway.identity.service.store.SimpleIdentityStoreKeyAdapter</class>
+ </credential-store-key-adapter>
+
+</authentication-scheme>
+ ]]>
+</programlisting></para>
+ </listitem>
+ <listitem>
+ <para> <emphasis>SSO Identity Store: </emphasis>
+ <programlisting>
+ <![CDATA[
+<sso-identity-manager>
+
+ <class>org.josso.gateway.identity.service.SSOIdentityManagerImpl</class>
+
+ <!-- ================================================= -->
+ <!-- JBoss Portal Credential Store -->
+ <!-- ================================================= -->
+ <sso-identity-store>
+ <class>org.jboss.portal.identity.sso.josso.JOSSOIdentityStore</class>
+ </sso-identity-store>
+
+ <!-- ================================================= -->
+ <!-- Identity Store Key adapter -->
+ <!-- ================================================= -->
+ <sso-identity-store-key-adapter>
+ <class>org.josso.gateway.identity.service.store.SimpleIdentityStoreKeyAdapter</class>
+ </sso-identity-store-key-adapter>
+
+</sso-identity-manager>
+ ]]>
+</programlisting></para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <para>
+ To test the integration:
+ <itemizedlist>
+ <listitem><para>Go to your portal. Typically, http://localhost:8080/portal</para></listitem>
+ <listitem><para>Click on the "Login" link on the main portal page</para></listitem>
+ <listitem><para>This should bring up the JOSSO login screen instead of the default JBoss Portal login screen</para></listitem>
+ <listitem><para>Input your portal username and password. For built-in portal login try user:user or admin:admin</para></listitem>
+ <listitem><para>If login is successful, you should be redirected back to the portal with the appropriate user logged in</para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+
+</chapter>
+ <chapter id="cmsPortlet">
+ <!--<chapterinfo>
+ <author>
+ <firstname>Roy</firstname>
+ <surname>Russo</surname>
+ </author>
+ <author>
+ <firstname>Thomas</firstname>
+ <surname>Heute</surname>
+ </author>
+ </chapterinfo>-->
+ <title>CMS Portlet</title>
+ <para>JBoss Portal packages a Web Content Management System capable of serving and allowing
+ administration of web content. This chapter describes the CMS Portlet which is responsible for
+ serving resources requested, the following chapter describes the CMSAdmin Portlet and all
+ administration functionality.</para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/cms/cms_ss_1.gif" align="center" valign="middle" scalefit="1"/>
+ </imageobject>
+</mediaobject>
+ <section>
+ <title>Introduction</title>
+ <para>The CMS Portlet displays content from the file store inside a portlet window, or, in the
+ case of binary content, outside of the portlet window altogether.</para>
+ </section>
+ <section>
+ <title>Features</title>
+ <para>The CMSPortlet handles all requests for all content types.</para>
+ <para>The methodology of serving content within the CMSPortlet, allows for some beneficial
+ features, like:</para>
+ <orderedlist>
+
+ <listitem><para>Search-engine friendly URLs: http://domain/[portal]/content/company.html</para></listitem>
+ <listitem><para>Serve binaries with simple urls independent of the portal:
+ http://domain/content/products.pdf</para></listitem>
+ <listitem><para>Deploy several instances of the CMSPortlet on any page and configure them to
+ display different start pages.</para></listitem>
+ <listitem><para>Localization support: CMSPortlet will display content based on the user request
+ locale, or display content using the default locale setting.</para></listitem>
+ </orderedlist>
+ </section>
+ <section id="configuration-cms_content">
+ <title>CMS content</title>
+ <para>Since 2.6 displaying CMS content in the portal is done using the new content integration
+ feature. Each window of the portal can be configured to display CMS content directly instead of
+ having to configure the CMS portlet as it used to be.
+ </para>
+ <section>
+ <title>Configuring a window to display CMS content</title>
+ <para>Showing CMS content in a portal window can be done in the deployment descriptor quite easily
+ <programlisting><![CDATA[<window>
+ <window-name>MyCMSWindow</window-name>
+ <content>
+ <content-type>cms</content-type>
+ <content-uri>/default/index.html</content-uri>
+ </content>
+ <region>center</region>
+ <height>1</height>
+</window>
+]]></programlisting>
+ At the first display of the window, the content is initialized with the content uri value.
+ When the user clicks on a link that navigates to another CMS file, the CMS file will be shown in the
+ same window.
+ </para>
+ </section>
+ </section>
+ <section>
+ <title>CMS Configuration</title>
+ <section>
+ <title>Display CMS content</title>
+ <para>Since 2.6 displaying CMS content in the portal is done using the new content integration
+ feature.
+
+
+ The portal is also able to map urls content to the CMS through a specific window.
+ The CMS portlet default page is defined as a preference and can be overridden like any
+ other preference up to the user's preference level. The default CMS portlet displayed
+ when you install JBoss Portal for the first time is describe in the following file:
+ <emphasis>jboss-portal.sar/portal-core.war/WEB-INF/portlet.xml</emphasis>
+ .
+ </para>
+ <programlisting><![CDATA[<portlet-preferences>
+ <preference>
+ <name>indexpage</name>
+ <value>/default/index.html</value>
+ </preference>
+</portlet-preferences>]]></programlisting>
+ <para>
+ The preference key is "indexpage". To change the default page, just make sure to create
+ an HTML document using the CMS Admin portlet then change the value of "indexpage" to
+ the corresponding path.
+ </para>
+ </section>
+ <section>
+ <title>Service Configuration</title>
+ <section>
+ <title>Tuning Apache Jackrabbit</title>
+ <para>JBoss Portal uses Apache Jackrabbit as its Java Content Repository implementation.
+ Configuration of the service descriptor, allows for changing many of the variables
+ associated with the service.</para>
+ <para>Here is the default configuration for the CMS repository found under
+ <literal>portal-cms.sar/META-INF-INF/jboss-service.xml</literal>
+ </para>
+ <programlisting><![CDATA[...
+<attribute name="DoChecking">true</attribute>
+<attribute name="DefaultContentLocation">portal/cms/conf/default-content/default/</attribute>
+<attribute name="DefaultLocale">en</attribute>
+<attribute name="RepositoryName">PortalRepository</attribute>
+<attribute name="HomeDir">${jboss.server.data.dir}${/}portal${/}cms${/}conf</attribute>]]>
+...</programlisting>
+ <para>Below is a list of items found in the service descriptor and their definitions. Only
+ items commonly changed are covered here and it is recommended you do not change any others
+ unless you are very brave.</para>
+ <para>
+ <itemizedlist>
+ <listitem><para>
+ <emphasis role="bold">DoChecking:</emphasis>
+ Should the portal attempt to check for the
+ existence of the repository configuration files and default content on startup?</para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">DefaultContentLocation:</emphasis>
+ Location of the default content used to
+ pre-populate the repository.</para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">DefaultLocale:</emphasis>
+ Two-letter abbreviation of the default
+ locale the portal should use when fetching content for users. A complete ISO-639 list
+ can be found
+ <ulink url="http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt">here</ulink>
+ .</para>
+ </listitem>
+ <listitem>
+ <para> <emphasis role="bold">HomeDir:</emphasis>
+ Location of configuration information for the
+ repository when in 100% FileSystem store mode. Otherwise, its in the database.</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ <section>
+ <title>Changing the url under which the content should be accessible</title>
+ <para>
+ By default, the content will be accessible to a url like this: http://www.example.com/content/[...], if
+ you need or prefer to change "content" to something else you will need to edit the following file:
+ <literal>portal-cms.sar/META-INF-INF/jboss-service.xml</literal>
+ and change the value of Prefix to something else. Please note that you cannot change it to "nothing", you
+ need to provide a value.
+ </para>
+ <programlisting><![CDATA[...
+<mbean
+ code="org.jboss.portal.core.cms.CMSObjectCommandFactory"
+ name="portal:commandFactory=CMSObject"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.common.system.JBossServiceModelMBean">
+ <xmbean/>
+ <attribute name="Prefix">content</attribute>
+ <attribute name="TargetWindowRef">default.default.CMSPortletWindow</attribute>
+ <depends optional-attribute-name="Factory" proxy-type="attribute">
+ portal:commandFactory=Delegating
+ </depends>
+ <depends optional-attribute-name="CMSService" proxy-type="attribute">
+ portal:service=CMS
+ </depends>
+</mbean>
+...]]>
+ </programlisting>
+ <itemizedlist>
+ <listitem>
+ <para><emphasis role="bold">Prefix:</emphasis>
+ This is the context path prefix that will
+ trigger the portal to render content. By default, navigating to a URL such as
+ http://localhost:8080/[portal_context]/content/Test.PDF will trigger the portal to
+ display the PDF isolated from the portal pages. The path following the
+ <emphasis>Prefix</emphasis>
+ has to be absolute when fetching content.</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ </section>
+ <section id="configuration-cms">
+ <title>Configuring the Content Store Location</title>
+ <para>By default, the JBoss Portal CMS stores all node properties, references, and binary
+ content in the database, using the portal datasource. The location of some of these items
+ is configurable, and there are 3 options:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <xref linkend="configuration-cms_fs"/>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <xref linkend="configuration-cms_db"/>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <xref linkend="configuration-cms_mixed"/>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <section id="configuration-cms_fs">
+ <title>100% Filesystem Storage</title>
+ <para>To enable 100% Filesystem storage, you must edit the file:
+ <emphasis>jboss-portal.sar/portal-cms.sar/META-INF/jboss-service.xml</emphasis>
+ . You will note that the file is set to use the HibernateStore
+ and HibernatePersistenceManager classes, by default. To have the CMS use 100% file
+ system storage, simply comment these blocks. Then, you should uncomment to use the
+ LocalFileSystem and XMLPersistenceManager classes. Follow these steps to activate 100% FS storage:
+ </para>
+ <para>
+ <orderedlist>
+ <listitem>
+ <para>
+ Comment out the following blocks (there are 3 in total):
+ <programlisting><![CDATA[
+<!-- HibernateStore: uses RDBMS + Hibernate for storage -->
+<FileSystem class="org.jboss.portal.cms.hibernate.HibernateStore">
+...
+</FileSystem>
+]]></programlisting>
+ And uncomment the blocks under them (there are 3 in total):
+ <programlisting><![CDATA[
+<!-- LocalFileSystem: uses FileSystem for storage. -->
+<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+...
+</FileSystem>]]></programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Now comment out the following blocks (there are 2 in total):
+ <programlisting><![CDATA[
+<!-- HibernatePersistentManager: uses RDBMS + Hibernate for storage -->
+<PersistenceManager class="org.jboss.portal.cms.hibernate.state.HibernatePersistenceManager">
+...
+</PersistenceManager>]]></programlisting>
+ And uncomment the blocks under them (there are 2 in total):
+ <programlisting><![CDATA[
+<!-- XMLPersistenceManager: uses FileSystem for storage -->
+<PersistenceManager class="org.apache.jackrabbit.core.state.xml.XMLPersistenceManager"/>
+]]></programlisting>
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <para>
+ <warning><title>Caution</title><para>
+ If you do any change at the workspaces configuration you will need to delete the file
+ <emphasis>$JBOSS_HOME/server/xxx/data/portal/cms/conf/workspaces/default/workspace.xml</emphasis>
+ before restarting JBoss or redeploying JBoss Portal. If you forget to do that, the changes
+ won't affect the CMS.
+ For the same reason, you also need to delete that file if you recompile JBoss Portal after
+ changing the name of the datasource.
+ Note that on a cluster environment, you need to remove that file (if it exists) on all the nodes.
+ </para></warning>
+ </para>
+ </section>
+ <section id="configuration-cms_db">
+ <title>100% Database Storage</title>
+ <para>This is the default configuration for the CMS store. Please view the original
+ <emphasis>jboss-portal.sar/portal-cms.sar/META-INF/jboss-service.xml</emphasis>
+ , for guidance on how to reset it.
+ </para>
+ </section>
+ <section id="configuration-cms_mixed">
+ <title>Mixed Storage</title>
+ <para>Mixed storage consists of meta-data being stored in the DB and blobs being stored on the Filesystem.
+ This is the recommended setting for those of you that serve large files or stream media content.</para>
+ <para>
+ Setting the repository this way is simple. Change every instance in the file
+ <emphasis>jboss-portal.sar/portal-cms.sar/META-INF/jboss-service.xml</emphasis>
+ , from:
+ <programlisting><![CDATA[<param name="externalBLOBs" value="false"/>]]></programlisting>
+ to:
+ <programlisting><![CDATA[<param name="externalBLOBs" value="true"/>]]></programlisting>
+ </para>
+ <para>
+ <warning><title>Caution</title><para>
+ If you do any change at the workspaces configuration you will need to delete the file
+ <emphasis>$JBOSS_HOME/server/xxx/data/portal/cms/conf/workspaces/default/workspace.xml</emphasis>
+ before restarting JBoss or redeploying JBoss Portal. If you forget to do that, the changes
+ won't affect the CMS.
+ For the same reason, you also need to delete that file if you recompile JBoss Portal after
+ changing the name of the datasource.
+ Note that on a cluster environment, you need to remove that file (if it exists) on all the nodes.
+ </para></warning>
+ </para>
+ </section>
+ </section>
+ </section>
+ <!-- <section>
+ <title>Portlet Preferences</title>
+ <para>TODO</para>
+ </section>-->
+ <section>
+ <title>Localization Support</title>
+ <para>The CMS Portlet now serves content based on the user's locale setting. For example: if a
+ user's locale is set to Spanish in his browser, and he requests URL:
+ <emphasis>default/index.html</emphasis>
+ , the CMSPortlet will first try and retrieve the
+ Spanish version of that file. If a Spanish version is not found, it will then try and
+ retrieve the default language version set for the CMSPortlet.
+ </para>
+ </section>
+ <section>
+ <title>CMS Service</title>
+ <para>
+ The CMS portlet calls a CMS service that can be reused in your own portlets.
+ </para>
+ <section>
+ <title>CMS Interceptors</title>
+ <para>
+ Since JBoss Portal 2.4 you can add your own interceptor stack to the CMS service.
+ The interceptors are called around each command (Get a file, write a file, create a folder...),
+ this is a very easy way to customize some actions based on your needs.
+ </para>
+ <para>
+ To create your own interceptor you just need to extend the
+ <literal>org.jboss.portal.cms.CMSInterceptor</literal>
+ class and provide the content of the
+ <literal>invoke(JCRCommand)</literal>
+ method. Do not forget to make a call
+ to
+ <literal>JCRCommand.invokeNext()</literal>
+ or the command will never be executed.
+ </para>
+ <para>
+ JBoss Portal relies on the interceptor mechanism to integrate its Fine Grained Security Service and
+ the Publish/Approve Workflow Service
+ </para>
+ <para>
+ To add or remove an interceptor, you just need to edit the following file:
+ <literal>portal-cms-sar/META-INF/jboss-service.xml</literal>.
+ It works the same way as the server interceptor, for each interceptor you need to define an MBean then add it
+ to the cms interceptor stack. For example, if you have the 2 default interceptors, you should have the following
+ lines in the jboss-service.xml file:
+ <programlisting><![CDATA[<!-- ACL Security Interceptor -->
+<mbean code="org.jboss.portal.cms.impl.interceptors.ACLInterceptor"
+ name="portal:service=Interceptor,type=Cms,name=ACL" xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean />
+ <attribute name="JNDIName">
+ java:/portal/cms/ACLInterceptor
+ </attribute>
+ <attribute name="CmsSessionFactory">
+ java:/portal/cms/CMSSessionFactory
+ </attribute>
+ <attribute name="IdentitySessionFactory">
+ java:/portal/IdentitySessionFactory
+ </attribute>
+ <attribute name="DefaultPolicy">
+ <policy>
+ <!-- permissions on the root cms node -->
+ <criteria name="path" value="/">
+ <permission name="cms" action="read">
+ <role name="Anonymous" />
+ </permission>
+ <permission name="cms" action="write">
+ <role name="User" />
+ </permission>
+ <permission name="cms" action="manage">
+ <role name="Admin" />
+ </permission>
+ </criteria>
+ <!-- permissions on the default cms node -->
+ <criteria name="path" value="/default">
+ <permission name="cms" action="read">
+ <role name="Anonymous" />
+ </permission>
+ <permission name="cms" action="write">
+ <role name="User" />
+ </permission>
+ <permission name="cms" action="manage">
+ <role name="Admin" />
+ </permission>
+ </criteria>
+ <!-- permissions on the private/protected node -->
+ <criteria name="path" value="/default/private">
+ <permission name="cms" action="manage">
+ <role name="Admin" />
+ </permission>
+ </criteria>
+ </policy>
+ </attribute>
+ <depends optional-attribute-name="AuthorizationManager"
+ proxy-type="attribute">
+ portal:service=AuthorizationManager,type=cms
+ </depends>
+ <depends>portal:service=Hibernate,type=CMS</depends>
+ <depends>
+ portal:service=Module,type=IdentityServiceController
+ </depends>
+</mbean>
+
+<!-- Approval Workflow Interceptor -->
+<mbean
+ code="org.jboss.portal.cms.impl.interceptors.ApprovalWorkflowInterceptor"
+ name="portal:service=Interceptor,type=Cms,name=ApprovalWorkflow"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean />
+ <attribute name="JNDIName">
+ java:/portal/cms/ApprovalWorkflowInterceptor
+ </attribute>
+ <depends>portal:service=Hibernate,type=CMS</depends>
+</mbean>
+
+<!-- CMS Interceptor Registration -->
+<mbean
+ code="org.jboss.portal.server.impl.invocation.JBossInterceptorStackFactory"
+ name="portal:service=InterceptorStackFactory,type=Cms" xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean />
+ <depends-list optional-attribute-name="InterceptorNames">
+ <depends-list-element>
+ portal:service=Interceptor,type=Cms,name=ACL
+ </depends-list-element>
+ <depends-list-element>
+ portal:service=Interceptor,type=Cms,name=ApprovalWorkflow
+ </depends-list-element>
+ </depends-list>
+</mbean>
+ ]]>
+ </programlisting>
+ The first two MBeans define the interceptors and the third MBean, define which interceptors to add to
+ the CMS service.
+ </para>
+ <para>
+ If you create your own interceptor <literal>org.example.myCMSInterceptor</literal>, the service descriptor file will look like:
+ <programlisting><![CDATA[<mbean code="org.example.myCMSInterceptor"
+ name="portal:service=Interceptor,type=Cms,name=MyName" xmbean-dd=""
+ xmbean-code="org.jboss.portal.common.system.JBossServiceModelMBean">
+ <xmbean />
+</mbean>
+
+<!-- ACL Security Interceptor -->
+<mbean code="org.jboss.portal.cms.impl.interceptors.ACLInterceptor"
+ name="portal:service=Interceptor,type=Cms,name=ACL" xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean />
+ <attribute name="JNDIName">
+ java:/portal/cms/ACLInterceptor
+ </attribute>
+ <attribute name="CmsSessionFactory">
+ java:/portal/cms/CMSSessionFactory
+ </attribute>
+ <attribute name="IdentitySessionFactory">
+ java:/portal/IdentitySessionFactory
+ </attribute>
+ <attribute name="DefaultPolicy">
+ <policy>
+ <!-- permissions on the root cms node -->
+ <criteria name="path" value="/">
+ <permission name="cms" action="read">
+ <role name="Anonymous" />
+ </permission>
+ <permission name="cms" action="write">
+ <role name="User" />
+ </permission>
+ <permission name="cms" action="manage">
+ <role name="Admin" />
+ </permission>
+ </criteria>
+ <!-- permissions on the default cms node -->
+ <criteria name="path" value="/default">
+ <permission name="cms" action="read">
+ <role name="Anonymous" />
+ </permission>
+ <permission name="cms" action="write">
+ <role name="User" />
+ </permission>
+ <permission name="cms" action="manage">
+ <role name="Admin" />
+ </permission>
+ </criteria>
+ <!-- permissions on the private/protected node -->
+ <criteria name="path" value="/default/private">
+ <permission name="cms" action="manage">
+ <role name="Admin" />
+ </permission>
+ </criteria>
+ </policy>
+ </attribute>
+ <depends optional-attribute-name="AuthorizationManager"
+ proxy-type="attribute">
+ portal:service=AuthorizationManager,type=cms
+ </depends>
+ <depends>portal:service=Hibernate,type=CMS</depends>
+ <depends>
+ portal:service=Module,type=IdentityServiceController
+ </depends>
+</mbean>
+
+<!-- Approval Workflow Interceptor -->
+<mbean
+ code="org.jboss.portal.cms.impl.interceptors.ApprovalWorkflowInterceptor"
+ name="portal:service=Interceptor,type=Cms,name=ApprovalWorkflow"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean />
+ <attribute name="JNDIName">
+ java:/portal/cms/ApprovalWorkflowInterceptor
+ </attribute>
+ <depends>portal:service=Hibernate,type=CMS</depends>
+</mbean>
+<mbean
+ code="org.jboss.portal.server.impl.invocation.JBossInterceptorStackFactory"
+ name="portal:service=InterceptorStackFactory,type=Cms" xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean />
+ <depends-list optional-attribute-name="InterceptorNames">
+ <depends-list-element>
+ portal:service=Interceptor,type=Cms,name=ACL
+ </depends-list-element>
+ <depends-list-element>
+ portal:service=Interceptor,type=Cms,name=ApprovalWorkflow
+ </depends-list-element>
+ </depends-list>
+</mbean>
+
+<!-- CMS Interceptor Registration -->
+<mbean
+ code="org.jboss.portal.server.impl.invocation.JBossInterceptorStack"
+ name="portal:service=InterceptorStack,type=Cms" xmbean-dd=""
+ xmbean-code="org.jboss.portal.common.system.JBossServiceModelMBean">
+ <xmbean />
+ <depends-list optional-attribute-name="InterceptorNames">
+ <depends-list-element>
+ portal:service=Interceptor,type=Cms,name=ACL
+ </depends-list-element>
+ <depends-list-element>
+ portal:service=Interceptor,type=Cms,name=ApprovalWorkflow
+ </depends-list-element>
+ <depends-list-element>
+ portal:service=Interceptor,type=Cms,name=MyName
+ </depends-list-element>
+ </depends-list>
+</mbean>
+]]></programlisting>
+ </para>
+ <note>
+ <para>
+ The interceptor order is important !
+ </para>
+ </note>
+ <para>
+ To check that the interceptors have been correctly added, you can check the JMX console, by going to:
+ <literal>http://localhost.localdomain:8080/jmx-console/HtmlAdaptor?action=inspectM...</literal>
+ You should notice all the interceptors in the attribute "interceptors".
+ </para>
+ </section>
+ </section>
+</chapter>
+ <chapter id="workflow">
+ <!-- <chapterinfo>
+ <author>
+ <firstname>Sohil</firstname>
+ <surname>Shah</surname>
+ <email>sshah @ redhat dot com</email>
+ </author>
+ </chapterinfo>-->
+ <title>Portal Workflow</title>
+ <para>
+ JBoss Portal packages a Workflow Service based on jBPM. This service provides you with the jBPM services that your
+ portal can use to build out the end-user/application workflows that should meet your portal's requirements.
+ </para>
+ <section>
+ <title>jBPM Workflow Engine Integration</title>
+ <para>
+ The jBPM Workflow service is packaged as an mbean and takes care of all the low-level jBPM related functions.
+ The configuration is found in <filename>portal-workflow.sar/META-INF/jboss-service.xml</filename>.
+ </para>
+ </section>
+ <section>
+ <title>CMS Publish/Approve Workflow Service</title>
+ <para>
+ The CMS Publish/Approval Workflow feature is turned on by default, so that every file that is created or
+ updated needs to go through an <emphasis role="bold">approval process</emphasis> before it can be published to
+ go live. The current implementation creates a pending queue for managers. The managers can then either approve
+ or reject the publishing of the document in question.
+ </para>
+ <section>
+ <title>How to activate this feature?</title>
+ <para>
+ The CMS Publish/Approval Workflow feature can be activated by uncommenting the
+ <literal>ApprovePublishWorkflow</literal> attribute of the <literal>portal:service=CMS</literal> mbean in
+ <filename>portal-cms.sar/META-INF/jboss-service.xml</filename>:
+ <programlisting><![CDATA[
+<mbean
+ code="@cms.service.code@"
+ name="portal:service=CMS"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+
+ ...
+
+ <!-- Add this to activate publish/approval workflow integration -->
+ <!-- <depends optional-attribute-name="ApprovePublishWorkflow" proxy-type="attribute">portal:service=ApprovePublish,type=Workflow</depends> -->
+
+ ...
+</mbean>]]></programlisting>
+ </para>
+ </section>
+ <section>
+ <title>How to configure this feature?</title>
+ <para>
+ The workflow service can be configured by editing the <literal>portal:service=ApprovePublish,type=Workflow</literal>
+ mbean found in <filename>portal-cms.sar/META-INF/jboss-service.xml</filename>.
+ <programlisting>
+ <![CDATA[
+<!-- ApprovePublish workflow service -->
+ <mbean
+ code="org.jboss.portal.cms.workflow.ApprovePublishImpl"
+ name="portal:service=ApprovePublish,type=Workflow"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="WorkflowService" proxy-type="attribute">
+ portal:service=Workflow,type=WorkflowService
+ </depends>
+ <depends optional-attribute-name="IdentityServiceController" proxy-type="attribute">
+ portal:service=Module,type=IdentityServiceController
+ </depends>
+ <!-- JBPM process definition -->
+ <attribute name="Process">
+ <!-- cms approval workflow -->
+ <process-definition name="approval_workflow">
+ <start-state>
+ <transition to="request_approval"/>
+ </start-state>
+ <task-node name="request_approval" signal="first">
+ <task name="approve_publish">
+ <assignment class="org.jboss.portal.cms.workflow.PublishAssignmentHandler"/>
+ <event type="task-start">
+ <action class="org.jboss.portal.cms.workflow.FinalizePublish"/>
+ </event>
+ <exception-handler>
+ <action class="org.jboss.portal.cms.workflow.TaskExceptionHandler"/>
+ </exception-handler>
+ </task>
+ <transition name="approval" to="end"/>
+ <transition name="rejection" to="end"/>
+ </task-node>
+ <end-state name="end"/>
+ </process-definition>
+ </attribute>
+ <!--
+ overwrite = false creates the process first time if does not exist, for
+ subsequent server restarts, this process definition remains in tact
+
+ overwrite = true creates the process first time if does not exist,
+ for subsequent server restarts, it creates a new version of the process definition
+ which will be used for processes created from then onwards. Old processes created
+ for an older version of the definition remain in tact and use their corresponding
+ process definition.
+
+ Typically use overwrite=false and overwrite=true only when a new process definition
+ related to this workflow needs to be deployed
+ -->
+ <attribute name="Overwrite">false</attribute>
+ <!--
+ A comma separated list of portal roles that are designated
+ to act as workflow managers. They are allowed to
+ approve/reject content publish requests
+ -->
+ <attribute name="ManagerRoles">Admin</attribute>
+ <attribute name="JNDIName">java:portal/ApprovePublishWorkflow</attribute>
+ </mbean>]]></programlisting>
+ </para>
+ <para>
+ Of note in this configuration are the <literal>Process</literal> and <literal>ManagerRoles</literal>
+ attributes. The <literal>Process</literal> attribute is used to provide the jBPM process definition to be
+ followed by the workflow service during the approval process. This follows the standard jBPM syntax
+ for process definition. <literal>ManagerRoles</literal>, on the other hand, is a comma-delimited list of
+ user roles that are being marked as "managers" who can approve the publication of CMS documents.
+ </para>
+ </section>
+ </section>
+</chapter>
+ <chapter id="navtabs">
+ <!--<chapterinfo>
+ <author>
+ <firstname>Roy</firstname>
+ <surname>Russo</surname>
+ </author>
+ <author>
+ <firstname>Thomas</firstname>
+ <surname>Heute</surname>
+ </author>
+ </chapterinfo>-->
+ <title>Navigation Tabs</title>
+ <para>The navigation tabs allow users to navigate the portal pages. This section describes some of the functionality
+ available in configuring them.
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/navtabs/navtabs_ss.gif" align="center" valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <section>
+ <title>Explicit ordering of tabs</title>
+ <para>Explicit ordering of the tab display, is accomplished via page properties that are defined in your
+ <emphasis>*-object.xml</emphasis>
+ (
+ <xref linkend="desc_objectxml"/>
+ ). Ordering is accomplished using the
+ <emphasis>order</emphasis>
+ tag at the page level as a page property.
+ <programlisting><![CDATA[
+<page>
+ <page-name>default</page-name>
+ <properties>
+ <property>
+ <name>order</name>
+ <value>1</value>
+ </property>
+ </properties>
+ ...
+</page>]]></programlisting>
+ </para>
+ </section>
+ <section>
+ <title>Translating tab labels</title>
+ <para>Labels on tabs can be defined in multiple languages. Two different ways can be used, the first one consist at
+ defining several display name for page objects, the second one consists of defining a resource bundle where to find
+ the localized display-name. Both methods have advantages and drawbacks.</para>
+ <section>
+ <title>Method one: Multiple <literal>display-name</literal></title>
+ <para>In the <filename>*-object.xml</filename> descriptor under the <literal>page</literal> element, it is possible
+ to define a display-name per locale. Here is an example:
+ <programlisting><![CDATA[
+<page>
+ <page-name>News</page-name>
+ <display-name xml:lang="en">News</display-name>
+ <display-name xml:lang="it">Novita'</display-name>
+ <display-name xml:lang="es">Noticias</display-name>
+ <display-name xml:lang="fr">Actualités</display-name>
+ ...
+</page>
+ ]]></programlisting>
+ Here we defined a display name for four different languages. The advantage of this method is that it is simple and the
+ display name is kept along the metadata. The drawback of this method is that if you may end up with different places
+ to keep your localized data. If you are using resource bundles for other elements, the second method might be simpler
+ when you add new supported languages.
+ </para>
+ </section>
+ <section>
+ <title>Defining a resource bundle and supported locales</title>
+ <para>If you are already using resource bundles for localization you may prefer to point to those files. To do so you
+ can define the name of your ressource bundle. The files should be in the classloader of the war containing the <filename>*-object.xml</filename>
+ where you define them, meaning in the same war file.</para>
+ <para>Here is an example:
+ <programlisting><![CDATA[
+<page>
+ <page-name>Weather</page-name>
+ <supported-locale>fr</supported-locale>
+ <supported-locale>en</supported-locale>
+ ...
+</page>
+ ]]></programlisting>
+ With one or the other method, accessing the portal will now display the tab names with the preferred locale if a localized
+ value exists.
+ </para>
+ <warning><para>If you change the values in the descriptor (method 1) or in the resource bundles (method 2) you need to use
+ the <literal><if-exists>overwrite</if-exists></literal> so that the values are updated</para></warning>
+ </section>
+ </section>
+</chapter>
+ <chapter id="themeandlayouts">
+ <!-- <chapterinfo>
+ <author>
+ <firstname>Martin</firstname>
+ <surname>Holzner</surname>
+ </author>
+ <author>
+ <firstname>Mark</firstname>
+ <surname>Fernandes</surname>
+ </author>
+ <author>
+ <firstname>Thomas</firstname>
+ <surname>Heute</surname>
+ </author>
+ </chapterinfo>-->
+ <title>Layouts and Themes</title>
+ <section>
+ <title>Overview</title>
+ <para>Portals usually render the markup fragments of several portlets, and aggregate these
+ fragments into one page that ultimately gets sent back as response. Each portlet on that
+ page will be decorated by the portal to limit the real estate the portlet has on the page,
+ but also to allow the portal to inject extra functionality on a per portlet basis. Classic
+ examples of this injection are the maximize, minimize and mode change links that will
+ appear in the portlet window , together with the title.
+ </para>
+ <para>Layouts and themes allow to manipulate the look and feel of the portal. Layouts are
+ responsible to render markup that will wrap the markup fragments produced by the individual
+ portlets. Themes, on the other hand, are responsible to style and enhance this markup.
+ </para>
+ <para>In JBoss Portal, layouts are implemented as a JSP or a Servlet. Themes are implemented using CSS Style sheets, <trademark class="trade">JavaScript</trademark> and images. The binding element between layouts and themes are the class and id attributes of the rendered markup.
+ </para>
+ <para>JBoss Portal has the concept of regions on a page. When a page is defined, and portlet
+ windows are assigned to the page, the region, and order inside the region, has to be
+ specified as well. For portal layouts this has significant meaning. It defines the top most
+ markup container that can wrap portlet content (other then the static markup in the JSP
+ itself). In other words: from a layout perspective all portlets of a page are assigned to
+ one or more regions. Each region can contain one or more portlets. To render the page
+ content to return from a portal request, the portal has to render the layout JSP, and for
+ each region, all the portlets in the region.
+ </para>
+ <para>Since the markup around each region, and around each portlet inside that region, is
+ effectively the same for all the pages of a portal, it makes sense to encapsulate it in its
+ own entity.
+ </para>
+ <para>To implement this encapsulation there are several ways:</para>
+ <itemizedlist>
+
+ <listitem><para>JSP pages that get included from the layout JSP for each region/portlet</para></listitem>
+ <listitem><para>a taglib that allows to place region, window, and decoration tags into the layout JSP</para>
+ </listitem>
+ <listitem><para>a taglib that uses a pluggable API to delegate the markup generation to a set of classes</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>
+ In JBoss Portal you can currently see two out of these approaches, namely
+ the first and the last. Examples for the first can be found in the portal-core.war,
+ implemented by the nodesk and phalanx layouts. Examples for the third approach can be found
+ in the same war, implemented by the industrial and Nphalanx layout. What encapsulates the
+ markup generation for each region, window, and portlet decoration in this last approach is
+ what's called the RenderSet.
+ </para>
+ <para>The RenderSet consist of four interfaces that correspond with the four markup
+ containers that wrap the markup fragments of one of more portlets:
+ </para>
+ <itemizedlist>
+
+ <listitem><para>Region</para></listitem>
+ <listitem><para>Window</para></listitem>
+ <listitem><para>Decoration</para></listitem>
+ <listitem><para>Portlet Content</para></listitem>
+ </itemizedlist>
+
+ <para>While we want to leave it open to you to decide which way to implement your layouts and
+ themes, we strongly believe that the last approach is superior, and allows for far more
+ flexibility, and clearer separation of duties between portal developers and web designers.
+ </para>
+ <!--
+ <para>Portal layouts also have the concept of a layout strategy. The layout strategy is a
+ pluggable API, and lets the layout developer have a last say about the content to be
+ rendered. The strategy is called right after the portal has determined what needs to be
+ rendered as part of the current request. So the strategy is invoked right between the point
+ where the portal knows what needs to be done, and before the actual work is initiated. The
+ strategy gets all the details about what is going to happen, and it can take measures to
+ influence those details.
+ <itemizedlist>
+ <para>Some simple examples of those measures are:</para>
+ <listitem>ommit one of the portlets from being rendered</listitem>
+ <listitem>change the portlet mode or window state of a portlet before it gets rendered</listitem>
+ <listitem>change the layout to be used for this request</listitem>
+ <listitem>...and many more</listitem>
+ </itemizedlist>
+ </para>
+ -->
+ <para>The last topic to introduce in this overview is the one of portal themes. A theme is a
+ collection of web design artifacts. It defines a set of CSS, JavaScript and image files
+ that together decide about the look and feel of the portal page. The theme can take a wide
+ spectrum of control over the look and feel. It can limit itself to decide fonts and colors,
+ or it can take over a lot more and decide the placement (location) of portlets and much
+ more.
+ </para>
+ </section>
+ <section>
+ <title>Header</title>
+ <section>
+ <title>Overview</title>
+ <para>The default header is divided into two parts, links to pages displayed as tabs and links
+ to navigate between portals and dahsboards as well as loggin in and out. Those two parts are
+ included into the template thanks to the layout as defined in <xref linkend="layouts"/>.
+ In fact, the region named, <literal>dashboardnav</literal> will include the navigation links,
+ while the region named <literal>navigation</literal> will include the navigation tabs.
+ It is then easy to hide one and/or the other by removing the corresponding inclusion in the
+ layout.
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/themeguide/portal-header.gif" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ <para>Screenshot of the header with the 'renaissance' theme</para>
+
+ <note><title>Note</title><para>Here, we use split content from rendering by using a CSS style sheet, it allows us to change the
+ display by switching the CSS without affecting the content. THe Maple theme will display the links
+ on the left side with a different font for example. THis is up to you to choose or not this approach</para>
+ </note>
+ <para>To customize the header there are several options detailed after.
+ <itemizedlist>
+ <listitem><para>The first option would simply require to modify
+ the theme CSS, by doing this you could change the fonts, the way tabs are rendered, colors and many
+ other things but not change the content.</para></listitem>
+ <listitem><para>The second option is to modify the provided JSP files, <literal>header.jsp</literal> and
+ <literal>tabs.jsp</literal>. It gives you more flexibility than the previous solution on modifying
+ the content. Links to legacy application could easily be added, URLs could be arranged differently, the CSS
+ approach could be replaced by good old HTML, CSS style names could be changed... The drawback of
+ this method compare to the next one is the limitation in what is accessible from the JSP.</para></listitem>
+ <!-- listitem>The third option is the most flexible and let you inject whatever you want, it consists in
+ replacing the default <literal>PageCustomizerInterceptor</literal> by your own.</listitem-->
+ </itemizedlist>
+ </para>
+ <section>
+ <title>Writing his own <trademark class="trade">JSP</trademark> pages</title>
+ <para>The content of those two parts are displayed thanks to two different <trademark class="trade">JSP</trademark> pages. By default
+ you would find those pages in the directory <literal>portal-core.war/WEB-INF/jsp/header/</literal>.
+ The file <literal>header.jsp</literal> is used to display the links that are displayed on the upper
+ right of the default theme. The file <literal>tabs.jsp</literal> is used to display the pages tabs
+ appearing on the left.
+ </para>
+ <para> Again, you have several choices, either to edit the included JSP files directly or create your own,
+ store them in a web application then edit the following file: <literal>jboss-portal.sar/META-INF/jboss-service.xml</literal>.
+ The interesting part in that file is the following:
+ <programlisting><![CDATA[<mbean
+ code="org.jboss.portal.core.aspects.controller.PageCustomizerInterceptor"
+ name="portal:service=Interceptor,type=Command,name=PageCustomizer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <attribute name="TargetContextPath">/portal-core</attribute>
+ <attribute name="HeaderPath">/WEB-INF/jsp/header/header.jsp</attribute>
+ <attribute name="TabsPath">/WEB-INF/jsp/header/tabs.jsp</attribute>
+ <depends
+ optional-attribute-name="PortalAuthorizationManagerFactory"
+ proxy-type="attribute">portal:service=PortalAuthorizationManagerFactory</depends>
+</mbean>]]></programlisting>
+ The three attributes are:
+ <itemizedlist>
+ <listitem><para>TargetContextPath: Defines the web application context where the JSP files are located</para></listitem>
+ <listitem><para>HeaderPath: Defines the location (in the web application previously defined) of the JSP in charge of writing the header links</para></listitem>
+ <listitem><para>TabsPath: Defines the location (in the web application previously defined) of the JSP in charge of writing the pages links (note that it doesn't have to be renderer as tabs)</para></listitem>
+ </itemizedlist>
+ </para>
+ <para>Writing the header JSP</para>
+ <para>A couple of request attributes are set so that they can be used by the JSP, here is the list of attributes and their meaning:
+ <itemizedlist>
+ <listitem><para><literal>org.jboss.portal.header.USER</literal>: A <literal>org.jboss.portal.identity.User</literal> object of the logged-in user, null if the user is not logged-in.</para></listitem>
+ <listitem><para><literal>org.jboss.portal.header.LOGIN_URL</literal>: URL to logging-in.</para></listitem>
+ <listitem><para><literal>org.jboss.portal.header.DASHBOARD_URL</literal>: URL to the dashboard, null if the user is already on the dashboard, null if the user is on the default portal already.</para></listitem>
+ <listitem><para><literal>org.jboss.portal.header.DEFAULT_PORTAL_URL</literal>: URL to the default page of the portal named 'default', null if the user is on the default portal already.</para></listitem>
+ <listitem><para><literal>org.jboss.portal.header.ADMIN_PORTAL_URL</literal>: URL to the default page of the admin portal (named 'admin'), null if the user is on the admin portal already.</para></listitem>
+ <listitem><para><literal>org.jboss.portal.header.EDIT_DASHBOARD_URL</literal>: URL to the page content editor of the dashboard, set only if the user is on the dashboard, null otherwise.</para></listitem>
+ <listitem><para><literal>org.jboss.portal.header.COPY_TO_DASHBOARD_URL</literal>: URL to copy a page from a portal to the personal dashboard, null if the user is on the dashboard.</para></listitem>
+ <listitem><para><literal>org.jboss.portal.header.SIGN_OUT_URL</literal>: URL to log out the portal.</para></listitem>
+ </itemizedlist>
+ Every attribute that is an URL attribute is an object implementing the <emphasis>org.jboss.portal.api.PortalURL</emphasis> interface.
+ Therefore it is possible to generate the URL using the <emphasis>toString()</emphasis> method and change various things related
+ to the URL.
+ With that in hand, if someone just wanted to display the logged-in username and a link to log out, he could write:
+ <programlisting><![CDATA[<%@ page import="org.jboss.portal.identity.User" %>
+
+<%
+ User user = (User) request.getAttribute("org.jboss.portal.header.USER");
+ PortalURL signOutURL = (PortalURL)request.getAttribute("org.jboss.portal.header.SIGN_OUT_URL");
+ PortalURL loginURL = (PortalURL)request.getAttribute("org.jboss.portal.header.LOGIN_URL");
+
+
+ if (user == null)
+ {
+%>
+ <a href="<%= loginURL %>">Login</a>
+<%
+ }
+ else
+ {
+%>
+Logged in as: <%= user.getUserName() %>
+<br/>
+<a href="<%= signOutURL %>">Logout</a>
+<%
+ }
+%>]]></programlisting>
+ </para>
+ <para>Writing the tabs JSP</para>
+ <para>A couple of request attributes are set so that they can be used by the JSP, here is the list of attributes and their meaning:
+ <itemizedlist>
+ <listitem><para><literal>org.jboss.portal.api.PORTAL_NODE</literal>: A <literal>org.jboss.portal.api.node.PortalNode</literal> object of the root Portal node. Authorized children and siblings
+ of this object are accessible.</para></listitem>
+ <listitem><para><literal>org.jboss.portal.api.PORTAL_RUNTIME_CONTEXT</literal>: A <literal>org.jboss.portal.api.PortalRuntimeContext</literal> object that can be used to render URLs.</para></listitem>
+ </itemizedlist>
+ </para>
+ <para>The default file in charge of displaying the tabs can be found in: <literal>portal-core.war/WEB-INF/jsp/header/</literal></para>
+ </section>
+ <!-- section>
+ <title>Modifying the default PageCustomizerInterceptor</title>
+ <para>Instead of modifying the class directly, create your own Interceptor
+ (I suggest you copy the default PageCustomizerInterceptor look at the source in
+ <literal>core/src/main/org/jboss/portal/core/aspects/controller</literal>) then add it to:
+ <literal>portal-core.sar/META-INF/jboss-service.xml</literal> the same way it
+ is done by the default Interceptor. Then replace the default one by your own in
+ the following part:
+<programlisting><![CDATA[
+<mbean
+ code="org.jboss.portal.server.impl.invocation.JBossInterceptorStackFactory"
+ name="portal:service=InterceptorStackFactory,type=Command"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends-list optional-attribute-name="InterceptorNames">
+ <depends-list-element>portal:service=Interceptor,type=Command,name=Ajax</depends-list-element>
+ <depends-list-element>portal:service=Interceptor,type=Command,name=NavigationalState</depends-list-element>
+ <depends-list-element>portal:service=Interceptor,type=Command,name=PortalNode</depends-list-element>
+ <depends-list-element>portal:service=Interceptor,type=Command,name=PolicyEnforcement</depends-list-element>
+ <depends-list-element>portal:service=Interceptor,type=Command,name=PageCustomizer</depends-list-element>
+ <depends-list-element>portal:service=Interceptor,type=Command,name=EventBroadcaster</depends-list-element>
+ </depends-list>
+</mbean>
+]]></programlisting>
+ Just replace the PageCustomizer by one of your own.
+ </para>
+ </section-->
+ </section>
+ </section>
+ <section id="layouts">
+ <title>Layouts</title>
+ <section>
+ <title>How to define a Layout</title>
+ <para>Layouts are used by the portal to produce the actual markup of a portal response.
+ After all the portlets on a page have been rendered and have produced their markup
+ fragments, the layout is responsible for aggregating all these pieces, mix them with
+ some ingredients from the portal itself, and at the end write the response back to the
+ requesting client.
+ </para>
+ <para>Layouts can be either a JSP or a Servlet. The portal determines the layout to use
+ via the configured properties of the portal, or the requested page. Both, portal and
+ pages, can define the layout to use in order to render their content. In case both
+ define a layout, the layout defined for the page will overwrite the one defined for the
+ portal.
+ </para>
+ <para>A Layout is defined in the layout descriptor named portal-layouts.xml. This
+ descriptor must be part of the portal application, and is picked up by the layout
+ deployer. If the layout deployer detects such a descriptor in a web application, it will
+ parse the content and register the layouts with the layout service of the portal. Here
+ is an example of such a descriptor file:
+ <programlisting><![CDATA[<layouts>
+ <layout>
+ <name>phalanx</name>
+ <uri>/phalanx/index.jsp</uri>
+ </layout>
+ <layout>
+ <name>industrial</name>
+ <uri>/industrial/index.jsp</uri>
+ <uri state="maximized">/industrial/maximized.jsp</uri>
+ </layout>
+</layouts>]]></programlisting>
+ </para>
+ </section>
+ <section>
+ <title>How to use a Layout</title>
+ <section>
+ <title>Declarative use</title>
+ <para>Portals and pages can be configured to use a particular layout. The connection to
+ the desired layout is made in the portal descriptor (YourNameHere-object.xml). Here
+ is an example of such a portal descriptor:
+ <programlisting><![CDATA[<portal>
+ <portal-name>default</portal-name>
+ <properties>
+ <!-- Set the layout for the default portal -->
+ <!-- see also portal-layouts.xml -->
+ <property>
+ <name>layout.id</name>
+ <value>phalanx</value>
+ </property>
+ </properties>
+ <pages>
+ <page>
+ <page-name>theme test</page-name>
+ <properties>
+ <!-- set a difference layout for this page -->
+ <property>
+ <name>layout.id</name>
+ <value>industrial</value>
+ </property>
+ </properties>
+ </page>
+ </pages>
+</portal>]]></programlisting>
+ The name specified for the layout to use has to
+ match one of the names defined in the portal-layouts.xml descriptor of one of the
+ deployed applications.
+ </para>
+ <para>As you can see, the portal or page property points to the layout to use via the
+ name of the layout. The name has been given to the layout in the layout descriptor.
+ It is in that layout descriptor where the name gets linked to the physical resource
+ (the JSP or Servlet) that will actually render the layout.
+ </para>
+ </section>
+ <section>
+ <title>Programmatic use</title>
+ <para>To access a layout from code, you need to get a reference to the LayoutService
+ interface. The layout service is an mbean that allows access to the PortalLayout
+ interface for each layout that was defined in a portal layout descriptor. As a layout
+ developer you should never have to deal with the layout service directly. Your layout
+ hooks are the portal and page properties to configure the layout, and the layout
+ strategy, where you can change the layout to use for the current request, before the
+ actual render process begins.
+ </para>
+ </section>
+ </section>
+ <section>
+ <title>Where to place the Descriptor files</title>
+ <para>Both descriptors, the portal and the theme descriptor, are located in the WEB-INF/
+ folder of the deployed portal application. Note that this is not limited to the
+ portal-core.war, but can be added to any WAR that you deploy to the same server. The
+ Portal runtime will detect the deployed application and introspect the WEB-INF folder
+ for known descriptors like the two mentioned here. If present, the appropriate meta data
+ is formed and added to the portal runtime. From that time on the resources in that
+ application are available to be used by the portal. This is an elegant way to
+ dynamically add new layouts or themes to the portal without having to bring down , or
+ even rebuild the core portal itself.
+ </para>
+ </section>
+ <!--
+ <section>
+ <title>How to connect a Layout to a Layout Strategy</title>
+ <para>As you might have noticed already, a layout definition consists of a name and one or
+ more uri elements. We have already seen the function of the name element. Now let's take
+ a closer look at the uri element. In the example above, the phalanx layout defined one
+ uri element only, the industrial layout defines two. What you can see in the industrial
+ layout is the option of defining different uri's for different states. In this example ,
+ we configured the layout to use a different JSP if the layout state is maximized. If no
+ such separation is made in the layout descriptor, then the portal will always use the
+ same JSP for this layout. Note that the 'state' attribute value works together with the
+ state that was set by the layout strategy. Please refere to the section about the layout
+ strategy for more details.
+ </para>
+ </section>
+ -->
+ <section>
+ <title>Layout <trademark class="trade">JSP</trademark> tags</title>
+ <para>The portal comes with a set of <trademark class="trade">JSP</trademark> tags that allow the layout developer faster
+ development.
+ </para>
+ <para>There are currently two taglibs, containing tags for different approaches to
+ layouts:
+ </para>
+ <itemizedlist>
+
+ <listitem><para>portal-layout.tld</para></listitem>
+ <listitem><para>theme-basic-lib.tld</para></listitem>
+ </itemizedlist>
+
+ <para>The theme-basic-lib.tld contains a list of tags that allow a JSP writer to access
+ the state of the rendered page content. It is built on the assumption that regions,
+ portlet windows and portlet decoration is managed inside the JSP.
+ </para>
+ <para>The portal-layout.tld contains tags that work under the assumption that the
+ RenderSet will take care of how regions, portlet windows and the portlet decoration will
+ be rendered. The advantage of this approach is that the resulting JSP is much simpler
+ and easier to read and maintain.
+ </para>
+ <para>Here is an example layout JSP that uses tags from the latter:
+ <programlisting>
+ <![CDATA[<%@ taglib uri="/WEB-INF/theme/portal-layout.tld" prefix="p" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title><p:title default="My Great Portal"/></title>
+ <meta http-equiv="Content-Type" content="text/html;" />
+ <p:theme themeName='renaissance' />
+ <p:headerContent />
+ </head>
+ <body id="body">
+ <div id="portal-container">
+ <div id="sizer">
+ <div id="expander">
+ <div id="logoName"></div>
+ <table border="0" cellpadding="0" cellspacing="0" id="header-container">
+ <tr>
+ <td align="center" valign="top" id="header">
+ <div id="spacer"></div>
+ </td>
+ </tr>
+ </table>
+ <div id="content-container">
+ <p:region regionName='This-Is-The-Page-Region-To-Query-The-Page'
+ regionID='This-Is-The-Tag-ID-Attribute-To-Match-The-CSS-Selector'/>
+ <p:region regionName='left' regionID='regionA'/>
+ <p:region regionName='center' regionID='regionB'/>
+ <hr class="cleaner" />
+ <div id="footer-container" class="portal-copyright">Powered by
+ <a class="portal-copyright"
+ href="http://www.jboss.com/products/jbossportal">
+ JBoss Portal
+ </a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </body>
+</html>]]></programlisting>
+ </para>
+ <section>
+ <title>The title tag</title>
+ <para>The title tag is used to insert the web browser title defined by a portlet which
+ is part of the page rendering. The default attribute defines the title to use if no
+ portlet defined a web browser title.
+ </para>
+ </section>
+ <section>
+ <title>The theme tag</title>
+ <para>The theme tag looks for the determined theme of the current request (see
+ Portal Themes for more details). If no theme was determined, this tag allows an
+ optional attribute 'themeName' that can be used to specify a default theme to use
+ as a last resort. Based on the determined theme name, the ThemeService is called
+ to lookup the theme with this name and to get the resources associated with this
+ theme. The resulting style and link elements are injected, making sure that war
+ context URLS are resolved appropriately.
+ </para>
+ </section>
+ <section>
+ <title>The headerContent tag</title>
+ <para>This tags allows portlets to inject content into the header. More details
+ about this function are mentioned in the 'other Theme Functions' section of this
+ document.
+ </para>
+ </section>
+ <section>
+ <title>The region tag</title>
+ <para>The region tag renders all the portlets in the specified region of the current
+ page, using the determined RenderSet to produce the markup that surrounds the
+ individual portlet markup fragments. The regionName attribute functions as a query
+ param into the current page. It determines from what page region the portlets will
+ be rendered in this tag. The regionID attribute is what the RenderSet can use to
+ generate a CSS selector for this particular region. In case of the divRenderer, a
+ DIV tag with an id attribute corresponding to the provided value will be rendered
+ for this region. This id in turn can be picked up by the CSS to style the region.
+ </para>
+ </section>
+ </section>
+ </section>
+ <!--
+<section>
+<title>Layout Strategy</title>
+<section>
+<title>What is a Layout Strategy</title>
+<para>The layout strategy is a pluggable API that allows the layout developer to influence
+the content of the page that is about to be rendered. Based on the current request URL,
+the portal determined the portal and page that needs to be rendered. The page contains a
+list of portlets, and those portlets are in a particular navigational state. The
+navigational state consists of the portlet mode and the window state of the portlet.
+This information, togeher with the determined layout, the region and order assignments
+of each portlet, the allowed window states and portlet modes for both, the portal and
+the individual portlets, is passed to the layout strategy before the actual rendering is
+invoked. The layout strategy can check what is about to be rendered, and take action in
+a limited way to influence the content that is about to be rendered.
+</para>
+</section>
+<section>
+<title>How can I use a Layout Strategy</title>
+<section>
+<title>Define a Strategy</title>
+<para>A layout strategy is defined in the strategy descriptor. The descriptor is named
+ portal-strategies.xml, and is located in the WEB-INF/layout folder of any web
+ application deployed to the server. Here is an example of such a descriptor:
+ <programlisting>
+ <![CDATA[<portal-strategies>
+ <set name="default">
+ <strategy content-type="text/html">
+ <implementation>org.jboss.portal.theme.impl.strategy.DefaultStrategyImpl</implementation>
+ </strategy>
+ </set>
+ <set name="maximizedRegion">
+ <strategy content-type="text/html">
+ <implementation>org.jboss.portal.theme.impl.strategy.MaximizingStrategyImpl</implementation>
+ </strategy>
+ </set>
+ </portal-strategies>
+ ]]></programlisting>
+ Layout strategies are defined as sets. A set consists of one or
+ more strategy definitions, separated by content type they are assigned for. The idea
+ behind this is to allow the layout developer to apply different strategies based on
+ requested content type. Each set has a name that is unique in the application context
+ it is deployed in. The strategy can be refered to by this name. As a result of that
+ it is considered a named layout strategy in contrast to an anonymous strategy as
+ described below.
+</para>
+</section>
+<section>
+<title>Specify the Strategy to use</title>
+<para>The strategy that will be used for a portal request is defined as a property of
+ the current layout, the requested portal, or the requested page. If the layout
+ defines a strategy to use it will overwrite all other assignments. If there is no
+ particular strategy defined for the layout, then the page property will overwrite the
+ portal property. If no strategy can be determined, then a last attempt will be made
+ to use the strategy with the name 'default'. If no strategy can be determined at all,
+ the request will proceed normally without invoking any strategy. Here is an example
+ layout descriptor that defines a strategy for the layouts defined:
+ <programlisting>
+ <![CDATA[
+ <layouts>
+ <strategy content-type="text/html">
+ <implementation>com.novell.portal.strategy.MaximizingStrategy</implementation>
+ </strategy>
+
+ <layout>
+ <name>generic</name>
+ <uri>/generic/index.jsp</uri>
+ <uri state="maximized">/generic/maximized.jsp</uri>
+ </layout>
+ </layouts>
+ ]]></programlisting>
+ In this case the strategy is anonymous and directly assigned to
+ the generic layout. The strategy cannot be discovered independently from the generic
+ layout. Here is an example portal descriptor that points to a strategy for the
+ portal, and for a particular page:
+ <programlisting>
+ <![CDATA[
+ <portal>
+ <portal-name>default</portal-name>
+ <properties>
+ <property>
+ <name>layout.strategyId</name>
+ <value>default</value>
+ </property>
+ </properties>
+ <pages>
+ <default-page>theme test</default-page>
+ <page>
+ <page-name>theme test</page-name>
+ <properties>
+ -->
+ <!-- set a difference layout strategy for this page -->
+ <!--
+ <property>
+ <name>layout.strategyId</name>
+ <value>maximizedRegion</value>
+ </property>
+ </properties>
+ <window>
+ <window-name>CatalogPortletWindow</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>left</region>
+ <height>0</height>
+ </window>
+ </page>
+ </pages>
+ </portal>
+ ]]></programlisting>
+ As you can see, analogous to how layouts are refered to, the
+ strategy name is the linking element between the portal descriptor and the layout
+ strategy descriptor. The content type is determined at runtime, and serves as a
+ secondary query parameter to get the correct strategy for this content type out of
+ the set that matches the name provided in the portal descriptor.
+ </para>
+ </section>
+ </section>
+ <section>
+ <title>Linking the Strategy and the Layout</title>
+ <para>As mentioned above, the layout descriptor can link a strategy directly to the
+ layout. This will overwrite all other defined strategies for the portal or the page, for
+ any page that uses this layout.
+ </para>
+ <para>The layout strategy can set a state to return to the portal as a result of the
+ strategy evaluation. This state will be matched with the state attribute of the uri
+ element of the layout. If there is a match, then the uri that matches this state will be
+ used as the layout for the current request. So, if the strategy sets a state of
+ 'maximized' , the portal will try to use the layout resource that is pointed to for that
+ particular state in the currently selected layout. As you might remember from the
+ previous layout section, a layout can point to another JSP or Servlet based on the state
+ attribute of the uri element, like so:
+ <programlisting><![CDATA[
+ <layouts>
+ <layout>
+ <name>industrial</name>
+ <uri>/industrial/index.jsp</uri>
+ <uri state="maximized">/industrial/maximized.jsp</uri>
+ </layout>
+ </layouts>]]></programlisting>
+ In this case all reuquests that don't return a state
+ 'maximized' from the evaluation of the strategy will use the /industrial/index.jsp as
+ the layout. However, if the evaluation of the strategy returns a state of 'maximized'
+ then the request will use /industrial/maximized.jsp as the layout.
+ </para>
+ </section>
+ </section>
+ -->
+ <section>
+ <title>RenderSets</title>
+ <section>
+ <title>What is a RenderSet</title>
+ <para>A RenderSet can be used to produce the markup containers around portlets and portlet
+ regions. The markup for each region, and each portlet window in a region is identical.
+ Further more, it is most likely identical across several layouts. The way portlets are
+ arranged and decorated will most likely not change across layouts. What will change is
+ the look and feel of the decoration, the images, fonts, and colors used to render each
+ portlet window on the page. This is clearly a task for the web designer, and hence
+ should be realized via the portal theme. The layout only needs to provide enough
+ information to the theme so that it can do its job. The RenderSet is exactly that link
+ between the layout and the theme that takes the information available in the portal and
+ renders markup containing the current state of the page and each portlet on it. It makes
+ sure that the markup around each region and portlet contains the selectors that the
+ theme CSS needs to style the page content appropriately.
+ </para>
+ <para>A RenderSet consists of the implementations of four interfaces. Each of those
+ interfaces corresponds to a markup container on the page.
+ </para>
+ <para>Here are the four markup containers and their interface representation:</para>
+ <itemizedlist>
+
+ <listitem><para>Region - RegionRenderer</para></listitem>
+ <listitem><para>Window - WindowRenderer</para></listitem>
+ <listitem><para>Decoration - DecorationRenderer</para></listitem>
+ <listitem><para>Portlet Content - PortletRenderer</para></listitem>
+ </itemizedlist>
+ <para>
+ All the renderer interfaces are specified in the
+ org.jboss.portal.theme.render package.
+ </para>
+ <para>The four markup containers are hierarchical. The region contains one or more
+ windows. A window contains the portlet decoration and the portlet content.
+ </para>
+ <para>The region is responsible for arranging the positioning and order of each portlet
+ window. Should they be arranged in a row or a column? If there are more then one portlet
+ window in a region, in what order should they appear?
+ </para>
+ <para>The window is responsible for placing the window decoration, including the portlet
+ title, over the portlet content, or under, or next to it.
+ </para>
+ <para>The decoration is responsible for inserting the correct markup with the links to the
+ portlet modes and window states currently available for each portlet.
+ </para>
+ <para>The portlet content is responsible for inserting the actually rendered markup
+ fragment that was produced by the portlet itself.
+ </para>
+ </section>
+ <section>
+ <title>How is a RenderSet defined</title>
+ <para>Similar to layouts, render sets must be defined in a RenderSet descriptor. The
+ RenderSet descriptor is located in the WEB-INF/layout folder of a web application, and
+ is named portal-renderSet.xml. Here is an example descriptor:
+ <programlisting>
+ <![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<portal-renderSet>
+ <renderSet name="divRenderer">
+ <set content-type="text/html">
+ <region-renderer>org.jboss.portal.theme.impl.render.DivRegionRenderer</region-renderer>
+ <window-renderer>org.jboss.portal.theme.impl.render.DivWindowRenderer</window-renderer>
+ <portlet-renderer>org.jboss.portal.theme.impl.render.DivPortletRenderer</portlet-renderer>
+ <decoration-renderer>
+ org.jboss.portal.theme.impl.render.DivDecorationRenderer
+ </decoration-renderer>
+ </set>
+ </renderSet>
+ <renderSet name="emptyRenderer">
+ <set content-type="text/html">
+ <region-renderer>org.jboss.portal.theme.impl.render.EmptyRegionRenderer</region-renderer>
+ <window-renderer>org.jboss.portal.theme.impl.render.EmptyWindowRenderer</window-renderer>
+ <portlet-renderer>
+ org.jboss.portal.theme.impl.render.EmptyPortletRenderer
+ </portlet-renderer>
+ <decoration-renderer>
+ org.jboss.portal.theme.impl.render.EmptyDecorationRenderer
+ </decoration-renderer>
+ </set>
+ </renderSet>
+</portal-renderSet>
+ ]]></programlisting>
+ </para>
+ </section>
+ <section>
+ <title>How to specify what RenderSet to use</title>
+ <para>Analogous to how a strategy is specified, the RenderSet can be specified as a portal
+ or page property, or a particular layout can specify an anonymous RenderSet to use. Here
+ is an example of a portal descriptor:
+ <programlisting>
+ <![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<portal>
+ <portal-name>default</portal-name>
+ <properties>
+ <!-- use the divRenderer for this portal -->
+ <property>
+ <name>theme.renderSetId</name>
+ <value>divRenderer</value>
+ </property>
+ </properties>
+ <pages>
+ <default-page>default</default-page>
+ <page>
+ <page-name>default</page-name>
+ <properties>
+ <!-- overwrite the portal's renderset for this page -->
+ <property>
+ <name>theme.renderSetId</name>
+ <value>emptyRenderer</value>
+ </property>
+ </properties>
+ <window>
+ <window-name>TestPortletWindow</window-name>
+ <instance-ref>TestPortletInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ </page>
+ </pages>
+</portal>]]></programlisting>
+ Here is an example of a layout descriptor with an anonymous
+ RenderSet:
+ <programlisting>
+ <![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<layouts>
+<renderSet>
+<set content-type="text/html">
+<region-renderer>org.foo.theme.render.MyRegionRenderer</region-renderer>
+<window-renderer>org.foo.theme.render.MyWindowRenderer</window-renderer>
+<portlet-renderer>org.foo.theme.render.MyPortletRenderer</portlet-renderer>
+<decoration-renderer>org.foo.theme.render.MyDecorationRenderer</decoration-renderer>
+</set>
+</renderSet>
+<layout>
+<name>generic</name>
+<uri>/generic/index.jsp</uri>
+<uri state="maximized">/generic/maximized.jsp</uri>
+</layout>
+</layouts>]]></programlisting>
+ Again, analogous to layout strategies, the anonymous RenderSet
+ overwrites the one specified for the page, and that overwrites the one specified for the
+ portal. In other words: all pages that use the layout that defines an anonymous
+ RenderSet will use that RenderSet, and ignore what is defined as RenderSet for the
+ portal or the page.
+ </para>
+ <para>
+ In addition to specifying the renderSet for a portal or a page, each individual portlet window
+ can define what renderSet to use for the one of the three aspects of a window, the window renderer,
+ the decoration renderer, and the portlet renderer. This feature allow you to use the the window renderer
+ implementation from one renderSet, and the decoration renderer from another.
+ Here is an example for a window that uses the implementations of the emptyRenderer renderSet for all three
+ aspects:
+ <programlisting>
+ <![CDATA[<window>
+ <window-name>NavigationPortletWindow</window-name>
+ <instance-ref>NavigationPortletInstance</instance-ref>
+ <region>navigation</region>
+ <height>0</height>
+ <!-- overwrite portal and page properties set for the renderSet for this window -->
+ <properties>
+ <!-- use the window renderer from the emptyRenderer renderSet -->
+ <property>
+ <name>theme.windowRendererId</name>
+ <value>emptyRenderer</value>
+ </property>
+ <!-- use the decoration renderer from the emptyRenderer renderSet -->
+ <property>
+ <name>theme.decorationRendererId</name>
+ <value>emptyRenderer</value>
+ </property>
+ <!-- use the portlet renderer from the emptyRenderer renderSet -->
+ <property>
+ <name>theme.portletRendererId</name>
+ <value>emptyRenderer</value>
+ </property>
+ </properties>
+</window>]]></programlisting>
+
+ </para>
+ </section>
+ </section>
+ <section>
+ <title>Themes</title>
+ <section>
+ <title>What is a Theme</title>
+ <para>A portal theme is a collection of CSS styles, JavaScript files, and images, that all
+ work together to style and enhance the rendered markup of the portal page. The theme
+ works together with the layout and the RenderSet in producing the content and final look
+ and feel of the portal response. Through clean separation of markup and styles a much
+ more flexible and powerful approach to theming portals is possible. While this approach
+ is not enforced, it is strongly encouraged. If you follow the definitions of the
+ Theme Style Guide (see later), it is not necessary to change the layout or the strategy,
+ or the RenderSet to achieve very different look and feels for the portal. All you need
+ to change is the theme. Since the theme has no binary dependencies, it is very simple to
+ swap, or change individual items of it. No compile or redeploy is necessary. Themes
+ can be added or removed while the portal is active. Themes can be deployed in separate
+ web applications furthering even more the flexibility of this approach. Web developers
+ don't have to work with JSP pages. They can stay in their favorite design tool and simple
+ work against the exploded war content that is deployed into the portal. The results can
+ be validated life in the portal.
+ </para>
+ </section>
+ <section>
+ <title>How to define a Theme</title>
+ <para>Themes can be added as part of any web application that is deployed to the portal
+ server. All what is needed is a theme descriptor file that is part of the deployed
+ archive. This descriptor indicates to the portal what themes and theme resources are
+ becoming available to the portal. The theme deployer scans the descriptor and adds the
+ theme(s) to the ThemeService, which in turn makes the themes available for consumption
+ by the portal. Here is an example of a theme descriptor:
+ <programlisting>
+ <![CDATA[<themes>
+<theme>
+<name>nodesk</name>
+<link href="/nodesk/css/portal_style.css" rel="stylesheet" type="text/css" />
+<link rel="shortcut icon" href="/images/favicon.ico" />
+</theme>
+<theme>
+<name>phalanx</name>
+<link href="/phalanx/css/portal_style.css" rel="stylesheet" type="text/css" />
+<link rel="shortcut icon" href="/images/favicon.ico" />
+</theme>
+
+<theme>
+<name>industrial-CSSSelect</name>
+<link rel="stylesheet" id="main_css" href="/industrial/portal_style.css" type="text/css" />
+<link rel="shortcut icon" href="/industrial/images/favicon.ico" />
+
+<script language="JavaScript" type="text/javascript">
+// MAF - script to switch current tab and css in layout...
+function switchCss(currentTab,colNum) {
+var obj = currentTab;
+var objParent = obj.parentNode;
+
+if (document.getElementById("current") != null) {
+var o = document.getElementById("current");
+o.setAttribute("id","");
+o.className = 'hoverOff';
+objParent.setAttribute("id","current");
+}
+
+var css = document.getElementById("main_css");
+source = css.href;
+if (colNum == "3Col") {
+if (source.indexOf("portal_style.css" != -1)) {
+source = source.replace("portal_style.css","portal_style_3Col.css");
+}
+if (source.indexOf("portal_style_1Col.css" != -1)) {
+source = source.replace("portal_style_1Col.css","portal_style_3Col.css");
+}
+}
+if (colNum == "2Col") {
+if (source.indexOf("portal_style_3Col.css" != -1)) {
+source = source.replace("portal_style_3Col.css","portal_style.css");
+}
+if (source.indexOf("portal_style_1Col.css" != -1)) {
+source = source.replace("portal_style_1Col.css","portal_style.css");
+}
+}
+if (colNum == "1Col") {
+if (source.indexOf("portal_style_3Col.css" != -1)) {
+source = source.replace("portal_style_3Col.css","portal_style_1Col.css");
+}
+if (source.indexOf("portal_style.css" != -1)) {
+source = source.replace("portal_style.css","portal_style_1Col.css");
+}
+}
+
+css.href = source;
+}
+</script>
+</theme>
+</themes>]]></programlisting>
+ </para>
+ <para>Themes are defined in the portal-themes.xml theme descriptor, which is located in
+ the WEB-INF/ folder of the web application.
+ </para>
+ </section>
+ <section>
+ <title>How to use a Theme</title>
+ <para>Again, analogous to the way it is done for layouts, themes are specified in the
+ portal descriptor as a portal or page property. The page property overwrites the portal
+ property. In addition to these two options, themes can also be specified as part of the
+ theme JSP tag , that is placed on the layout JSP. Here is an example portal descriptor
+ that specifies the phalanx theme as the theme for the entire portal, and the industrial
+ theme for the theme test page:
+ <programlisting>
+ <![CDATA[<portal>
+ <portal-name>default</portal-name>
+ <properties>
+ <!-- Set the theme for the default portal -->
+ <property>
+ <name>layout.id</name>
+ <value>phalanx</value>
+ </property>
+ </properties>
+ <pages>
+ <page>
+ <page-name>theme test</page-name>
+ <properties>
+ <!-- set a difference layout for this page -->
+ <property>
+ <name>layout.id</name>
+ <value>industrial</value>
+ </property>
+ </properties>
+ <window>
+ <window-name>CatalogPortletWindow</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>left</region>
+ <height>0</height>
+ </window>
+ </page>
+ </pages>
+</portal>]]></programlisting>
+ And here is an example of a layout JSP that defines a default
+ theme to use if no other theme was defined for the portal or page:
+ <programlisting>
+ <![CDATA[<%@ taglib uri="/WEB-INF/theme/portal-layout.tld" prefix="p" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title><%= "JBoss Portal :: 2.2 early (Industrial)" %></title>
+ <meta http-equiv="Content-Type" content="text/html;" />
+ <p:theme themeName='industrial' />
+ <p:headerContent />
+ </head>
+ <body id="body">
+ <div id="portal-container">
+ <div id="sizer">
+ <div id="expander">
+ <div id="logoName"></div>
+ <table border="0" cellpadding="0" cellspacing="0"
+ id="header-container">
+ <tr>
+ <td align="center" valign="top" id="header">
+ <div id="spacer"></div>
+ </td>
+ </tr>
+ </table>
+ <div id="content-container">
+ <p:region
+ regionName='This-Is-The-Page-Region-To-Query-The-Page'
+ regionID='This-Is-The-Tag-ID-Attribute-To-Match-The-CSS-Selector' />
+ <p:region regionName='left' regionID='regionA' />
+ <p:region regionName='center' regionID='regionB' />
+ <hr class="cleaner" />
+ <div id="footer-container" class="portal-copyright">
+ Powered by
+ <a class="portal-copyright"
+ href="http://www.jboss.com/products/jbossportal">
+ JBoss Portal
+ </a>
+ <br />
+ Theme by
+ <a class="portal-copyright"
+ href="http://www.novell.com">
+ Novell
+ </a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </body>
+</html>]]></programlisting>
+ For the function of the individual tags in this example, please
+ refer to the layout section of this document.
+ </para>
+ </section>
+ <section>
+ <title>How to write your own Theme</title>
+ <para>Ask your favorite web designer and/or consult the Theme Style Guide in this document.</para>
+ </section>
+ </section>
+ <section>
+ <title>Other Theme Functionalities and Features</title>
+ <para>This section contains all the functionalities that don't fit with any of the other
+ topics. Bits and pieces of useful functions that are related to the theme and layout
+ functionality.
+ </para>
+ <section>
+ <title>Content Rewriting and Header Content Injection</title>
+ <para>Portlets can have their content rewritten by the portal. This is useful if you want
+ to uniquely namespace markup (JavaScript functions for example) in the scope of a page.
+ The rewrite functionality can be applied to the portlet content (the markup fragment)
+ and to content a portlet wants to inject into the header. The rewrite is implemented as
+ specified in the WSRP (OASIS: Web Services for Remote Portlets; producer write). As a
+ result of this, the token to use for rewrite is the WSRP specified "wsrp_rewrite_". If
+ the portlet sets the following response property
+ <programlisting>res.setProperty("WSRP_REWRITE","true");</programlisting>
+ all occurrences
+ of the wsrp_rewrite_ token in the portlet fragment will be replaced with a unique token
+ (the window id). If the portlet also specifies content to be injected into the header of
+ the page, that content is also subject to this rewrite.
+ <programlisting><![CDATA[res.setProperty("HEADER_CONTENT", "
+ <script>function wsrp_rewrite_OnFocus(){alert('hello button');}</script>
+ ");]]>
+ </programlisting>
+ Note that in order for the header content injection to work, the layout needs to make
+ use of the headerContent JSP tag, like:
+ <programlisting>
+ <![CDATA[<%@ taglib uri="/WEB-INF/theme/portal-layout.tld" prefix="p" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title><JBoss Portal 2.2 early</title>
+ <meta http-equiv="Content-Type" content="text/html;" />
+
+ <p:headerContent />
+ </head>
+ <body id="body">
+ <p>...</p>
+ </body>
+</html>]]></programlisting>
+ </para>
+ </section>
+ <section>
+ <title>Declarative CSS Style injection</title>
+ <para>If a portlet needs a CSS style sheet to be injected via a link tag in the page
+ header, it can do so by providing the context relative URI to the file in the
+ jboss-portlet.xml descriptor, like:
+ <programlisting>
+ <![CDATA[<portlet-app>
+ <portlet>
+ <portlet-name>HeaderContentPortlet</portlet-name>
+ <header-content>
+ <link rel="stylesheet" type="text/css" href="/portlet-styles/HeaderContent.css"
+ title="" media="screen" />
+ </header-content>
+ </portlet>
+</portlet-app>]]></programlisting>
+ </para>
+ <para>This functionality, just like the previously described header content injection,
+ requires the layout JSP to add the "headerContent" JSP tag (see example above). One thing to note here is
+ the order of the tags. If the headerContent tag is placed after the theme tag, it will allow portlet
+ injected
+ CSS files to overwrite the theme's behavior, making this feature even more powerful!
+ </para>
+ </section>
+ <section>
+ <title>Disabling Portlet Decoration</title>
+ <para>One possible use of window properties is demonstrated in the divRenderer RenderSet implementation.
+ If a window definition (in the portal descriptor) contains a property like:
+ <programlisting>
+ <![CDATA[<window>
+ <window-name>HintPortletWindow</window-name>
+ <instance-ref>HintPortletInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
+ <properties>
+ <!-- turn the decoration off for this portlet (i.e. no title and mode/state links) -->
+ <property>
+ <name>theme.decorationRendererId</name>
+ <value>emptyRenderer</value>
+ </property>
+ </properties>
+</window>]]></programlisting>
+ the DivWindowRenderer will use the decoration renderer from the emptyRenderer
+ RenderSet to render the decoration for this window (not delegate to the DivDecorationRenderer).
+ As a result, the portlet window will be part of the rendered page, but it will not have a title,
+ nor will it have any links to change the portlet mode or window state.
+ </para>
+ </section>
+ </section>
+ <section>
+ <title>Theme Style Guide (based on the Industrial theme)</title>
+ <section>
+ <title>Overview</title>
+ <note><title>Note</title><para>This section to be updated soon with new CSS selectors found in JBoss Portal 2.6. The current
+ definitions remain, but the newer additions with regards to dashboards/drag-n-drop have not been
+ documented as of yet.</para>
+ </note>
+ <para>This document outlines the different selectors used to handle the layout and
+ look/feel of the Industrial theme included in the JBoss portal.
+ </para>
+ <para>A couple of things to know about the theming approach discussed below:</para>
+
+ <itemizedlist>
+
+ <listitem><para>Main premise behind this approach was to provide a clean separation between
+ the business and presentation layer of the portal. As we go through each selector
+ and explain the relation to the visual presentation on the page, this will become
+ more apparent.</para>
+ </listitem>
+ <listitem><para>The flexibility of the selectors used in the theme stylesheet allow a
+ designer to very easily customize the visual aspects of the portal, thereby taking
+ the responsibility off of the developers hands through allowing the designer to
+ quickly achieve the desired effect w/out the need to dive down into code and/or
+ having to deploy changes to the portal. This saves time and allows both developers
+ and designers to focus on what they do best.</para>
+ </listitem>
+ <listitem><para>This theme incorporates a liquid layout approach which allows elements on a
+ page to expand/contract based on screen resolution and provides a consistent look
+ across varying display settings. However, the stylesheet is adaptable to
+ facilitate a fixed layout and/or combination approach where elements are pixel
+ based and completely independent of viewport.</para>
+ </listitem>
+ <listitem><para>The pieces that make up the portal theme consist of at least one stylesheet
+ and any associated images. Having a consolidated set of files to control the
+ portal look and feel allows administrators to effortlessly swap themes on the fly.
+ In addition, this clean separation of the pieces that make up a specific theme
+ will enable sharing and collaboration of different themes by those looking to get
+ involved or contribute to the open source initiative.</para>
+ </listitem>
+ </itemizedlist>
+
+ </section>
+ <section>
+ <title>Main Screen Shot</title>
+ <para>Screen shot using color outline of main ID selectors used to control presentation
+ and layout:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/themeguide/selector-outline.gif" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+
+ <itemizedlist>
+ <listitem><para>Red Border - portal-container</para></listitem>
+ <listitem><para>Yellow Border - header-container</para></listitem>
+ <listitem><para>Orange Border - content-container</para></listitem>
+ <listitem><para>Blue Border - regionA/regionB</para></listitem>
+ <listitem><para>Green Border - portlet-container</para></listitem>
+ </itemizedlist>
+
+ </section>
+ <section>
+ <title>List of CSS Selectors</title>
+
+ <para>The following is a list of the selectors used in the theme stylesheet,
+ including a brief explanation of how each selector is used in the portal:
+ </para>
+ <itemizedlist>
+
+ <listitem>
+ <para>Portal Body Selector
+ <programlisting>#body {
+ background-color: #FFFFFF;
+ background-image: url( images/header_bg.gif );
+ background-repeat: repeat-x;
+ margin: 0px;
+ padding: 0px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ background-repeat: repeat-x;
+ font-size: 11px;
+ color: #656565;
+}</programlisting>
+ Usage: This selector controls the background of the page, and can be modified
+ to set a base font-family, layout margin, etc. that will be inherited by all
+ child elements that do not have their own individual style applied. By default,
+ the selector pulls an image background for the page.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Portal Header Selectors
+ <programlisting>#spacer {
+ width: 770px;
+ line-height: 0px;
+ font-size: 0px;
+ height: 0px;
+}</programlisting>
+ Usage: Spacer div used to keep header at certain width regardless of display
+ size. This is done to avoid overlapping of tab navigation in header. To account
+ for different display sizes, this selector can be modified to force a
+ horizontal scroll in the browser which eliminates any issue with overlapping
+ elements in the header.
+ <programlisting>#header-container {
+ background-repeat: repeat-y;
+ height: 100%;
+ min-width: 1000px;
+ width: 100%;
+ position: absolute;
+ bottom: 5px;*/
+ }</programlisting>
+ Usage: Wrapper selector used to control the position of the header on the page.
+ This selector is applied as an ID on the
+ table used to structure the header. You can adjust the attributes to reposition
+ the header location on the page and/or create margin space on the top, right,
+ bottom and left sides of the header.
+ Screenshot:
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/themeguide/portal-header.gif" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+
+ <programlisting>#header {
+ height: 65px;
+ width: 100%;
+ padding: 0px;
+ margin: 0px;
+ z-index: 1;
+}</programlisting>
+ Usage: This selector applies the header background image in the portal. It can
+ be adjusted to accommodate a header background of a certain width/height or, as
+ it currently does, repeat the header graphic so that it tiles across the header
+ portion of the page.
+ <programlisting>#logoName {
+ background-image: url( images/logo.gif );
+ background-repeat: no-repeat;
+ float: left;
+ width: 250px;
+ height: 25px;
+ z-index: 2;
+ position: absolute;
+ left: 20px;
+ top: 10px;
+}</programlisting>
+ Usage: Logo selector which is used to brand the header with a specific,
+ customized logo. The style is applied as an ID on an absolutely positioned DIV
+ element which enables it to be moved to any location on the page, and allows it
+ to be adjusted to accommodate a logo of any set width/height.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Portal Layout Region Selectors
+ <programlisting>#portal-container {
+/* part of below IE hack to preserve min-width for portlet regions */
+/*width: 100%;*/
+ margin: 4px 2% 0px 2%;
+
+ padding: 0 350px 0 350px;
+}</programlisting>
+ Usage: Wrapper for entire portal which starts/ends after/before the BODY tag
+ (see red border in screen shot). The padding attribute for this selector is
+ used to preserve a minimum width setting for the portlet regions (discussed
+ below). Similar to body selector, this style can modified to create margin or
+ padding space on the top, right, bottom and left sections of the page. It
+ provides the design capability to accommodate most layouts (e.g. a centered
+ look such as the phalanx theme where there is some spacing around the content
+ of the portal, or a full width look as illustrated in the Industrial theme).
+ Screenshot:
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/themeguide/region-selectors.gif" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+
+ <programlisting>/* min width for IE */
+#expander {
+ position: relative;
+ padding: 0 0 0 0;
+
+ margin: 0 -350px 0 -350px;
+ min-width: 770px;
+ padding: 0 0 0 0;
+}
+
+/* min width hack for IE */
+#sizer {
+ width: 100%;
+}
+
+/* IE Hack \*/
+* html #portal-container,
+ * html #sizer,
+ * html #expander {
+ height: 0;
+}</programlisting>
+ Usage: These selectors are used in conjunction with the above,
+ portal-container, selector to preserve a minimum width setting for the portlet
+ regions. This was implemented to maintain a consistent look across different
+ browsers.
+ <programlisting>#content-container {
+ height: 100%;
+ text-align: left;
+ width: 100%;
+ min-width: 770px;
+ /*
+ position: absolute;
+ top: 70px;
+ left: 0px; / * z-index: 1; * /
+ / * part of below IE hack
+padding: 0 350px 0 350px; * /
+ padding: 0px 100px 0px 0px;
+ */
+}</programlisting>
+ Usage: Wrapper that contains all regions in portal with the exception of the
+ header (see orange border in screen shot). Its attributes can be adjusted to
+ create margin space on page, as well as control positioning of the area of the
+ page below the header.
+ <programlisting>/* portlet regions within content-container. this includes footer-container. */
+#regionA {
+ width: 30%;
+ float: left;
+ margin: 0px;
+ padding: 0px;
+ min-width: 250px; /*height: 300px;*/
+}</programlisting>
+ Usage: First portlet region located within the content-container (see blue
+ border in screen shot). This selector controls the width of the region as well
+ as its location on the page. Designers can very easily reposition this region
+ in the portal (e.g. swap left regionA with right regionB, etc.) by adjusting
+ the attributes of this selector.
+ <programlisting>#regionB {
+ /* test to swap columns..
+margin: 0 30% 0 0; */
+
+ /*two column layout
+margin: 0 0 0 30%;*/
+ padding: 0px; /* test to add 3rd region in layout...*/
+ width: 67%;
+ float: left; /*height: 300px;*/
+}</programlisting>
+ Usage: Second portlet region located within the content-container (see blue
+ border in screen shot). Similar to regionA, this selector controls the width of
+ the region as well as its location on the page.
+ <programlisting>#regionC {
+/* inclusion of 3rd region - comment out for 2 region testing */
+ padding: 0px;
+ margin: 0px;
+ width: 28%;
+ float: left; /*hide 3rd region*/
+ display: none;
+}</programlisting>
+ Usage: Third portlet region located within the content-container (please refer
+ to blue border in screen shot representing regionA and regionB for an example).
+ Used for 3 column layout. Similar to regionA and regionB, this selector
+ controls the width of the region as well as its location on the page.
+ Screenshot:
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/themeguide/regions.gif" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+
+ <programlisting>
+hr.cleaner {
+clear:both;
+height:1px;
+margin: -1px 0 0 0;
+padding:0;
+border:none;
+visibility: hidden;
+}
+ </programlisting>
+ Usage: Used to clear floats in regionA, regionB and regionC DIVs so that footer
+ spans bottom of page.
+ <programlisting>#footer-container {
+ padding: 10px;
+ text-align: center;
+ clear: both;
+}</programlisting>
+ Usage: Footer region located towards the bottom of the content-container (see
+ above screen shot). This region spans the entire width of the page, but can be
+ adjusted (just like regionA, regionB and regionC) to take on a certain position
+ and width/height in the layout.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Portlet Container Window Selectors
+ <programlisting>.portlet-container {
+ padding: 10px;
+}</programlisting>
+ Usage: Wrapper that surrounds the portlet windows (see green border in screen
+ shot). Currently, this selector is used to create space (padding) between the
+ portlets displayed in each particular region.
+ <programlisting>.portlet-titlebar-title {
+ color: #656565;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 12px;
+ font-weight: bold;
+ white-space: nowrap;
+ line-height: 100%;
+ float: left;
+ text-indent: 5px;
+ padding-top: 5px;
+ padding-bottom: 6px;
+}</programlisting>
+ Usage: Class used to style the title of each portlet window. Attributes of this
+ selector set font properties, indentation and position of title.
+ <programlisting>.portlet-mode-container {
+ float: right;
+ padding-top: 4px;
+ white-space: nowrap;
+}</programlisting>
+ Usage: Wrapper that contains the portlet window modes that display in the top
+ right section of the portlet windows.
+ <programlisting>.portlet-titlebar-left {
+ background-image: url( images/portlet-top-left.gif );
+ background-repeat: no-repeat;
+ width: 9px;
+ height: 29px;
+ min-width: 9px;
+ background-position: bottom;
+}</programlisting>
+ Usage: Used to style the top left corner of the portlet window. Each portlet
+ window consists of one table that has 3 columns and 3 rows. This selector
+ styles the first column (TD) in the first row (TR).
+ Screenshot:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/themeguide/portlet-titlebar-left.gif"/>
+ </imageobject>
+ </mediaobject>
+ <programlisting>.portlet-titlebar-center {
+ background-image: url( images/portlet-top-middle.gif );
+ background-repeat: repeat-x;
+ height: 29px;
+ background-position: bottom;
+}</programlisting>
+ Usage: Used to style the center section of the portlet title bar. Each portlet
+ window consists of one table that has 3 columns and 3 rows. This selector
+ styles the second column (TD) in the first row (TR).
+ Screenshot:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/themeguide/portlet-titlebar-center.gif"/>
+ </imageobject>
+ </mediaobject>
+ <programlisting>.portlet-titlebar-right {
+ background-image: url( images/portlet-top-right.gif );
+ background-repeat: no-repeat;
+ width: 10px;
+ height: 30px;
+ min-width: 10px;
+ background-position: bottom left;
+}</programlisting>
+ Usage: Used to style the top right corner of the portlet window. Each portlet
+ window consists of one table that has 3 columns and 3 rows. This selector
+ styles the third column (TD) in the first row (TR).
+ Screenshot:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/themeguide/portlet-titlebar-right.gif"/>
+ </imageobject>
+ </mediaobject>
+ <programlisting>.portlet-content-left {
+ background-image: url( images/portlet-left-vertical.gif );
+ background-repeat: repeat-y;
+ width: 9px;
+ min-width: 9px;
+ /*
+ width:20px;
+ background-color:#FFFFFF;
+ border-left: 1px solid #dfe8ed;
+ */
+}</programlisting>
+ Usage: Used to style the left hand vertical lines that make up the portlet
+ window. Each portlet window consists of one table that has 3 columns and 3
+ rows. This selector styles the first column (TD) in the second row (TR).
+
+ Screenshot:
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/themeguide/portlet-content-left.gif"/>
+ </imageobject>
+ </mediaobject>
+ <programlisting>.portlet-content-center {
+ vertical-align: top;
+ padding: 0;
+ margin: 0;
+}</programlisting>
+ Usage: Used to style the center, content area where the portlet content is
+ injected into the portlet window (see below screen). Attributes for this
+ selector control the positioning of the portlet content as well as the
+ background and font properties. Each portlet window consists of one table that
+ has 3 columns and 3 rows. This selector styles the second column (TD) in the
+ second row (TR).
+ Screenshot:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/themeguide/portlet-content-center.gif"/>
+ </imageobject>
+ </mediaobject>
+ <programlisting>.portlet-body {
+ background-color: #FFFFFF;
+ padding: 0;
+ margin: 0;
+}</programlisting>
+ Usage: An extra selector for controlling the content section of the portlet
+ windows (see below screen). This was added to better deal with structuring the
+ content that gets inserted/rendered in the portlet windows, specifically if the
+ content is causing display problems in a portlet.
+ Screenshot:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/themeguide/portlet-body.gif"/>
+ </imageobject>
+ </mediaobject>
+ <programlisting>.portlet-content-right {
+ background-image: url( images/portlet-right-vertical.gif );
+ height: 100%;
+ background-repeat: repeat-y;
+ background-position: left;
+ width: 5px;
+ min-width: 5px;
+ padding: 0;
+ margin: 0;
+ /*
+ width:5px;
+ background-color:#FFFFFF;
+ border-right: 1px solid #dfe8ed;
+ */
+}</programlisting>
+ Usage: Used to style the right hand vertical lines that make up the portlet
+ window. Each portlet window consists of one table that has 3 columns and 3
+ rows. This selector styles the third column (TD) in the second row (TR).
+
+ Screenshot:
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/themeguide/portlet-content-right.gif"/>
+ </imageobject>
+ </mediaobject>
+ <programlisting>.portlet-footer-left {
+ background-image: url( images/portlet-bottom-left.gif );
+ width: 9px;
+ height: 4px;
+ background-repeat: no-repeat;
+ background-position: top right;
+ min-width: 9px;
+ padding: 0;
+ margin: 0;
+ /*
+ background-color:#FFFFFF;
+ border-bottom: 1px solid #98b7c6;
+ border-left: 1px solid #dfe8ed;
+ height:5px;
+ */
+}</programlisting>
+ Usage: Used to style the bottom left corner of the portlet window. Each portlet
+ window consists of one table that has 3 columns and 3 rows. This selector
+ styles the first column (TD) in the third row (TR).
+ Screenshot:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/themeguide/portlet-footer-left.gif"/>
+ </imageobject>
+ </mediaobject>
+ <programlisting>.portlet-footer-center {
+ background-image: url( images/portlet-bottom-middle.gif );
+ height: 4px;
+ background-repeat: repeat-x;
+ /* background-color:#FFFFFF;
+ border-bottom: 1px solid #98b7c6;
+ height:5px;
+ */
+}</programlisting>
+ Usage: Used to style the bottom, center of the portlet window (i.e. the bottom
+ horizontal line in the Industrial theme). Each portlet window consists of one
+ table that has 3 columns and 3 rows. This selector styles the second column
+ (TD) in the third row (TR).
+ Screenshot:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/themeguide/portlet-footer-center.gif"/>
+ </imageobject>
+ </mediaobject>
+ <programlisting>.portlet-footer-right {
+ background-image: url( images/portlet-bottom-right.gif );
+ width: 5px;
+ height: 4px;
+ background-repeat: no-repeat;
+ min-width: 5px;
+ /*
+ background-color:#FFFFFF;
+ border-bottom: 1px solid #98b7c6;
+ border-right: 1px solid #dfe8ed;
+ height:5px;
+ */
+}</programlisting>
+ Usage: Used to style the bottom right corner of the portlet window. Each
+ portlet window consists of one table that has 3 columns and 3 rows. This
+ selector styles the third column (TD) in the third row (TR).
+ Screenshot:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/themeguide/portlet-footer-right.gif"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ </listitem>
+ <listitem>
+ <para>Portlet Window Mode Selectors
+ <programlisting>.portlet-mode-maximized {
+ background-image: url( images/ico_16_maximize.gif );
+ background-repeat: no-repeat;
+ width: 16px;
+ height: 16px;
+ float: left;
+ display: inline;
+ cursor: pointer;
+ padding-left: 3px;
+}</programlisting>
+ Usage: Selector used to display the portlet maximize mode. Attributes for this
+ selector control the display and dimensions of the maximize icon, including the
+ behavior of the mouse pointer when hovering the mode.
+ <programlisting>.portlet-mode-minimized {
+ background-image: url( images/ico_16_minimize.gif );
+ background-repeat: no-repeat;
+ width: 16px;
+ height: 16px;
+ float: left;
+ display: inline;
+ cursor: pointer;
+ padding-left: 3px;
+}</programlisting>
+ Usage: Selector used to display the portlet minimize mode. Attributes for this
+ selector control the display and dimensions of the minimize icon, including the
+ behavior of the mouse pointer when hovering the mode.
+ <programlisting>.portlet-mode-normal {
+ background-image: url( images/ico_16_normal.gif );
+ width: 16px;
+ height: 16px;
+ background-repeat: no-repeat;
+ float: left;
+ display: inline;
+ cursor: pointer;
+ padding-left: 3px;
+}</programlisting>
+ Usage: Selector used to display the portlet normal mode (i.e. the icon that
+ when clicked, restores the portlet to the original, default view). Attributes
+ for this selector control the display and dimensions of the normal icon,
+ including the behavior of the mouse pointer when hovering the mode.
+ <programlisting>.portlet-mode-help {
+ background-image: url( images/ico_16_help.gif );
+ width: 16px;
+ height: 16px;
+ background-repeat: no-repeat;
+ float: left;
+ display: inline;
+ cursor: pointer;
+ padding-left: 3px;
+}</programlisting>
+ Usage: Selector used to display the portlet help mode. Attributes for this
+ selector control the display and dimensions of the help icon, including the
+ behavior of the mouse pointer when hovering the mode.
+ <programlisting>.portlet-mode-edit {
+ background-image: url( images/ico_edit.gif );
+ background-repeat: no-repeat;
+ width: 28px;
+ height: 16px;
+ float: left;
+ display: inline;
+ cursor: pointer;
+ padding-left: 3px;
+}</programlisting>
+ Usage: Selector used to display the portlet edit mode. Attributes for this
+ selector control the display and dimensions of the edit icon, including the
+ behavior of the mouse pointer when hovering the mode.
+ <programlisting>.portlet-mode-remove {
+ background-image: url( images/ico_16_remove.gif );
+ background-repeat: no-repeat;
+ width: 16px;
+ height: 16px;
+ float: left;
+ display: inline;
+ cursor: pointer;
+ padding-left: 3px;
+}</programlisting>
+ Usage: Currently not available. But here is the intended use: Selector used to
+ display the portlet remove mode. Attributes for this selector control the
+ display and dimensions of the remove icon, including the behavior of the mouse
+ pointer when hovering the mode.
+ <programlisting>.portlet-mode-view {
+ background-image: url( images/ico_cancel.gif );
+ background-repeat: no-repeat;
+ width: 28px;
+ height: 16px;
+ float: left;
+ display: inline;
+ cursor: pointer;
+ padding-left: 3px;
+ padding-right: 20px;
+}</programlisting>
+ Usage: Selector used to display the portlet view mode. Attributes for this
+ selector control the display and dimensions of the view icon, including the
+ behavior of the mouse pointer when hovering the mode.
+ <programlisting>.portlet-mode-reload {
+ background-image: url( images/ico_16_reload.gif );
+ background-repeat: no-repeat;
+ width: 16px;
+ height: 16px;
+ float: left;
+ display: inline;
+ cursor: pointer;
+ padding-left: 3px;
+}</programlisting>
+ Usage: Currently not available. But here is the intended use: Selector used to
+ display the portlet reload mode. Attributes for this selector control the
+ display and dimensions of the reload icon, including the behavior of the mouse
+ pointer when hovering the mode.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Copyright Selectors
+ <programlisting>.portal-copyright {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10px;
+ color: #5E6D7A;
+}
+
+a.portal-copyright {
+ color: #768591;
+ text-decoration: none;
+}
+
+a.portal-copyright:hover {
+ color: #bcbcbc;
+ text-decoration: underline;
+}</programlisting>
+ Usage: The above three selectors are used to style copyright content in the
+ portal. The portal-copyright selector sets the font properties (color, etc.),
+ and the a.portal-copyright/a.portal-copyright:hover selectors style any links
+ that are part of the copyright information.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Table Selectors
+ <programlisting>.portlet-table-header {
+ background-color: #eef;
+ padding: 0 5px 5px 5px;
+ font-weight: bold;
+ color: #656565;
+ font-size: 12px;
+ border-bottom: 1px solid #d5d5d5;
+}</programlisting>
+ Usage: Intended for styling tables (specifically, the TH
+ or table header elements) that get rendered within a portlet window.
+ <programlisting>.portlet-table-body {
+
+}</programlisting>
+ Usage: Intended for styling the table body element used
+ to group rows in a table.
+ <programlisting>.portlet-table-alternate {
+ background-color: #E6E8E5;
+ border-bottom: 1px solid #d5d5d5;
+}</programlisting>
+ Usage: Used to style the background color (and possibly
+ other attributes) for every other row within a table.
+ <programlisting>.portlet-table-selected {
+ color: #000;
+ font-size: 12px;
+ background-color: #CBD4E6;
+}</programlisting>
+ Usage: Used to style text, color, etc. in a selected cell
+ range.
+ <programlisting>.portlet-table-subheader {
+ font-weight: bold;
+ color: #000;
+ font-size: 12px;
+}</programlisting>
+ Usage: Used to style a subheading within a table that
+ gets rendered in a portlet.
+ <programlisting>.portlet-table-footer {
+ padding: 5px 5px 0 5px;
+ font-weight: bold;
+ color: #656565;
+ font-size: 12px;
+ border: none;
+ border-top: 1px solid #d5d5d5;
+}</programlisting>
+ Usage: Similar to portlet-table-header and
+ portlet-table-body, this selector is used to style the table footer element
+ which is used to group the footer row in a table.
+ <programlisting>.portlet-table-text {
+ padding: 3px 5px;
+ border-bottom: 1px solid #d5d5d5;
+}</programlisting>
+ Usage: Text that belongs to the table but does not fall in one of the other
+ categories (e.g. explanatory or help text that is associated with the table).
+ This selector can also be modified to provide styled text that can be used in
+ all tables that are rendered within a portlet.
+ </para>
+ </listitem>
+ <listitem>
+ <para>FONT Selectors
+ <programlisting>.portlet-font {
+ color: #000000;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+}</programlisting>
+ Usage: Used to style the font properties on text used in a portlet. Typically
+ this class is used for the display of non-accentuated information.
+ <programlisting>.portlet-font-dim {
+ color: #777777;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+}</programlisting>
+ Usage: A lighter version (color-wise) of the portlet-font selector.
+ </para>
+ </listitem>
+ <listitem>
+ <para>FORM Selectors
+ <programlisting>.portlet-form-label {
+ font-size: 10px;
+ color: #656565;
+}</programlisting>
+ Usage: Text used for the descriptive label of an entire form (not the label for
+ each actual form field).
+ <programlisting>.portlet-form-button {
+ font-size: 10px;
+ font-weight: bold;
+ color: #FFFFFF;
+ background-color: #5078aa;
+ border-top: 1px solid #97B7C6;
+ border-left: 1px solid #97B7C6;
+ border-bottom: 1px solid #254869;
+ border-right: 1px solid #254869;
+}</programlisting>
+ Usage: Used to style portlet form buttons (e.g. Submit).
+ <programlisting>.portlet-icon-label {
+
+}</programlisting>
+ Usage: Text that appears beside a context dependent
+ action icon.
+ <programlisting>.portlet-dlg-icon-label {
+
+}</programlisting>
+ Usage: Text that appears beside a "standard" icon (e.g
+ Ok, or Cancel).
+ <programlisting>.portlet-form-field-label {
+ font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
+ font-size: 10px;
+ color: #000;
+ vertical-align: bottom;
+ white-space: nowrap
+}</programlisting>
+ Usage: Selector used to style portlet form field labels.
+ <programlisting>.portlet-form-field {
+ font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
+ font-size: 10px;
+ color: #000; /*margin-top: 10px;*/
+}</programlisting>
+ Usage: Selector used to style portlet form fields (i.e. INPUT controls, SELECT
+ elements, etc.).
+ </para>
+ </listitem>
+ <listitem>
+ <para>LINK Selectors
+ <programlisting>.portal-links:link {
+ font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
+ font-size: 11px;
+ font-weight: bold;
+ color: #242424;
+ text-decoration: none;
+}
+
+.portal-links:hover {
+ font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
+ font-size: 11px;
+ font-weight: bold;
+ color: #5699B7;
+ text-decoration: none;
+}
+
+.portal-links:active {
+ font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
+ font-size: 11px;
+ font-weight: bold;
+ color: #242424;
+ text-decoration: none;
+}
+
+.portal-links:visited {
+ font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
+ font-size: 11px;
+ font-weight: bold;
+ color: #242424;
+ text-decoration: none;
+}</programlisting>
+ Usage: The above four selectors are used to style links in the portal. Each
+ pseudo class (i.e. hover, active, etc.) provides a different link style.
+ </para>
+ </listitem>
+ <listitem>
+ <para>MESSAGE Selectors
+ <programlisting>.portlet-msg-status {
+ font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
+ font-size: 12px;
+ font-style: normal;
+ color: #336699;
+}</programlisting>
+ Usage: Selector used to signify the status of a current operation that takes
+ place in the portlet (e.g. "saving results", "step 1 of 4").
+ <programlisting>.portlet-msg-info {
+ font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
+ font-size: 12px;
+ font-style: italic;
+ color: #000;
+}</programlisting>
+ Usage: Selector used to signify general information in a portlet (e.g. help
+ messages).
+ <programlisting>.portlet-msg-error {
+ color: red;
+ font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
+ font-size: 12px;
+ font-weight: bold;
+}</programlisting>
+ Usage: Selector used to signify an error message in the portlet (e.g. form
+ validation error).
+ <programlisting>.portlet-msg-alert {
+ font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
+ font-size: 12px;
+ font-weight: bold;
+ color: #821717;
+}</programlisting>
+ Usage: Selector used to style an alert that is displayed to the user.
+ <programlisting>.portlet-msg-success {
+ font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
+ font-size: 12px;
+ font-weight: bold;
+ color: #359630;
+}</programlisting>
+ Usage: Selector used to indicate successful completion of an action in a
+ portlet (e.g. "save successful").
+ </para>
+ </listitem>
+ <listitem>
+ <para>SECTION Selectors
+ <programlisting>.portlet-section-header {
+ font-weight: bold;
+ color: #656565;
+ font-size: 12px;
+}
+</programlisting>
+ Usage: Table or section header.
+ <programlisting>.portlet-section-body {
+ color: #656565;
+}</programlisting>
+ Usage: Normal text in a table cell.
+ <programlisting>.portlet-section-alternate {
+ background-color: #F2F2F2;
+}</programlisting>
+ Usage: Used to style background color and text in every other table row.
+ <programlisting>.portlet-section-selected {
+ background-color: #CBD4E6;
+}</programlisting>
+ Usage: Used to style background and font properties in a selected cell range.
+ <programlisting>.portlet-section-subheader {
+ font-weight: bold;
+ font-size: 10px;
+}</programlisting>
+ Usage: Used to style a subheading within a table/section that gets rendered in
+ a portlet.
+ <programlisting>.portlet-section-footer {
+ font-size: 11px;
+}</programlisting>
+ Usage: Used to style footer area of a section/table that gets rendered in a
+ portlet.
+ <programlisting>.portlet-section-text {
+ font-size: 12px;
+ font-style: italic;
+}</programlisting>
+ Usage: Text that belongs to a section but does not fall in
+ one of the other categories. This selector can also be modified to provide
+ styled text that can be used in all sections that are rendered within a
+ portlet.
+ </para>
+ </listitem>
+ <listitem>
+ <para>MENU Selectors
+ <programlisting>
+.portlet-menu {}
+ </programlisting>
+ Usage: General menu settings such as background color,
+ margins, etc.
+ <programlisting>.portlet-menu-item {
+ color: #242424;
+ text-decoration: none;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 12px;
+}</programlisting>
+ Usage: Normal, unselected menu item.
+ <programlisting>.portlet-menu-item:hover {
+ color: #5699B7;
+ text-decoration: none;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 12px;
+}</programlisting>
+ Usage: Used to style hover effect on a normal, unselected
+ menu item.
+ <programlisting>
+.portlet-menu-item-selected {}
+ </programlisting>
+ Usage: Applies to selected menu items.
+ <programlisting>
+.portlet-menu-item-selected:hover {}
+ </programlisting>
+ Usage: Selector styles the hover effect on a selected menu
+ item.
+ <programlisting>
+.portlet-menu-cascade-item {}
+ </programlisting>
+ Usage: Normal, unselected menu item that has sub-menus.
+ <programlisting>
+.portlet-menu-cascade-item-selected {}
+ </programlisting>
+ Usage: Selected sub-menu item.
+ <programlisting>
+.portlet-menu-description {}
+ </programlisting>
+ Usage: Descriptive text for the menu (e.g. in a help
+ context below the menu).
+ <programlisting>
+.portlet-menu-caption {}
+ </programlisting>
+ Usage: Selector used to style menu captions.
+ </para>
+ </listitem>
+ <listitem>
+ <para>WSRP Selectors
+ <programlisting>
+.portlet-horizontal-separator {}
+ </programlisting>
+ Usage: A separator bar similar to a horizontal rule, but
+ with styling matching the page.
+ <programlisting>
+.portlet-nestedTitle-bar {}
+ </programlisting>
+ Usage: Allows portlets to mimic the title bar when nesting
+ something.
+ <programlisting>
+.portlet-nestedTitle {}
+ </programlisting>
+ Usage: Allows portlets to match the textual character of
+ the title on the title bar.
+ <programlisting>
+.portlet-tab {}
+ </programlisting>
+ Usage: Support portlets having tabs in the same style as
+ the page or other portlets.
+ <programlisting>
+.portlet-tab-active {}
+ </programlisting>
+ Usage: Highlight the tab currently being shown.
+ <programlisting>
+.portlet-tab-selected {}
+ </programlisting>
+ Usage: Highlight the selected tab (not yet active).
+ <programlisting>
+.portlet-tab-disabled {}
+ </programlisting>
+ Usage: A tab which can not be currently activated.
+ <programlisting>
+.portlet-tab-area {}
+ </programlisting>
+ Usage: Top level style for the content of a tab.
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ </section>
+ </section>
+ <section>
+ <title>Additional Ajax selectors</title>
+ <para>Since 2.6 JBoss Portal has ajax features. Those features introduce a couple of
+ CSS selectors that enables further customization of the visual look and feel. Indeed by default
+ those CSS styles are provided by ajaxified layouts but it may not fit with some themes. It is possible
+ to redefine them in the stylesheet of the themes.</para>
+ <itemizedlist>
+ <listitem><para>
+ <programlisting>
+.dyna-region {}
+ </programlisting>
+
+ Usage:
+ Denotes a dynamic region which can be subject to ajax capabilities.</para>
+ </listitem>
+ <listitem><para>
+ <programlisting>
+.dyna-window {}
+ </programlisting>
+
+ Usage:
+ Denotes a dynamic window which can be subject to ajax capabilities.</para>
+ </listitem>
+ <listitem><para>
+ <programlisting>
+.dyna-decoration {}
+ </programlisting>
+
+ Usage:
+ Denotes a dynamic decorator which can be subject to ajax capabilities.</para>
+ </listitem>
+ <listitem><para>
+ <programlisting>
+.dyna-portlet {}
+ </programlisting>
+
+ Usage:
+ Denotes a dynamic content which can be subject to ajax capabilities.</para>
+ </listitem>
+ <listitem><para>
+ <programlisting>
+.dnd-handle {
+ cursor: move;
+}
+ </programlisting>
+
+ Usage:
+ Denotes the handle offered by draggable windows. By default it changes the mouse shape to indicate
+ to the user that his mouse is hovering a draggable window.</para>
+ </listitem>
+ <listitem><para>
+ <programlisting>
+.dnd-droppable {
+ border: red 1px dashed;
+ background-color: Transparent;
+}
+ </programlisting>
+
+ Usage:
+ Denotes a zone where a user can drop a window during drag and drop operations. This selector is added
+ and removed dynamically at runtime by the ajax framework and is not present in the generated markup.</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+</chapter>
+ <chapter id="ajax">
+<!-- <chapterinfo>
+ <author>
+ <firstname>Julien</firstname>
+ <surname>Viet</surname>
+ </author>
+ </chapterinfo>-->
+ <title>Ajax</title>
+ <para>This section covers the ajax features provided by the portal.</para>
+ <section>
+ <title>Introduction</title>
+ <para>Todo</para>
+ </section>
+ <section>
+ <title>Ajaxified markup</title>
+ <section>
+ <title>Ajaxified layouts</title>
+ <para>Part of the Ajax capabilities are implemented in the layout framework which provide the structure for
+ generating portal pages. The good news is that the existing layout only requires a few modifications in
+ order to be ajaxified.</para>
+ <para>We will use as example an simplified version of the layout JSP provided in JBoss Portal 2.6 and outline
+ what are the required changes that makes it an ajaxified layout:
+ <programlisting><![CDATA[
+<%@ taglib uri="/WEB-INF/theme/portal-layout.tld" prefix="p" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="Content-Type" content="text/html;"/>
+ <!-- inject the theme, default to the Renaissance theme if
+ nothing is selected for the portal or the page -->
+ <p:theme themeName="renaissance"/>
+ <!-- insert header content that was possibly set by portlets on the page -->
+ <p:headerContent/>
+</head>
+
+<body id="body">
+<p:region regionName='AJAXScripts' regionID='AJAXScripts'/>
+<div id="portal-container">
+ <div id="sizer">
+ <div id="expander">
+ <div id="logoName"></div>
+ <table border="0" cellpadding="0" cellspacing="0" id="header-container">
+ <tr>
+ <td align="center" valign="top" id="header">
+
+ <!-- Utility controls -->
+ <p:region regionName='dashboardnav' regionID='dashboardnav'/>
+
+ <!-- navigation tabs and such -->
+ <p:region regionName='navigation' regionID='navigation'/>
+ <div id="spacer"></div>
+ </td>
+ </tr>
+ </table>
+ <div id="content-container">
+ <!-- insert the content of the 'left' region of the page,
+ and assign the css selector id 'regionA' -->
+ <p:region regionName='left' regionID='regionA'/>
+ <!-- insert the content of the 'center' region of the page,
+ and assign the css selector id 'regionB' -->
+ <p:region regionName='center' regionID='regionB'/>
+ <hr class="cleaner"/>
+ </div>
+ </div>
+ </div>
+</div>
+
+<p:region regionName='AJAXFooter' regionID='AJAXFooter'/>
+
+</body>
+</html>
+]]></programlisting>
+ <itemizedlist>
+ <listitem><para><![CDATA[<p:theme themeName="renaissance"/>]]> should be already present as it exists since 2.4 but is even more
+ necessary as it will inject in the page the reference to the ajax stylesheet.</para></listitem>
+ <listitem><para><![CDATA[<p:region regionName='AJAXScripts' regionID='AJAXScripts'/>]]> should be added before any other region
+ in the markup of the layout.</para></listitem>
+ <listitem><para><![CDATA[<p:region regionName='AJAXFooter' regionID='AJAXFooter'/>]]> should be added after any other region
+ in the markup of the layout.</para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ <section>
+ <title>Ajaxified renderers</title>
+ <para>At runtime the portal combines the layout and the renderers in order create the markup returned to the
+ web browser. The most used render set is the divRenderer. Renderers only need a modification in the deployment
+ descriptor to indicate that they support ajax. Here is the declaration of the default divRenderer now in 2.6:</para>
+ <programlisting role="XML"><![CDATA[
+<renderSet name="divRenderer">
+ <set content-type="text/html">
+ <ajax-enabled>true</ajax-enabled>
+ <region-renderer>org.jboss.portal.theme.impl.render.div.DivRegionRenderer
+ </region-renderer>
+ <window-renderer>org.jboss.portal.theme.impl.render.div.DivWindowRenderer
+ </window-renderer>
+ <portlet-renderer>org.jboss.portal.theme.impl.render.div.DivPortletRenderer
+ </portlet-renderer>
+ <decoration-renderer>org.jboss.portal.theme.impl.render.div.DivDecorationRenderer
+ </decoration-renderer>
+ </set>
+</renderSet>
+]]></programlisting>
+ <para>You should notice the <![CDATA[<ajax-enabled>true</ajax-enabled>]]> which indicates that the render set
+ supports ajaxification.</para>
+ </section>
+ </section>
+ <section>
+ <title>Ajaxified pages</title>
+ <para>The ajaxification of the portal pages can be configured in a fine grained manner. Thanks to the portal
+ object properties it is possible to control which pages support ajax and which page do not support ajax. The
+ administrator must pay attention to the fact that property values are inherited in the object hierarchy.</para>
+ <section>
+ <title>Drag and Drop</title>
+ <para>That feature is only effective in dashboards as it requires the offer personalization of the page
+ layout per user. By default the feature is enabled thanks to a property set on the dashboard object.
+ It is possible to turn off that property if the administrator does not want to expose that feature
+ to its user.</para>
+ <para>In the file <emphasis>jboss-portal.sar/conf/data/default-object.xml</emphasis> is declared and configured the
+ creation of the dashboard portal:</para>
+ <programlisting role="XML"><![CDATA[
+<deployment>
+ <parent-ref/>
+ <if-exists>keep</if-exists>
+ <context>
+ <context-name>dashboard</context-name>
+ <properties>
+ ...
+ <property>
+ <name>theme.dyna.dnd_enabled</name>
+ <value>true</value>
+ </property>
+ ...
+ </properties>
+ ...
+ </context>
+</deployment>
+]]></programlisting>
+ <para>The property <emphasis>theme.dyna.dnd_enabled</emphasis> is set to the value <emphasis>true</emphasis>
+ which means that the dashboard object will provide the drag and drop feature.
+ </para>
+ </section>
+ <section>
+ <title>Partial refresh</title>
+ <para>Partial refresh is a very powerful feature which allows the portal to optimize the refreshing
+ of portlets on a page. When one portlet is invoked, instead of redrawing the full page, the portal is able
+ to detect which portlets needs to be refreshed and will update only these portlets.</para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/ajax/partial-refresh.png" format="PNG" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ <para>The portal providing partial refresh.</para>
+
+ <section>
+ <title>Portal objects configuration</title>
+ <para>Like with the drag and drop feature, partial page refresh is controlled via properties on portal objects.
+ The name of the property is <emphasis>theme.dyna.partial_refresh_enabled</emphasis> and its values can
+ be <emphasis>true</emphasis> or <emphasis>false</emphasis>. When this property is set on an object
+ it is automatically inherited by the sub hierarchy located under that object. By default the drag
+ and drop feature is positioned on the dashboard object and not on the rest of the portal objects.
+ </para>
+ <programlisting role="XML"><![CDATA[
+<deployment>
+ <parent-ref/>
+ <if-exists>keep</if-exists>
+ <context>
+ <context-name>dashboard</context-name>
+ <properties>
+ ...
+ <property>
+ <name>theme.dyna.partial_refresh_enabled</name>
+ <value>true</value>
+ </property>
+ ...
+ </properties>
+ ...
+ </context>
+</deployment>
+]]></programlisting>
+ <note>
+ <para>The partial page refresh feature is compatible with the Portal API. The Portal API allows programmatic
+ update of the state of portlets at runtime. For instance it is possible to modify the window state or
+ the mode of several portlets on a given page. When such event occurs, the portal detects the changes
+ which occurred and will update the portlet fragments in the page.</para>
+ </note>
+ <para>It is possible to change that behavior at runtime using the property editor of the management portlet.
+ If you want to enable partial refreshing on the default portal you should set the property to true
+ directly on the portal and all the pages in that portal will automatically inherit those properties.</para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/ajax/partial-refresh-admin.png" format="PNG" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ <para>The default portal configured for partial page refresh</para>
+
+ </section>
+ <section>
+ <title>Portlet configuration</title>
+ <para>
+ By default any portlet will support partial refreshing. When does the portal performs partial page
+ refreshing ? By default it is enabled for action and render links with the following exceptions. In those
+ situations, the portal will prefer to perform a full page refresh:
+ <itemizedlist>
+ <listitem>
+ <para>Form GET are not handled, however it should not be an issue as this situation is discouraged
+ by the Portlet specification. It however taken in account, just in case of. Here is an example
+ of a JavaServer Page that would do one:</para>
+ <programlisting><![CDATA[
+<form action="<%= renderResponse.createActionURL() %>" method="get">
+ ...
+</form>
+]]></programlisting>
+ </listitem>
+ <listitem>
+ <para>Form uploads are not handled.</para>
+ </listitem>
+ <listitem><para>Having an interaction that deals with the <emphasis>MAXIMIZED</emphasis> window state.
+ When a window is entering a maximized state or leaving a maximized window state, the portal will
+ perform a full page refresh.</para></listitem>
+ </itemizedlist>
+ </para>
+ <para>It can happen that a portlet does not want to support partial refreshing, in those situations
+ the <emphasis>jboss-portlet.xml</emphasis> can be used to control that behavior. Since 2.6 an ajax
+ section has been added in order to configure ajax features related to the portlet.</para>
+ <programlisting role="XML"><![CDATA[
+<portlet>
+ <portlet-name>MyPortletNoAjax</portlet-name>
+ <ajax>
+ <partial-refresh>false</partial-refresh>
+ </ajax>
+</portlet>
+]]></programlisting>
+ <para>The usage of the <emphasis>partial-refresh</emphasis> set to the value false means that
+ the portlet will not be subject of a partial page refresh when it is invoked. However the portlet
+ markup can still be subject to a partial rendering.</para>
+ </section>
+ <section>
+ <title>Limitations</title>
+ <para>Partial refreshing of portlets has limitations both on the server side (portal) and on the client side (browser).</para>
+ <section>
+ <title>Application scoped session attributes</title>
+ <para>When partial refresh is activated, the state of a page can potentially become inconsistent. for
+ example, if some objects are shared in the application scope of the session between portlets. When one
+ portlet update a session object, the other portlet won't be refreshed and will still display content based
+ on the previous value of the object in the session. To avoid that, partial refresh can be deactivated
+ for certain portlets by adding <portlet-refresh>false<portlet-refresh> in the jboss-portlet.xml file.</para>
+ </section>
+ <section>
+ <title>Non ajax interactions</title>
+ <para>The solution developed by JBoss Portal on the client side is built on top of DOM events emitted
+ by the web browser when the user interacts with the page. If an interaction is done without an
+ emission of an event then JBoss Portal will not be able to transform it into a partial refresh and
+ it will result instead of a full refresh. This can happen with programmatic submission of forms.
+ </para>
+ <programlisting role="XHTML"><![CDATA[
+<form id="<%= formId %>" action="<%= renderResponse.createActionURL() %>" method="post">
+ ...
+ <select onclick="document.getElementById('<%= formId %>').submit()">
+ ...
+ </select>
+ ...
+</form>
+]]></programlisting>
+ </section>
+ </section>
+ </section>
+ </section>
+</chapter>
+ <chapter id="troubleshooting">
+ <!-- <chapterinfo>
+ <author>
+ <firstname>Roy</firstname>
+ <surname>Russo</surname>
+ </author>
+ </chapterinfo>-->
+ <title>Troubleshooting and FAQ</title>
+ <section id="troubleshooting-faq">
+ <title>Troubleshooting and FAQ</title>
+ <para>
+ <emphasis role="bold">Installation / Configuration</emphasis>
+ <itemizedlist>
+ <listitem><para>
+ <xref linkend="conf1"/> I am seeing "ERROR [JDBCExceptionReporter] Table not found in statement" in the
+ logfile
+ on first boot. What is this?</para>
+ </listitem>
+ <listitem><para>
+ <xref linkend="conf2"/> I want to do a clean install/upgrade over my existing one. What are the
+ steps?</para>
+ </listitem>
+ <listitem><para>
+ <xref linkend="conf3"/> Is my database vendor/version combination supported?</para>
+ </listitem>
+ <listitem>
+ <para><xref linkend="conf4"/> How do I force the Hibernate Dialect used for my database?</para>
+ </listitem>
+ <listitem>
+ <para> <xref linkend="conf5"/> How do I change the context-root of the portal to http://localhost:8080/?</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ <emphasis role="bold">CMS</emphasis>
+ <itemizedlist>
+ <listitem>
+ <para> <xref linkend="cms1"/>. How do I change the CMS repository configuration?</para>
+ </listitem>
+ <listitem>
+ <para> <xref linkend="cms2"/>.On reboot, the CMS is complaining about a locked repository.</para>
+ </listitem>
+ <listitem>
+ <para> <xref linkend="cms3"/>. I created a file in the CMSAdmin. How do I view it?</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ <emphasis role="bold">Errors</emphasis>
+ <itemizedlist>
+ <listitem>
+ <para> <xref linkend="error1"/>. When I access a specific portal-instance or page, I keep seeing "401 - not
+ authorized" error in my browser.</para>
+ </listitem>
+ <listitem>
+ <para> <xref linkend="error2"/>. How do I disable development-mode errors on the presentation layer?</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ <emphasis role="bold">Miscellaneous</emphasis>
+ <itemizedlist>
+ <listitem>
+ <para> <xref linkend="misc1"/>Is there a sample portlet I can look at to learn about portlet development and
+ JBoss
+ Portal deployments?</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+
+ <section id="conf1"><title>"Error [JDBCExceptionReporter] Table not found in statement"</title>
+ <para>
+ <emphasis role="bold">I am seeing "ERROR [JDBCExceptionReporter] Table not found in statement" in the logfile
+ on first
+ boot. What is
+ this?</emphasis>
+ Ignore this error. It is used by the portal to create the initial database tables. On second boot, you should
+ not see them at all.
+ </para>
+</section>
+
+ <section id="conf2"><title>install/upgrade</title>
+ <para>
+ <emphasis role="bold">I want to do a clean install/upgrade over my existing one. What are the steps?</emphasis>
+ <itemizedlist>
+ <listitem><para>Shut down JBoss AS</para></listitem>
+ <listitem><para>Delete JBOSS_HOME/server/default/data/portal</para></listitem>
+ <listitem><para>Delete all JBoss Portal tables from your database</para></listitem>
+ <listitem><para>Start JBoss AS.</para></listitem>
+ </itemizedlist>
+ </para>
+</section>
+
+ <section id="conf3"><title>database support</title>
+ <para>
+ <emphasis role="bold">Is my database vendor/version combination supported?</emphasis>
+ See
+ <xref linkend="supportedversions-db"/>
+ </para>
+</section>
+
+ <section id="conf4"><title>Hibernate Dialect</title>
+ <para>
+ <emphasis role="bold">How do I force the Hibernate Dialect used for my database?</emphasis>
+ See
+ <xref linkend="configuration-hibdialect"/>
+ </para>
+</section>
+
+ <section id="conf5"><title>context-root</title>
+ <para>
+ <emphasis role="bold">How do I change the context-root of the portal to http://localhost:8080/?</emphasis>
+ See
+ <xref linkend="configuration-contextroot"/>
+ </para>
+</section>
+
+ <section id="cms1"><title>CMS repository configuration</title>
+ <para>
+ <emphasis role="bold">How do I change the CMS repository configuration?</emphasis>
+
+ There are 3 supported modes: 100% DB (default), 100% Filsystem, and Mixed (Blobs on the Filesystem and metadata
+ in the DB). You can see configuration options here:
+ <xref linkend="configuration-cms"/>
+ </para>
+</section>
+ <section id="cms2"><title>Locked repository</title>
+ <para>
+ <emphasis role="bold">On reboot, the CMS is complaining about a locked repository.</emphasis>
+
+ This occurs when JBoss AS is improperly shutdown or the CMS Service errors on startup. To remove the lock,
+ shutdown JBoss, and then remove the file under JBOSS_HOME/server/default/data/portal/cms/conf/.lock.
+ </para>
+</section>
+
+ <section id="cms3"><title>CMSAdmin</title>
+ <para>
+ <emphasis role="bold">I created a file in the CMSAdmin. How do I view it?</emphasis>
+
+ Using the default configuration, the path to the file in the browser would be:
+ http://localhost:8080/portal/content/path/to/file.ext.
+ Note that all requests for cms content must be prepended with /content and then followed by the
+ path/to/the/file.gif as it is in your directory structure.
+ </para>
+</section>
+
+ <section id="error1"><title>"401 - not authorised"</title>
+ <para>
+ <emphasis role="bold">When I access a specific portal-instance or page, I keep seeing "401 - not
+ authorized" error in my browser.</emphasis>
+ You are likely not authorized to view the page or portal instance. You can either modify the security using the
+ Management Portlet under the Admin Tab, or secure your portlets via the object descriptor,
+ <xref linkend="securing_objects"/>
+ </para>
+</section>
+
+ <section id="error2"><title>Development errors</title>
+ <para>
+ <emphasis role="bold">How do I disable development-mode errors on the presentation layer?</emphasis>
+ See:
+ <xref linkend="descriptor_debug"/>
+ </para>
+</section>
+ <section id="misc1"><title>Portlet Deployment</title>
+ <para>
+ <emphasis role="bold">Is there a sample portlet I can look at to learn about portlet development and JBoss
+ Portal deployments?</emphasis>
+</para>
+
+ <itemizedlist>
+ <listitem><para>Sample portlets with tutorials can be found here,
+ <xref linkend="tutorials_tutorials"/></para>
+ </listitem>
+ <listitem><para>Additional Portlets can be found at
+ <ulink url="http://www.portletswap.com">PortletSwap.com</ulink>
+ .</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ </section>
+</chapter>
+ <!-- DO NOT EDIT ME DIRECTLY, I AM GENERATED FROM THE DTD USING THE dtd2docbook ANT TASK --><appendix id="portalObjectsDTD">
+ <title>*-object.xml DTD</title>
+ <para>
+<programlisting><![CDATA[
+
+ <?xml version="1.0" encoding="UTF-8" ?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!--
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portal Object 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
+-->
+
+<!--
+The deployements element is a generic container for deployment elements.
+-->
+<!ELEMENT deployments (deployment*)>
+
+<!--
+The deployment is a generic container for portal object elements. The parent-ref
+child gives the name of the parent object that the current object will use as parent.
+The optional if-exists element define the behavior when a portal object which
+an identical name is already child of the parent element. The default behavior of
+the if-exist tag is to keep the existing object and not create a new object. The
+last element is the portal object itself.
+
+Example:
+
+<deployment>
+ <parent-ref>default</parent-ref>
+ <page>
+ ...
+ </page>
+</deployment>
+
+All portal objects have a common configuration which can be :
+
+1/ a listener : specifies the id of a listener is the listener registry. A listener
+object is able to listen portal events which apply to the portal node hierarchy.
+
+2/ properties : a set of generic properties owned by the portal object. Some
+properties can drive the behavior of the object.
+
+3/ security-constraint : defines security configuration of the portal object.
+
+-->
+<!ELEMENT deployment (parent-ref?,if-exists?,(context|portal|page|window))>
+
+<!--
+Contains a reference to the parent object. The naming convention for naming object
+is to concatenate the names of the path to the object and separate the names by a dot.
+If the path is empty then the empty string must be used.
+
+Example:
+
+<parent-ref/> the root having an empty path
+
+<parent-ref>default</parent-ref> the object with the name default under the root
+having the path (default)
+
+<parent-ref>default.default</parent-ref> the object with the path (default,default)
+
+-->
+<!ELEMENT parent-ref (#PCDATA)>
+
+<!--
+The authorized values are overwrite and keep. Overwrite means that the existing
+object will be destroyed and the current declaration will be used. Keep means that
+the existing object will not be destroyed and no creation hence will be done.
+-->
+<!ELEMENT if-exists (#PCDATA)>
+
+<!--
+A portal object of type context. A context type represent a node in the tree which
+does not have a visual representation. It can exist only under the root. A context can
+only have children with the portal type.
+-->
+<!ELEMENT context (context-name,properties?,listener?,security-constraint?,portal*,
+ (display-name* | (resource-bundle, supported-locale+)))>
+
+<!--
+The context name value.
+-->
+<!ELEMENT context-name (#PCDATA)>
+
+<!--
+A portal object of type portal. A portal type represents a virtual portal and can
+have children of type page. In addition of the common portal object elements it support
+also the declaration of the modes and the window states it supports. If no declaration
+of modes or window states is done then the default value will be respectively
+(view,edit,help) and (normal,minimized,maximized).
+-->
+<!ELEMENT portal (portal-name,supported-modes,supported-window-states?,properties?,
+ listener?,security-constraint?,page*,
+ (display-name* | (resource-bundle, supported-locale+)))>
+
+<!--
+The portal name value.
+-->
+<!ELEMENT portal-name (#PCDATA)>
+
+
+<!--
+The supported modes of a portal.
+
+Example:
+
+<supported-mode>
+ <mode>view</mode>
+ <mode>edit</mode>
+ <mode>help</mode>
+</supported-mode>
+-->
+<!ELEMENT supported-modes (mode*)>
+
+<!--
+A portlet mode value.
+-->
+<!ELEMENT mode (#PCDATA)>
+
+<!--
+The supported window states of a portal.
+
+Example:
+
+<supported-window-states>
+ <window-state>normal</window-state>
+ <window-state>minimized</window-state>
+ <window-state>maximized</window-state>
+</supported-window-states>
+
+-->
+<!ELEMENT supported-window-states (window-state*)>
+
+<!--
+A window state value.
+-->
+<!ELEMENT window-state (#PCDATA)>
+
+<!--
+A portal object of type page. A page type represents a page which can have children of
+type page and window. The children windows are the windows of the page and the children
+pages are the subpages of this page.
+-->
+<!ELEMENT page (page-name,properties?,listener?,security-constraint?,(page|window)*,
+ (display-name* | (resource-bundle, supported-locale+)))>
+
+<!ELEMENT display-name (#PCDATA)>
+<!ATTLIST display-name
+ xml:lang NMTOKEN #IMPLIED
+>
+
+<!ELEMENT resource-bundle (#PCDATA)>
+
+<!ELEMENT supported-locale (#PCDATA)>
+
+<!--
+The page name value.
+-->
+<!ELEMENT page-name (#PCDATA)>
+
+<!--
+A portal object of type window. A window type represents a window. Beside the common
+properties a window has a content and belong to a region on the page.
+
+The instance-ref or content tags are used to define the content of the window. The
+usage of the content tag is generic and can be used to describe any kind of content.
+The instance-ref is a shortcut to define a content type of portlet which points to a
+portlet instance.
+
+The region and height defines how the window is placed in the page.
+-->
+<!ELEMENT window (window-name,(instance-ref|content),region,height,
+ initial-window-state?,initial-mode?,properties?,listener?,
+ (display-name* | (resource-bundle, supported-locale+)))>
+
+<!--
+The window name value.
+-->
+<!ELEMENT window-name (#PCDATA)>
+
+<!--
+Define the content of the window as a reference to a portlet instance. The value
+is the id of the instance.
+
+Example:
+
+<instance-ref>MyPortletInstance</instance-ref>
+
+-->
+<!ELEMENT instance-ref (#PCDATA)>
+
+<!--
+Define the content of the window in a generic manner. The content is define by
+the type of the content and an URI which acts as an identificator for the content.
+
+Example:
+
+<content>
+ <content-type>portlet</content-type>
+ <content-uri>MyPortletInstance</content-uri>
+</content>
+
+<content>
+ <content-type>cms</content-type>
+ <content-uri>/default/index.html</content-uri>
+</content>
+
+-->
+<!ELEMENT content (content-type,content-uri)>
+
+<!--
+The content type of the window.
+-->
+<!ELEMENT content-type (#PCDATA)>
+
+<!--
+The content URI of the window.
+-->
+<!ELEMENT content-uri (#PCDATA)>
+
+<!--
+The region the window belongs to.
+-->
+<!ELEMENT region (#PCDATA)>
+
+<!--
+The window state to use when the window is first accessed
+-->
+<!ELEMENT initial-window-state (#PCDATA)>
+
+<!--
+The mode to use when the window is first accessed
+-->
+<!ELEMENT initial-mode (#PCDATA)>
+
+<!--
+The height of the window in the particular region.
+-->
+<!ELEMENT height (#PCDATA)>
+
+<!--
+Define a listener for a portal object. The value is the id of the listener.
+-->
+<!ELEMENT listener (#PCDATA)>
+
+<!--
+A set of generic properties for the portal object.
+-->
+<!ELEMENT properties (property*)>
+
+<!--
+A generic string property.
+-->
+<!ELEMENT property (name,value)>
+
+<!--
+A name value.
+-->
+<!ELEMENT name (#PCDATA)>
+
+<!--
+A value.
+-->
+<!ELEMENT value (#PCDATA)>
+
+<!--
+The security-constraint element is a container for policy-permission elements
+
+Examples:
+
+<security-constraint>
+ <policy-permission>
+ <role-name>User</role-name>
+ <action-name>view</action-name>
+ </policy-permission>
+</security-constraint>
+
+<security-constraint>
+ <policy-permission>
+ <unchecked/>
+ <action-name>view</action-name>
+ </policy-permission>
+</security-constraint>
+-->
+<!ELEMENT security-constraint (policy-permission*)>
+
+<!--
+The policy-permission element is used to secure a specific portal page based on a
+user's role.
+-->
+<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>
+
+<!--
+The role-name element is used to define a role that this security constraint will apply to
+
+ * <role-name>SOMEROLE</role-name> Access to this portal page is limited to the defined role.
+-->
+<!ELEMENT action-name (#PCDATA)>
+
+<!--
+The unchecked element is used to define (if present) that anyone can view this portal page
+-->
+<!ELEMENT unchecked EMPTY>
+
+<!--
+The action-name element is used to define the access rights given to the role defined.
+Possible values are:
+
+ * view - Users can view the page.
+-->
+<!ELEMENT role-name (#PCDATA)>
+
+
+]]></programlisting>
+ </para>
+</appendix>
+ <!-- DO NOT EDIT ME DIRECTLY, I AM GENERATED FROM THE DTD USING THE dtd2docbook ANT TASK --><appendix id="portletInstancesDTD">
+ <title>portlet-instances.xml DTD</title>
+ <para>
+<programlisting><![CDATA[
+
+ <?xml version="1.0" encoding="UTF-8" ?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!--
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
+-->
+
+<!--
+The deployements element is a container for deployment elements.
+-->
+<!ELEMENT deployments (deployment*)>
+
+<!--
+The deployment is a container for an instance element.
+-->
+<!ELEMENT deployment (if-exists?,instance)>
+
+<!--
+The if-exists element is used to define action to take if instance with such name is
+already present. Possible values are overwrite or keep . Overwrite will destroy the
+existing object in the database and create a new one, based on the content of the
+deployment. Keep will maintain the existing object deployment or create a new one if
+it does not yet exist.
+-->
+<!ELEMENT if-exists (#PCDATA)>
+
+<!--
+The instance element is used to create an instance of a portlet from the portlet
+application of the same war file containing the portlet-instances.xml file. The portlet
+will be created and configured only if the portlet is present and an instance with
+such a name does not already exist.
+
+Example :
+
+<instance>
+ <instance-id>MyPortletInstance</instance-id>
+ <portlet-ref>MyPortlet</portlet-ref>
+ <preferences>
+ <preference>
+ <name>abc</name>
+ <value>def</value>
+ </preference>
+ </preferences>
+ <security-constraint>
+ <policy-permission>
+ <role-name>User</role-name>
+ <action-name>view</action-name>
+ </policy-permission>
+ </security-constraint>
+</instance>
+
+-->
+<!ELEMENT instance (instance-id,portlet-ref,display-name*,preferences?,
+ security-constraint?, (display-name* | (resource-bundle, supported-locale+)))>
+
+<!ELEMENT display-name (#PCDATA)>
+<!ATTLIST display-name
+ xml:lang NMTOKEN #IMPLIED
+>
+
+<!ELEMENT resource-bundle (#PCDATA)>
+
+<!ELEMENT supported-locale (#PCDATA)>
+
+
+<!--
+The identifier of the instance.
+-->
+<!ELEMENT instance-id (#PCDATA)>
+
+<!--
+The reference to the portlet which is its portlet name.
+-->
+<!ELEMENT portlet-ref (#PCDATA)>
+
+<!--
+Display name is the string used to represent this instance
+-->
+<!ELEMENT display-name (#PCDATA)>
+<!ATTLIST display-name
+ xml:lang NMTOKEN #IMPLIED
+>
+
+<!--
+The preferences element configures the instance with a specific set of preferences.
+-->
+<!ELEMENT preferences (preference+)>
+
+<!--
+The preference configure one preference of a set of preferences.
+-->
+<!ELEMENT preference (name,value)>
+
+<!--
+A name.
+-->
+<!ELEMENT name (#PCDATA)>
+
+<!--
+A string value.
+-->
+<!ELEMENT value (#PCDATA)>
+
+<!--
+The security-constraint element is a container for policy-permission elements
+
+Examples:
+
+<security-constraint>
+ <policy-permission>
+ <role-name>User</role-name>
+ <action-name>view</action-name>
+ </policy-permission>
+</security-constraint>
+
+<security-constraint>
+ <policy-permission>
+ <unchecked/>
+ <action-name>view</action-name>
+ </policy-permission>
+</security-constraint>
+-->
+<!ELEMENT security-constraint (policy-permission*)>
+
+<!--
+The policy-permission element is used to secure a specific portlet instance based on a
+user's role.
+-->
+<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>
+
+<!--
+The action-name element is used to define the access rights given to the role defined.
+Possible values are:
+
+ * view - Users can view the page.
+ * viewrecursive - Users can view the page and child pages.
+ * personalize - Users are able to view AND personalize the page.
+ * personalizerecursive - Users are able to view AND personalize the page AND its child
+ pages.
+-->
+<!ELEMENT action-name (#PCDATA)>
+
+<!--
+The unchecked element is used to define (if present) that anyone can view this instance
+-->
+<!ELEMENT unchecked EMPTY>
+
+<!--
+The role-name element is used to define a role that this security constraint will apply to
+
+ * <role-name>SOMEROLE</role-name> Access to this instance is limited to the defined role.
+-->
+<!ELEMENT role-name (#PCDATA)>
+
+
+]]></programlisting>
+ </para>
+</appendix>
+ <!-- DO NOT EDIT ME DIRECTLY, I AM GENERATED FROM THE DTD USING THE dtd2docbook ANT TASK --><appendix id="jbossPortletDTD">
+ <title>jboss-portlet.xml DTD</title>
+ <para>
+<programlisting><![CDATA[
+
+ <?xml version="1.0" encoding="UTF-8" ?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!-- The additional configuration elements of the JBoss portlet container.
+
+<!DOCTYPE portlet-app PUBLIC
+ "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
+-->
+
+<!--
+The remotable element is used to configure the default behavior of the portlets with
+respect to WSRP exposure.
+
+For each portlet defined in portlet.xml, it is possible to configure specific
+settings of the portlet container.
+
+It is also possible to inject services in the portlet context of the application
+using the service elements.
+-->
+<!ELEMENT portlet-app (remotable?,portlet*,service*)>
+
+<!--
+Additional configuration for a portlet.
+
+The portlet-name defines the name of the portlet. It must match a portlet defined already
+in portlet.xml of the same web application.
+
+The remotable element configures the portlet exposure to WSRP. If no value is present
+then the value considered is either the value defined globally at the portlet
+application level or false.
+
+The trans-attribute value specifies the behavior of the portlet when it is invoked at
+runtime with respect to the transactionnal context. According to how the portlet is
+invoked a transaction may exist or not before the portlet is invoked. Usually in the
+local context the portal transaction could be present. By default the value considered is
+ NotSupported which means that the portal transaction will be suspended for the duration
+ of the portlet invocation.
+
+Example:
+
+<portlet>
+ <portlet-name>MyPortlet</portlet-name>
+ <remotable>true</remotable>
+ <trans-attribute>Required</trans-attribute>
+</portlet>
+
+-->
+<!ELEMENT portlet (portlet-name,remotable?,ajax?,session-config?,transaction?,
+ header-content?,portlet-info?)>
+
+<!--
+The portlet name.
+-->
+<!ELEMENT portlet-name (#PCDATA)>
+
+<!--
+The remotable value is used for WSRP exposure. The accepted values are the
+litterals true of false.
+-->
+<!ELEMENT remotable (#PCDATA)>
+
+<!--
+The ajax tag allows to configure the ajax capabilities of the portlet. If
+the portlet is tagged as partial-refresh then the portal may use partial page
+refreshing and render only that portlet. If the portlet partial-refresh value
+is false, then the portal will perform a full page refresh when the portlet is refreshed.
+-->
+<!ELEMENT ajax (partial-refresh)>
+
+<!--
+The authorized values for the partial-refresh element are true or false.
+-->
+<!ELEMENT partial-refresh (#PCDATA)>
+
+<!--
+Additional portlet information
+-->
+<!ELEMENT portlet-info (icon?)>
+
+<!--
+Defines icons for the portlet, they can be used by the administration portlet
+to represent a particular portlet.
+-->
+<!ELEMENT icon (small-icon?, large-icon?)>
+
+<!--
+A small icon image, usually 16x16, gif, jpg and png are usually supported.
+An absolute URL or a URL starting with a '/' in the context of the webapp are accepted:
+eg. http://www.example.com/images/smallIcon.png
+eg. /images/smallIcon.png
+-->
+<!ELEMENT small-icon (#PCDATA)>
+
+<!--
+A large icon image, usually 32x32, gif, jpg and png are usually supported.
+An absolute URL or a URL starting with a '/' in the context of the webapp are accepted:
+eg. http://www.example.com/images/smallIcon.png
+eg. /images/smallIcon.png
+-->
+<!ELEMENT large-icon (#PCDATA)>
+
+<!--
+This element configure the portlet session of the portlet.
+
+The distributed element instructs the container to distribute the session attributes
+using the portal session replication. It applies only to local portlets are not to
+remote portlets. The default value is false.
+
+Example:
+
+<session-config>
+ <distributed>true</distributed>
+</session-config>
+
+-->
+<!ELEMENT session-config (distributed)>
+
+<!--
+The authorized values for the distributed element are true or false.
+-->
+<!ELEMENT distributed (#PCDATA)>
+
+<!--
+Defines how the portlet behaves with the transactionnal context. The default value
+is Never.
+
+Example:
+
+<transaction>
+ <trans-attribute>Required</transaction>
+<transaction>
+-->
+<!ELEMENT transaction (trans-attribute)>
+
+<!--
+The trans-attribute value defines the transactionnal behavior. The accepted values
+are Required, Mandatory, Never, Supports, NotSupported and RequiresNew.
+-->
+<!ELEMENT trans-attribute (#PCDATA)>
+
+<!--
+Specify content which should be included in the portal aggregated page when the portlet
+is present on that page. This setting only applies when the portlet is used in the local mode.
+-->
+<!ELEMENT header-content (link|script|meta)*>
+
+<!--
+Creates a header markup element for linked resources,
+see http://www.w3.org/TR/html401/struct/links.html#h-12.3
+
+At runtime the href attribute value will be prefixed with the context path
+of the web application.
+
+Example:
+
+<link rel="stylesheet" type="text/css" href="/style.css" media="screen"/>
+
+will produce at runtime the following markup
+
+<link rel="stylesheet" type="text/css" href="/my-web-application/style.css" media="screen"/>
+-->
+<!ATTLIST link
+ href CDATA #IMPLIED
+ rel CDATA #IMPLIED
+ type CDATA #IMPLIED
+ media CDATA #IMPLIED
+ title CDATA #IMPLIED>
+
+<!--
+No content is allowed inside an link element.
+-->
+<!ELEMENT link EMPTY>
+
+<!--
+Creates a header markup for scripting,
+see http://www.w3.org/TR/html401/interact/scripts.html
+
+At runtime the src attribute value will be prefixed with the context path
+of the web application.
+
+Example 1:
+
+<script type="text/javascript" src="/myscript.js"></script>
+
+will produce at runtime the following markup
+
+<script type="text/javascript" src="/my-web-application/myscript.js"></script>
+
+Example 2:
+
+<script type="text/javascript">
+ function hello() {
+ alert('Hello');
+ }
+</script>
+-->
+<!ATTLIST script
+ src CDATA #IMPLIED
+ type CDATA #IMPLIED
+ language CDATA #IMPLIED>
+
+<!--
+The script header element can contain inline script definitions.
+-->
+<!ELEMENT script (#PCDATA)>
+
+<!--
+Creates a header markup for adding meta data to a page,
+see http://www.w3.org/TR/html401/struct/global.html#h-7.4.4
+
+Example:
+
+<meta name="keywords" content="jboss, portal, redhat"/>
+-->
+<!ATTLIST meta
+ name CDATA #REQUIRED
+ content CDATA #REQUIRED>
+
+<!--
+No content is allowed for meta element.
+-->
+<!ELEMENT meta EMPTY>
+
+<!--
+Declare a service that will be injected by the portlet container as an
+attribute of the portlet context.
+
+Example:
+
+<service>
+ <service-name>UserModule</service-name>
+ <service-class>org.jboss.portal.identity.UserModule</service-class>
+ <service-ref>:service=Module,type=User</service-ref>
+</service>
+
+In the portlet it is then possible to use it by doing a lookup on the service
+name, for example in the init() lifecycle method :
+
+public void init()
+{
+ UserModule userModule = (UserModule)getPortletContext().getAttribute("UserModule");
+}
+
+-->
+<!ELEMENT service (service-name,service-class,service-ref)>
+
+<!--
+The service name that will be used to bind the service as a portlet context attribute.
+-->
+<!ELEMENT service-name (#PCDATA)>
+
+<!--
+The full qualified name of the interface that the service implements.
+-->
+<!ELEMENT service-class (#PCDATA)>
+
+<!--
+The reference to the service. In the JMX Microkernel environment it consist of the JMX
+name of the service MBean. For an MBean reference if the domain is left out, then the
+current domain of the portal will be used.
+-->
+<!ELEMENT service-ref (#PCDATA)>
+
+
+]]></programlisting>
+ </para>
+</appendix>
+</book>
Modified: docs/enterprise/trunk/Reference_Guide/pom.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/pom.xml 2008-11-12 22:44:10 UTC (rev 12288)
+++ docs/enterprise/trunk/Reference_Guide/pom.xml 2008-11-12 23:51:15 UTC (rev 12289)
@@ -33,7 +33,8 @@
<configuration>
<!--minmemory>1024m</minmemory>
<maxmemory>1024m</maxmemory -->
- <sourceDocumentName>resolved.xml</sourceDocumentName>
+ <!--sourceDocumentName>resolved.xml</sourceDocumentName-->
+ <sourceDocumentName>JBoss_Portal_Reference_Guide.xml</sourceDocumentName>
<sourceDirectory>en-US</sourceDirectory>
<imageResource>
<directory>en-US</directory>
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Book_Info.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Book_Info.xml 2008-11-12 22:44:10 UTC (rev 12288)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Book_Info.xml 2008-11-12 23:51:15 UTC (rev 12289)
@@ -11,6 +11,7 @@
<productnumber>2.7</productnumber>
<pubdate>Oct, 2007</pubdate>
<isbn>N/A</isbn>
+ <issuenum>1</issuenum>
<abstract>
<para>This book is a JBoss Portal 2.7 Reference Guide.</para></abstract>
<corpauthor>
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Common_Content/Feedback.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Common_Content/Feedback.xml 2008-11-12 22:44:10 UTC (rev 12288)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Common_Content/Feedback.xml 2008-11-12 23:51:15 UTC (rev 12289)
@@ -1,4 +1,4 @@
-<?xml version='1.0'?>
+<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Common_Content/Legal_Notice.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Common_Content/Legal_Notice.xml 2008-11-12 22:44:10 UTC (rev 12288)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml/Common_Content/Legal_Notice.xml 2008-11-12 23:51:15 UTC (rev 12289)
@@ -1,4 +1,4 @@
-<?xml version='1.0'?>
+<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE legalnotice PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
Modified: docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml_tmp/Book_Info.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml_tmp/Book_Info.xml 2008-11-12 22:44:10 UTC (rev 12288)
+++ docs/enterprise/trunk/Reference_Guide/tmp/en-US/xml_tmp/Book_Info.xml 2008-11-12 23:51:15 UTC (rev 12289)
@@ -11,8 +11,8 @@
<productnumber>2.7</productnumber>
<pubdate>Oct, 2007</pubdate>
<isbn>N/A</isbn>
+ <issuenum>1</issuenum>
-
<abstract><para>This book is a JBoss Portal 2.7 Reference Guide.</para>
</abstract>
15 years, 6 months
JBoss Portal SVN: r12288 - in docs/enterprise/trunk/Reference_Guide/en-US: Common_Content and 2 other directories.
by portal-commits@lists.jboss.org
Author: skittoli(a)redhat.com
Date: 2008-11-12 17:44:10 -0500 (Wed, 12 Nov 2008)
New Revision: 12288
Added:
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/Feedback.xml
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/Legal_Notice.xml
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/css/
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/css/overrides.css
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/1.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/1.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/10.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/10.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/11.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/11.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/12.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/12.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/13.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/13.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/14.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/14.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/15.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/15.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/16.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/16.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/17.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/17.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/18.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/18.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/19.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/19.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/2.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/2.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/20.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/20.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/21.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/21.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/22.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/22.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/23.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/23.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/3.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/3.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/4.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/4.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/5.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/5.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/6.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/6.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/7.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/7.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/8.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/8.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/9.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/9.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/background.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/bkgrnd_greydots.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/bullet_arrowblue.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/documentation.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/dot.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/dot2.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/h1-bg.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/image_left.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/image_right.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/important.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/important.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/jboss-logo.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/key.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/note.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/note.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/redhat-logo.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/rhlogo.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/shade.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/stock-go-back.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/stock-go-forward.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/stock-go-up.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/stock-home.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/title_logo.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/title_logo.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/warning.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/warning.svg
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/watermark-alpha1.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/watermark-alpha2.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/watermark-beta1.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/watermark-beta2.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/watermark-blank.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/watermark-pre-release-candidate.png
docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/watermark-release-candidate.png
Modified:
docs/enterprise/trunk/Reference_Guide/en-US/Book_Info.xml
docs/enterprise/trunk/Reference_Guide/en-US/resolved.xml
Log:
added local common content to be modified before docs publicly available
Modified: docs/enterprise/trunk/Reference_Guide/en-US/Book_Info.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Book_Info.xml 2008-11-10 21:47:13 UTC (rev 12287)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Book_Info.xml 2008-11-12 22:44:10 UTC (rev 12288)
@@ -11,8 +11,8 @@
<productnumber>2.7</productnumber>
<pubdate>Oct, 2007</pubdate>
<isbn>N/A</isbn>
+ <issuenum>1</issuenum>
-
<abstract><para>This book is a JBoss Portal 2.7 Reference Guide.</para>
</abstract>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/Feedback.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/Feedback.xml (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/Feedback.xml 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,22 @@
+<?xml version='1.0'?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+
+<section>
+ <title>We Need Feedback!</title>
+ <indexterm>
+ <primary>feedback</primary>
+ <secondary>contact information for this manual</secondary>
+ </indexterm>
+ <para>
+ If you find a typographical error in this manual, or if you have thought of a way to make this manual better, we would love to hear from you! Please submit a report in Bugzilla: <ulink url="http://bugzilla.redhat.com/bugzilla/">http://bugzilla.redhat.com/bugzilla/</ulink> against the product <application>&PRODUCT;.</application>
+ </para>
+ <para>
+ When submitting a bug report, be sure to mention the manual's identifier: <citetitle>&BOOKID;</citetitle>
+ </para>
+ <para>
+ If you have a suggestion for improving the documentation, try to be as specific as possible when describing it. If you have found an error, please include the section number and some of the surrounding text so we can find it easily.
+ </para>
+</section>
+
+
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/Legal_Notice.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/Legal_Notice.xml (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/Legal_Notice.xml 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,31 @@
+<?xml version='1.0'?>
+<!DOCTYPE legalnotice PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+
+<legalnotice>
+ <para>
+ Copyright <trademark class="copyright"></trademark> &YEAR; &HOLDER;. This material may only be distributed subject to the terms and conditions set forth in the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License (which is presently available at <ulink url="http://creativecommons.org/licenses/by-nc-sa/3.0/">http://creativecommons.org/licenses/by-nc-sa/3.0/</ulink>).
+ </para>
+ <para>
+ Red Hat and the Red Hat "Shadow Man" logo are registered trademarks of Red Hat, Inc. in the United States and other countries.
+ </para>
+ <para>
+ All other trademarks referenced herein are the property of their respective owners.
+ </para>
+ <para>
+ The GPG fingerprint of the security(a)redhat.com key is:
+ </para>
+ <para>
+ CA 20 86 86 2B D6 9D FC 65 F6 EC C4 21 91 80 CD DB 42 A6 0E
+ </para>
+ <para>
+ <address>
+ <street>1801 Varsity Drive</street>
+ <city>Raleigh</city>, <state>NC</state> <postcode>27606-2072</postcode><country>USA</country><phone>Phone: +1 919 754 3700</phone>
+ <phone>Phone: 888 733 4281</phone>
+ <fax>Fax: +1 919 754 3701</fax>
+ <pob>PO Box 13588</pob><city>Research Triangle Park</city>, <state>NC</state> <postcode>27709</postcode><country>USA</country>
+ </address>
+ </para>
+</legalnotice>
+
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/css/overrides.css
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/css/overrides.css (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/css/overrides.css 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,53 @@
+a:link {
+ color:#0066cc;
+}
+
+a:visited {
+ color:#6699cc;
+}
+
+h1 {
+ color:#a70000;
+}
+
+.producttitle {
+ background: #800 url(../images/h1-bg.png) top left repeat;
+}
+
+.section h1.title {
+ color:#a70000;
+}
+
+
+h2,h3,h4,h5,h6 {
+ color:#a70000;
+}
+
+table {
+ border:1px solid #aaa;
+}
+
+table th {
+ background-color:#900;
+}
+
+table tr.even td {
+ background-color:#f5f5f5;
+}
+
+#title a {
+ height:54px;
+}
+
+.term{
+ color:#a70000;
+}
+
+.revhistory table th {
+ color:#a70000;
+}
+
+.edition {
+ color: #a70000;
+}
+
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/1.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/1.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/1.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/1.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="32"
+ height="32"
+ id="svg2">
+ <defs
+ id="defs15" />
+ <circle
+ cx="16"
+ cy="16"
+ r="14"
+ id="circle"
+ style="fill:#aa0000" />
+ <path
+ d="M 17.993,22.013004 L 17.993,10.113004 L 15.239,10.113004 C 14.899001,11.218003 14.286999,11.643004 12.757,11.728004 L 12.757,13.819004 L 14.763,13.819004 L 14.763,22.013004 L 17.993,22.013004"
+ id="text2207"
+ style="fill:#ffffff" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/10.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/10.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/10.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/10.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/10.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="32"
+ height="32"
+ id="svg2">
+ <defs
+ id="defs15" />
+ <circle
+ cx="16"
+ cy="16"
+ r="14"
+ id="circle"
+ style="fill:#aa0000" />
+ <path
+ d="M 12.252562,22 L 12.252562,10.1 L 9.4985624,10.1 C 9.1585628,11.204999 8.5465609,11.63 7.0165624,11.715 L 7.0165624,13.806 L 9.0225624,13.806 L 9.0225624,22 L 12.252562,22 M 24.983438,16.033 C 24.983438,12.072004 22.705435,9.913 19.611438,9.913 C 16.517441,9.913 14.205438,12.106004 14.205438,16.067 C 14.205438,20.027996 16.483441,22.187 19.577438,22.187 C 22.671435,22.187 24.983438,19.993996 24.983438,16.033 M 21.600438,16.067 C 21.600438,18.242998 20.886437,19.348 19.611438,19.348 C 18.336439,19.348 17.588438,18.208998 17.588438,16.033 C 17.588438,13.857002 18.302439,12.752 19.577438,12.752 C 20.852437,12.752 21.600438,13.891002 21.600438,16.067"
+ id="text2219"
+ style="fill:#ffffff" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/11.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/11.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/11.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/11.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/11.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="32"
+ height="32"
+ id="svg2">
+ <defs
+ id="defs15" />
+ <circle
+ cx="16"
+ cy="16"
+ r="14"
+ id="circle"
+ style="fill:#aa0000" />
+ <path
+ d="M 14.623052,22 L 14.623052,10.1 L 11.869052,10.1 C 11.529053,11.204999 10.917051,11.63 9.3870527,11.715 L 9.3870527,13.806 L 11.393052,13.806 L 11.393052,22 L 14.623052,22 M 21.794928,22 L 21.794928,10.1 L 19.040928,10.1 C 18.700928,11.204999 18.088926,11.63 16.558928,11.715 L 16.558928,13.806 L 18.564928,13.806 L 18.564928,22 L 21.794928,22"
+ id="text2219"
+ style="fill:#ffffff" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/12.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/12.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/12.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/12.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/12.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="32"
+ height="32"
+ id="svg2">
+ <defs
+ id="defs15" />
+ <circle
+ cx="16"
+ cy="16"
+ r="14"
+ id="circle"
+ style="fill:#aa0000" />
+ <path
+ d="M 12.677562,22 L 12.677562,10.1 L 9.9235624,10.1 C 9.5835628,11.204999 8.9715609,11.63 7.4415624,11.715 L 7.4415624,13.806 L 9.4475624,13.806 L 9.4475624,22 L 12.677562,22 M 24.558438,22 L 24.558438,19.314 L 18.353438,19.314 C 18.608438,18.600001 19.27144,17.936999 21.651438,16.832 C 23.929436,15.778001 24.473438,14.825998 24.473438,13.262 C 24.473438,11.103002 22.926435,9.913 19.968438,9.913 C 17.92844,9.913 16.381436,10.491001 14.868438,11.46 L 16.381438,13.891 C 17.571437,13.092001 18.727439,12.684 19.917438,12.684 C 20.869437,12.684 21.243438,12.973001 21.243438,13.5 C 21.243438,13.976 21.056437,14.163001 19.798438,14.724 C 16.823441,16.049999 14.936438,17.988004 14.834438,22 L 24.558438,22"
+ id="text2219"
+ style="fill:#ffffff" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/13.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/13.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/13.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/13.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/13.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="32"
+ height="32"
+ id="svg2">
+ <defs
+ id="defs15" />
+ <circle
+ cx="16"
+ cy="16"
+ r="14"
+ id="circle"
+ style="fill:#aa0000" />
+ <path
+ d="M 12.550062,22 L 12.550062,10.1 L 9.7960624,10.1 C 9.4560628,11.204999 8.8440609,11.63 7.3140624,11.715 L 7.3140624,13.806 L 9.3200624,13.806 L 9.3200624,22 L 12.550062,22 M 24.685938,18.226 C 24.685938,16.713002 23.716937,15.914 22.611938,15.659 C 23.427937,15.268 24.192938,14.638999 24.192938,13.33 C 24.192938,10.814003 22.288935,9.913 19.432938,9.913 C 17.35894,9.913 15.930937,10.610001 14.825938,11.46 L 16.389938,13.602 C 17.307937,12.939001 18.191939,12.582 19.347938,12.582 C 20.520937,12.582 20.996938,12.922001 20.996938,13.551 C 20.996938,14.332999 20.656937,14.554 19.619938,14.554 L 18.089938,14.554 L 18.089938,17.121 L 19.806938,17.121 C 21.013937,17.121 21.489938,17.427001 21.489938,18.26 C 21.489938,19.075999 20.911937,19.467 19.534938,19.467 C 18.225939,19.467 17.120937,18.973999 16.151938,18.226 L 14.451938,20.368 C 15.726937,21.489999 17.44394,22.187 19.466938,22.187 C 22.696935,22.187 24.685938,20.979997 24.685938,18.226"
+ id="text2219"
+ style="fill:#ffffff" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/14.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/14.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/14.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/14.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/14.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="32"
+ height="32"
+ id="svg2">
+ <defs
+ id="defs15" />
+ <circle
+ cx="16"
+ cy="16"
+ r="14"
+ id="circle"
+ style="fill:#aa0000" />
+ <path
+ d="M 12.040062,22 L 12.040062,10.1 L 9.2860624,10.1 C 8.9460628,11.204999 8.3340609,11.63 6.8040624,11.715 L 6.8040624,13.806 L 8.8100624,13.806 L 8.8100624,22 L 12.040062,22 M 25.195938,19.96 L 25.195938,17.172 L 23.665938,17.172 L 23.665938,10.1 L 20.401938,10.1 L 13.992938,17.461 L 13.992938,19.875 L 20.707938,19.875 L 20.707938,22 L 23.665938,22 L 23.665938,19.96 L 25.195938,19.96 M 20.758938,13.432 C 20.724938,13.992999 20.707938,15.302001 20.707938,15.999 L 20.707938,17.172 L 19.823938,17.172 C 19.007939,17.172 18.191937,17.189 17.596938,17.223 C 18.038938,16.798 18.531939,16.253999 19.160938,15.489 L 19.330938,15.285 C 20.112937,14.350001 20.435938,13.925 20.758938,13.432"
+ id="text2219"
+ style="fill:#ffffff" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/15.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/15.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/15.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/15.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/15.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="32"
+ height="32"
+ id="svg2">
+ <defs
+ id="defs15" />
+ <circle
+ cx="16"
+ cy="16"
+ r="14"
+ id="circle"
+ style="fill:#aa0000" />
+ <path
+ d="M 12.388562,22 L 12.388562,10.1 L 9.6345624,10.1 C 9.2945628,11.204999 8.6825609,11.63 7.1525624,11.715 L 7.1525624,13.806 L 9.1585624,13.806 L 9.1585624,22 L 12.388562,22 M 24.847438,17.852 C 24.847438,15.200003 23.164435,13.908 20.597438,13.908 C 19.407439,13.908 18.693437,14.112 18.030438,14.435 L 18.132438,12.786 L 24.133438,12.786 L 24.133438,10.1 L 15.463438,10.1 L 15.055438,16.271 L 17.877438,17.223 C 18.472437,16.798 19.067439,16.543 20.070438,16.543 C 21.090437,16.543 21.668438,17.019001 21.668438,17.937 C 21.668438,18.888999 21.107436,19.45 19.577438,19.45 C 18.302439,19.45 16.891437,18.956999 15.752438,18.277 L 14.409438,20.742 C 15.871436,21.625999 17.43544,22.187 19.492438,22.187 C 22.875435,22.187 24.847438,20.622997 24.847438,17.852"
+ id="text2219"
+ style="fill:#ffffff" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/16.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/16.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/16.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/16.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/16.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="32"
+ height="32"
+ id="svg2">
+ <defs
+ id="defs15" />
+ <circle
+ cx="16"
+ cy="16"
+ r="14"
+ id="circle"
+ style="fill:#aa0000" />
+ <path
+ d="M 12.405562,22 L 12.405562,10.1 L 9.6515624,10.1 C 9.3115628,11.204999 8.6995609,11.63 7.1695624,11.715 L 7.1695624,13.806 L 9.1755624,13.806 L 9.1755624,22 L 12.405562,22 M 24.830438,17.903 C 24.830438,15.387003 23.096435,14.214 20.631438,14.214 C 19.203439,14.214 18.336437,14.486 17.571438,14.911 C 18.472437,13.534001 20.104441,12.616 23.215438,12.616 L 23.215438,9.913 C 16.415445,9.913 14.341438,14.112003 14.341438,17.257 C 14.341438,20.537997 16.415441,22.187 19.407438,22.187 C 22.773435,22.187 24.830438,20.588997 24.830438,17.903 M 21.651438,18.124 C 21.651438,19.075999 20.818437,19.586 19.577438,19.586 C 18.132439,19.586 17.486438,18.990999 17.486438,18.141 C 17.486438,17.206001 18.183439,16.645 19.645438,16.645 C 20.903437,16.645 21.651438,17.206001 21.651438,18.124"
+ id="text2219"
+ style="fill:#ffffff" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/17.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/17.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/17.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/17.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/17.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="32"
+ height="32"
+ id="svg2">
+ <defs
+ id="defs15" />
+ <circle
+ cx="16"
+ cy="16"
+ r="14"
+ id="circle"
+ style="fill:#aa0000" />
+ <path
+ d="M 12.652062,22 L 12.652062,10.1 L 9.8980624,10.1 C 9.5580628,11.204999 8.9460609,11.63 7.4160624,11.715 L 7.4160624,13.806 L 9.4220624,13.806 L 9.4220624,22 L 12.652062,22 M 24.583938,12.48 L 24.583938,10.1 L 14.740938,10.1 L 14.740938,12.786 L 20.656938,12.786 C 18.36194,15.131998 17.239938,17.920004 17.205938,22 L 20.435938,22 C 20.435938,18.141004 21.098941,15.675997 24.583938,12.48"
+ id="text2219"
+ style="fill:#ffffff" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/18.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/18.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/18.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/18.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/18.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="32"
+ height="32"
+ id="svg2">
+ <defs
+ id="defs15" />
+ <circle
+ cx="16"
+ cy="16"
+ r="14"
+ id="circle"
+ style="fill:#aa0000" />
+ <path
+ d="M 12.176062,22 L 12.176062,10.1 L 9.4220624,10.1 C 9.0820628,11.204999 8.4700609,11.63 6.9400624,11.715 L 6.9400624,13.806 L 8.9460624,13.806 L 8.9460624,22 L 12.176062,22 M 25.059938,18.294 C 25.059938,16.764002 23.971937,15.948 23.206938,15.642 C 23.954937,15.166 24.549938,14.519999 24.549938,13.449 C 24.549938,11.171002 22.526935,9.913 19.653938,9.913 C 16.780941,9.913 14.723938,11.171002 14.723938,13.449 C 14.723938,14.519999 15.352939,15.251 16.066938,15.676 C 15.301939,15.982 14.213938,16.764002 14.213938,18.294 C 14.213938,20.707998 16.287941,22.187 19.619938,22.187 C 22.951935,22.187 25.059938,20.707998 25.059938,18.294 M 21.387938,13.5 C 21.387938,14.094999 20.945937,14.639 19.653938,14.639 C 18.361939,14.639 17.885938,14.094999 17.885938,13.5 C 17.885938,12.905001 18.327939,12.31 19.619938,12.31 C 20.911937,12.31 21.387938,12.905001 21.387938,13.5 M 21.897938,18.26 C 21.897938,19.075999 21.149936,19.688 19.653938,19.688 C 18.157939,19.688 17.375938,19.0759!
99 17.375938,18.26 C 17.375938,17.444001 18.106939,16.849 19.619938,16.849 C 21.115936,16.849 21.897938,17.444001 21.897938,18.26"
+ id="text2219"
+ style="fill:#ffffff" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/19.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/19.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/19.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/19.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/19.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="32"
+ height="32"
+ id="svg2">
+ <defs
+ id="defs15" />
+ <circle
+ cx="16"
+ cy="16"
+ r="14"
+ id="circle"
+ style="fill:#aa0000" />
+ <path
+ d="M 12.414062,22 L 12.414062,10.1 L 9.6600624,10.1 C 9.3200628,11.204999 8.7080609,11.63 7.1780624,11.715 L 7.1780624,13.806 L 9.1840624,13.806 L 9.1840624,22 L 12.414062,22 M 24.821938,14.843 C 24.821938,11.562003 22.747935,9.913 19.755938,9.913 C 16.389941,9.913 14.332938,11.511003 14.332938,14.197 C 14.332938,16.712997 16.06694,17.886 18.531938,17.886 C 19.959937,17.886 20.826939,17.614 21.591938,17.189 C 20.690939,18.565999 19.058935,19.484 15.947938,19.484 L 15.947938,22.187 C 22.747931,22.187 24.821938,17.987997 24.821938,14.843 M 21.676938,13.959 C 21.676938,14.893999 20.979936,15.455 19.517938,15.455 C 18.259939,15.455 17.511938,14.893999 17.511938,13.976 C 17.511938,13.024001 18.344939,12.514 19.585938,12.514 C 21.030936,12.514 21.676938,13.109001 21.676938,13.959"
+ id="text2219"
+ style="fill:#ffffff" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/2.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/2.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/2.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/2.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="32"
+ height="32"
+ id="svg2">
+ <defs
+ id="defs15" />
+ <circle
+ cx="16"
+ cy="16"
+ r="14"
+ id="circle"
+ style="fill:#aa0000" />
+ <path
+ d="M 20.862,22.013004 L 20.862,19.327004 L 14.657,19.327004 C 14.912,18.613005 15.575003,17.950003 17.955,16.845004 C 20.232998,15.791005 20.777,14.839003 20.777,13.275004 C 20.777,11.116006 19.229997,9.9260043 16.272,9.9260043 C 14.232002,9.9260043 12.684999,10.504005 11.172,11.473004 L 12.685,13.904004 C 13.874999,13.105005 15.031001,12.697004 16.221,12.697004 C 17.172999,12.697004 17.547,12.986005 17.547,13.513004 C 17.547,13.989004 17.359999,14.176005 16.102,14.737004 C 13.127003,16.063003 11.24,18.001008 11.138,22.013004 L 20.862,22.013004"
+ id="text2207"
+ style="fill:#ffffff" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/20.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/20.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/20.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/20.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/20.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="32"
+ height="32"
+ id="svg2">
+ <defs
+ id="defs15" />
+ <circle
+ cx="16"
+ cy="16"
+ r="14"
+ id="circle"
+ style="fill:#aa0000" />
+ <path
+ d="M 14.685,22 L 14.685,19.314 L 8.4799999,19.314 C 8.7349997,18.600001 9.3980023,17.936999 11.778,16.832 C 14.055998,15.778001 14.6,14.825998 14.6,13.262 C 14.6,11.103002 13.052997,9.913 10.095,9.913 C 8.055002,9.913 6.5079984,10.491001 4.9949999,11.46 L 6.5079999,13.891 C 7.6979988,13.092001 8.8540011,12.684 10.044,12.684 C 10.995999,12.684 11.37,12.973001 11.37,13.5 C 11.37,13.976 11.182999,14.163001 9.9249999,14.724 C 6.9500029,16.049999 5.0629998,17.988004 4.9609999,22 L 14.685,22 M 27.421719,16.033 C 27.421719,12.072004 25.143716,9.913 22.049719,9.913 C 18.955722,9.913 16.643719,12.106004 16.643719,16.067 C 16.643719,20.027996 18.921722,22.187 22.015719,22.187 C 25.109716,22.187 27.421719,19.993996 27.421719,16.033 M 24.038719,16.067 C 24.038719,18.242998 23.324717,19.348 22.049719,19.348 C 20.77472,19.348 20.026719,18.208998 20.026719,16.033 C 20.026719,13.857002 20.74072,12.752 22.015719,12.752 C 23.290717,12.752 24.038719,13.891002 24.038719,16.067"
+ id="text2219"
+ style="fill:#ffffff" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/21.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/21.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/21.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/21.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/21.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="32"
+ height="32"
+ id="svg2">
+ <defs
+ id="defs15" />
+ <circle
+ cx="16"
+ cy="16"
+ r="14"
+ id="circle"
+ style="fill:#aa0000" />
+ <path
+ d="M 16.648141,22 L 16.648141,19.314 L 10.44314,19.314 C 10.69814,18.600001 11.361143,17.936999 13.741141,16.832 C 16.019139,15.778001 16.563141,14.825998 16.563141,13.262 C 16.563141,11.103002 15.016138,9.913 12.058141,9.913 C 10.018143,9.913 8.471139,10.491001 6.9581405,11.46 L 8.4711405,13.891 C 9.661139,13.092001 10.817142,12.684 12.007141,12.684 C 12.95914,12.684 13.333141,12.973001 13.333141,13.5 C 13.333141,13.976 13.14614,14.163001 11.88814,14.724 C 8.9131435,16.049999 7.0261404,17.988004 6.9241405,22 L 16.648141,22 M 23.82586,22 L 23.82586,10.1 L 21.07186,10.1 C 20.73186,11.204999 20.119858,11.63 18.58986,11.715 L 18.58986,13.806 L 20.59586,13.806 L 20.59586,22 L 23.82586,22"
+ id="text2219"
+ style="fill:#ffffff" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/22.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/22.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/22.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/22.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/22.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="32"
+ height="32"
+ id="svg2">
+ <defs
+ id="defs15" />
+ <circle
+ cx="16"
+ cy="16"
+ r="14"
+ id="circle"
+ style="fill:#aa0000" />
+ <path
+ d="M 14.685,22 L 14.685,19.314 L 8.4799999,19.314 C 8.7349997,18.600001 9.3980023,17.936999 11.778,16.832 C 14.055998,15.778001 14.6,14.825998 14.6,13.262 C 14.6,11.103002 13.052997,9.913 10.095,9.913 C 8.055002,9.913 6.5079984,10.491001 4.9949999,11.46 L 6.5079999,13.891 C 7.6979988,13.092001 8.8540011,12.684 10.044,12.684 C 10.995999,12.684 11.37,12.973001 11.37,13.5 C 11.37,13.976 11.182999,14.163001 9.9249999,14.724 C 6.9500029,16.049999 5.0629998,17.988004 4.9609999,22 L 14.685,22 M 26.571719,22 L 26.571719,19.314 L 20.366719,19.314 C 20.621718,18.600001 21.284721,17.936999 23.664719,16.832 C 25.942716,15.778001 26.486719,14.825998 26.486719,13.262 C 26.486719,11.103002 24.939716,9.913 21.981719,9.913 C 19.941721,9.913 18.394717,10.491001 16.881719,11.46 L 18.394719,13.891 C 19.584718,13.092001 20.74072,12.684 21.930719,12.684 C 22.882718,12.684 23.256719,12.973001 23.256719,13.5 C 23.256719,13.976 23.069717,14.163001 21.811719,14.724 C 18.836722,16.049999 16.9497!
19,17.988004 16.847719,22 L 26.571719,22"
+ id="number"
+ style="fill:#ffffff" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/23.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/23.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/23.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/23.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/23.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="32"
+ height="32"
+ id="svg2">
+ <defs
+ id="defs15" />
+ <circle
+ cx="16"
+ cy="16"
+ r="14"
+ id="circle"
+ style="fill:#aa0000" />
+ <path
+ d="M 15.32239,22.013004 L 15.32239,19.327004 L 9.1173907,19.327004 C 9.3723904,18.613005 10.035393,17.950003 12.41539,16.845004 C 14.693388,15.791005 15.23739,14.839003 15.23739,13.275004 C 15.23739,11.116006 13.690387,9.9260043 10.73239,9.9260043 C 8.6923927,9.9260043 7.1453891,10.504005 5.6323906,11.473004 L 7.1453906,13.904004 C 8.3353896,13.105005 9.4913919,12.697004 10.68139,12.697004 C 11.633389,12.697004 12.00739,12.986005 12.00739,13.513004 C 12.00739,13.989004 11.820389,14.176005 10.56239,14.737004 C 7.5873937,16.063003 5.7003905,18.001008 5.5983906,22.013004 L 15.32239,22.013004 M 26.401609,18.239004 C 26.401609,16.726006 25.432608,15.927004 24.327609,15.672004 C 25.143608,15.281005 25.908609,14.652003 25.908609,13.343004 C 25.908609,10.827007 24.004606,9.9260043 21.148609,9.9260043 C 19.074611,9.9260043 17.646608,10.623005 16.541609,11.473004 L 18.105609,13.615004 C 19.023608,12.952005 19.90761,12.595004 21.063609,12.595004 C 22.236608,12.595004 22.712609,12!
.935005 22.712609,13.564004 C 22.712609,14.346004 22.372608,14.567004 21.335609,14.567004 L 19.805609,14.567004 L 19.805609,17.134004 L 21.522609,17.134004 C 22.729608,17.134004 23.205609,17.440005 23.205609,18.273004 C 23.205609,19.089003 22.627608,19.480004 21.250609,19.480004 C 19.94161,19.480004 18.836608,18.987004 17.867609,18.239004 L 16.167609,20.381004 C 17.442608,21.503003 19.159611,22.200004 21.182609,22.200004 C 24.412606,22.200004 26.401609,20.993002 26.401609,18.239004"
+ id="text2207"
+ style="fill:#ffffff" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/3.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/3.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/3.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/3.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/3.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="32"
+ height="32"
+ id="svg2">
+ <defs
+ id="defs15" />
+ <circle
+ cx="16"
+ cy="16"
+ r="14"
+ id="circle"
+ style="fill:#aa0000" />
+ <path
+ d="M 21.117,18.239004 C 21.117,16.726006 20.147999,15.927004 19.043,15.672004 C 19.858999,15.281005 20.624,14.652003 20.624,13.343004 C 20.624,10.827007 18.719997,9.9260043 15.864,9.9260043 C 13.790002,9.9260043 12.361999,10.623005 11.257,11.473004 L 12.821,13.615004 C 13.738999,12.952005 14.623001,12.595004 15.779,12.595004 C 16.951999,12.595004 17.428,12.935005 17.428,13.564004 C 17.428,14.346004 17.087999,14.567004 16.051,14.567004 L 14.521,14.567004 L 14.521,17.134004 L 16.238,17.134004 C 17.444999,17.134004 17.921,17.440005 17.921,18.273004 C 17.921,19.089003 17.342999,19.480004 15.966,19.480004 C 14.657002,19.480004 13.551999,18.987004 12.583,18.239004 L 10.883,20.381004 C 12.157999,21.503003 13.875002,22.200004 15.898,22.200004 C 19.127997,22.200004 21.117,20.993002 21.117,18.239004"
+ id="text2207"
+ style="fill:#ffffff" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/4.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/4.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/4.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/4.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/4.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="32"
+ height="32"
+ id="svg2">
+ <defs
+ id="defs15" />
+ <circle
+ cx="16"
+ cy="16"
+ r="14"
+ id="circle"
+ style="fill:#aa0000" />
+ <path
+ d="M 20.573772,19.96 L 20.573772,17.172 L 19.043772,17.172 L 19.043772,10.1 L 15.779772,10.1 L 9.3707718,17.461 L 9.3707718,19.875 L 16.085772,19.875 L 16.085772,22 L 19.043772,22 L 19.043772,19.96 L 20.573772,19.96 M 16.136772,13.432 C 16.102772,13.992999 16.085772,15.302001 16.085772,15.999 L 16.085772,17.172 L 15.201772,17.172 C 14.385773,17.172 13.569771,17.189 12.974772,17.223 C 13.416772,16.798 13.909773,16.253999 14.538772,15.489 L 14.708772,15.285 C 15.490771,14.350001 15.813772,13.925 16.136772,13.432"
+ id="text2219"
+ style="fill:#ffffff" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/5.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/5.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/5.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/5.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/5.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="32"
+ height="32"
+ id="svg2">
+ <defs
+ id="defs15" />
+ <circle
+ cx="16"
+ cy="16"
+ r="14"
+ id="circle"
+ style="fill:#aa0000" />
+ <path
+ d="M 21.219,17.852 C 21.219,15.200003 19.535997,13.908 16.969,13.908 C 15.779001,13.908 15.064999,14.112 14.402,14.435 L 14.504,12.786 L 20.505,12.786 L 20.505,10.1 L 11.835,10.1 L 11.427,16.271 L 14.249,17.223 C 14.843999,16.798 15.439001,16.543 16.442,16.543 C 17.461999,16.543 18.04,17.019001 18.04,17.937 C 18.04,18.888999 17.478998,19.45 15.949,19.45 C 14.674001,19.45 13.262999,18.956999 12.124,18.277 L 10.781,20.742 C 12.242999,21.625999 13.807002,22.187 15.864,22.187 C 19.246997,22.187 21.219,20.622997 21.219,17.852"
+ id="text2219"
+ style="fill:#ffffff" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/6.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/6.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/6.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/6.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/6.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="32"
+ height="32"
+ id="svg2">
+ <defs
+ id="defs15" />
+ <circle
+ cx="16"
+ cy="16"
+ r="14"
+ id="circle"
+ style="fill:#aa0000" />
+ <path
+ d="M 21.2445,17.903 C 21.2445,15.387003 19.510497,14.214 17.0455,14.214 C 15.617501,14.214 14.750499,14.486 13.9855,14.911 C 14.886499,13.534001 16.518503,12.616 19.6295,12.616 L 19.6295,9.913 C 12.829507,9.913 10.7555,14.112003 10.7555,17.257 C 10.7555,20.537997 12.829503,22.187 15.8215,22.187 C 19.187497,22.187 21.2445,20.588997 21.2445,17.903 M 18.0655,18.124 C 18.0655,19.075999 17.232499,19.586 15.9915,19.586 C 14.546501,19.586 13.9005,18.990999 13.9005,18.141 C 13.9005,17.206001 14.597501,16.645 16.0595,16.645 C 17.317499,16.645 18.0655,17.206001 18.0655,18.124"
+ id="text2219"
+ style="fill:#ffffff" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/7.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/7.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/7.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/7.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/7.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="32"
+ height="32"
+ id="svg2">
+ <defs
+ id="defs15" />
+ <circle
+ cx="16"
+ cy="16"
+ r="14"
+ id="circle"
+ style="fill:#aa0000" />
+ <path
+ d="M 20.9215,12.48 L 20.9215,10.1 L 11.0785,10.1 L 11.0785,12.786 L 16.9945,12.786 C 14.699502,15.131998 13.5775,17.920004 13.5435,22 L 16.7735,22 C 16.7735,18.141004 17.436503,15.675997 20.9215,12.48"
+ id="text2219"
+ style="fill:#ffffff" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/8.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/8.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/8.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/8.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/8.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="32"
+ height="32"
+ id="svg2">
+ <defs
+ id="defs15" />
+ <circle
+ cx="16"
+ cy="16"
+ r="14"
+ id="circle"
+ style="fill:#aa0000" />
+ <path
+ d="M 21.423,18.294 C 21.423,16.764002 20.334999,15.948 19.57,15.642 C 20.317999,15.166 20.913,14.519999 20.913,13.449 C 20.913,11.171002 18.889997,9.913 16.017,9.913 C 13.144003,9.913 11.087,11.171002 11.087,13.449 C 11.087,14.519999 11.716001,15.251 12.43,15.676 C 11.665001,15.982 10.577,16.764002 10.577,18.294 C 10.577,20.707998 12.651003,22.187 15.983,22.187 C 19.314997,22.187 21.423,20.707998 21.423,18.294 M 17.751,13.5 C 17.751,14.094999 17.308999,14.639 16.017,14.639 C 14.725001,14.639 14.249,14.094999 14.249,13.5 C 14.249,12.905001 14.691001,12.31 15.983,12.31 C 17.274999,12.31 17.751,12.905001 17.751,13.5 M 18.261,18.26 C 18.261,19.075999 17.512998,19.688 16.017,19.688 C 14.521001,19.688 13.739,19.075999 13.739,18.26 C 13.739,17.444001 14.470002,16.849 15.983,16.849 C 17.478998,16.849 18.261,17.444001 18.261,18.26"
+ id="text2219"
+ style="fill:#ffffff" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/9.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/9.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/9.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/9.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/9.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="32"
+ height="32"
+ id="svg2">
+ <defs
+ id="defs15" />
+ <circle
+ cx="16"
+ cy="16"
+ r="14"
+ id="circle"
+ style="fill:#aa0000" />
+ <path
+ d="M 22.128383,14.843 C 22.128383,11.562003 20.05438,9.913 17.062383,9.913 C 13.696386,9.913 11.639383,11.511003 11.639383,14.197 C 11.639383,16.712997 13.373385,17.886 15.838383,17.886 C 17.266382,17.886 18.133384,17.614 18.898383,17.189 C 17.997384,18.565999 16.36538,19.484 13.254383,19.484 L 13.254383,22.187 C 20.054376,22.187 22.128383,17.987997 22.128383,14.843 M 18.983383,13.959 C 18.983383,14.893999 18.286381,15.455 16.824383,15.455 C 15.566384,15.455 14.818383,14.893999 14.818383,13.976 C 14.818383,13.024001 15.651384,12.514 16.892383,12.514 C 18.337381,12.514 18.983383,13.109001 18.983383,13.959"
+ id="text2219"
+ style="fill:#ffffff" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/background.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/background.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/bkgrnd_greydots.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/bkgrnd_greydots.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/bullet_arrowblue.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/bullet_arrowblue.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/documentation.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/documentation.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/dot.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/dot.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/dot2.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/dot2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/h1-bg.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/h1-bg.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/image_left.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/image_left.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/image_right.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/image_right.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/important.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/important.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/important.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/important.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/important.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="48"
+ height="48"
+ id="svg2">
+ <defs
+ id="defs5" />
+ <path
+ d="M 255.25,-411.29002 L 261.86798,-400.85887 L 273.83367,-397.7882 L 265.95811,-388.27072 L 266.73534,-375.94179 L 255.25,-380.49082 L 243.76466,-375.94179 L 244.54189,-388.27072 L 236.66633,-397.7882 L 248.63202,-400.85887 L 255.25,-411.29002 z "
+ transform="matrix(1.1071323,0,0,1.1071323,-258.4137,459.98052)"
+ style="fill:#2e3436;fill-opacity:1;stroke:#2e3436;stroke-width:4.25880718;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path4450" />
+ <path
+ d="M 255.25,-411.29002 L 261.86798,-400.85887 L 273.83367,-397.7882 L 265.95811,-388.27072 L 266.73534,-375.94179 L 255.25,-380.49082 L 243.76466,-375.94179 L 244.54189,-388.27072 L 236.66633,-397.7882 L 248.63202,-400.85887 L 255.25,-411.29002 z "
+ transform="matrix(1.1071323,0,0,1.1071323,-258.4137,459.98052)"
+ style="fill:#fac521;fill-opacity:1;stroke-width:3.4070456;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path4452" />
+ <path
+ d="M 24.175987,4.476098 L 16.980534,16.087712 L 3.9317841,19.443104 L 16.980534,20.076901 L 24.175987,10.383543 L 31.408721,20.076901 L 44.457471,19.443104 L 31.468862,16.027571 L 24.175987,4.476098 z "
+ style="fill:#feeaab;fill-opacity:1;stroke-width:3.4070456;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path4531" />
+ <path
+ d="M 12.456856,24.055852 C 11.65845,24.299685 14.436112,29.177769 14.436112,32.041127 C 14.436112,37.343117 13.010825,39.831516 15.971742,37.364645 C 18.711008,35.08244 21.184735,34.873512 24.195894,34.873512 C 27.207053,34.873512 29.646656,35.08244 32.38592,37.364645 C 35.346837,39.831516 33.921551,37.343117 33.92155,32.041127 C 33.92155,28.223316 38.868232,20.827013 33.682674,25.591482 C 31.458295,27.635233 27.413886,29.481744 24.195894,29.481744 C 20.977903,29.481744 16.933493,27.635233 14.709113,25.591482 C 13.412724,24.400365 12.722992,23.974574 12.456856,24.055852 z "
+ style="fill:#fcd867;fill-opacity:1;stroke-width:3.4070456;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2185" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/jboss-logo.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/jboss-logo.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/jboss-logo.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.0" width="191.6333" height="83.573601" id="svg2898" sodipodi:version="0.32" inkscape:version="0.45+devel" sodipodi:docname="jboss.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <metadata id="metadata16">
+ <rdf:RDF>
+ <cc:Work rdf:about="">
+ <dc:format></dc:format>
+ <dc:type rdf:resource="" />
+ <dc:title></dc:title>
+ <dc:date></dc:date>
+ <dc:creator>
+ <cc:Agent>
+ <dc:title></dc:title>
+ </cc:Agent>
+ </dc:creator>
+ <dc:rights>
+ <cc:Agent>
+ <dc:title></dc:title>
+ </cc:Agent>
+ </dc:rights>
+ <dc:publisher>
+ <cc:Agent>
+ <dc:title></dc:title>
+ </cc:Agent>
+ </dc:publisher>
+ <dc:identifier></dc:identifier>
+ <dc:source></dc:source>
+ <dc:relation></dc:relation>
+ <dc:language></dc:language>
+ <dc:subject>
+ <rdf:Bag />
+ </dc:subject>
+ <dc:coverage></dc:coverage>
+ <dc:description></dc:description>
+ <dc:contributor>
+ <cc:Agent>
+ <dc:title></dc:title>
+ </cc:Agent>
+ </dc:contributor>
+ <cc:license rdf:resource="" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview inkscape:window-height="566" inkscape:window-width="640" inkscape:pageshadow="2" inkscape:pageopacity="0.0" guidetolerance="10.0" gridtolerance="10.0" objecttolerance="10.0" borderopacity="1.0" bordercolor="#666666" pagecolor="#ffffff" id="base" showgrid="false" inkscape:zoom="2.8544099" inkscape:cx="95.81665" inkscape:cy="41.7868" inkscape:window-x="4" inkscape:window-y="59" inkscape:current-layer="svg2898" />
+ <defs id="defs21">
+ <inkscape:perspective sodipodi:type="inkscape:persp3d" inkscape:vp_x="-50 : 600 : 1" inkscape:vp_y="0 : 1000 : 0" inkscape:vp_z="700 : 600 : 1" inkscape:persp3d-origin="300 : 400 : 1" id="perspective18" />
+ </defs>
+ <path d="M 61.49611,73.983626 C 61.49611,79.277856 57.200354,83.573612 51.910768,83.573612 C 46.616539,83.573612 42.320782,79.277856 42.320782,73.983626 C 42.320782,68.689397 46.616539,64.39364 51.910768,64.39364 C 57.200354,64.39364 61.49611,68.689397 61.49611,73.983626 z" id="path4330" style="fill:#cc0000;fill-opacity:1" />
+ <path d="M 36.106196,71.091176 C 36.106196,75.731345 32.337243,79.500298 27.697074,79.500298 C 23.053117,79.500298 19.284163,75.731345 19.284163,71.091176 C 19.284163,66.447219 23.053117,62.682053 27.697074,62.682053 C 32.337243,62.682053 36.106196,66.447219 36.106196,71.091176 z" id="path4333" style="fill:#ff850c;fill-opacity:1" />
+ <path d="M 17.087185,55.822179 C 17.087185,60.022953 13.68187,63.432056 9.4810962,63.432056 C 5.2841107,63.432056 1.875007,60.022953 1.875007,55.822179 C 1.875007,51.625194 5.2841107,48.21609 9.4810962,48.21609 C 13.68187,48.21609 17.087185,51.625194 17.087185,55.822179 z" id="path4335" style="fill:#fac521;fill-opacity:1" />
+ <path d="M 13.606112,34.556948 C 13.606112,38.31075 10.560646,41.360004 6.8030558,41.360004 C 3.0492539,41.360004 4.2148359e-18,38.31075 4.2148359e-18,34.556948 C 4.2148359e-18,30.803146 3.0492539,27.753892 6.8030558,27.753892 C 10.560646,27.753892 13.606112,30.803146 13.606112,34.556948 z" id="path4337" style="fill:#b5bd14;fill-opacity:1" />
+ <path d="M 23.087208,15.431876 C 23.087208,18.62507 20.496289,21.219777 17.303095,21.219777 C 14.109901,21.219777 11.518983,18.62507 11.518983,15.431876 C 11.518983,12.238682 14.109901,9.6477635 17.303095,9.6477635 C 20.496289,9.6477635 23.087208,12.238682 23.087208,15.431876 z" id="path4339" style="fill:#007f91;fill-opacity:1" />
+ <path d="M 39.375148,7.0379052 C 39.375148,9.8750371 37.068321,12.181864 34.231189,12.181864 C 31.394057,12.181864 29.08723,9.8750371 29.08723,7.0379052 C 29.08723,4.2007734 31.394057,1.8939465 34.231189,1.8939465 C 37.068321,1.8939465 39.375148,4.2007734 39.375148,7.0379052 z" id="path4341" style="fill:#0099d7;fill-opacity:1" />
+ <path d="M 56.568394,4.3371375 C 56.568394,6.7310859 54.625205,8.6780629 52.231257,8.6780629 C 49.83352,8.6780629 47.890331,6.7310859 47.890331,4.3371375 C 47.890331,1.9431892 49.83352,0 52.231257,0 C 54.625205,0 56.568394,1.9431892 56.568394,4.3371375 z" id="path4343" style="fill:#7a82ba;fill-opacity:1" />
+ <path d="M 89.663215,46.8676 C 93.102622,46.8676 94.193535,43.46986 94.193535,40.591061 C 94.193535,37.712263 93.102622,34.272856 89.663215,34.272856 C 86.22002,34.272856 85.170774,37.712263 85.170774,40.591061 C 85.170774,43.46986 86.22002,46.8676 89.663215,46.8676 M 89.663215,28.60238 C 96.678393,28.60238 101.60644,33.791793 101.60644,40.591061 C 101.60644,47.390329 96.678393,52.534288 89.663215,52.534288 C 82.644249,52.534288 77.757868,47.390329 77.757868,40.591061 C 77.757868,33.791793 82.644249,28.60238 89.663215,28.60238 z M 107.59889,44.428197 C 107.59889,45.560777 108.07616,46.390326 108.8148,46.954722 C 109.51556,47.481239 110.51557,47.738816 111.56481,47.738816 C 113.00042,47.738816 115.04967,47.128965 115.04967,45.341079 C 115.04967,43.598648 112.73906,43.250162 111.43224,42.943343 C 106.76934,41.769096 100.92462,41.63652 100.92462,35.534224 C 100.92462,30.083446 106.80722,28.60238 111.25799,28.60238 C 116.22771,28.60238 121.41333,30.041779 121.6747,35.928165 L!
114.83376,35.928165 C 114.83376,34.96604 114.48528,34.359977 113.87543,33.966037 C 113.26179,33.572096 112.43603,33.397853 111.51936,33.397853 C 110.29587,33.397853 108.33753,33.526641 108.33753,35.098617 C 108.33753,37.234988 113.30724,37.625141 116.70498,38.367568 C 121.28455,39.284238 122.46258,42.594857 122.46258,44.469864 C 122.46258,50.530493 116.70498,52.534288 111.60648,52.534288 C 106.24661,52.534288 100.75417,50.75019 100.53447,44.428197 L 107.59889,44.428197 L 107.59889,44.428197 z M 129.26185,44.428197 C 129.26185,45.560777 129.74291,46.390326 130.48534,46.954722 C 131.18231,47.481239 132.1861,47.738816 133.23156,47.738816 C 134.66717,47.738816 136.71642,47.128965 136.71642,45.341079 C 136.71642,43.598648 134.40581,43.250162 133.09898,42.943343 C 128.43609,41.769096 122.59516,41.63652 122.59516,35.534224 C 122.59516,30.083446 128.48154,28.60238 132.92474,28.60238 C 137.89446,28.60238 143.08387,30.041779 143.34523,35.928165 L 136.50051,35.928165 C 136.50051,34.9!
6604 136.15203,34.359977 135.54218,33.966037 C 134.92854,33.572096 134
.10278,33.397853 133.18611,33.397853 C 131.9664,33.397853 130.00806,33.526641 130.00806,35.098617 C 130.00806,37.234988 134.97399,37.625141 138.37552,38.367568 C 142.95129,39.284238 144.12933,42.594857 144.12933,44.469864 C 144.12933,50.530493 138.37552,52.534288 133.27702,52.534288 C 127.91336,52.534288 122.42091,50.75019 122.20122,44.428197 L 129.26185,44.428197 L 129.26185,44.428197 z M 82.091217,67.814648 C 81.981368,67.848739 81.863944,67.879043 81.738943,67.90177 C 81.613943,67.928285 81.481366,67.947225 81.341214,67.962376 C 81.20485,67.981316 81.064698,68.000255 80.928334,68.022983 C 80.799546,68.049498 80.670757,68.079801 80.541969,68.121468 C 80.416968,68.159347 80.307119,68.216165 80.21621,68.284347 C 80.121513,68.352529 80.045755,68.439651 79.988936,68.541924 C 79.932118,68.647985 79.905603,68.780561 79.905603,68.939653 C 79.905603,69.091168 79.932118,69.219957 79.988936,69.326018 C 80.045755,69.432079 80.121513,69.511624 80.219998,69.572231 C 80.318483,69.632837!
80.43212,69.674504 80.560908,69.701019 C 80.693485,69.723746 80.826061,69.73511 80.962425,69.73511 C 81.307123,69.73511 81.568488,69.678292 81.757883,69.564655 C 81.943489,69.454806 82.079853,69.318442 82.170763,69.163138 C 82.261672,69.007835 82.314703,68.848743 82.33743,68.685864 C 82.35637,68.526772 82.367733,68.397984 82.367733,68.303287 L 82.367733,67.663133 C 82.291975,67.727527 82.201066,67.776769 82.091217,67.814648 M 78.689689,65.397973 C 78.86772,65.13282 79.094994,64.920698 79.367722,64.757819 C 79.64045,64.598727 79.951058,64.48509 80.291968,64.416908 C 80.636666,64.348726 80.981364,64.314635 81.326063,64.314635 C 81.640458,64.314635 81.958641,64.337363 82.280612,64.379029 C 82.602583,64.424484 82.898038,64.511606 83.163191,64.640394 C 83.428343,64.769182 83.648041,64.947213 83.814708,65.178275 C 83.985164,65.405548 84.072285,65.70858 84.072285,66.087369 L 84.072285,69.329806 C 84.072285,69.61011 84.087437,69.87905 84.11774,70.136627 C 84.151831,70.394204 84.20!
8649,70.587386 84.288195,70.716174 L 82.557128,70.704811 C 82.526825,7
0.610113 82.496522,70.511628 82.477582,70.413143 C 82.458643,70.314658 82.443491,70.212385 82.435915,70.110112 C 82.163187,70.390416 81.841216,70.591174 81.470003,70.701023 C 81.098789,70.81466 80.72,70.871478 80.329847,70.871478 C 80.030603,70.871478 79.754087,70.837387 79.49651,70.765417 C 79.235146,70.689659 79.01166,70.57981 78.818478,70.424507 C 78.621507,70.272991 78.473779,70.079808 78.36393,69.844959 C 78.254081,69.613898 78.201051,69.333594 78.201051,69.011623 C 78.201051,68.659349 78.261657,68.367681 78.386658,68.136619 C 78.511658,67.909346 78.674538,67.723739 78.871508,67.587375 C 79.068478,67.451011 79.295752,67.348738 79.549541,67.280556 C 79.80333,67.212373 80.060906,67.159343 80.318483,67.117676 C 80.57606,67.076009 80.833637,67.041918 81.083638,67.019191 C 81.333638,66.996464 81.553336,66.958585 81.746519,66.91313 C 81.943489,66.863887 82.095005,66.791917 82.208642,66.701008 C 82.322279,66.606311 82.375309,66.473734 82.367733,66.295703 C 82.367733,66.110097 !
82.33743,65.962369 82.276824,65.856308 C 82.21243,65.746459 82.132884,65.663125 82.030611,65.602519 C 81.928338,65.541913 81.810913,65.500246 81.674549,65.481306 C 81.541973,65.462367 81.394245,65.451003 81.242729,65.451003 C 80.901819,65.451003 80.632878,65.522973 80.435908,65.670701 C 80.238937,65.814641 80.125301,66.057066 80.094997,66.397976 L 78.390446,66.397976 C 78.413173,65.99646 78.511658,65.663125 78.689689,65.397973 z M 92.598832,66.829796 C 92.54959,66.594947 92.466256,66.382825 92.348831,66.204794 C 92.231407,66.022975 92.083679,65.875247 91.898072,65.76161 C 91.712465,65.647974 91.481404,65.591155 91.197312,65.591155 C 90.917008,65.591155 90.678371,65.647974 90.485188,65.76161 C 90.292005,65.875247 90.136702,66.022975 90.019277,66.208582 C 89.901852,66.394189 89.818519,66.606311 89.765488,66.844948 C 89.712458,67.079797 89.685943,67.329798 89.685943,67.587375 C 89.685943,67.8298 89.716246,68.072225 89.773064,68.310862 C 89.829882,68.553288 89.917004,68.769197 !
90.045792,68.958592 C 90.167005,69.147987 90.326096,69.30329 90.515491
,69.416927 C 90.704886,69.534352 90.932159,69.594958 91.197312,69.594958 C 91.481404,69.594958 91.716253,69.53814 91.905648,69.424503 C 92.091255,69.310866 92.24277,69.15935 92.356407,68.969956 C 92.470044,68.780561 92.54959,68.564651 92.598832,68.322226 C 92.644287,68.083589 92.670802,67.833588 92.670802,67.576011 C 92.670802,67.318434 92.644287,67.068433 92.598832,66.829796 M 92.670802,69.920717 C 92.470044,70.257839 92.204891,70.500265 91.879133,70.647992 C 91.557162,70.79572 91.189736,70.871478 90.776856,70.871478 C 90.310945,70.871478 89.901852,70.780569 89.549578,70.602538 C 89.197304,70.420719 88.905637,70.174506 88.674575,69.863899 C 88.447302,69.557079 88.273058,69.201017 88.159422,68.799501 C 88.041997,68.397984 87.981391,67.977528 87.981391,67.545708 C 87.981391,67.125252 88.041997,66.723735 88.159422,66.333582 C 88.273058,65.943429 88.447302,65.598731 88.674575,65.303275 C 88.901849,65.004032 89.189729,64.765395 89.534427,64.583576 C 89.879125,64.405545 90.280642!
,64.314635 90.735189,64.314635 C 91.106402,64.314635 91.454889,64.390393 91.788223,64.545697 C 92.121558,64.704788 92.382922,64.932062 92.576105,65.235093 L 92.598832,65.235093 L 92.598832,62.113869 L 94.326111,62.113869 L 94.326111,70.716174 L 92.69353,70.716174 L 92.69353,69.920717 L 92.670802,69.920717 z M 96.958697,64.477515 L 96.958697,70.704811 L 95.254145,70.704811 L 95.254145,64.477515 L 96.958697,64.477515 M 95.254145,63.507814 L 95.254145,62.087354 L 96.958697,62.087354 L 96.958697,63.507814 L 95.254145,63.507814 z M 99.606434,70.704811 L 97.473851,64.481303 L 99.269312,64.481303 L 100.57992,68.731319 L 100.60644,68.731319 L 101.91705,64.481303 L 103.61781,64.481303 L 101.51174,70.704811 L 99.606434,70.704811 L 99.606434,70.704811 z M 105.85267,64.477515 L 105.85267,70.704811 L 104.14812,70.704811 L 104.14812,64.477515 L 105.85267,64.477515 M 104.14812,63.507814 L 104.14812,62.087354 L 105.85267,62.087354 L 105.85267,63.507814 L 104.14812,63.507814 z M 108.40571,6!
9.166926 C 108.48526,69.299502 108.58374,69.405563 108.70117,69.488897
C 108.82238,69.572231 108.96253,69.636625 109.12162,69.674504 C 109.27693,69.716171 109.4398,69.73511 109.61026,69.73511 C 109.72768,69.73511 109.85647,69.723746 109.98905,69.693443 C 110.12163,69.666928 110.24284,69.621473 110.35269,69.560867 C 110.45875,69.500261 110.54966,69.420715 110.62163,69.318442 C 110.69739,69.219957 110.73148,69.091168 110.73148,68.939653 C 110.73148,68.682076 110.56102,68.492681 110.21632,68.363893 C 109.87541,68.235105 109.39814,68.106316 108.7845,67.977528 C 108.5345,67.920709 108.28829,67.856315 108.05344,67.776769 C 107.8148,67.701012 107.60268,67.602526 107.41707,67.477526 C 107.23146,67.352525 107.08374,67.197222 106.9701,67.007827 C 106.85646,66.818433 106.80343,66.587371 106.80343,66.314643 C 106.80343,65.913126 106.87919,65.583579 107.03828,65.326003 C 107.19358,65.068426 107.40192,64.867668 107.65949,64.716152 C 107.91707,64.568424 108.20495,64.466151 108.52692,64.405545 C 108.84889,64.344938 109.17844,64.314635 109.51935,64.314635 C 10!
9.85647,64.314635 110.18223,64.344938 110.50041,64.409333 C 110.8186,64.473727 111.10269,64.583576 111.35269,64.735091 C 111.60269,64.886607 111.80724,65.091153 111.9739,65.344942 C 112.13678,65.598731 112.23906,65.916914 112.26936,66.303279 L 110.63678,66.303279 C 110.61026,65.969945 110.48526,65.746459 110.26178,65.629034 C 110.0345,65.507822 109.76935,65.451003 109.46253,65.451003 C 109.36405,65.451003 109.26177,65.454791 109.14814,65.466155 C 109.0345,65.481306 108.93223,65.507822 108.83753,65.545701 C 108.74662,65.587367 108.66707,65.644186 108.60268,65.723731 C 108.53829,65.799489 108.50798,65.901762 108.50798,66.030551 C 108.50798,66.182067 108.56101,66.307067 108.67465,66.405552 C 108.78829,66.50025 108.93601,66.579795 109.11405,66.640402 C 109.29586,66.701008 109.5042,66.754038 109.73905,66.803281 C 109.9739,66.852524 110.21253,66.901766 110.45496,66.958585 C 110.70117,67.015403 110.94739,67.083585 111.18224,67.166919 C 111.42087,67.246464 111.63299,67.352525 111.8!
186,67.485102 C 112.00421,67.617678 112.15194,67.784345 112.26557,67.9
81316 C 112.37921,68.178286 112.43603,68.420711 112.43603,68.708591 C 112.43603,69.121472 112.35269,69.46617 112.18981,69.742686 C 112.02315,70.019202 111.80724,70.242688 111.54209,70.413143 C 111.27693,70.57981 110.9739,70.701023 110.63299,70.769205 C 110.29208,70.837387 109.94359,70.871478 109.58753,70.871478 C 109.22768,70.871478 108.87541,70.837387 108.52692,70.765417 C 108.18222,70.689659 107.8754,70.572235 107.60646,70.401779 C 107.33752,70.235112 107.11404,70.011626 106.94358,69.73511 C 106.76934,69.458594 106.67464,69.110108 106.65949,68.69344 L 108.29207,68.69344 C 108.29207,68.875258 108.32995,69.03435 108.40571,69.166926 L 108.40571,69.166926 z M 114.9474,64.477515 L 114.9474,70.704811 L 113.24285,70.704811 L 113.24285,64.477515 L 114.9474,64.477515 M 113.24285,63.507814 L 113.24285,62.087354 L 114.9474,62.087354 L 114.9474,63.507814 L 113.24285,63.507814 z M 117.60271,68.329802 C 117.65196,68.568439 117.73529,68.780561 117.85271,68.969956 C 117.97014,69.15935 118!
.12923,69.310866 118.32241,69.424503 C 118.5156,69.53814 118.75802,69.594958 119.05348,69.594958 C 119.34514,69.594958 119.59136,69.53814 119.78833,69.424503 C 119.9853,69.310866 120.14439,69.15935 120.26181,68.969956 C 120.37924,68.780561 120.46257,68.568439 120.51182,68.329802 C 120.56106,68.091165 120.58757,67.848739 120.58757,67.598739 C 120.58757,67.348738 120.56106,67.102525 120.51182,66.860099 C 120.46257,66.621462 120.37924,66.405552 120.26181,66.219945 C 120.14439,66.034339 119.9853,65.886611 119.78833,65.769186 C 119.59136,65.651762 119.34514,65.591155 119.05348,65.591155 C 118.75802,65.591155 118.5156,65.651762 118.32241,65.769186 C 118.12923,65.886611 117.97014,66.034339 117.85271,66.219945 C 117.73529,66.405552 117.65196,66.621462 117.60271,66.860099 C 117.55726,67.102525 117.53074,67.348738 117.53074,67.598739 C 117.53074,67.848739 117.55726,68.091165 117.60271,68.329802 M 116.05725,66.250249 C 116.20877,65.844944 116.42847,65.496458 116.70877,65.212366 C 116.!
98908,64.924486 117.32999,64.704788 117.72393,64.549485 C 118.11787,64
.390393 118.56105,64.314635 119.05348,64.314635 C 119.5459,64.314635 119.98909,64.390393 120.38682,64.549485 C 120.78454,64.704788 121.12545,64.924486 121.40955,65.212366 C 121.68985,65.496458 121.90576,65.844944 122.06106,66.250249 C 122.21258,66.655553 122.29213,67.106312 122.29213,67.606314 C 122.29213,68.102528 122.21258,68.553288 122.06106,68.954804 C 121.90576,69.356321 121.68985,69.701019 121.40955,69.985111 C 121.12545,70.269203 120.78454,70.488901 120.38682,70.640417 C 119.98909,70.79572 119.5459,70.871478 119.05348,70.871478 C 118.56105,70.871478 118.11787,70.79572 117.72393,70.640417 C 117.32999,70.488901 116.98908,70.269203 116.70877,69.985111 C 116.42847,69.701019 116.20877,69.356321 116.05725,68.954804 C 115.90195,68.553288 115.82619,68.102528 115.82619,67.606314 C 115.82619,67.106312 115.90195,66.655553 116.05725,66.250249 z M 124.79592,64.481303 L 124.79592,65.34873 L 124.83001,65.34873 C 125.04592,64.98888 125.33002,64.723728 125.67471,64.560848 C 126.01941,!
64.397969 126.37169,64.314635 126.73532,64.314635 C 127.18987,64.314635 127.56487,64.375242 127.86033,64.500242 C 128.152,64.625243 128.38306,64.799486 128.54972,65.019183 C 128.72018,65.238881 128.8376,65.507822 128.90579,65.826005 C 128.97397,66.1404 129.00806,66.492674 129.00806,66.879039 L 129.00806,70.704811 L 127.30351,70.704811 L 127.30351,67.193434 C 127.30351,66.678281 127.22396,66.295703 127.06487,66.041914 C 126.90199,65.791914 126.6179,65.663125 126.21259,65.663125 C 125.74668,65.663125 125.40956,65.803277 125.20123,66.079793 C 124.99289,66.35631 124.89062,66.810857 124.89062,67.443435 L 124.89062,70.704811 L 123.16334,70.704811 L 123.16334,64.481303 L 124.79592,64.481303 L 124.79592,64.481303 z M 134.76187,68.329802 C 134.81111,68.568439 134.89445,68.780561 135.01187,68.969956 C 135.12929,69.15935 135.2846,69.310866 135.48157,69.424503 C 135.67475,69.53814 135.91718,69.594958 136.21263,69.594958 C 136.5043,69.594958 136.74673,69.53814 136.94748,69.424503 C 137.!
14445,69.310866 137.30355,69.15935 137.42097,68.969956 C 137.53839,68.
780561 137.62173,68.568439 137.67097,68.329802 C 137.72021,68.091165 137.74294,67.848739 137.74294,67.598739 C 137.74294,67.348738 137.72021,67.102525 137.67097,66.860099 C 137.62173,66.621462 137.53839,66.405552 137.42097,66.219945 C 137.30355,66.034339 137.14445,65.886611 136.94748,65.769186 C 136.74673,65.651762 136.5043,65.591155 136.21263,65.591155 C 135.91718,65.591155 135.67475,65.651762 135.48157,65.769186 C 135.2846,65.886611 135.12929,66.034339 135.01187,66.219945 C 134.89445,66.405552 134.81111,66.621462 134.76187,66.860099 C 134.71263,67.102525 134.6899,67.348738 134.6899,67.598739 C 134.6899,67.848739 134.71263,68.091165 134.76187,68.329802 M 133.21262,66.250249 C 133.36792,65.844944 133.58383,65.496458 133.86793,65.212366 C 134.14823,64.924486 134.48535,64.704788 134.87929,64.549485 C 135.27702,64.390393 135.72021,64.314635 136.21263,64.314635 C 136.70127,64.314635 137.14445,64.390393 137.54597,64.549485 C 137.9437,64.704788 138.28461,64.924486 138.56491,65.212!
366 C 138.84901,65.496458 139.06492,65.844944 139.21643,66.250249 C 139.37174,66.655553 139.44749,67.106312 139.44749,67.606314 C 139.44749,68.102528 139.37174,68.553288 139.21643,68.954804 C 139.06492,69.356321 138.84901,69.701019 138.56491,69.985111 C 138.28461,70.269203 137.9437,70.488901 137.54597,70.640417 C 137.14445,70.79572 136.70127,70.871478 136.21263,70.871478 C 135.72021,70.871478 135.27702,70.79572 134.87929,70.640417 C 134.48535,70.488901 134.14823,70.269203 133.86793,69.985111 C 133.58383,69.701019 133.36792,69.356321 133.21262,68.954804 C 133.06111,68.553288 132.98535,68.102528 132.98535,67.606314 C 132.98535,67.106312 133.06111,66.655553 133.21262,66.250249 z M 139.64825,65.61767 L 139.64825,64.481303 L 140.67477,64.481303 L 140.67477,64.00024 C 140.67477,63.447208 140.84523,62.992661 141.18992,62.640387 C 141.53462,62.288113 142.05356,62.113869 142.75432,62.113869 C 142.90584,62.113869 143.05735,62.117657 143.20887,62.129021 C 143.36039,62.140385 143.5119,!
62.151748 143.65584,62.159324 L 143.65584,63.439632 C 143.45508,63.405
541 143.24675,63.390389 143.03084,63.390389 C 142.79599,63.390389 142.62932,63.44342 142.52705,63.553269 C 142.42856,63.663118 142.37932,63.844937 142.37932,64.106301 L 142.37932,64.481303 L 143.55736,64.481303 L 143.55736,65.61767 L 142.37932,65.61767 L 142.37932,70.704811 L 140.67477,70.704811 L 140.67477,65.61767 L 139.64825,65.61767 L 139.64825,65.61767 z" id="path2337" style="fill:#9ea3a6;fill-rule:nonzero;stroke:none" />
+ <path d="M 51.015343,42.030461 C 51.015343,49.00776 47.439572,52.534288 40.117575,52.534288 C 31.878907,52.534288 29.216019,47.78427 29.216019,40.852426 L 29.216019,39.500148 L 36.848623,39.500148 L 36.848623,42.378947 C 36.848623,44.428197 37.981203,45.560777 39.984999,45.560777 C 41.860006,45.560777 42.905464,44.515319 42.905464,41.507732 L 42.905464,20.757654 L 51.015343,20.757654 L 51.015343,42.030461 L 51.015343,42.030461 z M 59.045676,45.386534 L 65.538125,45.386534 C 68.110104,45.386534 69.89799,44.469864 69.89799,41.897885 C 69.89799,39.15545 67.981316,38.234992 65.538125,38.234992 L 59.045676,38.234992 L 59.045676,45.386534 M 59.045676,33.0077 L 65.322215,33.0077 C 66.716159,33.0077 68.636621,32.265273 68.636621,30.041779 C 68.636621,27.776619 67.019191,27.034192 65.322215,27.034192 L 59.045676,27.034192 L 59.045676,33.0077 M 50.935797,20.757654 L 65.496458,20.757654 C 70.856326,20.666744 76.742712,22.064477 76.742712,28.560713 C 76.742712,31.348603 75.083615,33.!
61755 72.644212,34.837252 C 75.95483,35.795589 78.004081,38.6706 78.004081,42.204704 C 78.004081,49.613823 72.55709,51.88277 65.886611,51.88277 L 50.935797,51.88277 L 50.935797,20.757654 z M 151.33769,65.99646 C 151.7733,65.99646 152.09906,65.897975 152.31875,65.704792 C 152.53466,65.515397 152.64451,65.201002 152.64451,64.769182 C 152.64451,64.352514 152.53466,64.049483 152.31875,63.863876 C 152.09906,63.674481 151.7733,63.579784 151.33769,63.579784 L 149.25814,63.579784 L 149.25814,65.99646 L 151.33769,65.99646 M 152.01193,62.113869 C 152.3983,62.113869 152.75057,62.174476 153.05739,62.299476 C 153.368,62.424477 153.63315,62.591144 153.85664,62.810842 C 154.07634,63.026752 154.24679,63.276753 154.36043,63.560845 C 154.47785,63.844937 154.53846,64.151756 154.53846,64.481303 C 154.53846,64.985092 154.4324,65.424488 154.21649,65.791914 C 154.00437,66.159339 153.65588,66.439643 153.17482,66.632826 L 153.17482,66.659341 C 153.40588,66.719947 153.59906,66.818433 153.75058,66.95!
4797 C 153.90588,67.083585 154.03088,67.242677 154.12558,67.420708 C 1
54.22406,67.602526 154.29225,67.803285 154.3377,68.019195 C 154.37937,68.235105 154.41346,68.451014 154.42861,68.670712 C 154.43619,68.807076 154.44376,68.966168 154.45134,69.151775 C 154.45891,69.337381 154.47406,69.526776 154.493,69.716171 C 154.51573,69.913141 154.54603,70.09496 154.59149,70.265415 C 154.63694,70.439658 154.70134,70.587386 154.78846,70.704811 L 152.8983,70.704811 C 152.79224,70.432082 152.72785,70.106324 152.70512,69.731322 C 152.68239,69.352533 152.64451,68.992683 152.59527,68.647985 C 152.53088,68.197226 152.39451,67.867679 152.18618,67.659345 C 151.97406,67.451011 151.63314,67.34495 151.15587,67.34495 L 149.25814,67.34495 L 149.25814,70.704811 L 147.36419,70.704811 L 147.36419,62.113869 L 152.01193,62.113869 z M 159.20514,65.928278 C 159.0006,65.704792 158.6862,65.591155 158.26953,65.591155 C 157.9968,65.591155 157.76953,65.63661 157.5915,65.731307 C 157.40968,65.822217 157.26574,65.939641 157.15589,66.076006 C 157.04604,66.21237 156.97029,66.35631 156!
.92862,66.507825 C 156.88316,66.659341 156.85665,66.799493 156.84907,66.916918 L 159.63317,66.916918 C 159.55363,66.485098 159.40969,66.155551 159.20514,65.928278 M 157.26953,69.219957 C 157.52711,69.469958 157.89832,69.594958 158.37938,69.594958 C 158.72408,69.594958 159.01954,69.507837 159.26954,69.337381 C 159.51954,69.163138 159.67105,68.981319 159.72787,68.788137 L 161.23545,68.788137 C 160.99303,69.534352 160.6256,70.068445 160.1256,70.390416 C 159.62939,70.712387 159.02711,70.871478 158.31878,70.871478 C 157.83014,70.871478 157.38695,70.791932 156.99301,70.636629 C 156.59907,70.481325 156.26953,70.257839 155.9968,69.966172 C 155.72407,69.678292 155.51574,69.333594 155.36801,68.932077 C 155.21649,68.53056 155.14452,68.087377 155.14452,67.606314 C 155.14452,67.136616 155.22028,66.704796 155.3718,66.303279 C 155.52331,65.901762 155.73922,65.553276 156.01952,65.261609 C 156.29983,64.966153 156.63695,64.735091 157.02332,64.568424 C 157.41347,64.397969 157.84529,64.314635 !
158.31878,64.314635 C 158.84908,64.314635 159.3112,64.416908 159.70514
,64.621455 C 160.09909,64.826001 160.42106,65.098729 160.67485,65.443427 C 160.92863,65.788126 161.11045,66.182067 161.22409,66.62525 C 161.33394,67.064646 161.37561,67.526769 161.3453,68.007831 L 156.84907,68.007831 C 156.8718,68.564651 157.01195,68.969956 157.26953,69.219957 z M 166.83017,66.829796 C 166.78472,66.594947 166.70138,66.382825 166.58396,66.204794 C 166.46653,66.022975 166.31502,65.875247 166.12941,65.76161 C 165.94759,65.647974 165.71274,65.591155 165.43244,65.591155 C 165.14835,65.591155 164.9135,65.647974 164.71653,65.76161 C 164.52713,65.875247 164.36804,66.022975 164.2544,66.208582 C 164.13698,66.394189 164.05365,66.606311 164.00062,66.844948 C 163.94758,67.079797 163.92107,67.329798 163.92107,67.587375 C 163.92107,67.8298 163.95137,68.072225 164.0044,68.310862 C 164.06122,68.553288 164.15213,68.769197 164.27713,68.958592 C 164.40213,69.147987 164.55744,69.30329 164.74683,69.416927 C 164.93622,69.534352 165.1635,69.594958 165.43244,69.594958 C 165.71274,69!
.594958 165.94759,69.53814 166.13699,69.424503 C 166.32638,69.310866 166.4779,69.15935 166.58775,68.969956 C 166.70138,68.780561 166.78472,68.564651 166.83017,68.322226 C 166.87941,68.083589 166.90593,67.833588 166.90593,67.576011 C 166.90593,67.318434 166.87941,67.068433 166.83017,66.829796 M 166.90593,69.920717 C 166.70517,70.257839 166.44002,70.500265 166.11426,70.647992 C 165.7885,70.79572 165.42108,70.871478 165.01198,70.871478 C 164.54607,70.871478 164.13698,70.780569 163.78092,70.602538 C 163.42864,70.420719 163.13698,70.174506 162.9097,69.863899 C 162.67864,69.557079 162.50819,69.201017 162.39076,68.799501 C 162.27334,68.397984 162.21652,67.977528 162.21652,67.545708 C 162.21652,67.125252 162.27334,66.723735 162.39076,66.333582 C 162.50819,65.943429 162.67864,65.598731 162.9097,65.303275 C 163.13698,65.004032 163.42107,64.765395 163.76955,64.583576 C 164.11425,64.405545 164.51198,64.314635 164.97032,64.314635 C 165.33774,64.314635 165.69002,64.390393 166.01956,64.54!
5697 C 166.3529,64.704788 166.61805,64.932062 166.81123,65.235093 L 16
6.83396,65.235093 L 166.83396,62.113869 L 168.56124,62.113869 L 168.56124,70.716174 L 166.92866,70.716174 L 166.92866,69.920717 L 166.90593,69.920717 z M 174.78853,62.113869 L 174.78853,65.401761 L 178.26961,65.401761 L 178.26961,62.113869 L 180.16355,62.113869 L 180.16355,70.704811 L 178.26961,70.704811 L 178.26961,66.988888 L 174.78853,66.988888 L 174.78853,70.704811 L 172.89459,70.704811 L 172.89459,62.113869 L 174.78853,62.113869 L 174.78853,62.113869 z M 185.02721,67.814648 C 184.91736,67.848739 184.79994,67.879043 184.67115,67.90177 C 184.54615,67.928285 184.41357,67.947225 184.27721,67.962376 C 184.13705,67.981316 184.00069,68.000255 183.86054,68.022983 C 183.73175,68.049498 183.60296,68.079801 183.47796,68.121468 C 183.35296,68.159347 183.24311,68.216165 183.14841,68.284347 C 183.05372,68.352529 182.97796,68.439651 182.92493,68.541924 C 182.86432,68.647985 182.83781,68.780561 182.83781,68.939653 C 182.83781,69.091168 182.86432,69.219957 182.92493,69.326018 C 182.9779!
6,69.432079 183.05751,69.511624 183.15599,69.572231 C 183.25069,69.632837 183.36432,69.674504 183.4969,69.701019 C 183.62569,69.723746 183.76205,69.73511 183.89842,69.73511 C 184.23933,69.73511 184.50448,69.678292 184.69009,69.564655 C 184.87948,69.454806 185.01585,69.318442 185.10297,69.163138 C 185.19388,69.007835 185.2507,68.848743 185.26963,68.685864 C 185.28857,68.526772 185.29994,68.397984 185.29994,68.303287 L 185.29994,67.663133 C 185.22797,67.727527 185.13706,67.776769 185.02721,67.814648 M 181.62568,65.397973 C 181.80371,65.13282 182.0272,64.920698 182.29993,64.757819 C 182.57644,64.598727 182.88326,64.48509 183.22796,64.416908 C 183.56887,64.348726 183.91357,64.314635 184.26205,64.314635 C 184.57266,64.314635 184.89463,64.337363 185.2166,64.379029 C 185.53857,64.424484 185.83403,64.511606 186.0954,64.640394 C 186.36434,64.769182 186.58025,64.947213 186.7507,65.178275 C 186.92116,65.405548 187.00449,65.70858 187.00449,66.087369 L 187.00449,69.329806 C 187.00449,69!
.61011 187.01964,69.87905 187.05373,70.136627 C 187.08404,70.394204 18
7.14085,70.587386 187.2204,70.716174 L 185.49312,70.704811 C 185.45903,70.610113 185.43251,70.511628 185.41357,70.413143 C 185.39085,70.314658 185.37948,70.212385 185.37191,70.110112 C 185.09539,70.390416 184.77342,70.591174 184.40221,70.701023 C 184.03099,70.81466 183.6522,70.871478 183.26584,70.871478 C 182.9666,70.871478 182.68629,70.837387 182.42871,70.765417 C 182.17114,70.689659 181.94386,70.57981 181.75068,70.424507 C 181.5575,70.272991 181.40598,70.079808 181.29613,69.844959 C 181.18629,69.613898 181.13326,69.333594 181.13326,69.011623 C 181.13326,68.659349 181.19765,68.367681 181.31886,68.136619 C 181.44765,67.909346 181.60674,67.723739 181.8075,67.587375 C 182.00447,67.451011 182.22796,67.348738 182.48553,67.280556 C 182.73932,67.212373 182.99311,67.159343 183.25448,67.117676 C 183.51205,67.076009 183.76584,67.041918 184.01584,67.019191 C 184.26584,66.996464 184.48933,66.958585 184.68251,66.91313 C 184.87569,66.863887 185.02721,66.791917 185.14085,66.701008 C 185.2!
5448,66.606311 185.30751,66.473734 185.29994,66.295703 C 185.29994,66.110097 185.26963,65.962369 185.20903,65.856308 C 185.14842,65.746459 185.06509,65.663125 184.96282,65.602519 C 184.86054,65.541913 184.74312,65.500246 184.61054,65.481306 C 184.47418,65.462367 184.33024,65.451003 184.17493,65.451003 C 183.83402,65.451003 183.56508,65.522973 183.3719,65.670701 C 183.17493,65.814641 183.06129,66.057066 183.0272,66.397976 L 181.32265,66.397976 C 181.34917,65.99646 181.44765,65.663125 181.62568,65.397973 z M 191.63329,64.481303 L 191.63329,65.61767 L 190.3795,65.61767 L 190.3795,68.704803 C 190.3795,68.992683 190.42874,69.185866 190.52344,69.280563 C 190.62193,69.379048 190.81132,69.428291 191.10299,69.428291 C 191.19769,69.428291 191.29238,69.424503 191.37951,69.416927 C 191.46663,69.409351 191.55375,69.397988 191.63329,69.379048 L 191.63329,70.704811 C 191.48935,70.735114 191.32648,70.754053 191.14844,70.765417 C 190.9742,70.772993 190.79996,70.776781 190.63329,70.776781 C !
190.36814,70.776781 190.11814,70.757841 189.88329,70.72375 C 189.64465
,70.685871 189.43632,70.613901 189.25829,70.511628 C 189.07647,70.405567 188.93631,70.257839 188.83025,70.064657 C 188.72798,69.871474 188.67495,69.617685 188.67495,69.30329 L 188.67495,65.61767 L 187.64086,65.61767 L 187.64086,64.481303 L 188.67495,64.481303 L 188.67495,62.610083 L 190.3795,62.610083 L 190.3795,64.481303 L 191.63329,64.481303 L 191.63329,64.481303 z" id="logotype" style="fill:#cc0000;fill-rule:nonzero;stroke:none" />
+ <path d="M 146.94373,22.223568 L 146.94373,23.344785 L 147.44374,23.344785 C 147.74298,23.344785 147.94752,23.303118 148.06495,23.219784 C 148.18237,23.132663 148.24298,22.988723 148.24298,22.787964 C 148.24298,22.583418 148.18237,22.43569 148.06495,22.356145 C 147.94374,22.265235 147.95131,22.223568 147.65586,22.223568 M 147.47025,21.8069 C 147.94752,21.8069 148.30737,21.886446 148.53844,22.049325 C 148.77329,22.208417 148.8945,22.450842 148.8945,22.776601 C 148.8945,23.01145 148.82253,23.204633 148.67859,23.356148 C 148.53465,23.507664 148.33768,23.606149 148.07631,23.651604 C 148.14071,23.674331 148.21647,23.738725 148.30737,23.844786 C 148.40207,23.94706 148.50813,24.098575 148.63313,24.295546 L 149.18995,25.200852 L 148.49298,25.200852 L 147.96646,24.352364 C 147.80737,24.091 147.67858,23.92812 147.57631,23.859938 C 147.47783,23.791756 147.35661,23.753877 147.21267,23.753877 L 146.94373,23.753877 L 146.94373,25.200852 L 146.31494,25.200852 L 146.31494,21.8069 M 147.6!
4071,20.700835 C 146.08388,20.700835 144.81873,21.969779 144.81873,23.522816 C 144.81873,25.07964 146.08388,26.344796 147.64071,26.344796 C 149.19374,26.344796 150.46269,25.07964 150.46269,23.522816 C 150.46269,21.969779 149.19374,20.700835 147.64071,20.700835 z M 147.64071,21.223565 C 148.91344,21.223565 149.94753,22.250084 149.94753,23.522816 C 149.94753,24.795548 148.91344,25.83343 147.64071,25.83343 C 146.36797,25.83343 145.33767,24.795548 145.33767,23.522816 C 145.33767,22.250084 146.36797,21.223565 147.64071,21.223565 z" id="registration" style="font-size:31.38881302px;fill:#9ea3a6;fill-opacity:1;font-family:DejaVu Sans" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/key.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/key.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/note.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/note.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/note.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/note.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/note.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="48"
+ height="48"
+ id="svg2">
+ <defs
+ id="defs5" />
+ <path
+ d="M 30.27396,4.1232594 L 18.765811,4.1232594 C 11.476786,4.1232594 5.5574109,10.546411 5.5574109,19.960741 C 5.5574109,24.746615 7.0844878,29.075948 9.5403943,32.177328 C 9.4616811,32.681104 9.414455,33.200619 9.414455,33.720144 C 9.414455,39.308917 13.554865,43.591015 18.891751,44.267966 C 17.506371,42.693663 16.656245,40.914707 16.656245,38.616218 C 16.656245,38.01799 16.719219,37.419752 16.82942,36.837262 C 17.459135,36.963202 18.104599,37.026176 18.750063,37.026176 L 30.258211,37.026176 C 37.547237,37.026176 43.466612,29.39081 43.466612,19.960741 C 43.466612,10.530672 37.578724,4.1232594 30.27396,4.1232594 z "
+ style="fill:#2e3436;fill-opacity:1;stroke:#2e3436;stroke-width:4.7150631;stroke-miterlimit:4;stroke-dasharray:none"
+ id="path4317" />
+ <path
+ d="M 30.27396,4.1232594 L 18.765811,4.1232594 C 11.476786,4.1232594 5.5574109,10.546411 5.5574109,19.960741 C 5.5574109,24.746615 7.0844878,29.075948 9.5403943,32.177328 C 9.4616811,32.681104 9.414455,33.200619 9.414455,33.720144 C 9.414455,39.308917 13.554865,43.591015 18.891751,44.267966 C 17.506371,42.693663 16.656245,40.914707 16.656245,38.616218 C 16.656245,38.01799 16.719219,37.419752 16.82942,36.837262 C 17.459135,36.963202 18.104599,37.026176 18.750063,37.026176 L 30.258211,37.026176 C 37.547237,37.026176 43.466612,29.39081 43.466612,19.960741 C 43.466612,10.530672 37.578724,4.1232594 30.27396,4.1232594 z "
+ style="fill:#bfdce8;fill-opacity:1"
+ id="path142" />
+ <path
+ d="M 19.200879,5.5648899 C 12.490241,5.5648899 7.0622987,11.295775 7.0622987,19.690323 C 7.0622987,22.890926 7.8418023,25.879852 9.1910836,28.332288 C 8.6113289,26.599889 8.2852163,24.667826 8.2852163,22.673336 C 8.2852163,14.629768 13.495502,9.1620492 19.925575,9.1620492 L 30.071259,9.1620492 C 36.515213,9.1620492 41.711609,14.616311 41.711609,22.673336 C 41.864688,21.709218 41.983366,20.710908 41.983366,19.690323 C 41.983366,11.281743 36.524624,5.5648899 29.799492,5.5648899 L 19.200879,5.5648899 z "
+ style="fill:#ffffff"
+ id="path2358" />
+ <path
+ d="M 28.241965,33.725087 L 20.792252,33.725087 C 16.073756,33.725087 12.241894,32.944782 12.241894,26.850486 C 12.241894,25.10387 12.368512,23.572125 15.515722,23.567487 L 33.508301,23.540969 C 36.182481,23.537028 36.782127,24.950794 36.782127,26.850486 C 36.782127,32.95497 32.970649,33.725087 28.241965,33.725087 z "
+ style="fill:#d0ecf9;fill-opacity:1"
+ id="path2173" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/redhat-logo.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/redhat-logo.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/redhat-logo.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.0" width="300" height="140" viewBox="0 0 507 221" id="JBoss-Logo">
+<g>
+<g id="color-swoosh">
+ <path d="M 159.52,200.07 C 159.52,211.47 150.27,220.72 138.88,220.72 C 127.48,220.72 118.23,211.47 118.23,200.07 C 118.23,188.67 127.48,179.42 138.88,179.42 C 150.27,179.42 159.52,188.67 159.52,200.07 z " transform="matrix(1.2260274,0,0,1.2260274,-33.086787,-49.605282)" style="fill:#cc0000;fill-opacity:1" id="path4330" />
+ <path d="M 95.46,188.05 C 95.46,200.3 85.51,210.25 73.26,210.25 C 61,210.25 51.05,200.3 51.05,188.05 C 51.05,175.79 61,165.85 73.26,165.85 C 85.51,165.85 95.46,175.79 95.46,188.05 z " style="fill:#ff850c;fill-opacity:1" id="path4333" />
+ <path d="M 45.25,147.74 C 45.25,158.83 36.26,167.83 25.17,167.83 C 14.09,167.83 5.09,158.83 5.09,147.74 C 5.09,136.66 14.09,127.66 25.17,127.66 C 36.26,127.66 45.25,136.66 45.25,147.74 z " style="fill:#fac521;fill-opacity:1" id="path4335" />
+ <path d="M 36.06,91.6 C 36.06,101.51 28.02,109.56 18.1,109.56 C 8.19,109.56 0.14,101.51 0.14,91.6 C 0.14,81.69 8.19,73.64 18.1,73.64 C 28.02,73.64 36.06,81.69 36.06,91.6 z " style="fill:#b5bd14;fill-opacity:1" id="path4337" />
+ <path d="M 61.09,41.11 C 61.09,49.54 54.25,56.39 45.82,56.39 C 37.39,56.39 30.55,49.54 30.55,41.11 C 30.55,32.68 37.39,25.84 45.82,25.84 C 54.25,25.84 61.09,32.68 61.09,41.11 z " style="fill:#007f91;fill-opacity:1" id="path4339" />
+ <path d="M 104.09,18.95 C 104.09,26.44 98,32.53 90.51,32.53 C 83.02,32.53 76.93,26.44 76.93,18.95 C 76.93,11.46 83.02,5.37 90.51,5.37 C 98,5.37 104.09,11.46 104.09,18.95 z " style="fill:#0099d7;fill-opacity:1" id="path4341" />
+ <path d="M 149.48,11.82 C 149.48,18.14 144.35,23.28 138.03,23.28 C 131.7,23.28 126.57,18.14 126.57,11.82 C 126.57,5.5 131.7,0.37 138.03,0.37 C 144.35,0.37 149.48,5.5 149.48,11.82 z " style="fill:#7a82ba;fill-opacity:1" id="path4343" />
+ </g>
+ <path d="M 236.85,124.1 C 245.93,124.1 248.81,115.13 248.81,107.53 C 248.81,99.93 245.93,90.85 236.85,90.85 C 227.76,90.85 224.99,99.93 224.99,107.53 C 224.99,115.13 227.76,124.1 236.85,124.1 M 236.85,75.88 C 255.37,75.88 268.38,89.58 268.38,107.53 C 268.38,125.48 255.37,139.06 236.85,139.06 C 218.32,139.06 205.42,125.48 205.42,107.53 C 205.42,89.58 218.32,75.88 236.85,75.88 z M 284.2,117.66 C 284.2,120.65 285.46,122.84 287.41,124.33 C 289.26,125.72 291.9,126.4 294.67,126.4 C 298.46,126.4 303.87,124.79 303.87,120.07 C 303.87,115.47 297.77,114.55 294.32,113.74 C 282.01,110.64 266.58,110.29 266.58,94.18 C 266.58,79.79 282.11,75.88 293.86,75.88 C 306.98,75.88 320.67,79.68 321.36,95.22 L 303.3,95.22 C 303.3,92.68 302.38,91.08 300.77,90.04 C 299.15,89 296.97,88.54 294.55,88.54 C 291.32,88.54 286.15,88.88 286.15,93.03 C 286.15,98.67 299.27,99.7 308.24,101.66 C 320.33,104.08 323.44,112.82 323.44,117.77 C 323.44,133.77 308.24,139.06 294.78,139.06 C 280.63,139.06 266.13,134.35 265!
.55,117.66 L 284.2,117.66 L 284.2,117.66 z M 341.39,117.66 C 341.39,120.65 342.66,122.84 344.62,124.33 C 346.46,125.72 349.11,126.4 351.87,126.4 C 355.66,126.4 361.07,124.79 361.07,120.07 C 361.07,115.47 354.97,114.55 351.52,113.74 C 339.21,110.64 323.79,110.29 323.79,94.18 C 323.79,79.79 339.33,75.88 351.06,75.88 C 364.18,75.88 377.88,79.68 378.57,95.22 L 360.5,95.22 C 360.5,92.68 359.58,91.08 357.97,90.04 C 356.35,89 354.17,88.54 351.75,88.54 C 348.53,88.54 343.36,88.88 343.36,93.03 C 343.36,98.67 356.47,99.7 365.45,101.66 C 377.53,104.08 380.64,112.82 380.64,117.77 C 380.64,133.77 365.45,139.06 351.99,139.06 C 337.83,139.06 323.33,134.35 322.75,117.66 L 341.39,117.66 L 341.39,117.66 z M 216.86,179.4 C 216.57,179.49 216.26,179.57 215.93,179.63 C 215.6,179.7 215.25,179.75 214.88,179.79 C 214.52,179.84 214.15,179.89 213.79,179.95 C 213.45,180.02 213.11,180.1 212.77,180.21 C 212.44,180.31 212.15,180.46 211.91,180.64 C 211.66,180.82 211.46,181.05 211.31,181.32 C 211.16,181.6 !
211.09,181.95 211.09,182.37 C 211.09,182.77 211.16,183.11 211.31,183.3
9 C 211.46,183.67 211.66,183.88 211.92,184.04 C 212.18,184.2 212.48,184.31 212.82,184.38 C 213.17,184.44 213.52,184.47 213.88,184.47 C 214.79,184.47 215.48,184.32 215.98,184.02 C 216.47,183.73 216.83,183.37 217.07,182.96 C 217.31,182.55 217.45,182.13 217.51,181.7 C 217.56,181.28 217.59,180.94 217.59,180.69 L 217.59,179 C 217.39,179.17 217.15,179.3 216.86,179.4 M 207.88,173.02 C 208.35,172.32 208.95,171.76 209.67,171.33 C 210.39,170.91 211.21,170.61 212.11,170.43 C 213.02,170.25 213.93,170.16 214.84,170.16 C 215.67,170.16 216.51,170.22 217.36,170.33 C 218.21,170.45 218.99,170.68 219.69,171.02 C 220.39,171.36 220.97,171.83 221.41,172.44 C 221.86,173.04 222.09,173.84 222.09,174.84 L 222.09,183.4 C 222.09,184.14 222.13,184.85 222.21,185.53 C 222.3,186.21 222.45,186.72 222.66,187.06 L 218.09,187.03 C 218.01,186.78 217.93,186.52 217.88,186.26 C 217.83,186 217.79,185.73 217.77,185.46 C 217.05,186.2 216.2,186.73 215.22,187.02 C 214.24,187.32 213.24,187.47 212.21,187.47 C 211.42,187.!
47 210.69,187.38 210.01,187.19 C 209.32,186.99 208.73,186.7 208.22,186.29 C 207.7,185.89 207.31,185.38 207.02,184.76 C 206.73,184.15 206.59,183.41 206.59,182.56 C 206.59,181.63 206.75,180.86 207.08,180.25 C 207.41,179.65 207.84,179.16 208.36,178.8 C 208.88,178.44 209.48,178.17 210.15,177.99 C 210.82,177.81 211.5,177.67 212.18,177.56 C 212.86,177.45 213.54,177.36 214.2,177.3 C 214.86,177.24 215.44,177.14 215.95,177.02 C 216.47,176.89 216.87,176.7 217.17,176.46 C 217.47,176.21 217.61,175.86 217.59,175.39 C 217.59,174.9 217.51,174.51 217.35,174.23 C 217.18,173.94 216.97,173.72 216.7,173.56 C 216.43,173.4 216.12,173.29 215.76,173.24 C 215.41,173.19 215.02,173.16 214.62,173.16 C 213.72,173.16 213.01,173.35 212.49,173.74 C 211.97,174.12 211.67,174.76 211.59,175.66 L 207.09,175.66 C 207.15,174.6 207.41,173.72 207.88,173.02 z M 244.6,176.8 C 244.47,176.18 244.25,175.62 243.94,175.15 C 243.63,174.67 243.24,174.28 242.75,173.98 C 242.26,173.68 241.65,173.53 240.9,173.53 C 240.16,173.!
53 239.53,173.68 239.02,173.98 C 238.51,174.28 238.1,174.67 237.79,175
.16 C 237.48,175.65 237.26,176.21 237.12,176.84 C 236.98,177.46 236.91,178.12 236.91,178.8 C 236.91,179.44 236.99,180.08 237.14,180.71 C 237.29,181.35 237.52,181.92 237.86,182.42 C 238.18,182.92 238.6,183.33 239.1,183.63 C 239.6,183.94 240.2,184.1 240.9,184.1 C 241.65,184.1 242.27,183.95 242.77,183.65 C 243.26,183.35 243.66,182.95 243.96,182.45 C 244.26,181.95 244.47,181.38 244.6,180.74 C 244.72,180.11 244.79,179.45 244.79,178.77 C 244.79,178.09 244.72,177.43 244.6,176.8 M 244.79,184.96 C 244.26,185.85 243.56,186.49 242.7,186.88 C 241.85,187.27 240.88,187.47 239.79,187.47 C 238.56,187.47 237.48,187.23 236.55,186.76 C 235.62,186.28 234.85,185.63 234.24,184.81 C 233.64,184 233.18,183.06 232.88,182 C 232.57,180.94 232.41,179.83 232.41,178.69 C 232.41,177.58 232.57,176.52 232.88,175.49 C 233.18,174.46 233.64,173.55 234.24,172.77 C 234.84,171.98 235.6,171.35 236.51,170.87 C 237.42,170.4 238.48,170.16 239.68,170.16 C 240.66,170.16 241.58,170.36 242.46,170.77 C 243.34,171.19 244.03!
,171.79 244.54,172.59 L 244.6,172.59 L 244.6,164.35 L 249.16,164.35 L 249.16,187.06 L 244.85,187.06 L 244.85,184.96 L 244.79,184.96 z M 256.11,170.59 L 256.11,187.03 L 251.61,187.03 L 251.61,170.59 L 256.11,170.59 M 251.61,168.03 L 251.61,164.28 L 256.11,164.28 L 256.11,168.03 L 251.61,168.03 z M 263.1,187.03 L 257.47,170.6 L 262.21,170.6 L 265.67,181.82 L 265.74,181.82 L 269.2,170.6 L 273.69,170.6 L 268.13,187.03 L 263.1,187.03 L 263.1,187.03 z M 279.59,170.59 L 279.59,187.03 L 275.09,187.03 L 275.09,170.59 L 279.59,170.59 M 275.09,168.03 L 275.09,164.28 L 279.59,164.28 L 279.59,168.03 L 275.09,168.03 z M 286.33,182.97 C 286.54,183.32 286.8,183.6 287.11,183.82 C 287.43,184.04 287.8,184.21 288.22,184.31 C 288.63,184.42 289.06,184.47 289.51,184.47 C 289.82,184.47 290.16,184.44 290.51,184.36 C 290.86,184.29 291.18,184.17 291.47,184.01 C 291.75,183.85 291.99,183.64 292.18,183.37 C 292.38,183.11 292.47,182.77 292.47,182.37 C 292.47,181.69 292.02,181.19 291.11,180.85 C 290.21,18!
0.51 288.95,180.17 287.33,179.83 C 286.67,179.68 286.02,179.51 285.4,1
79.3 C 284.77,179.1 284.21,178.84 283.72,178.51 C 283.23,178.18 282.84,177.77 282.54,177.27 C 282.24,176.77 282.1,176.16 282.1,175.44 C 282.1,174.38 282.3,173.51 282.72,172.83 C 283.13,172.15 283.68,171.62 284.36,171.22 C 285.04,170.83 285.8,170.56 286.65,170.4 C 287.5,170.24 288.37,170.16 289.27,170.16 C 290.16,170.16 291.02,170.24 291.86,170.41 C 292.7,170.58 293.45,170.87 294.11,171.27 C 294.77,171.67 295.31,172.21 295.75,172.88 C 296.18,173.55 296.45,174.39 296.53,175.41 L 292.22,175.41 C 292.15,174.53 291.82,173.94 291.23,173.63 C 290.63,173.31 289.93,173.16 289.12,173.16 C 288.86,173.16 288.59,173.17 288.29,173.2 C 287.99,173.24 287.72,173.31 287.47,173.41 C 287.23,173.52 287.02,173.67 286.85,173.88 C 286.68,174.08 286.6,174.35 286.6,174.69 C 286.6,175.09 286.74,175.42 287.04,175.68 C 287.34,175.93 287.73,176.14 288.2,176.3 C 288.68,176.46 289.23,176.6 289.85,176.73 C 290.47,176.86 291.1,176.99 291.74,177.14 C 292.39,177.29 293.04,177.47 293.66,177.69 C 294.29,177.9 29!
4.85,178.18 295.34,178.53 C 295.83,178.88 296.22,179.32 296.52,179.84 C 296.82,180.36 296.97,181 296.97,181.76 C 296.97,182.85 296.75,183.76 296.32,184.49 C 295.88,185.22 295.31,185.81 294.61,186.26 C 293.91,186.7 293.11,187.02 292.21,187.2 C 291.31,187.38 290.39,187.47 289.45,187.47 C 288.5,187.47 287.57,187.38 286.65,187.19 C 285.74,186.99 284.93,186.68 284.22,186.23 C 283.51,185.79 282.92,185.2 282.47,184.47 C 282.01,183.74 281.76,182.82 281.72,181.72 L 286.03,181.72 C 286.03,182.2 286.13,182.62 286.33,182.97 L 286.33,182.97 z M 303.6,170.59 L 303.6,187.03 L 299.1,187.03 L 299.1,170.59 L 303.6,170.59 M 299.1,168.03 L 299.1,164.28 L 303.6,164.28 L 303.6,168.03 L 299.1,168.03 z M 310.61,180.76 C 310.74,181.39 310.96,181.95 311.27,182.45 C 311.58,182.95 312,183.35 312.51,183.65 C 313.02,183.95 313.66,184.1 314.44,184.1 C 315.21,184.1 315.86,183.95 316.38,183.65 C 316.9,183.35 317.32,182.95 317.63,182.45 C 317.94,181.95 318.16,181.39 318.29,180.76 C 318.42,180.13 318.49,179.!
49 318.49,178.83 C 318.49,178.17 318.42,177.52 318.29,176.88 C 318.16,
176.25 317.94,175.68 317.63,175.19 C 317.32,174.7 316.9,174.31 316.38,174 C 315.86,173.69 315.21,173.53 314.44,173.53 C 313.66,173.53 313.02,173.69 312.51,174 C 312,174.31 311.58,174.7 311.27,175.19 C 310.96,175.68 310.74,176.25 310.61,176.88 C 310.49,177.52 310.42,178.17 310.42,178.83 C 310.42,179.49 310.49,180.13 310.61,180.76 M 306.53,175.27 C 306.93,174.2 307.51,173.28 308.25,172.53 C 308.99,171.77 309.89,171.19 310.93,170.78 C 311.97,170.36 313.14,170.16 314.44,170.16 C 315.74,170.16 316.91,170.36 317.96,170.78 C 319.01,171.19 319.91,171.77 320.66,172.53 C 321.4,173.28 321.97,174.2 322.38,175.27 C 322.78,176.34 322.99,177.53 322.99,178.85 C 322.99,180.16 322.78,181.35 322.38,182.41 C 321.97,183.47 321.4,184.38 320.66,185.13 C 319.91,185.88 319.01,186.46 317.96,186.86 C 316.91,187.27 315.74,187.47 314.44,187.47 C 313.14,187.47 311.97,187.27 310.93,186.86 C 309.89,186.46 308.99,185.88 308.25,185.13 C 307.51,184.38 306.93,183.47 306.53,182.41 C 306.12,181.35 305.92,180.16 !
305.92,178.85 C 305.92,177.53 306.12,176.34 306.53,175.27 z M 329.6,170.6 L 329.6,172.89 L 329.69,172.89 C 330.26,171.94 331.01,171.24 331.92,170.81 C 332.83,170.38 333.76,170.16 334.72,170.16 C 335.92,170.16 336.91,170.32 337.69,170.65 C 338.46,170.98 339.07,171.44 339.51,172.02 C 339.96,172.6 340.27,173.31 340.45,174.15 C 340.63,174.98 340.72,175.91 340.72,176.93 L 340.72,187.03 L 336.22,187.03 L 336.22,177.76 C 336.22,176.4 336.01,175.39 335.59,174.72 C 335.16,174.06 334.41,173.72 333.34,173.72 C 332.11,173.72 331.22,174.09 330.67,174.82 C 330.12,175.55 329.85,176.75 329.85,178.42 L 329.85,187.03 L 325.29,187.03 L 325.29,170.6 L 329.6,170.6 L 329.6,170.6 z M 355.91,180.76 C 356.04,181.39 356.26,181.95 356.57,182.45 C 356.88,182.95 357.29,183.35 357.81,183.65 C 358.32,183.95 358.96,184.1 359.74,184.1 C 360.51,184.1 361.15,183.95 361.68,183.65 C 362.2,183.35 362.62,182.95 362.93,182.45 C 363.24,181.95 363.46,181.39 363.59,180.76 C 363.72,180.13 363.78,179.49 363.78,178.83 !
C 363.78,178.17 363.72,177.52 363.59,176.88 C 363.46,176.25 363.24,175
.68 362.93,175.19 C 362.62,174.7 362.2,174.31 361.68,174 C 361.15,173.69 360.51,173.53 359.74,173.53 C 358.96,173.53 358.32,173.69 357.81,174 C 357.29,174.31 356.88,174.7 356.57,175.19 C 356.26,175.68 356.04,176.25 355.91,176.88 C 355.78,177.52 355.72,178.17 355.72,178.83 C 355.72,179.49 355.78,180.13 355.91,180.76 M 351.82,175.27 C 352.23,174.2 352.8,173.28 353.55,172.53 C 354.29,171.77 355.18,171.19 356.22,170.78 C 357.27,170.36 358.44,170.16 359.74,170.16 C 361.03,170.16 362.2,170.36 363.26,170.78 C 364.31,171.19 365.21,171.77 365.95,172.53 C 366.7,173.28 367.27,174.2 367.67,175.27 C 368.08,176.34 368.28,177.53 368.28,178.85 C 368.28,180.16 368.08,181.35 367.67,182.41 C 367.27,183.47 366.7,184.38 365.95,185.13 C 365.21,185.88 364.31,186.46 363.26,186.86 C 362.2,187.27 361.03,187.47 359.74,187.47 C 358.44,187.47 357.27,187.27 356.22,186.86 C 355.18,186.46 354.29,185.88 353.55,185.13 C 352.8,184.38 352.23,183.47 351.82,182.41 C 351.42,181.35 351.22,180.16 351.22,178.85 C 35!
1.22,177.53 351.42,176.34 351.82,175.27 z M 368.81,173.6 L 368.81,170.6 L 371.52,170.6 L 371.52,169.33 C 371.52,167.87 371.97,166.67 372.88,165.74 C 373.79,164.81 375.16,164.35 377.01,164.35 C 377.41,164.35 377.81,164.36 378.21,164.39 C 378.61,164.42 379.01,164.45 379.39,164.47 L 379.39,167.85 C 378.86,167.76 378.31,167.72 377.74,167.72 C 377.12,167.72 376.68,167.86 376.41,168.15 C 376.15,168.44 376.02,168.92 376.02,169.61 L 376.02,170.6 L 379.13,170.6 L 379.13,173.6 L 376.02,173.6 L 376.02,187.03 L 371.52,187.03 L 371.52,173.6 L 368.81,173.6 L 368.81,173.6 z " style="fill:#9ea3a6;fill-rule:nonzero;stroke:none" id="path2337" />
+ <path d="M 134.82,111.33 C 134.82,129.75 125.38,139.06 106.05,139.06 C 84.3,139.06 77.27,126.52 77.27,108.22 L 77.27,104.65 L 97.42,104.65 L 97.42,112.25 C 97.42,117.66 100.41,120.65 105.7,120.65 C 110.65,120.65 113.41,117.89 113.41,109.95 L 113.41,55.17 L 134.82,55.17 L 134.82,111.33 L 134.82,111.33 z M 156.02,120.19 L 173.16,120.19 C 179.95,120.19 184.67,117.77 184.67,110.98 C 184.67,103.74 179.61,101.31 173.16,101.31 L 156.02,101.31 L 156.02,120.19 M 156.02,87.51 L 172.59,87.51 C 176.27,87.51 181.34,85.55 181.34,79.68 C 181.34,73.7 177.07,71.74 172.59,71.74 L 156.02,71.74 L 156.02,87.51 M 134.61,55.17 L 173.05,55.17 C 187.2,54.93 202.74,58.62 202.74,75.77 C 202.74,83.13 198.36,89.12 191.92,92.34 C 200.66,94.87 206.07,102.46 206.07,111.79 C 206.07,131.35 191.69,137.34 174.08,137.34 L 134.61,137.34 L 134.61,55.17 z M 399.67,174.6 C 400.82,174.6 401.68,174.34 402.26,173.83 C 402.83,173.33 403.12,172.5 403.12,171.36 C 403.12,170.26 402.83,169.46 402.26,168.97 C 401.68,168.4!
7 400.82,168.22 399.67,168.22 L 394.18,168.22 L 394.18,174.6 L 399.67,174.6 M 401.45,164.35 C 402.47,164.35 403.4,164.51 404.21,164.84 C 405.03,165.17 405.73,165.61 406.32,166.19 C 406.9,166.76 407.35,167.42 407.65,168.17 C 407.96,168.92 408.12,169.73 408.12,170.6 C 408.12,171.93 407.84,173.09 407.27,174.06 C 406.71,175.03 405.79,175.77 404.52,176.28 L 404.52,176.35 C 405.13,176.51 405.64,176.77 406.04,177.13 C 406.45,177.47 406.78,177.89 407.03,178.36 C 407.29,178.84 407.47,179.37 407.59,179.94 C 407.7,180.51 407.79,181.08 407.83,181.66 C 407.85,182.02 407.87,182.44 407.89,182.93 C 407.91,183.42 407.95,183.92 408,184.42 C 408.06,184.94 408.14,185.42 408.26,185.87 C 408.38,186.33 408.55,186.72 408.78,187.03 L 403.79,187.03 C 403.51,186.31 403.34,185.45 403.28,184.46 C 403.22,183.46 403.12,182.51 402.99,181.6 C 402.82,180.41 402.46,179.54 401.91,178.99 C 401.35,178.44 400.45,178.16 399.19,178.16 L 394.18,178.16 L 394.18,187.03 L 389.18,187.03 L 389.18,164.35 L 401.45,164.35 !
z M 420.44,174.42 C 419.9,173.83 419.07,173.53 417.97,173.53 C 417.25,
173.53 416.65,173.65 416.18,173.9 C 415.7,174.14 415.32,174.45 415.03,174.81 C 414.74,175.17 414.54,175.55 414.43,175.95 C 414.31,176.35 414.24,176.72 414.22,177.03 L 421.57,177.03 C 421.36,175.89 420.98,175.02 420.44,174.42 M 415.33,183.11 C 416.01,183.77 416.99,184.1 418.26,184.1 C 419.17,184.1 419.95,183.87 420.61,183.42 C 421.27,182.96 421.67,182.48 421.82,181.97 L 425.8,181.97 C 425.16,183.94 424.19,185.35 422.87,186.2 C 421.56,187.05 419.97,187.47 418.1,187.47 C 416.81,187.47 415.64,187.26 414.6,186.85 C 413.56,186.44 412.69,185.85 411.97,185.08 C 411.25,184.32 410.7,183.41 410.31,182.35 C 409.91,181.29 409.72,180.12 409.72,178.85 C 409.72,177.61 409.92,176.47 410.32,175.41 C 410.72,174.35 411.29,173.43 412.03,172.66 C 412.77,171.88 413.66,171.27 414.68,170.83 C 415.71,170.38 416.85,170.16 418.1,170.16 C 419.5,170.16 420.72,170.43 421.76,170.97 C 422.8,171.51 423.65,172.23 424.32,173.14 C 424.99,174.05 425.47,175.09 425.77,176.26 C 426.06,177.42 426.17,178.64 426.09,17!
9.91 L 414.22,179.91 C 414.28,181.38 414.65,182.45 415.33,183.11 z M 440.57,176.8 C 440.45,176.18 440.23,175.62 439.92,175.15 C 439.61,174.67 439.21,174.28 438.72,173.98 C 438.24,173.68 437.62,173.53 436.88,173.53 C 436.13,173.53 435.51,173.68 434.99,173.98 C 434.49,174.28 434.07,174.67 433.77,175.16 C 433.46,175.65 433.24,176.21 433.1,176.84 C 432.96,177.46 432.89,178.12 432.89,178.8 C 432.89,179.44 432.97,180.08 433.11,180.71 C 433.26,181.35 433.5,181.92 433.83,182.42 C 434.16,182.92 434.57,183.33 435.07,183.63 C 435.57,183.94 436.17,184.1 436.88,184.1 C 437.62,184.1 438.24,183.95 438.74,183.65 C 439.24,183.35 439.64,182.95 439.93,182.45 C 440.23,181.95 440.45,181.38 440.57,180.74 C 440.7,180.11 440.77,179.45 440.77,178.77 C 440.77,178.09 440.7,177.43 440.57,176.8 M 440.77,184.96 C 440.24,185.85 439.54,186.49 438.68,186.88 C 437.82,187.27 436.85,187.47 435.77,187.47 C 434.54,187.47 433.46,187.23 432.52,186.76 C 431.59,186.28 430.82,185.63 430.22,184.81 C 429.61,184 429.16!
,183.06 428.85,182 C 428.54,180.94 428.39,179.83 428.39,178.69 C 428.3
9,177.58 428.54,176.52 428.85,175.49 C 429.16,174.46 429.61,173.55 430.22,172.77 C 430.82,171.98 431.57,171.35 432.49,170.87 C 433.4,170.4 434.45,170.16 435.66,170.16 C 436.63,170.16 437.56,170.36 438.43,170.77 C 439.31,171.19 440.01,171.79 440.52,172.59 L 440.58,172.59 L 440.58,164.35 L 445.14,164.35 L 445.14,187.06 L 440.83,187.06 L 440.83,184.96 L 440.77,184.96 z M 461.58,164.35 L 461.58,173.03 L 470.77,173.03 L 470.77,164.35 L 475.77,164.35 L 475.77,187.03 L 470.77,187.03 L 470.77,177.22 L 461.58,177.22 L 461.58,187.03 L 456.58,187.03 L 456.58,164.35 L 461.58,164.35 L 461.58,164.35 z M 488.61,179.4 C 488.32,179.49 488.01,179.57 487.67,179.63 C 487.34,179.7 486.99,179.75 486.63,179.79 C 486.26,179.84 485.9,179.89 485.53,179.95 C 485.19,180.02 484.85,180.1 484.52,180.21 C 484.19,180.31 483.9,180.46 483.65,180.64 C 483.4,180.82 483.2,181.05 483.06,181.32 C 482.9,181.6 482.83,181.95 482.83,182.37 C 482.83,182.77 482.9,183.11 483.06,183.39 C 483.2,183.67 483.41,183.88 483.67,!
184.04 C 483.92,184.2 484.22,184.31 484.57,184.38 C 484.91,184.44 485.27,184.47 485.63,184.47 C 486.53,184.47 487.23,184.32 487.72,184.02 C 488.22,183.73 488.58,183.37 488.81,182.96 C 489.05,182.55 489.2,182.13 489.25,181.7 C 489.3,181.28 489.33,180.94 489.33,180.69 L 489.33,179 C 489.14,179.17 488.9,179.3 488.61,179.4 M 479.63,173.02 C 480.1,172.32 480.69,171.76 481.41,171.33 C 482.14,170.91 482.95,170.61 483.86,170.43 C 484.76,170.25 485.67,170.16 486.59,170.16 C 487.41,170.16 488.26,170.22 489.11,170.33 C 489.96,170.45 490.74,170.68 491.43,171.02 C 492.14,171.36 492.71,171.83 493.16,172.44 C 493.61,173.04 493.83,173.84 493.83,174.84 L 493.83,183.4 C 493.83,184.14 493.87,184.85 493.96,185.53 C 494.04,186.21 494.19,186.72 494.4,187.06 L 489.84,187.03 C 489.75,186.78 489.68,186.52 489.63,186.26 C 489.57,186 489.54,185.73 489.52,185.46 C 488.79,186.2 487.94,186.73 486.96,187.02 C 485.98,187.32 484.98,187.47 483.96,187.47 C 483.17,187.47 482.43,187.38 481.75,187.19 C 481.07,1!
86.99 480.47,186.7 479.96,186.29 C 479.45,185.89 479.05,185.38 478.76,
184.76 C 478.47,184.15 478.33,183.41 478.33,182.56 C 478.33,181.63 478.5,180.86 478.82,180.25 C 479.16,179.65 479.58,179.16 480.11,178.8 C 480.63,178.44 481.22,178.17 481.9,177.99 C 482.57,177.81 483.24,177.67 483.93,177.56 C 484.61,177.45 485.28,177.36 485.94,177.3 C 486.6,177.24 487.19,177.14 487.7,177.02 C 488.21,176.89 488.61,176.7 488.91,176.46 C 489.21,176.21 489.35,175.86 489.33,175.39 C 489.33,174.9 489.25,174.51 489.09,174.23 C 488.93,173.94 488.71,173.72 488.44,173.56 C 488.17,173.4 487.86,173.29 487.51,173.24 C 487.15,173.19 486.77,173.16 486.36,173.16 C 485.46,173.16 484.75,173.35 484.24,173.74 C 483.72,174.12 483.42,174.76 483.33,175.66 L 478.83,175.66 C 478.9,174.6 479.16,173.72 479.63,173.02 z M 506.05,170.6 L 506.05,173.6 L 502.74,173.6 L 502.74,181.75 C 502.74,182.51 502.87,183.02 503.12,183.27 C 503.38,183.53 503.88,183.66 504.65,183.66 C 504.9,183.66 505.15,183.65 505.38,183.63 C 505.61,183.61 505.84,183.58 506.05,183.53 L 506.05,187.03 C 505.67,187.11 505!
.24,187.16 504.77,187.19 C 504.31,187.21 503.85,187.22 503.41,187.22 C 502.71,187.22 502.05,187.17 501.43,187.08 C 500.8,186.98 500.25,186.79 499.78,186.52 C 499.3,186.24 498.93,185.85 498.65,185.34 C 498.38,184.83 498.24,184.16 498.24,183.33 L 498.24,173.6 L 495.51,173.6 L 495.51,170.6 L 498.24,170.6 L 498.24,165.66 L 502.74,165.66 L 502.74,170.6 L 506.05,170.6 L 506.05,170.6 z " style="fill:#cc0000;fill-rule:nonzero;stroke:none" id="logotype" />
+ <path d="M 388.07,59.04 L 388.07,62 L 389.39,62 C 390.18,62 390.72,61.89 391.03,61.67 C 391.34,61.44 391.5,61.06 391.5,60.53 C 391.5,59.99 391.34,59.6 391.03,59.39 C 390.71,59.15 390.73,59.04 389.95,59.04 M 389.46,57.94 C 390.72,57.94 391.67,58.15 392.28,58.58 C 392.9,59 393.22,59.64 393.22,60.5 C 393.22,61.12 393.03,61.63 392.65,62.03 C 392.27,62.43 391.75,62.69 391.06,62.81 C 391.23,62.87 391.43,63.04 391.67,63.32 C 391.92,63.59 392.2,63.99 392.53,64.51 L 394,66.9 L 392.16,66.9 L 390.77,64.66 C 390.35,63.97 390.01,63.54 389.74,63.36 C 389.48,63.18 389.16,63.08 388.78,63.08 L 388.07,63.08 L 388.07,66.9 L 386.41,66.9 L 386.41,57.94 M 389.91,55.02 C 385.8,55.02 382.46,58.37 382.46,62.47 C 382.46,66.58 385.8,69.92 389.91,69.92 C 394.01,69.92 397.36,66.58 397.36,62.47 C 397.36,58.37 394.01,55.02 389.91,55.02 z M 389.91,56.4 C 393.27,56.4 396,59.11 396,62.47 C 396,65.83 393.27,68.57 389.91,68.57 C 386.55,68.57 383.83,65.83 383.83,62.47 C 383.83,59.11 386.55,56.4 389.91,56.4 z !
" style="font-size:31.38881302px;fill:#9ea3a6;fill-opacity:1;font-family:DejaVu Sans" id="registration" />
+ </g>
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/rhlogo.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/rhlogo.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/shade.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/shade.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/stock-go-back.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/stock-go-back.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/stock-go-forward.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/stock-go-forward.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/stock-go-up.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/stock-go-up.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/stock-home.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/stock-home.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/title_logo.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/title_logo.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/title_logo.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/title_logo.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/title_logo.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.0" width="300" height="140" viewBox="0 0 507 221" id="JBoss-Logo">
+<g>
+<g id="color-swoosh">
+ <path d="M 159.52,200.07 C 159.52,211.47 150.27,220.72 138.88,220.72 C 127.48,220.72 118.23,211.47 118.23,200.07 C 118.23,188.67 127.48,179.42 138.88,179.42 C 150.27,179.42 159.52,188.67 159.52,200.07 z " transform="matrix(1.2260274,0,0,1.2260274,-33.086787,-49.605282)" style="fill:#cc0000;fill-opacity:1" id="path4330" />
+ <path d="M 95.46,188.05 C 95.46,200.3 85.51,210.25 73.26,210.25 C 61,210.25 51.05,200.3 51.05,188.05 C 51.05,175.79 61,165.85 73.26,165.85 C 85.51,165.85 95.46,175.79 95.46,188.05 z " style="fill:#ff850c;fill-opacity:1" id="path4333" />
+ <path d="M 45.25,147.74 C 45.25,158.83 36.26,167.83 25.17,167.83 C 14.09,167.83 5.09,158.83 5.09,147.74 C 5.09,136.66 14.09,127.66 25.17,127.66 C 36.26,127.66 45.25,136.66 45.25,147.74 z " style="fill:#fac521;fill-opacity:1" id="path4335" />
+ <path d="M 36.06,91.6 C 36.06,101.51 28.02,109.56 18.1,109.56 C 8.19,109.56 0.14,101.51 0.14,91.6 C 0.14,81.69 8.19,73.64 18.1,73.64 C 28.02,73.64 36.06,81.69 36.06,91.6 z " style="fill:#b5bd14;fill-opacity:1" id="path4337" />
+ <path d="M 61.09,41.11 C 61.09,49.54 54.25,56.39 45.82,56.39 C 37.39,56.39 30.55,49.54 30.55,41.11 C 30.55,32.68 37.39,25.84 45.82,25.84 C 54.25,25.84 61.09,32.68 61.09,41.11 z " style="fill:#007f91;fill-opacity:1" id="path4339" />
+ <path d="M 104.09,18.95 C 104.09,26.44 98,32.53 90.51,32.53 C 83.02,32.53 76.93,26.44 76.93,18.95 C 76.93,11.46 83.02,5.37 90.51,5.37 C 98,5.37 104.09,11.46 104.09,18.95 z " style="fill:#0099d7;fill-opacity:1" id="path4341" />
+ <path d="M 149.48,11.82 C 149.48,18.14 144.35,23.28 138.03,23.28 C 131.7,23.28 126.57,18.14 126.57,11.82 C 126.57,5.5 131.7,0.37 138.03,0.37 C 144.35,0.37 149.48,5.5 149.48,11.82 z " style="fill:#7a82ba;fill-opacity:1" id="path4343" />
+ </g>
+ <path d="M 236.85,124.1 C 245.93,124.1 248.81,115.13 248.81,107.53 C 248.81,99.93 245.93,90.85 236.85,90.85 C 227.76,90.85 224.99,99.93 224.99,107.53 C 224.99,115.13 227.76,124.1 236.85,124.1 M 236.85,75.88 C 255.37,75.88 268.38,89.58 268.38,107.53 C 268.38,125.48 255.37,139.06 236.85,139.06 C 218.32,139.06 205.42,125.48 205.42,107.53 C 205.42,89.58 218.32,75.88 236.85,75.88 z M 284.2,117.66 C 284.2,120.65 285.46,122.84 287.41,124.33 C 289.26,125.72 291.9,126.4 294.67,126.4 C 298.46,126.4 303.87,124.79 303.87,120.07 C 303.87,115.47 297.77,114.55 294.32,113.74 C 282.01,110.64 266.58,110.29 266.58,94.18 C 266.58,79.79 282.11,75.88 293.86,75.88 C 306.98,75.88 320.67,79.68 321.36,95.22 L 303.3,95.22 C 303.3,92.68 302.38,91.08 300.77,90.04 C 299.15,89 296.97,88.54 294.55,88.54 C 291.32,88.54 286.15,88.88 286.15,93.03 C 286.15,98.67 299.27,99.7 308.24,101.66 C 320.33,104.08 323.44,112.82 323.44,117.77 C 323.44,133.77 308.24,139.06 294.78,139.06 C 280.63,139.06 266.13,134.35 265!
.55,117.66 L 284.2,117.66 L 284.2,117.66 z M 341.39,117.66 C 341.39,120.65 342.66,122.84 344.62,124.33 C 346.46,125.72 349.11,126.4 351.87,126.4 C 355.66,126.4 361.07,124.79 361.07,120.07 C 361.07,115.47 354.97,114.55 351.52,113.74 C 339.21,110.64 323.79,110.29 323.79,94.18 C 323.79,79.79 339.33,75.88 351.06,75.88 C 364.18,75.88 377.88,79.68 378.57,95.22 L 360.5,95.22 C 360.5,92.68 359.58,91.08 357.97,90.04 C 356.35,89 354.17,88.54 351.75,88.54 C 348.53,88.54 343.36,88.88 343.36,93.03 C 343.36,98.67 356.47,99.7 365.45,101.66 C 377.53,104.08 380.64,112.82 380.64,117.77 C 380.64,133.77 365.45,139.06 351.99,139.06 C 337.83,139.06 323.33,134.35 322.75,117.66 L 341.39,117.66 L 341.39,117.66 z M 216.86,179.4 C 216.57,179.49 216.26,179.57 215.93,179.63 C 215.6,179.7 215.25,179.75 214.88,179.79 C 214.52,179.84 214.15,179.89 213.79,179.95 C 213.45,180.02 213.11,180.1 212.77,180.21 C 212.44,180.31 212.15,180.46 211.91,180.64 C 211.66,180.82 211.46,181.05 211.31,181.32 C 211.16,181.6 !
211.09,181.95 211.09,182.37 C 211.09,182.77 211.16,183.11 211.31,183.3
9 C 211.46,183.67 211.66,183.88 211.92,184.04 C 212.18,184.2 212.48,184.31 212.82,184.38 C 213.17,184.44 213.52,184.47 213.88,184.47 C 214.79,184.47 215.48,184.32 215.98,184.02 C 216.47,183.73 216.83,183.37 217.07,182.96 C 217.31,182.55 217.45,182.13 217.51,181.7 C 217.56,181.28 217.59,180.94 217.59,180.69 L 217.59,179 C 217.39,179.17 217.15,179.3 216.86,179.4 M 207.88,173.02 C 208.35,172.32 208.95,171.76 209.67,171.33 C 210.39,170.91 211.21,170.61 212.11,170.43 C 213.02,170.25 213.93,170.16 214.84,170.16 C 215.67,170.16 216.51,170.22 217.36,170.33 C 218.21,170.45 218.99,170.68 219.69,171.02 C 220.39,171.36 220.97,171.83 221.41,172.44 C 221.86,173.04 222.09,173.84 222.09,174.84 L 222.09,183.4 C 222.09,184.14 222.13,184.85 222.21,185.53 C 222.3,186.21 222.45,186.72 222.66,187.06 L 218.09,187.03 C 218.01,186.78 217.93,186.52 217.88,186.26 C 217.83,186 217.79,185.73 217.77,185.46 C 217.05,186.2 216.2,186.73 215.22,187.02 C 214.24,187.32 213.24,187.47 212.21,187.47 C 211.42,187.!
47 210.69,187.38 210.01,187.19 C 209.32,186.99 208.73,186.7 208.22,186.29 C 207.7,185.89 207.31,185.38 207.02,184.76 C 206.73,184.15 206.59,183.41 206.59,182.56 C 206.59,181.63 206.75,180.86 207.08,180.25 C 207.41,179.65 207.84,179.16 208.36,178.8 C 208.88,178.44 209.48,178.17 210.15,177.99 C 210.82,177.81 211.5,177.67 212.18,177.56 C 212.86,177.45 213.54,177.36 214.2,177.3 C 214.86,177.24 215.44,177.14 215.95,177.02 C 216.47,176.89 216.87,176.7 217.17,176.46 C 217.47,176.21 217.61,175.86 217.59,175.39 C 217.59,174.9 217.51,174.51 217.35,174.23 C 217.18,173.94 216.97,173.72 216.7,173.56 C 216.43,173.4 216.12,173.29 215.76,173.24 C 215.41,173.19 215.02,173.16 214.62,173.16 C 213.72,173.16 213.01,173.35 212.49,173.74 C 211.97,174.12 211.67,174.76 211.59,175.66 L 207.09,175.66 C 207.15,174.6 207.41,173.72 207.88,173.02 z M 244.6,176.8 C 244.47,176.18 244.25,175.62 243.94,175.15 C 243.63,174.67 243.24,174.28 242.75,173.98 C 242.26,173.68 241.65,173.53 240.9,173.53 C 240.16,173.!
53 239.53,173.68 239.02,173.98 C 238.51,174.28 238.1,174.67 237.79,175
.16 C 237.48,175.65 237.26,176.21 237.12,176.84 C 236.98,177.46 236.91,178.12 236.91,178.8 C 236.91,179.44 236.99,180.08 237.14,180.71 C 237.29,181.35 237.52,181.92 237.86,182.42 C 238.18,182.92 238.6,183.33 239.1,183.63 C 239.6,183.94 240.2,184.1 240.9,184.1 C 241.65,184.1 242.27,183.95 242.77,183.65 C 243.26,183.35 243.66,182.95 243.96,182.45 C 244.26,181.95 244.47,181.38 244.6,180.74 C 244.72,180.11 244.79,179.45 244.79,178.77 C 244.79,178.09 244.72,177.43 244.6,176.8 M 244.79,184.96 C 244.26,185.85 243.56,186.49 242.7,186.88 C 241.85,187.27 240.88,187.47 239.79,187.47 C 238.56,187.47 237.48,187.23 236.55,186.76 C 235.62,186.28 234.85,185.63 234.24,184.81 C 233.64,184 233.18,183.06 232.88,182 C 232.57,180.94 232.41,179.83 232.41,178.69 C 232.41,177.58 232.57,176.52 232.88,175.49 C 233.18,174.46 233.64,173.55 234.24,172.77 C 234.84,171.98 235.6,171.35 236.51,170.87 C 237.42,170.4 238.48,170.16 239.68,170.16 C 240.66,170.16 241.58,170.36 242.46,170.77 C 243.34,171.19 244.03!
,171.79 244.54,172.59 L 244.6,172.59 L 244.6,164.35 L 249.16,164.35 L 249.16,187.06 L 244.85,187.06 L 244.85,184.96 L 244.79,184.96 z M 256.11,170.59 L 256.11,187.03 L 251.61,187.03 L 251.61,170.59 L 256.11,170.59 M 251.61,168.03 L 251.61,164.28 L 256.11,164.28 L 256.11,168.03 L 251.61,168.03 z M 263.1,187.03 L 257.47,170.6 L 262.21,170.6 L 265.67,181.82 L 265.74,181.82 L 269.2,170.6 L 273.69,170.6 L 268.13,187.03 L 263.1,187.03 L 263.1,187.03 z M 279.59,170.59 L 279.59,187.03 L 275.09,187.03 L 275.09,170.59 L 279.59,170.59 M 275.09,168.03 L 275.09,164.28 L 279.59,164.28 L 279.59,168.03 L 275.09,168.03 z M 286.33,182.97 C 286.54,183.32 286.8,183.6 287.11,183.82 C 287.43,184.04 287.8,184.21 288.22,184.31 C 288.63,184.42 289.06,184.47 289.51,184.47 C 289.82,184.47 290.16,184.44 290.51,184.36 C 290.86,184.29 291.18,184.17 291.47,184.01 C 291.75,183.85 291.99,183.64 292.18,183.37 C 292.38,183.11 292.47,182.77 292.47,182.37 C 292.47,181.69 292.02,181.19 291.11,180.85 C 290.21,18!
0.51 288.95,180.17 287.33,179.83 C 286.67,179.68 286.02,179.51 285.4,1
79.3 C 284.77,179.1 284.21,178.84 283.72,178.51 C 283.23,178.18 282.84,177.77 282.54,177.27 C 282.24,176.77 282.1,176.16 282.1,175.44 C 282.1,174.38 282.3,173.51 282.72,172.83 C 283.13,172.15 283.68,171.62 284.36,171.22 C 285.04,170.83 285.8,170.56 286.65,170.4 C 287.5,170.24 288.37,170.16 289.27,170.16 C 290.16,170.16 291.02,170.24 291.86,170.41 C 292.7,170.58 293.45,170.87 294.11,171.27 C 294.77,171.67 295.31,172.21 295.75,172.88 C 296.18,173.55 296.45,174.39 296.53,175.41 L 292.22,175.41 C 292.15,174.53 291.82,173.94 291.23,173.63 C 290.63,173.31 289.93,173.16 289.12,173.16 C 288.86,173.16 288.59,173.17 288.29,173.2 C 287.99,173.24 287.72,173.31 287.47,173.41 C 287.23,173.52 287.02,173.67 286.85,173.88 C 286.68,174.08 286.6,174.35 286.6,174.69 C 286.6,175.09 286.74,175.42 287.04,175.68 C 287.34,175.93 287.73,176.14 288.2,176.3 C 288.68,176.46 289.23,176.6 289.85,176.73 C 290.47,176.86 291.1,176.99 291.74,177.14 C 292.39,177.29 293.04,177.47 293.66,177.69 C 294.29,177.9 29!
4.85,178.18 295.34,178.53 C 295.83,178.88 296.22,179.32 296.52,179.84 C 296.82,180.36 296.97,181 296.97,181.76 C 296.97,182.85 296.75,183.76 296.32,184.49 C 295.88,185.22 295.31,185.81 294.61,186.26 C 293.91,186.7 293.11,187.02 292.21,187.2 C 291.31,187.38 290.39,187.47 289.45,187.47 C 288.5,187.47 287.57,187.38 286.65,187.19 C 285.74,186.99 284.93,186.68 284.22,186.23 C 283.51,185.79 282.92,185.2 282.47,184.47 C 282.01,183.74 281.76,182.82 281.72,181.72 L 286.03,181.72 C 286.03,182.2 286.13,182.62 286.33,182.97 L 286.33,182.97 z M 303.6,170.59 L 303.6,187.03 L 299.1,187.03 L 299.1,170.59 L 303.6,170.59 M 299.1,168.03 L 299.1,164.28 L 303.6,164.28 L 303.6,168.03 L 299.1,168.03 z M 310.61,180.76 C 310.74,181.39 310.96,181.95 311.27,182.45 C 311.58,182.95 312,183.35 312.51,183.65 C 313.02,183.95 313.66,184.1 314.44,184.1 C 315.21,184.1 315.86,183.95 316.38,183.65 C 316.9,183.35 317.32,182.95 317.63,182.45 C 317.94,181.95 318.16,181.39 318.29,180.76 C 318.42,180.13 318.49,179.!
49 318.49,178.83 C 318.49,178.17 318.42,177.52 318.29,176.88 C 318.16,
176.25 317.94,175.68 317.63,175.19 C 317.32,174.7 316.9,174.31 316.38,174 C 315.86,173.69 315.21,173.53 314.44,173.53 C 313.66,173.53 313.02,173.69 312.51,174 C 312,174.31 311.58,174.7 311.27,175.19 C 310.96,175.68 310.74,176.25 310.61,176.88 C 310.49,177.52 310.42,178.17 310.42,178.83 C 310.42,179.49 310.49,180.13 310.61,180.76 M 306.53,175.27 C 306.93,174.2 307.51,173.28 308.25,172.53 C 308.99,171.77 309.89,171.19 310.93,170.78 C 311.97,170.36 313.14,170.16 314.44,170.16 C 315.74,170.16 316.91,170.36 317.96,170.78 C 319.01,171.19 319.91,171.77 320.66,172.53 C 321.4,173.28 321.97,174.2 322.38,175.27 C 322.78,176.34 322.99,177.53 322.99,178.85 C 322.99,180.16 322.78,181.35 322.38,182.41 C 321.97,183.47 321.4,184.38 320.66,185.13 C 319.91,185.88 319.01,186.46 317.96,186.86 C 316.91,187.27 315.74,187.47 314.44,187.47 C 313.14,187.47 311.97,187.27 310.93,186.86 C 309.89,186.46 308.99,185.88 308.25,185.13 C 307.51,184.38 306.93,183.47 306.53,182.41 C 306.12,181.35 305.92,180.16 !
305.92,178.85 C 305.92,177.53 306.12,176.34 306.53,175.27 z M 329.6,170.6 L 329.6,172.89 L 329.69,172.89 C 330.26,171.94 331.01,171.24 331.92,170.81 C 332.83,170.38 333.76,170.16 334.72,170.16 C 335.92,170.16 336.91,170.32 337.69,170.65 C 338.46,170.98 339.07,171.44 339.51,172.02 C 339.96,172.6 340.27,173.31 340.45,174.15 C 340.63,174.98 340.72,175.91 340.72,176.93 L 340.72,187.03 L 336.22,187.03 L 336.22,177.76 C 336.22,176.4 336.01,175.39 335.59,174.72 C 335.16,174.06 334.41,173.72 333.34,173.72 C 332.11,173.72 331.22,174.09 330.67,174.82 C 330.12,175.55 329.85,176.75 329.85,178.42 L 329.85,187.03 L 325.29,187.03 L 325.29,170.6 L 329.6,170.6 L 329.6,170.6 z M 355.91,180.76 C 356.04,181.39 356.26,181.95 356.57,182.45 C 356.88,182.95 357.29,183.35 357.81,183.65 C 358.32,183.95 358.96,184.1 359.74,184.1 C 360.51,184.1 361.15,183.95 361.68,183.65 C 362.2,183.35 362.62,182.95 362.93,182.45 C 363.24,181.95 363.46,181.39 363.59,180.76 C 363.72,180.13 363.78,179.49 363.78,178.83 !
C 363.78,178.17 363.72,177.52 363.59,176.88 C 363.46,176.25 363.24,175
.68 362.93,175.19 C 362.62,174.7 362.2,174.31 361.68,174 C 361.15,173.69 360.51,173.53 359.74,173.53 C 358.96,173.53 358.32,173.69 357.81,174 C 357.29,174.31 356.88,174.7 356.57,175.19 C 356.26,175.68 356.04,176.25 355.91,176.88 C 355.78,177.52 355.72,178.17 355.72,178.83 C 355.72,179.49 355.78,180.13 355.91,180.76 M 351.82,175.27 C 352.23,174.2 352.8,173.28 353.55,172.53 C 354.29,171.77 355.18,171.19 356.22,170.78 C 357.27,170.36 358.44,170.16 359.74,170.16 C 361.03,170.16 362.2,170.36 363.26,170.78 C 364.31,171.19 365.21,171.77 365.95,172.53 C 366.7,173.28 367.27,174.2 367.67,175.27 C 368.08,176.34 368.28,177.53 368.28,178.85 C 368.28,180.16 368.08,181.35 367.67,182.41 C 367.27,183.47 366.7,184.38 365.95,185.13 C 365.21,185.88 364.31,186.46 363.26,186.86 C 362.2,187.27 361.03,187.47 359.74,187.47 C 358.44,187.47 357.27,187.27 356.22,186.86 C 355.18,186.46 354.29,185.88 353.55,185.13 C 352.8,184.38 352.23,183.47 351.82,182.41 C 351.42,181.35 351.22,180.16 351.22,178.85 C 35!
1.22,177.53 351.42,176.34 351.82,175.27 z M 368.81,173.6 L 368.81,170.6 L 371.52,170.6 L 371.52,169.33 C 371.52,167.87 371.97,166.67 372.88,165.74 C 373.79,164.81 375.16,164.35 377.01,164.35 C 377.41,164.35 377.81,164.36 378.21,164.39 C 378.61,164.42 379.01,164.45 379.39,164.47 L 379.39,167.85 C 378.86,167.76 378.31,167.72 377.74,167.72 C 377.12,167.72 376.68,167.86 376.41,168.15 C 376.15,168.44 376.02,168.92 376.02,169.61 L 376.02,170.6 L 379.13,170.6 L 379.13,173.6 L 376.02,173.6 L 376.02,187.03 L 371.52,187.03 L 371.52,173.6 L 368.81,173.6 L 368.81,173.6 z " style="fill:#9ea3a6;fill-rule:nonzero;stroke:none" id="path2337" />
+ <path d="M 134.82,111.33 C 134.82,129.75 125.38,139.06 106.05,139.06 C 84.3,139.06 77.27,126.52 77.27,108.22 L 77.27,104.65 L 97.42,104.65 L 97.42,112.25 C 97.42,117.66 100.41,120.65 105.7,120.65 C 110.65,120.65 113.41,117.89 113.41,109.95 L 113.41,55.17 L 134.82,55.17 L 134.82,111.33 L 134.82,111.33 z M 156.02,120.19 L 173.16,120.19 C 179.95,120.19 184.67,117.77 184.67,110.98 C 184.67,103.74 179.61,101.31 173.16,101.31 L 156.02,101.31 L 156.02,120.19 M 156.02,87.51 L 172.59,87.51 C 176.27,87.51 181.34,85.55 181.34,79.68 C 181.34,73.7 177.07,71.74 172.59,71.74 L 156.02,71.74 L 156.02,87.51 M 134.61,55.17 L 173.05,55.17 C 187.2,54.93 202.74,58.62 202.74,75.77 C 202.74,83.13 198.36,89.12 191.92,92.34 C 200.66,94.87 206.07,102.46 206.07,111.79 C 206.07,131.35 191.69,137.34 174.08,137.34 L 134.61,137.34 L 134.61,55.17 z M 399.67,174.6 C 400.82,174.6 401.68,174.34 402.26,173.83 C 402.83,173.33 403.12,172.5 403.12,171.36 C 403.12,170.26 402.83,169.46 402.26,168.97 C 401.68,168.4!
7 400.82,168.22 399.67,168.22 L 394.18,168.22 L 394.18,174.6 L 399.67,174.6 M 401.45,164.35 C 402.47,164.35 403.4,164.51 404.21,164.84 C 405.03,165.17 405.73,165.61 406.32,166.19 C 406.9,166.76 407.35,167.42 407.65,168.17 C 407.96,168.92 408.12,169.73 408.12,170.6 C 408.12,171.93 407.84,173.09 407.27,174.06 C 406.71,175.03 405.79,175.77 404.52,176.28 L 404.52,176.35 C 405.13,176.51 405.64,176.77 406.04,177.13 C 406.45,177.47 406.78,177.89 407.03,178.36 C 407.29,178.84 407.47,179.37 407.59,179.94 C 407.7,180.51 407.79,181.08 407.83,181.66 C 407.85,182.02 407.87,182.44 407.89,182.93 C 407.91,183.42 407.95,183.92 408,184.42 C 408.06,184.94 408.14,185.42 408.26,185.87 C 408.38,186.33 408.55,186.72 408.78,187.03 L 403.79,187.03 C 403.51,186.31 403.34,185.45 403.28,184.46 C 403.22,183.46 403.12,182.51 402.99,181.6 C 402.82,180.41 402.46,179.54 401.91,178.99 C 401.35,178.44 400.45,178.16 399.19,178.16 L 394.18,178.16 L 394.18,187.03 L 389.18,187.03 L 389.18,164.35 L 401.45,164.35 !
z M 420.44,174.42 C 419.9,173.83 419.07,173.53 417.97,173.53 C 417.25,
173.53 416.65,173.65 416.18,173.9 C 415.7,174.14 415.32,174.45 415.03,174.81 C 414.74,175.17 414.54,175.55 414.43,175.95 C 414.31,176.35 414.24,176.72 414.22,177.03 L 421.57,177.03 C 421.36,175.89 420.98,175.02 420.44,174.42 M 415.33,183.11 C 416.01,183.77 416.99,184.1 418.26,184.1 C 419.17,184.1 419.95,183.87 420.61,183.42 C 421.27,182.96 421.67,182.48 421.82,181.97 L 425.8,181.97 C 425.16,183.94 424.19,185.35 422.87,186.2 C 421.56,187.05 419.97,187.47 418.1,187.47 C 416.81,187.47 415.64,187.26 414.6,186.85 C 413.56,186.44 412.69,185.85 411.97,185.08 C 411.25,184.32 410.7,183.41 410.31,182.35 C 409.91,181.29 409.72,180.12 409.72,178.85 C 409.72,177.61 409.92,176.47 410.32,175.41 C 410.72,174.35 411.29,173.43 412.03,172.66 C 412.77,171.88 413.66,171.27 414.68,170.83 C 415.71,170.38 416.85,170.16 418.1,170.16 C 419.5,170.16 420.72,170.43 421.76,170.97 C 422.8,171.51 423.65,172.23 424.32,173.14 C 424.99,174.05 425.47,175.09 425.77,176.26 C 426.06,177.42 426.17,178.64 426.09,17!
9.91 L 414.22,179.91 C 414.28,181.38 414.65,182.45 415.33,183.11 z M 440.57,176.8 C 440.45,176.18 440.23,175.62 439.92,175.15 C 439.61,174.67 439.21,174.28 438.72,173.98 C 438.24,173.68 437.62,173.53 436.88,173.53 C 436.13,173.53 435.51,173.68 434.99,173.98 C 434.49,174.28 434.07,174.67 433.77,175.16 C 433.46,175.65 433.24,176.21 433.1,176.84 C 432.96,177.46 432.89,178.12 432.89,178.8 C 432.89,179.44 432.97,180.08 433.11,180.71 C 433.26,181.35 433.5,181.92 433.83,182.42 C 434.16,182.92 434.57,183.33 435.07,183.63 C 435.57,183.94 436.17,184.1 436.88,184.1 C 437.62,184.1 438.24,183.95 438.74,183.65 C 439.24,183.35 439.64,182.95 439.93,182.45 C 440.23,181.95 440.45,181.38 440.57,180.74 C 440.7,180.11 440.77,179.45 440.77,178.77 C 440.77,178.09 440.7,177.43 440.57,176.8 M 440.77,184.96 C 440.24,185.85 439.54,186.49 438.68,186.88 C 437.82,187.27 436.85,187.47 435.77,187.47 C 434.54,187.47 433.46,187.23 432.52,186.76 C 431.59,186.28 430.82,185.63 430.22,184.81 C 429.61,184 429.16!
,183.06 428.85,182 C 428.54,180.94 428.39,179.83 428.39,178.69 C 428.3
9,177.58 428.54,176.52 428.85,175.49 C 429.16,174.46 429.61,173.55 430.22,172.77 C 430.82,171.98 431.57,171.35 432.49,170.87 C 433.4,170.4 434.45,170.16 435.66,170.16 C 436.63,170.16 437.56,170.36 438.43,170.77 C 439.31,171.19 440.01,171.79 440.52,172.59 L 440.58,172.59 L 440.58,164.35 L 445.14,164.35 L 445.14,187.06 L 440.83,187.06 L 440.83,184.96 L 440.77,184.96 z M 461.58,164.35 L 461.58,173.03 L 470.77,173.03 L 470.77,164.35 L 475.77,164.35 L 475.77,187.03 L 470.77,187.03 L 470.77,177.22 L 461.58,177.22 L 461.58,187.03 L 456.58,187.03 L 456.58,164.35 L 461.58,164.35 L 461.58,164.35 z M 488.61,179.4 C 488.32,179.49 488.01,179.57 487.67,179.63 C 487.34,179.7 486.99,179.75 486.63,179.79 C 486.26,179.84 485.9,179.89 485.53,179.95 C 485.19,180.02 484.85,180.1 484.52,180.21 C 484.19,180.31 483.9,180.46 483.65,180.64 C 483.4,180.82 483.2,181.05 483.06,181.32 C 482.9,181.6 482.83,181.95 482.83,182.37 C 482.83,182.77 482.9,183.11 483.06,183.39 C 483.2,183.67 483.41,183.88 483.67,!
184.04 C 483.92,184.2 484.22,184.31 484.57,184.38 C 484.91,184.44 485.27,184.47 485.63,184.47 C 486.53,184.47 487.23,184.32 487.72,184.02 C 488.22,183.73 488.58,183.37 488.81,182.96 C 489.05,182.55 489.2,182.13 489.25,181.7 C 489.3,181.28 489.33,180.94 489.33,180.69 L 489.33,179 C 489.14,179.17 488.9,179.3 488.61,179.4 M 479.63,173.02 C 480.1,172.32 480.69,171.76 481.41,171.33 C 482.14,170.91 482.95,170.61 483.86,170.43 C 484.76,170.25 485.67,170.16 486.59,170.16 C 487.41,170.16 488.26,170.22 489.11,170.33 C 489.96,170.45 490.74,170.68 491.43,171.02 C 492.14,171.36 492.71,171.83 493.16,172.44 C 493.61,173.04 493.83,173.84 493.83,174.84 L 493.83,183.4 C 493.83,184.14 493.87,184.85 493.96,185.53 C 494.04,186.21 494.19,186.72 494.4,187.06 L 489.84,187.03 C 489.75,186.78 489.68,186.52 489.63,186.26 C 489.57,186 489.54,185.73 489.52,185.46 C 488.79,186.2 487.94,186.73 486.96,187.02 C 485.98,187.32 484.98,187.47 483.96,187.47 C 483.17,187.47 482.43,187.38 481.75,187.19 C 481.07,1!
86.99 480.47,186.7 479.96,186.29 C 479.45,185.89 479.05,185.38 478.76,
184.76 C 478.47,184.15 478.33,183.41 478.33,182.56 C 478.33,181.63 478.5,180.86 478.82,180.25 C 479.16,179.65 479.58,179.16 480.11,178.8 C 480.63,178.44 481.22,178.17 481.9,177.99 C 482.57,177.81 483.24,177.67 483.93,177.56 C 484.61,177.45 485.28,177.36 485.94,177.3 C 486.6,177.24 487.19,177.14 487.7,177.02 C 488.21,176.89 488.61,176.7 488.91,176.46 C 489.21,176.21 489.35,175.86 489.33,175.39 C 489.33,174.9 489.25,174.51 489.09,174.23 C 488.93,173.94 488.71,173.72 488.44,173.56 C 488.17,173.4 487.86,173.29 487.51,173.24 C 487.15,173.19 486.77,173.16 486.36,173.16 C 485.46,173.16 484.75,173.35 484.24,173.74 C 483.72,174.12 483.42,174.76 483.33,175.66 L 478.83,175.66 C 478.9,174.6 479.16,173.72 479.63,173.02 z M 506.05,170.6 L 506.05,173.6 L 502.74,173.6 L 502.74,181.75 C 502.74,182.51 502.87,183.02 503.12,183.27 C 503.38,183.53 503.88,183.66 504.65,183.66 C 504.9,183.66 505.15,183.65 505.38,183.63 C 505.61,183.61 505.84,183.58 506.05,183.53 L 506.05,187.03 C 505.67,187.11 505!
.24,187.16 504.77,187.19 C 504.31,187.21 503.85,187.22 503.41,187.22 C 502.71,187.22 502.05,187.17 501.43,187.08 C 500.8,186.98 500.25,186.79 499.78,186.52 C 499.3,186.24 498.93,185.85 498.65,185.34 C 498.38,184.83 498.24,184.16 498.24,183.33 L 498.24,173.6 L 495.51,173.6 L 495.51,170.6 L 498.24,170.6 L 498.24,165.66 L 502.74,165.66 L 502.74,170.6 L 506.05,170.6 L 506.05,170.6 z " style="fill:#cc0000;fill-rule:nonzero;stroke:none" id="logotype" />
+ <path d="M 388.07,59.04 L 388.07,62 L 389.39,62 C 390.18,62 390.72,61.89 391.03,61.67 C 391.34,61.44 391.5,61.06 391.5,60.53 C 391.5,59.99 391.34,59.6 391.03,59.39 C 390.71,59.15 390.73,59.04 389.95,59.04 M 389.46,57.94 C 390.72,57.94 391.67,58.15 392.28,58.58 C 392.9,59 393.22,59.64 393.22,60.5 C 393.22,61.12 393.03,61.63 392.65,62.03 C 392.27,62.43 391.75,62.69 391.06,62.81 C 391.23,62.87 391.43,63.04 391.67,63.32 C 391.92,63.59 392.2,63.99 392.53,64.51 L 394,66.9 L 392.16,66.9 L 390.77,64.66 C 390.35,63.97 390.01,63.54 389.74,63.36 C 389.48,63.18 389.16,63.08 388.78,63.08 L 388.07,63.08 L 388.07,66.9 L 386.41,66.9 L 386.41,57.94 M 389.91,55.02 C 385.8,55.02 382.46,58.37 382.46,62.47 C 382.46,66.58 385.8,69.92 389.91,69.92 C 394.01,69.92 397.36,66.58 397.36,62.47 C 397.36,58.37 394.01,55.02 389.91,55.02 z M 389.91,56.4 C 393.27,56.4 396,59.11 396,62.47 C 396,65.83 393.27,68.57 389.91,68.57 C 386.55,68.57 383.83,65.83 383.83,62.47 C 383.83,59.11 386.55,56.4 389.91,56.4 z !
" style="font-size:31.38881302px;fill:#9ea3a6;fill-opacity:1;font-family:DejaVu Sans" id="registration" />
+ </g>
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/warning.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/warning.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/warning.svg
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/warning.svg (rev 0)
+++ docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/warning.svg 2008-11-12 22:44:10 UTC (rev 12288)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="48"
+ height="48"
+ id="svg2">
+ <defs
+ id="defs5" />
+ <path
+ d="M 26.553837,7.3026447 C 25.283816,5.0882437 23.199663,5.0882437 21.945919,7.3026447 L 3.9376032,38.711367 C 2.6675727,40.925778 3.7259346,42.749404 6.2822626,42.749404 L 42.217493,42.749404 C 44.77383,42.749404 45.832183,40.925778 44.545876,38.711367 L 26.553837,7.3026447 z "
+ style="fill:#2e3436;fill-opacity:1;stroke:#2e3436;stroke-width:4.7150631;stroke-miterlimit:4;stroke-dasharray:none"
+ id="use2812" />
+ <path
+ d="M 26.553837,7.3026447 C 25.283816,5.0882437 23.199663,5.0882437 21.945919,7.3026447 L 3.9376032,38.711367 C 2.6675727,40.925778 3.7259346,42.749404 6.2822626,42.749404 L 42.217493,42.749404 C 44.77383,42.749404 45.832183,40.925778 44.545876,38.711367 L 26.553837,7.3026447 z "
+ style="fill:#fde8a6;fill-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none"
+ id="path4309" />
+ <path
+ d="M 26.220057,12.491166 C 25.133792,10.597163 23.351196,10.597163 22.278859,12.491166 L 6.8761436,39.355379 C 5.789878,41.249382 6.6951041,42.809153 8.8815542,42.809153 L 39.617353,42.809153 C 41.803812,42.809153 42.709038,41.249382 41.608844,39.355379 L 26.220057,12.491166 z "
+ style="fill:#fac521;fill-opacity:1"
+ id="path2991" />
+ <path
+ d="M 28.470282,37.445157 C 28.470282,38.878008 27.2491,39.952646 25.392902,39.952646 L 25.36034,39.952646 C 23.520438,39.952646 22.282969,38.878008 22.282969,37.445157 C 22.282969,35.947181 23.553,34.921391 25.392902,34.921391 C 27.216538,34.921391 28.437711,35.947181 28.470282,37.445157 z M 28.144632,33.146613 L 29.21927,19.990446 L 21.517696,19.990446 L 22.592334,33.146613 L 28.144632,33.146613 z "
+ style="fill:#fef2cb;fill-opacity:1;stroke:#fef2cb;stroke-width:0.9430126;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+ id="path4468" />
+ <path
+ d="M 27.089325,36.371084 C 27.089325,37.803935 25.868143,38.878574 24.011955,38.878574 L 23.979392,38.878574 C 22.139481,38.878574 20.902022,37.803935 20.902022,36.371084 C 20.902022,34.873109 22.172043,33.847319 24.011955,33.847319 C 25.835581,33.847319 27.056763,34.873109 27.089325,36.371084 z M 26.763675,32.072531 L 27.838313,18.916364 L 20.136748,18.916364 L 21.211386,32.072531 L 26.763675,32.072531 z "
+ style="fill:#2e3436"
+ id="path4470" />
+</svg>
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/watermark-alpha1.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/watermark-alpha1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/watermark-alpha2.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/watermark-alpha2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/watermark-beta1.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/watermark-beta1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/watermark-beta2.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/watermark-beta2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/watermark-blank.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/watermark-blank.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/watermark-pre-release-candidate.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/watermark-pre-release-candidate.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/watermark-release-candidate.png
===================================================================
(Binary files differ)
Property changes on: docs/enterprise/trunk/Reference_Guide/en-US/Common_Content/images/watermark-release-candidate.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: docs/enterprise/trunk/Reference_Guide/en-US/resolved.xml
===================================================================
--- docs/enterprise/trunk/Reference_Guide/en-US/resolved.xml 2008-11-10 21:47:13 UTC (rev 12287)
+++ docs/enterprise/trunk/Reference_Guide/en-US/resolved.xml 2008-11-12 22:44:10 UTC (rev 12288)
@@ -1,17425 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.docbook.org/xml/4.5/docbookx.dtd" [
-<!ENTITY uArr "⇑">
-<!ENTITY hcirc "ĥ">
-<!ENTITY icirc "î">
-<!ENTITY equals "=">
-<!ENTITY cong "≅">
-<!ENTITY icy "и">
-<!ENTITY HARDcy "Ъ">
-<!ENTITY Ecaron "Ě">
-<!ENTITY clubs "♣">
-<!ENTITY phmmat "ℳ">
-<!ENTITY sqcap "⊓">
-<!ENTITY thorn "þ">
-<!ENTITY Lcedil "Ļ">
-<!ENTITY verbar "|">
-<!ENTITY rarr "→">
-<!ENTITY cire "≗">
-<!ENTITY DZcy "Џ">
-<!ENTITY b.delta "δ">
-<!ENTITY Gcirc "Ĝ">
-<!ENTITY ocir "⊚">
-<!ENTITY circ "^">
-<!ENTITY Igr "Ι">
-<!ENTITY udigr "ϋ">
-<!ENTITY prime "′">
-<!ENTITY npr "⊀">
-<!ENTITY b.pi "π">
-<!ENTITY frac58 "⅝">
-<!ENTITY ldquor "„">
-<!ENTITY sqsup "⊐">
-<!ENTITY boxDR "╒">
-<!ENTITY kcedil "ķ">
-<!ENTITY vDash "⊨">
-<!ENTITY Scedil "Ş">
-<!ENTITY perp "⊥">
-<!ENTITY b.Gamma "Γ">
-<!ENTITY b.kappa "κ">
-<!ENTITY Uuml "Ü">
-<!ENTITY mnplus "∓">
-<!ENTITY nearr "↗">
-<!ENTITY nrtri "⋫">
-<!ENTITY cupre "≼">
-<!ENTITY boxV "║">
-<!ENTITY Zdot "Ż">
-<!ENTITY pound "£">
-<!ENTITY lharu "↼">
-<!ENTITY boxdr "┌">
-<!ENTITY ocy "о">
-<!ENTITY xgr "ξ">
-<!ENTITY b.xi "ξ">
-<!ENTITY middot "·">
-<!ENTITY larr "←">
-<!ENTITY xrArr "⇒">
-<!ENTITY Ncy "Н">
-<!ENTITY acute "´">
-<!ENTITY phis "φ">
-<!ENTITY ncedil "ņ">
-<!ENTITY lAarr "⇚">
-<!ENTITY sqsube "⊑">
-<!ENTITY quot '"'>
-<!ENTITY TSHcy "Ћ">
-<!ENTITY amacr "ā">
-<!ENTITY otimes "⊗">
-<!ENTITY inodot "ı">
-<!ENTITY gsdot "⋗">
-<!ENTITY LJcy "Љ">
-<!ENTITY phiv "ϕ">
-<!ENTITY odblac "ő">
-<!ENTITY filig "fi">
-<!ENTITY amalg "∐">
-<!ENTITY sdotb "⊡">
-<!ENTITY boxDL "╕">
-<!ENTITY Theta "Θ">
-<!ENTITY cdot "ċ">
-<!ENTITY ordm "º">
-<!ENTITY atilde "ã">
-<!ENTITY squf "▪">
-<!ENTITY notin "∉">
-<!ENTITY nmid "∤">
-<!ENTITY shchcy "щ">
-<!ENTITY lfloor "⌊">
-<!ENTITY Xi "Ξ">
-<!ENTITY Hstrok "Ħ">
-<!ENTITY period ".">
-<!ENTITY numsp " ">
-<!ENTITY nldr "‥">
-<!ENTITY boxdl "┐">
-<!ENTITY Fcy "Ф">
-<!ENTITY tscy "ц">
-<!ENTITY Iukcy "І">
-<!ENTITY cross "✗">
-<!ENTITY ohgr "ω">
-<!ENTITY nbsp " ">
-<!ENTITY ni "∍">
-<!ENTITY comp "∁">
-<!ENTITY boxH "═">
-<!ENTITY b.Delta "Δ">
-<!ENTITY Oslash "Ø">
-<!ENTITY ndash "–">
-<!ENTITY marker "▮">
-<!ENTITY ordf "ª">
-<!ENTITY nsce "⋡">
-<!ENTITY vrtri "⊳">
-<!ENTITY ubrcy "ў">
-<!ENTITY Ccirc "Ĉ">
-<!ENTITY quest "?">
-<!ENTITY ne "≠">
-<!ENTITY gap "≳">
-<!ENTITY efDot "≒">
-<!ENTITY rcy "р">
-<!ENTITY bsim "∽">
-<!ENTITY bgr "β">
-<!ENTITY omacr "ō">
-<!ENTITY umacr "ū">
-<!ENTITY lpar "(">
-<!ENTITY uharl "↿">
-<!ENTITY Gcy "Г">
-<!ENTITY ast "*">
-<!ENTITY acy "а">
-<!ENTITY thetas "θ">
-<!ENTITY uring "ů">
-<!ENTITY Zcaron "Ž">
-<!ENTITY horbar "―">
-<!ENTITY star "⋆">
-<!ENTITY timesb "⊠">
-<!ENTITY npre "⋠">
-<!ENTITY real "ℜ">
-<!ENTITY nrArr "⇏">
-<!ENTITY dlarr "↙">
-<!ENTITY oplus "⊕">
-<!ENTITY Xgr "Ξ">
-<!ENTITY ucy "у">
-<!ENTITY thetav "ϑ">
-<!ENTITY jcirc "ĵ">
-<!ENTITY uharr "↾">
-<!ENTITY mgr "μ">
-<!ENTITY hearts "♥">
-<!ENTITY nvDash "⊭">
-<!ENTITY yicy "ї">
-<!ENTITY dot "˙">
-<!ENTITY alpha "α">
-<!ENTITY wedgeq "≙">
-<!ENTITY bowtie "⋈">
-<!ENTITY boxDr "╓">
-<!ENTITY b.upsi "υ">
-<!ENTITY euml "ë">
-<!ENTITY vArr "⇕">
-<!ENTITY lgr "λ">
-<!ENTITY b.rhov "ϱ">
-<!ENTITY ubreve "ŭ">
-<!ENTITY copysr "℗">
-<!ENTITY cap "∩">
-<!ENTITY aogon "ą">
-<!ENTITY racute "ŕ">
-<!ENTITY rthree "⋌">
-<!ENTITY Sgr "Σ">
-<!ENTITY uacute "ú">
-<!ENTITY Tcaron "Ť">
-<!ENTITY dagger "†">
-<!ENTITY oast "⊛">
-<!ENTITY prnE "">
-<!ENTITY thkap "≈">
-<!ENTITY boxdR "╔">
-<!ENTITY dgr "δ">
-<!ENTITY nacute "ń">
-<!ENTITY hardcy "ъ">
-<!ENTITY sqsupe "⊒">
-<!ENTITY TScy "Ц">
-<!ENTITY reg "®">
-<!ENTITY cir "○">
-<!ENTITY lsquor "‚">
-<!ENTITY ycy "ы">
-<!ENTITY Sigma "Σ">
-<!ENTITY Gbreve "Ğ">
-<!ENTITY order "ℴ">
-<!ENTITY nlarr "↚">
-<!ENTITY eng "ŋ">
-<!ENTITY sacute "ś">
-<!ENTITY ensp " ">
-<!ENTITY rarr2 "⇉">
-<!ENTITY coprod "∐">
-<!ENTITY iacgr "ί">
-<!ENTITY b.piv "ϖ">
-<!ENTITY rlhar2 "⇌">
-<!ENTITY boxDl "╗">
-<!ENTITY Pcy "П">
-<!ENTITY Dagger "‡">
-<!ENTITY khcy "х">
-<!ENTITY sigma "σ">
-<!ENTITY nltrie "⋬">
-<!ENTITY gjcy "ѓ">
-<!ENTITY b.alpha "α">
-<!ENTITY plusmn "±">
-<!ENTITY scnap "⋩">
-<!ENTITY vprime "′">
-<!ENTITY iota "ι">
-<!ENTITY Dcaron "Ď">
-<!ENTITY emsp " ">
-<!ENTITY trie "≜">
-<!ENTITY boxdL "╖">
-<!ENTITY cacute "ć">
-<!ENTITY rcedil "ŗ">
-<!ENTITY lhblk "▄">
-<!ENTITY lnsim "⋦">
-<!ENTITY bsime "⋍">
-<!ENTITY Vvdash "⊪">
-<!ENTITY zgr "ζ">
-<!ENTITY Ncaron "Ň">
-<!ENTITY rcaron "ř">
-<!ENTITY radic "√">
-<!ENTITY colone "≔">
-<!ENTITY Ucy "У">
-<!ENTITY lcub "{">
-<!ENTITY mdash "—">
-<!ENTITY ogon "˛">
-<!ENTITY Lgr "Λ">
-<!ENTITY b.chi "χ">
-<!ENTITY Barwed "⌆">
-<!ENTITY odot "⊙">
-<!ENTITY softcy "ь">
-<!ENTITY yucy "ю">
-<!ENTITY Ogr "Ο">
-<!ENTITY ecirc "ê">
-<!ENTITY Uacute "Ú">
-<!ENTITY jcy "й">
-<!ENTITY Oacgr "Ό">
-<!ENTITY ntilde "ñ">
-<!ENTITY Uring "Ů">
-<!ENTITY Udigr "Ϋ">
-<!ENTITY squ "□">
-<!ENTITY image "ℑ">
-<!ENTITY Uacgr "Ύ">
-<!ENTITY uarr "↑">
-<!ENTITY sim "∼">
-<!ENTITY egr "ε">
-<!ENTITY aleph "ℵ">
-<!ENTITY nharr "↮">
-<!ENTITY kcy "к">
-<!ENTITY Rgr "Ρ">
-<!ENTITY ffilig "ffi">
-<!ENTITY boxvl "┤">
-<!ENTITY Iacgr "Ί">
-<!ENTITY ang90 "∟">
-<!ENTITY nrarr "↛">
-<!ENTITY nges "≱">
-<!ENTITY nsube "⊈">
-<!ENTITY nsup "⊅">
-<!ENTITY egs "⋝">
-<!ENTITY acirc "â">
-<!ENTITY Yuml "Ÿ">
-<!ENTITY ltrif "◂">
-<!ENTITY lagran "ℒ">
-<!ENTITY npar "∦">
-<!ENTITY scsim "≿">
-<!ENTITY boxvr "├">
-<!ENTITY Acirc "Â">
-<!ENTITY Ucirc "Û">
-<!ENTITY zcaron "ž">
-<!ENTITY shy "">
-<!ENTITY ominus "⊖">
-<!ENTITY frac38 "⅜">
-<!ENTITY incare "℅">
-<!ENTITY uhblk "▀">
-<!ENTITY lEg "⋚">
-<!ENTITY gcy "г">
-<!ENTITY b.eta "η">
-<!ENTITY lnap "">
-<!ENTITY Iacute "Í">
-<!ENTITY yacute "ý">
-<!ENTITY dstrok "đ">
-<!ENTITY Imacr "Ī">
-<!ENTITY orarr "↻">
-<!ENTITY Eacgr "Έ">
-<!ENTITY apos "'">
-<!ENTITY b.epsiv "ε">
-<!ENTITY gcirc "ĝ">
-<!ENTITY udblac "ű">
-<!ENTITY planck "ℏ">
-<!ENTITY upsi "υ">
-<!ENTITY b.Lambda "Λ">
-<!ENTITY Bgr "Β">
-<!ENTITY scedil "ş">
-<!ENTITY Rarr "↠">
-<!ENTITY nrtrie "⋭">
-<!ENTITY nsub "⊄">
-<!ENTITY vcy "в">
-<!ENTITY b.epsis "ε">
-<!ENTITY Eacute "É">
-<!ENTITY boxvh "┼">
-<!ENTITY dcy "д">
-<!ENTITY Aring "Å">
-<!ENTITY Igrave "Ì">
-<!ENTITY utilde "ũ">
-<!ENTITY divonx "⋇">
-<!ENTITY lne "≨">
-<!ENTITY scnE "">
-<!ENTITY ccedil "ç">
-<!ENTITY supne "⊋">
-<!ENTITY empty "∅">
-<!ENTITY b.nu "ν">
-<!ENTITY top "⊤">
-<!ENTITY lcy "л">
-<!ENTITY b.gamma "γ">
-<!ENTITY aelig "æ">
-<!ENTITY iuml "ï">
-<!ENTITY Lcaron "Ľ">
-<!ENTITY bottom "⊥">
-<!ENTITY rarrhk "↪">
-<!ENTITY DScy "Ѕ">
-<!ENTITY idiagr "ΐ">
-<!ENTITY imacr "ī">
-<!ENTITY ltri "◃">
-<!ENTITY infin "∞">
-<!ENTITY le "≤">
-<!ENTITY sime "≃">
-<!ENTITY kappa "κ">
-<!ENTITY kappav "ϰ">
-<!ENTITY OElig "Œ">
-<!ENTITY urcrop "⌎">
-<!ENTITY darr2 "⇊">
-<!ENTITY lg "≶">
-<!ENTITY spar "∥">
-<!ENTITY Mgr "Μ">
-<!ENTITY rtri "▹">
-<!ENTITY daleth "ℸ">
-<!ENTITY sfrown "⌢">
-<!ENTITY epsiv "ε">
-<!ENTITY Omega "Ω">
-<!ENTITY colon ":">
-<!ENTITY prop "∝">
-<!ENTITY lArr "⇐">
-<!ENTITY Upsi "ϒ">
-<!ENTITY oslash "ø">
-<!ENTITY ap "≈">
-<!ENTITY Sup "⋑">
-<!ENTITY epsis "∊">
-<!ENTITY b.omega "ω">
-<!ENTITY rpar ")">
-<!ENTITY Abreve "Ă">
-<!ENTITY mldr "…">
-<!ENTITY ltrie "⊴">
-<!ENTITY Psi "Ψ">
-<!ENTITY Agrave "À">
-<!ENTITY Tcedil "Ţ">
-<!ENTITY auml "ä">
-<!ENTITY lcedil "ļ">
-<!ENTITY scirc "ŝ">
-<!ENTITY larrhk "↩">
-<!ENTITY varr "↕">
-<!ENTITY ncong "≇">
-<!ENTITY subE "⊆">
-<!ENTITY kjcy "ќ">
-<!ENTITY larr2 "⇇">
-<!ENTITY rsh "↱">
-<!ENTITY sdot "⋅">
-<!ENTITY wreath "≀">
-<!ENTITY cuepr "⋞">
-<!ENTITY frown "⌢">
-<!ENTITY Agr "Α">
-<!ENTITY uacgr "ύ">
-<!ENTITY rcub "}">
-<!ENTITY dharl "⇃">
-<!ENTITY bcy "б">
-<!ENTITY Tgr "Τ">
-<!ENTITY diam "⋄">
-<!ENTITY eacute "é">
-<!ENTITY xlArr "⇐">
-<!ENTITY leg "⋚">
-<!ENTITY boxvL "╡">
-<!ENTITY Kcy "К">
-<!ENTITY ncy "н">
-<!ENTITY sgr "σ">
-<!ENTITY beta "β">
-<!ENTITY exist "∃">
-<!ENTITY bprime "‵">
-<!ENTITY boxul "┘">
-<!ENTITY Zcy "З">
-<!ENTITY Iuml "Ï">
-<!ENTITY Scaron "Š">
-<!ENTITY sol "/">
-<!ENTITY boxvR "╞">
-<!ENTITY fcy "ф">
-<!ENTITY Egrave "È">
-<!ENTITY Utilde "Ũ">
-<!ENTITY lthree "⋋">
-<!ENTITY boxur "└">
-<!ENTITY dharr "⇂">
-<!ENTITY uarr2 "⇈">
-<!ENTITY lacute "ĺ">
-<!ENTITY spades "♠">
-<!ENTITY int "∫">
-<!ENTITY rect "▭">
-<!ENTITY compfn "∘">
-<!ENTITY b.sigma "σ">
-<!ENTITY Amacr "Ā">
-<!ENTITY prod "∏">
-<!ENTITY rpargt "">
-<!ENTITY b.sigmav "ς">
-<!ENTITY excl "!">
-<!ENTITY fnof "ƒ">
-<!ENTITY beth "ℶ">
-<!ENTITY yuml "ÿ">
-<!ENTITY rsquo "’">
-<!ENTITY pr "≺">
-<!ENTITY ccaron "č">
-<!ENTITY hyphen "-">
-<!ENTITY weierp "℘">
-<!ENTITY smile "⌣">
-<!ENTITY Egr "Ε">
-<!ENTITY eeacgr "ή">
-<!ENTITY nsc "⊁">
-<!ENTITY les "≤">
-<!ENTITY boxvH "╪">
-<!ENTITY KHcy "Х">
-<!ENTITY bernou "ℬ">
-<!ENTITY tgr "τ">
-<!ENTITY zacute "ź">
-<!ENTITY amp "&">
-<!ENTITY lnE "≨">
-<!ENTITY nlE "≰">
-<!ENTITY sbsol "﹨">
-<!ENTITY Pi "Π">
-<!ENTITY b.beta "β">
-<!ENTITY b.mu "μ">
-<!ENTITY Ograve "Ò">
-<!ENTITY phone "☎">
-<!ENTITY iff "⇔">
-<!ENTITY gsim "≳">
-<!ENTITY rx "℞">
-<!ENTITY there4 "∴">
-<!ENTITY harrw "↭">
-<!ENTITY udiagr "ΰ">
-<!ENTITY otilde "õ">
-<!ENTITY DotDot "⃜">
-<!ENTITY lrhar2 "⇋">
-<!ENTITY lE "≦">
-<!ENTITY hstrok "ħ">
-<!ENTITY Racute "Ŕ">
-<!ENTITY rarrw "↝">
-<!ENTITY angmsd "∡">
-<!ENTITY tshcy "ћ">
-<!ENTITY szlig "ß">
-<!ENTITY nequiv "≢">
-<!ENTITY pcy "п">
-<!ENTITY darr "↓">
-<!ENTITY female "♀">
-<!ENTITY curarr "↷">
-<!ENTITY minusb "⊟">
-<!ENTITY aacute "á">
-<!ENTITY Dcy "Д">
-<!ENTITY THORN "Þ">
-<!ENTITY ucirc "û">
-<!ENTITY asymp "≍">
-<!ENTITY bcong "≌">
-<!ENTITY die "¨">
-<!ENTITY ograve "ò">
-<!ENTITY iexcl "¡">
-<!ENTITY frac56 "⅚">
-<!ENTITY rArr "⇒">
-<!ENTITY tprime "‴">
-<!ENTITY osol "⊘">
-<!ENTITY sqsub "⊏">
-<!ENTITY rho "ρ">
-<!ENTITY b.psi "ψ">
-<!ENTITY aring "å">
-<!ENTITY Edot "Ė">
-<!ENTITY lcaron "ľ">
-<!ENTITY rlarr2 "⇄">
-<!ENTITY EEacgr "Ή">
-<!ENTITY pi "π">
-<!ENTITY sect "§">
-<!ENTITY bepsi "∍">
-<!ENTITY ffllig "ffl">
-<!ENTITY lsh "↰">
-<!ENTITY dscy "ѕ">
-<!ENTITY macr "¯">
-<!ENTITY b.kappav "ϰ">
-<!ENTITY scaron "š">
-<!ENTITY dollar "$">
-<!ENTITY commat "@">
-<!ENTITY angsph "∢">
-<!ENTITY Udblac "Ű">
-<!ENTITY copy "©">
-<!ENTITY comma ",">
-<!ENTITY diams "♦">
-<!ENTITY sube "⊆">
-<!ENTITY Dot "¨">
-<!ENTITY Cap "⋒">
-<!ENTITY nsmid "">
-<!ENTITY SOFTcy "Ь">
-<!ENTITY eegr "η">
-<!ENTITY lsim "≲">
-<!ENTITY ssmile "⌣">
-<!ENTITY nlt "≮">
-<!ENTITY boxHU "╨">
-<!ENTITY ZHcy "Ж">
-<!ENTITY abreve "ă">
-<!ENTITY lmidot "ŀ">
-<!ENTITY angst "Å">
-<!ENTITY b.lambda "λ">
-<!ENTITY uuml "ü">
-<!ENTITY IJlig "IJ">
-<!ENTITY ENG "Ŋ">
-<!ENTITY brvbar "¦">
-<!ENTITY esdot "≐">
-<!ENTITY boxuL "╝">
-<!ENTITY blk14 "░">
-<!ENTITY YAcy "Я">
-<!ENTITY caron "ˇ">
-<!ENTITY ohacgr "ώ">
-<!ENTITY sup3 "³">
-<!ENTITY flat "♭">
-<!ENTITY minus "−">
-<!ENTITY olarr "↺">
-<!ENTITY dlcorn "⌞">
-<!ENTITY boxuR "╙">
-<!ENTITY iukcy "і">
-<!ENTITY b.tau "τ">
-<!ENTITY Otilde "Õ">
-<!ENTITY ldquo "“">
-<!ENTITY lang "〈">
-<!ENTITY Verbar "‖">
-<!ENTITY ges "≥">
-<!ENTITY prap "≾">
-<!ENTITY thksim "∼">
-<!ENTITY Vcy "В">
-<!ENTITY yacy "я">
-<!ENTITY drcrop "⌌">
-<!ENTITY omega "ω">
-<!ENTITY Hcirc "Ĥ">
-<!ENTITY tstrok "ŧ">
-<!ENTITY ang "∠">
-<!ENTITY khgr "χ">
-<!ENTITY b.thetas "θ">
-<!ENTITY ecaron "ě">
-<!ENTITY Odblac "Ő">
-<!ENTITY fflig "ff">
-<!ENTITY lowast "∗">
-<!ENTITY nvdash "⊬">
-<!ENTITY frac18 "⅛">
-<!ENTITY sup1 "¹">
-<!ENTITY njcy "њ">
-<!ENTITY b.thetav "ϑ">
-<!ENTITY sup2 "²">
-<!ENTITY gimel "ℷ">
-<!ENTITY ldot "⋖">
-<!ENTITY Ccedil "Ç">
-<!ENTITY rdquo "”">
-<!ENTITY rhard "⇁">
-<!ENTITY nsime "≄">
-<!ENTITY boxhu "┴">
-<!ENTITY intcal "⊺">
-<!ENTITY nsupe "⊉">
-<!ENTITY Gt "≫">
-<!ENTITY igr "ι">
-<!ENTITY nabla "∇">
-<!ENTITY urcorn "⌝">
-<!ENTITY nle "≰">
-<!ENTITY Icy "И">
-<!ENTITY DJcy "Ђ">
-<!ENTITY jukcy "є">
-<!ENTITY lceil "⌈">
-<!ENTITY oS "Ⓢ">
-<!ENTITY malt "✠">
-<!ENTITY ccirc "ĉ">
-<!ENTITY ycirc "ŷ">
-<!ENTITY Aacgr "Ά">
-<!ENTITY Ntilde "Ñ">
-<!ENTITY vsupnE "⊋">
-<!ENTITY ogr "ο">
-<!ENTITY and "∧">
-<!ENTITY gvnE "≩">
-<!ENTITY dashv "⊣">
-<!ENTITY supE "⊇">
-<!ENTITY mu "μ">
-<!ENTITY vsubnE "">
-<!ENTITY gE "≧">
-<!ENTITY smid "">
-<!ENTITY delta "δ">
-<!ENTITY tcaron "ť">
-<!ENTITY rsqb "]">
-<!ENTITY bull "•">
-<!ENTITY cuwed "⋏">
-<!ENTITY raquo "»">
-<!ENTITY frac45 "⅘">
-<!ENTITY part "∂">
-<!ENTITY Vdash "⊩">
-<!ENTITY boxhd "┬">
-<!ENTITY psi "ψ">
-<!ENTITY b.Omega "Ω">
-<!ENTITY iquest "¿">
-<!ENTITY sqcup "⊔">
-<!ENTITY YUcy "Ю">
-<!ENTITY psgr "ψ">
-<!ENTITY conint "∮">
-<!ENTITY gel "⋛">
-<!ENTITY Icirc "Î">
-<!ENTITY twixt "≬">
-<!ENTITY boxHD "╥">
-<!ENTITY male "♂">
-<!ENTITY euro "€">
-<!ENTITY epsi "∊">
-<!ENTITY Rcaron "Ř">
-<!ENTITY SHCHcy "Щ">
-<!ENTITY ugr "υ">
-<!ENTITY Phi "Φ">
-<!ENTITY b.Xi "Ξ">
-<!ENTITY lt "<">
-<!ENTITY scnsim "⋩">
-<!ENTITY models "⊧">
-<!ENTITY boxHu "╩">
-<!ENTITY Lcy "Л">
-<!ENTITY Sacute "Ś">
-<!ENTITY nwarr "↖">
-<!ENTITY drcorn "⌟">
-<!ENTITY NJcy "Њ">
-<!ENTITY mumap "⊸">
-<!ENTITY rAarr "⇛">
-<!ENTITY nsubE "⊈">
-<!ENTITY b.rho "ρ">
-<!ENTITY oelig "œ">
-<!ENTITY utrif "▴">
-<!ENTITY subne "⊊">
-<!ENTITY para "¶">
-<!ENTITY ocirc "ô">
-<!ENTITY ouml "ö">
-<!ENTITY num "#">
-<!ENTITY boxUL "╛">
-<!ENTITY IEcy "Е">
-<!ENTITY Ocy "О">
-<!ENTITY Ugrave "Ù">
-<!ENTITY eogon "ę">
-<!ENTITY sum "∑">
-<!ENTITY mcy "м">
-<!ENTITY YIcy "Ї">
-<!ENTITY Gamma "Γ">
-<!ENTITY isin "∊">
-<!ENTITY cuesc "⋟">
-<!ENTITY b.Pi "Π">
-<!ENTITY Ubreve "Ŭ">
-<!ENTITY starf "★">
-<!ENTITY gne "≩">
-<!ENTITY gammad "Ϝ">
-<!ENTITY napos "ʼn">
-<!ENTITY sup "⊃">
-<!ENTITY dArr "⇓">
-<!ENTITY Larr "↞">
-<!ENTITY nVDash "⊯">
-<!ENTITY boxhU "╧">
-<!ENTITY Ggr "Γ">
-<!ENTITY Idigr "Ϊ">
-<!ENTITY AElig "Æ">
-<!ENTITY Idot "İ">
-<!ENTITY Lacute "Ĺ">
-<!ENTITY sharp "♯">
-<!ENTITY Ubrcy "Ў">
-<!ENTITY lsqb "[">
-<!ENTITY micro "µ">
-<!ENTITY Sub "⋐">
-<!ENTITY agr "α">
-<!ENTITY nap "≉">
-<!ENTITY sfgr "ς">
-<!ENTITY block "█">
-<!ENTITY nspar "∦">
-<!ENTITY supnE "⊋">
-<!ENTITY prsim "≾">
-<!ENTITY shcy "ш">
-<!ENTITY dblac "˝">
-<!ENTITY xhArr "↔">
-<!ENTITY dtri "▿">
-<!ENTITY barwed "⊼">
-<!ENTITY zcy "з">
-<!ENTITY agrave "à">
-<!ENTITY par "∥">
-<!ENTITY vsupne "⊋">
-<!ENTITY Scy "С">
-<!ENTITY zdot "ż">
-<!ENTITY rsquor "‘">
-<!ENTITY Delta "Δ">
-<!ENTITY nVdash "⊮">
-<!ENTITY Pgr "Π">
-<!ENTITY gamma "γ">
-<!ENTITY tau "τ">
-<!ENTITY Ecirc "Ê">
-<!ENTITY sung "♩">
-<!ENTITY natur "♮">
-<!ENTITY or "∨">
-<!ENTITY vsubne "⊊">
-<!ENTITY Jcy "Й">
-<!ENTITY square "□">
-<!ENTITY b.zeta "ζ">
-<!ENTITY b.Psi "Ψ">
-<!ENTITY gbreve "ğ">
-<!ENTITY Kcedil "Ķ">
-<!ENTITY ohm "Ω">
-<!ENTITY frac35 "⅗">
-<!ENTITY ssetmn "∖">
-<!ENTITY boxUR "╘">
-<!ENTITY frac34 "¾">
-<!ENTITY target "⌖">
-<!ENTITY cularr "↶">
-<!ENTITY xcirc "○">
-<!ENTITY boxhD "╤">
-<!ENTITY iecy "е">
-<!ENTITY Euml "Ë">
-<!ENTITY half "½">
-<!ENTITY rang "〉">
-<!ENTITY numero "№">
-<!ENTITY Ugr "Υ">
-<!ENTITY times "×">
-<!ENTITY semi ";">
-<!ENTITY rharu "⇀">
-<!ENTITY iocy "ё">
-<!ENTITY b.gammad "Ϝ">
-<!ENTITY thinsp " ">
-<!ENTITY lozf "✦">
-<!ENTITY plusb "⊞">
-<!ENTITY tilde "˜">
-<!ENTITY Aogon "Ą">
-<!ENTITY Eogon "Ę">
-<!ENTITY blk12 "▒">
-<!ENTITY pre "≼">
-<!ENTITY boxHd "╦">
-<!ENTITY piv "ϖ">
-<!ENTITY ncaron "ň">
-<!ENTITY wcirc "ŵ">
-<!ENTITY utri "▵">
-<!ENTITY Prime "″">
-<!ENTITY cedil "¸">
-<!ENTITY idigr "ϊ">
-<!ENTITY curren "¤">
-<!ENTITY laquo "«">
-<!ENTITY ulcrop "⌏">
-<!ENTITY ring "˚">
-<!ENTITY oacute "ó">
-<!ENTITY Nacute "Ń">
-<!ENTITY permil "‰">
-<!ENTITY oacgr "ό">
-<!ENTITY b.phis "φ">
-<!ENTITY frac78 "⅞">
-<!ENTITY blk34 "▓">
-<!ENTITY gnsim "⋧">
-<!ENTITY boxVH "╫">
-<!ENTITY zhcy "ж">
-<!ENTITY b.phiv "ϕ">
-<!ENTITY loz "◊">
-<!ENTITY Ngr "Ν">
-<!ENTITY phgr "φ">
-<!ENTITY b.iota "ι">
-<!ENTITY ETH "Ð">
-<!ENTITY trade "™">
-<!ENTITY Cup "⋓">
-<!ENTITY subnE "⊊">
-<!ENTITY PHgr "Φ">
-<!ENTITY xi "ξ">
-<!ENTITY Rcy "Р">
-<!ENTITY ggr "γ">
-<!ENTITY Lmidot "Ŀ">
-<!ENTITY Scirc "Ŝ">
-<!ENTITY rtrif "▸">
-<!ENTITY larrtl "↢">
-<!ENTITY eDot "≑">
-<!ENTITY boxVL "╢">
-<!ENTITY THgr "Θ">
-<!ENTITY Dstrok "Đ">
-<!ENTITY cent "¢">
-<!ENTITY odash "⊝">
-<!ENTITY boxUl "╜">
-<!ENTITY ape "≊">
-<!ENTITY gEl "⋛">
-<!ENTITY nltri "⋪">
-<!ENTITY Aacute "Á">
-<!ENTITY cuvee "⋎">
-<!ENTITY gnE "≩">
-<!ENTITY kgr "κ">
-<!ENTITY iogon "į">
-<!ENTITY rarrtl "↣">
-<!ENTITY sccue "≽">
-<!ENTITY IOcy "Ё">
-<!ENTITY sext "✶">
-<!ENTITY uplus "⊎">
-<!ENTITY ecolon "≕">
-<!ENTITY nlArr "⇍">
-<!ENTITY scap "≿">
-<!ENTITY rarrlp "↬">
-<!ENTITY ngE "≱">
-<!ENTITY nsim "≁">
-<!ENTITY Acy "А">
-<!ENTITY emacr "ē">
-<!ENTITY Jcirc "Ĵ">
-<!ENTITY ltimes "⋉">
-<!ENTITY Bcy "Б">
-<!ENTITY b.Sigma "Σ">
-<!ENTITY cup "∪">
-<!ENTITY fork "⋔">
-<!ENTITY frac25 "⅖">
-<!ENTITY setmn "∖">
-<!ENTITY bsol "\">
-<!ENTITY Ycy "Ы">
-<!ENTITY b.Phi "Φ">
-<!ENTITY Gcedil "Ģ">
-<!ENTITY frac23 "⅔">
-<!ENTITY Iogon "Į">
-<!ENTITY blank "␣">
-<!ENTITY vprop "∝">
-<!ENTITY boxVR "╟">
-<!ENTITY ecy "э">
-<!ENTITY OHacgr "Ώ">
-<!ENTITY yen "¥">
-<!ENTITY hairsp " ">
-<!ENTITY plusdo "∔">
-<!ENTITY lvnE "≨">
-<!ENTITY boxUr "╚">
-<!ENTITY breve "˘">
-<!ENTITY rtimes "⋊">
-<!ENTITY gnap "">
-<!ENTITY rtrie "⊵">
-<!ENTITY Mcy "М">
-<!ENTITY chi "χ">
-<!ENTITY tdot "⃛">
-<!ENTITY PSgr "Ψ">
-<!ENTITY Umacr "Ū">
-<!ENTITY caret "⁁">
-<!ENTITY xutri "△">
-<!ENTITY CHcy "Ч">
-<!ENTITY djcy "ђ">
-<!ENTITY lambda "λ">
-<!ENTITY Tstrok "Ŧ">
-<!ENTITY puncsp " ">
-<!ENTITY Ll "⋘">
-<!ENTITY aacgr "ά">
-<!ENTITY xdtri "▽">
-<!ENTITY GJcy "Ѓ">
-<!ENTITY gdot "ġ">
-<!ENTITY sub "⊂">
-<!ENTITY mid "∣">
-<!ENTITY dzcy "џ">
-<!ENTITY igrave "ì">
-<!ENTITY Emacr "Ē">
-<!ENTITY Rcedil "Ŗ">
-<!ENTITY gt ">">
-<!ENTITY larrlp "↫">
-<!ENTITY harr "↔">
-<!ENTITY thgr "θ">
-<!ENTITY map "↦">
-<!ENTITY drarr "↘">
-<!ENTITY boxVh "╬">
-<!ENTITY ijlig "ij">
-<!ENTITY tcedil "ţ">
-<!ENTITY dlcrop "⌍">
-<!ENTITY prnsim "⋨">
-<!ENTITY ecir "≖">
-<!ENTITY rgr "ρ">
-<!ENTITY deg "°">
-<!ENTITY lap "≲">
-<!ENTITY KJcy "Ќ">
-<!ENTITY Cdot "Ċ">
-<!ENTITY Uogon "Ų">
-<!ENTITY not "¬">
-<!ENTITY dash "‐">
-<!ENTITY nexist "∄">
-<!ENTITY Lt "≪">
-<!ENTITY b.Upsi "ϒ">
-<!ENTITY Atilde "Ã">
-<!ENTITY edot "ė">
-<!ENTITY Ncedil "Ņ">
-<!ENTITY els "⋜">
-<!ENTITY erDot "≓">
-<!ENTITY boxVl "╣">
-<!ENTITY scy "с">
-<!ENTITY ulcorn "⌜">
-<!ENTITY eacgr "έ">
-<!ENTITY Itilde "Ĩ">
-<!ENTITY Zacute "Ź">
-<!ENTITY xharr "↔">
-<!ENTITY gl "≷">
-<!ENTITY chcy "ч">
-<!ENTITY Oacute "Ó">
-<!ENTITY itilde "ĩ">
-<!ENTITY Ycirc "Ŷ">
-<!ENTITY nhArr "⇎">
-<!ENTITY Lstrok "Ł">
-<!ENTITY divide "÷">
-<!ENTITY Tcy "Т">
-<!ENTITY Jukcy "Є">
-<!ENTITY Yacute "Ý">
-<!ENTITY boxv "│">
-<!ENTITY hamilt "ℋ">
-<!ENTITY nu "ν">
-<!ENTITY ngt "≯">
-<!ENTITY jsercy "ј">
-<!ENTITY uml "¨">
-<!ENTITY KHgr "Χ">
-<!ENTITY lstrok "ł">
-<!ENTITY nsupE "⊉">
-<!ENTITY dtrif "▾">
-<!ENTITY vellip "⋮">
-<!ENTITY rceil "⌉">
-<!ENTITY ell "ℓ">
-<!ENTITY Ecy "Э">
-<!ENTITY Jsercy "Ј">
-<!ENTITY ljcy "љ">
-<!ENTITY Kgr "Κ">
-<!ENTITY ngr "ν">
-<!ENTITY sigmav "ς">
-<!ENTITY Gdot "Ġ">
-<!ENTITY rdquor "“">
-<!ENTITY prnap "⋨">
-<!ENTITY tcy "т">
-<!ENTITY frac12 "½">
-<!ENTITY telrec "⌕">
-<!ENTITY vdash "⊢">
-<!ENTITY Zgr "Ζ">
-<!ENTITY Auml "Ä">
-<!ENTITY Ocirc "Ô">
-<!ENTITY uogon "ų">
-<!ENTITY hArr "⇔">
-<!ENTITY nge "≱">
-<!ENTITY iacute "í">
-<!ENTITY Cacute "Ć">
-<!ENTITY Omacr "Ō">
-<!ENTITY equiv "≡">
-<!ENTITY vltri "⊲">
-<!ENTITY eta "η">
-<!ENTITY SHcy "Ш">
-<!ENTITY percnt "%">
-<!ENTITY lowbar "_">
-<!ENTITY frac16 "⅙">
-<!ENTITY lrarr2 "⇆">
-<!ENTITY nles "≰">
-<!ENTITY bump "≎">
-<!ENTITY veebar "⊻">
-<!ENTITY Wcirc "Ŵ">
-<!ENTITY frac15 "⅕">
-<!ENTITY bumpe "≏">
-<!ENTITY egrave "è">
-<!ENTITY frac14 "¼">
-<!ENTITY supe "⊇">
-<!ENTITY rfloor "⌋">
-<!ENTITY Dgr "Δ">
-<!ENTITY frac13 "⅓">
-<!ENTITY ge "≥">
-<!ENTITY boxVr "╠">
-<!ENTITY pgr "π">
-<!ENTITY kgreen "ĸ">
-<!ENTITY boxh "─">
-<!ENTITY Lambda "Λ">
-<!ENTITY ugrave "ù">
-<!ENTITY emsp13 " ">
-<!ENTITY becaus "∵">
-<!ENTITY sce "≽">
-<!ENTITY grave "`">
-<!ENTITY zeta "ζ">
-<!ENTITY b.Theta "Θ">
-<!ENTITY eth "ð">
-<!ENTITY Ouml "Ö">
-<!ENTITY check "✓">
-<!ENTITY hybull "⁃">
-<!ENTITY Gg "⋙">
-<!ENTITY Ccaron "Č">
-<!ENTITY plus "+">
-<!ENTITY fllig "fl">
-<!ENTITY forall "∀">
-<!ENTITY dcaron "ď">
-<!ENTITY gacute "ǵ">
-<!ENTITY sc "≻">
-<!ENTITY OHgr "Ω">
-<!ENTITY emsp14 " ">
-<!ENTITY hellip "…">
-<!ENTITY lhard "↽">
-<!ENTITY sstarf "⋆">
-<!ENTITY samalg "∐">
-<!ENTITY EEgr "Η">
-<!ENTITY rhov "ϱ">
-<!ENTITY b.epsi "ε">
-<!ENTITY lsquo "‘">
-]>
-<book id="jboss_portal_reference_guide">
-<!--<book lang="en">
- <bookinfo>
- <title>JBoss Portal Reference Guide</title>
- <subtitle>JBoss Portal Reference Guide</subtitle>
- <edition>2.7.0</edition>
- <pubsnumber>1</pubsnumber>
- <productname>JBoss Portal</productname>
- <productnumber>2.7</productnumber>
- <pubdate>Nov, 2007</pubdate>
- <isbn>N/A</isbn>
-
-
- <abstract><para>This document is an outline of the information plan for JBoss AS 5 GA project's documentation.</para></abstract>
-
-
-
-
-
-
-
- <xi:include href="Author_Group.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- </bookinfo>
- -->
- <!--<toc/>-->
- <bookinfo id="JBoss_Portal_Reference_Guide">
- <title>JBoss Portal Reference Guide</title>
- <subtitle>JBoss Portal 2.7 Reference Guide</subtitle>
- <edition>2</edition>
- <pubsnumber>7</pubsnumber>
- <productname>JBoss Portal</productname>
- <productnumber>2.7</productnumber>
- <pubdate>Oct, 2007</pubdate>
- <isbn>N/A</isbn>
-
-
-
- <abstract><para>This book is a JBoss Portal 2.7 Reference Guide.</para>
- </abstract>
- <corpauthor>
- <inlinemediaobject>
- <imageobject>
- <imagedata fileref="Common_Content/images/redhat-logo.svg"/>
- </imageobject>
- </inlinemediaobject>
- </corpauthor>
-
- <copyright>
- <year>&YEAR;</year>
- <holder>&HOLDER;</holder>
- </copyright>
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Common_Content/Legal_Notice.xml"/>
- <authorgroup><corpauthor> JBoss Portal Team </corpauthor>
-
-
-<author>
- <firstname>Thomas</firstname>
- <surname>Heute</surname>
- <email>theute(a)jboss.org</email>
- </author>
- <author>
- <firstname>Julien</firstname>
- <surname>Viet</surname>
- <email>julien(a)jboss.org</email>
- </author>
- <author>
- <firstname>Roy</firstname>
- <surname>Russo</surname>
- </author>
- <author>
- <firstname>Boleslaw</firstname>
- <surname>Dawidowicz</surname>
- <email>boleslaw dot dawidowicz at redhat dot com</email>
- </author>
- <author>
- <firstname>Chris</firstname>
- <surname>Laprun</surname>
- <email>chris.laprun(a)jboss.com</email>
- </author>
- <author>
- <firstname>Murray</firstname>
- <surname>McAllister</surname>
- <email>mmcallis(a)redhat.com</email>
- </author>
-
-
-
-</authorgroup>
-</bookinfo>
-
- <preface id="trademarks">
- <title>Please Read: Important Trademark Information</title>
- <para>
- Sun, JavaServer, JSP, Java, JMX, JDK, Java runtime environment, J2EE, JVM, Javadoc, 100% Pure Java, JDBC, and JavaScript are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.
- </para>
- <para>
- JBoss is a registered trademark of Red Hat, Inc. in the U.S. and other countries.
- </para>
- <para>
- Red Hat is a registered trademark of Red Hat, Inc. in the United States and other countries.
- </para>
- <para>
- Oracle is a registered trademark of Oracle International Corporation.
- </para>
- <para>
- Microsoft, Windows, Active Directory, and SQL Server are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.
- </para>
- <para>
- Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.
- </para>
- <para>
- UNIX is a registered trademark of The Open Group.
- </para>
- <para>
- MySQL is a trademark or registered trademark of MySQL AB in the U.S. and other countries.
- </para>
- <para>
- Apache is a trademark of The Apache Software Foundation.
- </para>
- <para>
- Mac and Mac OS are trademarks of Apple Inc., registered in the U.S. and other countries.
- </para>
- <para>
- All other trademarks referenced herein are the property of their respective owners.
- </para>
-</preface><!--To do:
-
-Apache?
-
-Linux?
-
-
-All the sun stuff
-
-
-
-Microsoft?
-
-
-Mail them first (see Apache Jackrabbit)
-
-
-
-
-
-'Apache is a trademark of The Apache Software Foundation, and is used with permission.' This is not necessary in the case of all-inclusive attribution language such as, 'All marks are the properties of their respective owners.' Contact the ASF Public Relations Committee <prc(a)apache.org> with all inquiries regarding trademark issues -->
-<!-- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Overview.xml" />-->
-<!-- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Featurelist.xml" />-->
- <preface id="target" revision="1">
- <title>Target Audience</title>
- <para>
- This guide is aimed towards portlet developers, portal administrators, and those wishing to
- implement and extend the JBoss Portal framework. For end-user documentation, please refer to the JBoss Portal User Manual from the <ulink url="http://labs.jboss.com/portal/jbossportal/docs/index.html">JBoss Portal Documentation Library</ulink>
- .</para>
-</preface>
-<!-- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Acknowledgements.xml" />-->
- <chapter id="supportedversions">
- <!-- <chapterinfo>
- <author>
- <firstname>Thomas</firstname>
- <surname>Heute</surname>
- </author>
- <author>
- <firstname>Roy</firstname>
- <surname>Russo</surname>
- </author>
- </chapterinfo>-->
- <title>System Requirements</title>
- <para>
- The following chapter details hardware and software versions that are compatible with JBoss Portal. The hardware and software listed has either been tested, or reported as working by users. Before reporting a problem, make sure you are using compatible hardware and software.
- </para>
- <para>
- If you successfully installed JBoss Portal on versions not listed here, please let us know so it can be added to this section.
- </para>
- <section>
- <title>Minimum System Requirements</title>
- <para>
- <itemizedlist>
- <listitem><para>JDK 5 (JDK 6 is not part of the test platform)</para></listitem>
- <listitem><para>512 MB RAM</para></listitem>
- <listitem><para>100 MB hard disk space</para></listitem>
- <listitem><para>400 MHz CPU</para></listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>Supported Operating Systems</title>
- <para>JBoss Portal is <trademark class="trade">100% Pure Java</trademark>, and therefore it is interoperable with most operating systems
- capable of running a Java Virtual Machine (<trademark class="trade">JVM</trademark>), including <trademark class="registered">Linux</trademark>, <trademark class="registered">Windows</trademark>, <trademark class="registered">UNIX</trademark> operating systems, and Mac OS X.
- </para>
- </section>
- <section>
- <title>JBoss Application Server</title>
- <para>JBoss Portal 2.7.0 is tested with JBoss Application Server (AS) JBoss AS 4.2.3, JBoss Enterprise Application Platform (EAP) 4.2 and JBoss EAP 4.3. It is highly recommended that customers who have access to the <ulink url="https://support.redhat.com/portal/login.html">JBoss Customer Support Portal (CSP)</ulink> use JBoss EAP 4.3. Customers who do not have access to the JBoss CSP should use <ulink url="http://labs.jboss.com/jbossas/">JBoss AS</ulink>.
- </para>
- <warning>
- <para>JBoss AS versions 4.0.<replaceable>x</replaceable> are not supported.</para>
- </warning>
- </section>
- <section id="supportedversions-db">
- <title>Databases</title>
- <para>JBoss Portal is database-agnostic. The following list outlines known-to-be-working database vendor and version combinations:</para>
- <itemizedlist>
- <listitem><para><trademark class="registered">MySQL</trademark> 4 (use <ulink url="http://dev.mysql.com/downloads/connector/j/3.1.html">Connector/J 3.1</ulink>) and 5 (<ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=AvoidMySQL5DataTruncationErrors">known issue</ulink>)</para></listitem>
- <listitem><para>PostgreSQL 8.<replaceable>x</replaceable></para></listitem>
- <listitem><para>Hypersonic SQL</para></listitem>
- <listitem><para>Apache Derby</para></listitem>
- <listitem><para><trademark class="registered">Oracle</trademark> Database 9 and 10g (use the <ulink url="http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html">latest driver from the Oracle 10 branch</ulink> even if you are running Oracle 9)</para></listitem>
- <listitem><para><trademark class="registered">Microsoft</trademark><trademark class="registered"> SQL Server</trademark></para></listitem>
- <listitem><para>MaxDB</para></listitem>
- </itemizedlist>
- <para>JBoss Portal employs Hibernate as an interface to a Relational Database Management System (RDBMS). Most Relational Database Management Systems supported by Hibernate will work with JBoss Portal.</para>
- </section>
- <section>
- <title>Source Building</title>
- <para>The source building mechanism works on Linux, Windows, Mac OS X, and UNIX operating systems.</para>
- </section>
-</chapter>
- <chapter id="installation">
- <title>Installation</title>
- <para>
- Depending on your needs, there are several different methods to install JBoss
- Portal. Pre-configured clustered versions (
- <computeroutput>JBoss Portal Binary (Clustered)</computeroutput>
- ) are available from the
- <ulink url="http://labs.jboss.com/portal/jbossportal/download/index.html">
- JBoss Portal Downloads
- </ulink>
- page. Clustered versions of JBoss Portal must be deployed in the
- <filename>JBOSS_INSTALLATION_DIRECTORY/server/all/deploy/</filename>
- directory. All JBoss AS instances must reference the same datasource. Refer to
- <xref linkend="install_source_env"/>
- for details on how to configure JBoss Portal for clustering.
- </para>
- <para>
- An environment variable,
- <computeroutput>JBOSS_HOME</computeroutput>
- , is configured in
- <xref linkend="install_source_env"/>
- . References to
- <computeroutput>$JBOSS_HOME</computeroutput>
- assume this to be your
- <replaceable>JBOSS_INSTALLATION_DIRECTORY</replaceable>
- .
- </para>
- <section id="install_bundle">
- <title>The JBoss Portal and JBoss AS Bundle</title>
- <para>
- This is the easiest and fastest way to get JBoss Portal installed and running.
- The JBoss Portal and JBoss AS bundle contains JBoss AS, JBoss Portal, and the
- embedded Hypersonic SQL database. To install the JBoss Portal and JBoss AS
- bundle:
- </para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- <emphasis role="bold">Get the bundle:</emphasis>
- the bundle is available from the
- <ulink url="http://labs.jboss.com/portal/jbossportal/download/index.html">
- JBoss Portal Downloads
- </ulink>
- page. Bundles use the
- <computeroutput>JBoss Portal + JBoss AS</computeroutput>
- naming convention.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">Extract the bundle:</emphasis>
- extract the ZIP archive. It does not matter which directory is used. On
- Windows, the recommended directory is
- <filename>
- C:\jboss-
- <replaceable>version-number</replaceable>
- </filename>
- .
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">Start the server:</emphasis>
- change into the
- <filename>JBOSS_PORTAL_INSTALLATION_DIRECTORY/bin/</filename>
- directory. On Windows, execute
- <command>run.bat</command>
- . On Linux, run the
- <command>sh run.sh</command>
- command. To specify a configuration to use, for example, the default
- configuration, append the
- <command>-c default</command>
- option to the
- <command>run.bat</command>
- or
- <command>sh run.sh</command>
- commands.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">Log in to JBoss Portal:</emphasis>
- using a Web browser, navigate to
- <ulink url="http://localhost:8080/portal"/>
- to open the JBoss Portal homepage. Log in using one of the two default
- accounts: username
- <emphasis>user</emphasis>
- , password
- <emphasis>user</emphasis>
- , or username
- <emphasis>admin</emphasis>
- , password
- <emphasis>admin</emphasis>
- :
- </para>
- </listitem>
- </orderedlist>
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/common/frontpage.png" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <formalpara>
- <title>SQL Errors</title>
- <para>
- Tables are automatically created the first time JBoss Portal starts. When
- deployed for the first time, JBoss Portal checks for the existence of the
- initial tables, which have not been created yet. This causes errors such as
- the following, which can safely be ignored:
- </para>
- </formalpara>
- <para>
- <programlisting><![CDATA[
-WARN [JDBCExceptionReporter] SQL Error: -22, SQLState: S0002
-ERROR [JDBCExceptionReporter] Table not found in statement ...
-WARN [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
-ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_repositoryentry' doesn't exist
-WARN [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
-ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_version_refs' doesn't exist]]></programlisting>
- </para>
- </section>
- <section id="install_binary">
- <title>Installing the Binary Download</title>
- <para>
- The binary package typically consists of the
- <filename>jboss-portal.sar/</filename>
- directory, documentation such as the JBoss Portal User Guide and the JBoss Portal
- Reference Guide, and a set of pre-configured Datasource descriptors that allow
- JBoss Portal to communicate with an external database. This installation method
- is recommended for users who already have JBoss EAP or JBoss AS installed, or
- those who need to install JBoss Portal in a clustered environment.
- </para>
- <section>
- <title>Setting up your Environment</title>
- <section id="install_binarydownload">
- <title>Getting the Binary</title>
- <para>
- The binary download is available from the
- <ulink url="http://labs.jboss.com/portal/jbossportal/download/index.html">
- JBoss Portal Downloads
- </ulink>
- page. Look for the
- <computeroutput>JBoss Portal Binary</computeroutput>
- package. Once the binary ZIP file has been downloaded and extracted, the
- folder hierarchy will look similar to the following:
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/setup/package.png"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- Files contained in this download are used in later sections. Download and
- extract the JBoss Portal binary ZIP file before proceeding.
- </para>
- </section>
- <section>
- <title>JBoss EAP and JBoss AS Setup</title>
- <para>
- Before deploying JBoss Portal, make sure you have JBoss EAP or JBoss AS
- installed. Customers who have access to the
- <ulink url="https://support.redhat.com/portal/login.html">
- JBoss Customer Support Portal (CSP)
- </ulink>
- are advised to download and install JBoss EAP 4.3. Customers who do not
- have access to the JBoss CSP are advised to use
- <ulink url="http://labs.jboss.com/jbossas/downloads/">JBoss AS</ulink>
- . For JBoss AS installation instructions, please refer to the
- <ulink url="http://labs.jboss.com/jbossas/docs/index.html">
- JBoss AS Installation Guide
- </ulink>
- .
- </para>
- <warning>
- <title>Use the JBoss EAP and JBoss AS ZIP file</title>
- <para>
- Only use the JBoss EAP and JBoss AS ZIP file versions.
- <emphasis role="bold">
- DO NOT ATTEMPT to deploy JBoss Portal on the installer version of
- JBoss EAP or JBoss AS.
- </emphasis>
- </para>
- </warning>
- </section>
- <section id="install_source_env_0">
- <title>Operating System Environment Settings</title>
- <para>
- For JBoss EAP, JBoss AS, and build targets to work, you must configure a
- <filename>JBOSS_HOME</filename>
- environment variable. This environment variable must point to the root
- directory of the JBoss EAP or JBoss AS installation directory, which is the
- directory where the JBoss EAP or JBoss AS files were extracted to.
- </para>
- <para>
- On Windows, this is accomplished by going to
- <emphasis>
- Start > Settings > Control Panel > System > Advanced > Environment
- Variables
- </emphasis>
- . Under the
- <emphasis>System Variables</emphasis>
- section, click
- <emphasis>New</emphasis>
- . Set the
- <filename>JBOSS_HOME</filename>
- environment variable to the location of your JBoss EAP or JBoss AS
- installation directory:
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/setup/win_envsetup.gif"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- To configure the
- <filename>JBOSS_HOME</filename>
- environment variable on Linux:
- </para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- Add the following line to the
- <filename>~/.bashrc</filename>
- file. Note: this must be configured while logged in as the user
- who runs JBoss EAP or JBoss AS:
- </para>
- <para>
- <programlisting>
- export JBOSS_HOME=/path/to/jboss/installation/
- </programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- Run the following command to enable the
- <filename>JBOSS_HOME</filename>
- environment variable:
- </para>
- <para>
- <programlisting>source ~/.bashrc</programlisting>
- </para>
- </listitem>
- </orderedlist>
- </para>
- <note>
- <title>
- JBoss EAP
- <filename>JBOSS_HOME</filename>
- Environment Variable
- </title>
- <para>
- If you are running JBoss EAP, configure the
- <filename>JBOSS_HOME</filename>
- environment variable to point to the
- <filename>
- /path/to/jboss-eap-
- <replaceable>version</replaceable>
- /jboss-as/
- </filename>
- directory.
- </para>
- </note>
- </section>
- <section>
- <title>Database Setup</title>
- <para>
- A database is required for JBoss Portal to run. JBoss EAP and JBoss AS
- include an embedded Hypersonic SQL database that JBoss Portal can use;
- however, this is only recommended for developer use. The following
- databases are recommended for production use, and have had test suites run
- against them:
- <trademark class="registered">MySQL</trademark>
- 4 and 5,
- <trademark class="registered">Microsoft</trademark>
- <trademark class="registered">SQL Server</trademark>
- , PostgreSQL 8, and
- <trademark class="registered">Oracle</trademark>
- Database 9 and 10. JBoss Portal can use any database that is supported by
- Hibernate.
- </para>
- <para>To configure a database to use with JBoss Portal:</para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- <emphasis role="bold">Create a new database:</emphasis>
- this guide assumes that the new database is called
- <emphasis>jbossportal</emphasis>
- .
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- Grant access rights for a user to the
- <emphasis>jbossportal</emphasis>
- database:
- </emphasis>
- JBoss Portal needs to create tables and modify table data. Grant
- access rights to a desired user to the
- <emphasis>jbossportal</emphasis>
- database. Configure the same username and password in the
- Datasource descriptor.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- Deploy an RDBMS
- <trademark class="trade">JDBC</trademark>
- connector:
- </emphasis>
- an RDBMS JDBC connector is required for JBoss Portal to
- communicate with a database. Copy the connector into the
- <filename>$JBOSS_HOME/server/default/lib/</filename>
- directory. For example, an RDBMS JDBC connector for MySQL can be
- download from
- <ulink url="http://www.mysql.com/products/connector/j/"/>
- . For the correct RDMBS JDBC connector, please refer to the
- database documentation.
- </para>
- </listitem>
- </orderedlist>
- </para>
- </section>
- <section>
- <title>Datasource Descriptors</title>
- <para>
- The JBoss Portal binary download that was extracted in
- <xref linkend="install_binarydownload"/>
- , contains pre-configured Datasource descriptors for the more popular
- databases. Datasource descriptors are provided for the MySQL 4 and 5,
- PostgreSQL, Microsoft SQL Server, and Oracle databases, and can be found in
- the
- <filename>setup</filename>
- subdirectory where the JBoss Portal binary was extracted to:
- </para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/setup/dsfiles.png"/>
- </imageobject>
- </mediaobject>
- <para>
- Copy the Datasource descriptor that matches your database into the
- <filename>
- $JBOSS_HOME/server/
- <replaceable>configuration</replaceable>
- /deploy/
- </filename>
- directory, where
- <replaceable>configuration</replaceable>
- is either all, default, minimal or production. The production configuration
- only exists on JBoss EAP, and not JBoss AS. For example, if you are using
- the all configuration, copy the Datasource descriptor into the
- <filename>$JBOSS_HOME/server/all/deploy/</filename>
- directory.
- </para>
- <para>
- After the Datasource descriptor has been copied into the
- <filename>deploy</filename>
- directory, make sure the
- <computeroutput>user-name</computeroutput>
- ,
- <computeroutput>password</computeroutput>
- ,
- <computeroutput>connection-url</computeroutput>
- , and
- <computeroutput>driver-class</computeroutput>
- , are correct for your chosen database. Datasource descriptor files can be
- deployed to test before being used in production. The following is an
- example Datasource descriptor for a PostgreSQL database:
- </para>
- <programlisting role="XML">
- <![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<datasources>
- <local-tx-datasource>
- <jndi-name>PortalDS</jndi-name>
- <connection-url>jdbc:postgresql:jbossportal</connection-url>
- <driver-class>org.postgresql.Driver</driver-class>
- <user-name>portal</user-name>
- <password>portalpassword</password>
- </local-tx-datasource>
-</datasources>]]></programlisting>
- <para>
- For further details about Datasource descriptors, please refer to the
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=CreateAJDBCDataSource">
- JBoss JDBC Datasource Wiki page
- </ulink>
- .
- </para>
- </section>
- </section>
- <section>
- <title>Deploying JBoss Portal</title>
- <para>To start JBoss EAP or JBoss AS and deploy JBoss Portal:</para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- <emphasis role="bold">Datasource descriptor:</emphasis>
- if you have not done so already, change into the
- <filename>setup</filename>
- subdirectory where the JBoss Portal binary was extracted to. Copy the
- correct Datasource descriptor file (
- <filename>*-ds.xml</filename>
- ) you modified in the previous steps into the
- <filename>
- $JBOSS_HOME/server/
- <replaceable>configuration</replaceable>
- /deploy/
- </filename>
- directory.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">Start the server:</emphasis>
- change into the
- <filename>$JBOSS_HOME/bin/</filename>
- directory. On Windows, execute
- <command>run.bat</command>
- . On Linux, run the
- <command>sh run.sh</command>
- command. To specify a configuration to use, for example, the default
- configuration, append the
- <command>-c default</command>
- option to the
- <command>run.bat</command>
- or
- <command>sh run.sh</command>
- commands.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">Log in to JBoss Portal:</emphasis>
- using a Web browser, navigate to
- <ulink url="http://localhost:8080/portal"/>
- to open the JBoss Portal homepage. Log in using one of the two
- default accounts: username
- <emphasis>user</emphasis>
- , password
- <emphasis>user</emphasis>
- , or username
- <emphasis>admin</emphasis>
- , password
- <emphasis>admin</emphasis>
- .
- </para>
- </listitem>
- </orderedlist>
- </para>
- <formalpara>
- <title>SQL Errors</title>
- <para>
- Tables are automatically created the first time JBoss Portal starts. When
- deployed for the first time, JBoss Portal checks for the existence of the
- initial tables, which have not been created yet. This causes errors such as
- the following, which can safely be ignored:
- </para>
- </formalpara>
- <para>
- <programlisting><![CDATA[
-WARN [JDBCExceptionReporter] SQL Error: -22, SQLState: S0002
-ERROR [JDBCExceptionReporter] Table not found in statement ...
-WARN [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
-ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_repositoryentry' doesn't exist
-WARN [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
-ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_version_refs' doesn't exist
-]]></programlisting>
- </para>
- </section>
- </section>
- <section id="install_source">
- <title>Installing from the Sources</title>
- <section>
- <title>Getting the Sources</title>
- <para>
- The JBoss Portal source files can be obtained from the
- <ulink url="http://labs.jboss.com/portal/jbossportal/download/index.html">
- JBoss Portal Downloads
- </ulink>
- page. The source files download uses a
- <filename>JBoss Portal Source Code</filename>
- naming convention. As well, the sources can be obtained from SVN. The latest
- sources for the 2.7.
- <replaceable>x</replaceable>
- versions are located at
- <ulink url="http://anonsvn.jboss.org/repos/portal/branches/JBoss_Portal_Branch_2_7"/>
- .
- </para>
- <para>
- Several modules have been extracted from the JBoss Portal SVN repository.
- These modules have a different lifecycle and a different version scheme. The
- following is a list of modules used in JBoss Portal 2.7.0, and the locations
- of their source code:
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- JBoss Portal Common 1.2.1:
- <emphasis>
- http://anonsvn.jboss.org/repos/portal/modules/common/tags/JBP_COMMON_1_2_1
- </emphasis>
- </para>
- </listitem>
- <listitem>
- <para>
- JBoss Portal Web 1.2.1:
- <emphasis>
- http://anonsvn.jboss.org/repos/portal/modules/web/tags/JBP_WEB_1_2_1
- </emphasis>
- </para>
- </listitem>
- <listitem>
- <para>
- JBoss Portal Test 1.0.3:
- <emphasis>
- http://anonsvn.jboss.org/repos/portal/modules/test/tags/JBP_TEST_1_0_3
- </emphasis>
- </para>
- </listitem>
- <listitem>
- <para>
- JBoss Portal Portlet 2.0.3:
- <emphasis>
- http://anonsvn.jboss.org/repos/portal/modules/portlet/tags/JBP_PORTLET_2_0_3
- </emphasis>
- </para>
- </listitem>
- <listitem>
- <para>
- JBoss Portal Identity 1.0.4:
- <emphasis>
- http://anonsvn.jboss.org/repos/portal/modules/identity/tags/JBP_IDENTITY_...
- </emphasis>
- </para>
- </listitem>
- <listitem>
- <para>
- JBoss Portal CMS 1.2.0:
- <emphasis>
- http://anonsvn.jboss.org/repos/portal/modules/cms/tags/JBP_CMS_1_2_0
- </emphasis>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- After checking out the source from SVN, or after extracting the
- <filename>JBoss Portal Source Code</filename>
- ZIP file, a directory structure similar to the following will be created:
- </para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/setup/svncodir.png"/>
- </imageobject>
- </mediaobject>
- <para>
- If the source files were obtained from SVN, change into the
- <filename>trunk/src/</filename>
- directory to see the directories from the above image. As well, there is an
- empty
- <filename>thirdparty</filename>
- directory. This directory contains files after building the JBoss Portal
- source code (refer to
- <xref linkend="building_deploying_from_source"/>
- ). For more information about the JBoss Portal SVN repository, and accessing
- different versions of the JBoss Portal codebase, refer to the
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=PortalSVNRepo">
- JBoss Portal SVN Repo
- </ulink>
- page on the JBoss Wiki.
- </para>
- </section>
- <section>
- <title>JBoss EAP and JBoss AS Setup</title>
- <section>
- <title>JBoss Application Server Setup</title>
- <para>
- Before deploying JBoss Portal, make sure you have JBoss EAP or JBoss AS
- installed. Customers who have access to the
- <ulink url="https://support.redhat.com/portal/login.html">
- JBoss Customer Support Portal (CSP)
- </ulink>
- are advised to download and install JBoss EAP 4.3. Customers who do not
- have access to the JBoss CSP are advised to use
- <ulink url="http://labs.jboss.com/jbossas/downloads/">JBoss AS</ulink>
- . For JBoss AS installation instructions, please refer to the
- <ulink url="http://labs.jboss.com/jbossas/docs/index.html">
- JBoss AS Installation Guide
- </ulink>
- .
- </para>
- <warning>
- <title>Use the JBoss EAP and JBoss AS ZIP file</title>
- <para>
- Only use the JBoss EAP and JBoss AS ZIP file versions.
- <emphasis role="bold">
- DO NOT ATTEMPT to deploy JBoss Portal on the installer version of
- JBoss EAP or JBoss AS.
- </emphasis>
- We are currently working on aligning the Application installer with
- JBoss Portal.
- </para>
- </warning>
- </section>
- <section id="install_source_env">
- <title>Operating System Environment Settings</title>
- <para>
- For JBoss EAP, JBoss AS, and build targets to work, you must configure a
- <filename>JBOSS_HOME</filename>
- environment variable. This environment variable must point to the root
- directory of the JBoss EAP or JBoss AS installation directory, which is the
- directory where the JBoss EAP or JBoss AS files were extracted to.
- </para>
- <para>
- On Windows, this is accomplished by going to
- <emphasis>
- Start > Settings > Control Panel > System > Advanced > Environment
- Variables
- </emphasis>
- . Under the
- <emphasis>System Variables</emphasis>
- section, click
- <emphasis>New</emphasis>
- . Set the
- <filename>JBOSS_HOME</filename>
- environment variable to the location of your JBoss EAP or JBoss AS
- installation directory:
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/setup/win_envsetup.gif"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- To configure the
- <filename>JBOSS_HOME</filename>
- environment variable on Linux:
- </para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- Add the following line to the
- <filename>~/.bashrc</filename>
- file. Note: this must be configured while logged in as the user
- who runs JBoss EAP or JBoss AS:
- </para>
- <para>
- <programlisting>
- export JBOSS_HOME=/path/to/jboss/installation/
- </programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- Run the following command to enable the
- <filename>JBOSS_HOME</filename>
- environment variable:
- </para>
- <para>
- <programlisting>source ~/.bashrc</programlisting>
- </para>
- </listitem>
- </orderedlist>
- </para>
- <note>
- <title>
- JBoss EAP
- <filename>JBOSS_HOME</filename>
- Environment Variable
- </title>
- <para>
- If you are running JBoss EAP, configure the
- <filename>JBOSS_HOME</filename>
- environment variable to point to the
- <filename>
- /path/to/jboss-eap-
- <replaceable>version</replaceable>
- /jboss-as/
- </filename>
- directory.
- </para>
- </note>
- </section>
- </section>
- <section id="building_deploying_from_source">
- <title>Building and Deploying from the Sources</title>
- <para>
- During the first build, third-party libraries are obtained from an online
- repository, so you must be connected to the Internet, and if you are behind a
- proxy server, you need to define your proxy server address and proxy server
- port number. To define a proxy server, add the following line to the
- <filename>$JBOSS_HOME/bin/run.conf</filename>
- file:
- </para>
-
-<!--<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="extras/runconf_javaops.xmlt"/>-->
-<programlisting>JAVA_OPTS=-Dhttp.proxyHost=<proxy-hostname> -Dhttp.proxyPort=<proxy-port></programlisting>
-
- <para>
- Replace
- <replaceable>proxy-hostname</replaceable>
- with the proxy server's hostname, and
- <replaceable>proxy-port</replaceable>
- with the correct proxy server port number.
- </para>
- <para>
- To build and deploy JBoss Portal from the sources, change into the
- <filename>JBOSS_PORTAL_SOURCE_DIRECTORY/build/</filename>
- directory, where
- <filename>JBOSS_PORTAL_SOURCE_DIRECTORY</filename>
- is the directory where the JBoss Portal source code was downloaded to. Then,
- Windows users need to run the
- <command>build.bat deploy</command>
- command, and Linux users need to run the
- <command>sh build.sh deploy</command>
- command.
- </para>
- <para>
- At the end of the build process, the
- <filename>jboss-portal.sar</filename>
- file is copied into the
- <filename>$JBOSS_HOME/server/default/deploy/</filename>
- directory:
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/setup/build_deploy.png" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- <note>
- <title>Portal Modules</title>
- <para>
- The previous steps install a bare version of JBoss Portal. In previous
- versions, several additional modules were deployed as well, but this has
- since been modularized to provide greater flexibility. To deploy
- additional modules, refer to the
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=PortalModules">
- Portal's module list
- </ulink>
- for more information. To deploy all modules at once, change into the
- <filename>build</filename>
- directory. If you are running Linux, run the
- <command>sh build.sh deploy-all</command>
- command. On Windows, run the
- <command>build.bat deploy-all</command>
- command.
- </para>
- </note>
- </para>
- <para>To build the clustered version on Linux operating systems:</para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- Change into the
- <filename>JBOSS_PORTAL_SOURCE_DIRECTORY/build/</filename>
- directory, and run the following command:
- </para>
- <para>
- <programlisting>sh build.sh main</programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- Change into the
- <filename>JBOSS_PORTAL_SOURCE_DIRECTORY/core/</filename>
- directory, and run the following command:
- </para>
- <para>
- <programlisting>sh build.sh deploy-ha</programlisting>
- </para>
- <para>
- After the
- <command>sh build.sh deploy-ha</command>
- command completes, the
- <filename>jboss-portal-ha.sar</filename>
- file is copied into the
- <filename>$JBOSS_HOME/server/all/deploy/</filename>
- directory.
- </para>
- </listitem>
- </orderedlist>
- </para>
- <para>
- To build the clustered version on Windows, repeat the previous steps,
- replacing
- <command>sh build.sh</command>
- with
- <command>build.bat</command>
- .
- </para>
- </section>
- <section>
- <title>Database Setup</title>
- <para>
- A database is required for JBoss Portal to run. JBoss EAP and JBoss AS include
- an embedded Hypersonic SQL database that JBoss Portal can use; however, this
- is only recommended for developer use. The following databases are recommended
- for production use, and have had test suites run against them: MySQL 4 and 5,
- Microsoft SQL Server, PostgreSQL 8, and Oracle Database 9 and 10. JBoss Portal
- can use any database that is supported by Hibernate.
- </para>
- <para>To configure a database to use with JBoss Portal:</para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- <emphasis role="bold">Create a new database:</emphasis>
- this guide assumes that the new database is called
- <emphasis>jbossportal</emphasis>
- .
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- Grant access rights for a user to the
- <emphasis>jbossportal</emphasis>
- database:
- </emphasis>
- JBoss Portal needs to create tables and modify table data. Grant
- access rights to a desired user to the
- <emphasis>jbossportal</emphasis>
- database. Configure the same username and password in the Datasource
- descriptor.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">Deploy an RDBMS JDBC connector:</emphasis>
- an RDBMS JDBC connector is required for JBoss Portal to communicate
- with a database. Copy the connector into the
- <filename>$JBOSS_HOME/server/default/lib/</filename>
- directory. For example, an RDBMS JDBC connector for MySQL can be
- download from
- <ulink url="http://www.mysql.com/products/connector/j/"/>
- . For the correct RDMBS JDBC connector, please refer to the database
- documentation.
- </para>
- </listitem>
- </orderedlist>
- </para>
- </section>
- <section>
- <title>Datasource Configuration</title>
- <para>
- The JBoss Portal binary download that was extracted in
- <xref linkend="install_binarydownload"/>
- , contains pre-configured Datasource descriptors for the more popular
- databases. Datasource descriptors are provided for the MySQL 4 and 5,
- PostgreSQL, Microsoft SQL Server, and Oracle databases, and can be found in
- the
- <filename>setup</filename>
- subdirectory where the JBoss Portal binary was extracted to:
- </para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/setup/dsfiles.png"/>
- </imageobject>
- </mediaobject>
- <para>
- Copy the Datasource descriptor that matches your database into the
- <filename>
- $JBOSS_HOME/server/
- <replaceable>configuration</replaceable>
- /deploy/
- </filename>
- directory, where
- <replaceable>configuration</replaceable>
- is either all, default, minimal, or production. For example, if you are using
- the production configuration, copy the Datasource descriptor into the
- <filename>$JBOSS_HOME/server/production/deploy/</filename>
- directory. The production configuration only exists on JBoss EAP
- installations, and not JBoss AS.
- </para>
- <para>
- After the Datasource descriptor has been copied into the
- <filename>deploy</filename>
- directory, make sure the
- <computeroutput>user-name</computeroutput>
- ,
- <computeroutput>password</computeroutput>
- ,
- <computeroutput>connection-url</computeroutput>
- , and
- <computeroutput>driver-class</computeroutput>
- , are correct for your chosen database. Datasource descriptor files can be
- deployed to test before being used in production. The following is an example
- Datasource descriptor for a PostgreSQL database:
- </para>
- <programlisting role="XML"><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<datasources>
- <local-tx-datasource>
- <jndi-name>PortalDS</jndi-name>
- <connection-url>jdbc:postgresql:jbossportal</connection-url>
- <driver-class>org.postgresql.Driver</driver-class>
- <user-name>portal</user-name>
- <password>portalpassword</password>
- </local-tx-datasource>
-</datasources>
- ]]></programlisting>
- <para>
- For further details about Datasource descriptors, please refer to the
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=CreateAJDBCDataSource">
- JBoss JDBC Datasource Wiki page
- </ulink>
- .
- </para>
- </section>
- </section>
- <section>
- <title>Deploying JBoss Portal</title>
- <para>To start JBoss EAP or JBoss AS and deploy JBoss Portal:</para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- <emphasis role="bold">Datasource descriptor:</emphasis>
- if you have not done so already, change into the
- <filename>setup</filename>
- subdirectory where the JBoss Portal binary was extracted to. Copy the
- correct Datasource descriptor file (
- <filename>*-ds.xml</filename>
- ) you modified in the previous steps into the
- <filename>
- $JBOSS_HOME/server/
- <replaceable>configuration</replaceable>
- /deploy/
- </filename>
- directory.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">Start the server:</emphasis>
- change into the
- <filename>$JBOSS_HOME/bin/</filename>
- directory. On Windows, execute
- <command>run.bat</command>
- . On Linux, run the
- <command>sh run.sh</command>
- command. To specify a configuration to use, for example, the default
- configuration, append the
- <command>-c default</command>
- option to the
- <command>run.bat</command>
- or
- <command>sh run.sh</command>
- commands.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">Log in to JBoss Portal:</emphasis>
- using a Web browser, navigate to
- <ulink url="http://localhost:8080/portal"/>
- to open the JBoss Portal homepage. Log in using one of the two default
- accounts: username
- <emphasis>user</emphasis>
- , password
- <emphasis>user</emphasis>
- , or username
- <emphasis>admin</emphasis>
- , password
- <emphasis>admin</emphasis>
- .
- </para>
- </listitem>
- </orderedlist>
- </para>
- <formalpara>
- <title>SQL Errors</title>
- <para>
- Tables are automatically created the first time JBoss Portal starts. When
- deployed for the first time, JBoss Portal checks for the existence of the
- initial tables, which have not been created yet. This causes errors such as
- the following, which can safely be ignored:
- </para>
- </formalpara>
- <para>
- <programlisting><![CDATA[
-WARN [JDBCExceptionReporter] SQL Error: -22, SQLState: S0002
-ERROR [JDBCExceptionReporter] Table not found in statement ...
-WARN [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
-ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_repositoryentry' doesn't exist
-WARN [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
-ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_version_refs' doesn't exist
-]]></programlisting>
- </para>
- </section>
-
-</chapter>
- <chapter id="configuration">
- <!-- <chapterinfo>
- <author>
- <firstname>Thomas</firstname>
- <surname>Heute</surname>
- </author>
- <author>
- <firstname>Roy</firstname>
- <surname>Russo</surname>
- </author>
- </chapterinfo>-->
- <title>Customizing your Installation</title>
- <para>
- This chapter describes how to customize the default installation. This includes the JBoss EAP or JBoss AS listening port, email and proxy settings, and database dialect settings. For further configuration details, refer to <xref linkend="portaldescriptors"/> and <xref linkend="troubleshooting"/>.
- </para>
- <section>
- <title>Changing the Port</title>
- <para>
- It is common for web services to run on port 80. By default, JBoss EAP and JBoss AS use port 8080. If you can not use <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingPortForwardingWithJBoss">port forwarding</ulink>, it is recommended to change the port JBoss EAP or JBoss AS listens on. To change the default port, open the <filename>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml</filename> file, and edit the <computeroutput>Connector port</computeroutput> value for the <computeroutput>jboss.web</computeroutput> service; however, this configuration only applies to Apache Tomcat:
- </para>
-<programlisting role="XML">
-<Service name="jboss.web">
-<Connector port="8088" address="${jboss.bind.address}"
-</programlisting>
- <para>
- This example changes the default port to port 8088. The JBoss EAP or JBoss AS server must be restarted before the new port settings take affect.
- </para>
- <para>
- The default SSL port is 8843. To enable HTTPS support, refer to the <ulink url="http://docs.jboss.org/jbossas/jboss4guide/r4/html/ch9.chapt.html#d0e21962">JBoss AS Guide</ulink>. For further information, refer to the <ulink url="http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html">Apache Tomcat SSL configuration how-to</ulink>.
- </para>
- <para>
- Please refer to <xref linkend="wsrp-ports"/> to update the WSRP service after having changed the port.
- </para>
- <para>
- <warning>
- <title>Root User Privileges</title>
- <para>
- Linux operating systems require root user privileges to run a service on a port less than 1024. Starting JBoss EAP or JBoss AS on port 80 as a non-privileged user will not work. Running JBoss EAP or JBoss AS as the root user could lead to security breaches.
- </para>
- </warning>
- </para>
- </section>
- <section id="configuration-contextroot">
- <title>Changing the Context Path</title>
- <para>By default, the main JBoss Portal page is accessible by navigating to <emphasis>http://localhost:8080/portal/index.html</emphasis>. This
-can be changed to a different path, for example,
-<emphasis>http://localhost:8080/index.html</emphasis>. The context path can be changed when using the deployed <filename>jboss-portal.sar/</filename>, or before building from source. To change the context path when using the JBoss Portal binary package:
-</para>
-<para>
- <orderedlist>
- <listitem>
- <para>Open the <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/portal-server.war/WEB-INF/jboss-web.xml</emphasis> file. If this file does not exist, copy and save the following example:
- </para>
-<programlisting><![CDATA[
-<?xml version="1.0"?>
-<jboss-web>
- <security-domain>java:jaas/portal</security-domain>
- <context-root>/portal</context-root>
- <replication-config>
- <replication-trigger>SET</replication-trigger>
- </replication-config>
- <resource-ref>
- <res-ref-name>jdbc/PortalDS</res-ref-name>
- <jndi-name>java:PortalDS</jndi-name>
- </resource-ref>
-</jboss-web>]]></programlisting>
- </listitem>
- <listitem>
- <para>Edit the
- <computeroutput><context-root></computeroutput> element with the desired context path:
- </para>
-<programlisting>
-<![CDATA[<context-root>/testing</context-root>]]>
-</programlisting>
- <para>
- Using this example, the main JBoss Portal page would be reached by navigating to <emphasis>http://localhost:8080/testing</emphasis>.
- </para>
- </listitem>
- </orderedlist>
- </para>
- <para>
- To change the context path when building from source:
- </para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- Change into the directory where the <filename>JBoss Portal Source Code</filename> ZIP file was extracted to, or where the source from SVN was checked out to. Copy the <filename>build/etc/local.properties-example</filename> file and save it as <filename>build/local.properties</filename>.
- </para>
- </listitem>
- <listitem>
- <para>
- Open the <filename>build/local.properties</filename> file and edit the <computeroutput>portal.web.context-root</computeroutput> option with the desired context path:
- </para>
-<programlisting>
-# Context root for the portal main servlet
-portal.web.context-root=/testing
-</programlisting>
- <para>
- Using this example, the main JBoss Portal page would be reached by navigating to <emphasis>http://localhost:8080/testing</emphasis>.
- </para>
- </listitem>
- <listitem>
-
- <para>
- To clean the project, make sure you are connected to the Internet, and change into the <filename>build/</filename> directory. Run the <command>ant clean</command> command.
- </para>
- </listitem>
- <listitem>
- <para>
- Rebuild and redeploy JBoss Portal. Refer to <xref linkend="install_source"/> for build instructions.
- </para>
- </listitem>
- </orderedlist>
-</para>
-<section>
- <title>Changing the context-root</title>
- <para>
- By default, Apache Tomcat holds on to the root context, <emphasis>/</emphasis>. You may need to remove the <filename>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/ROOT.war/</filename> directory,
- or add a <filename>jboss-web.xml</filename> file, which declares another
- context-root other than <emphasis>/</emphasis>, under the <filename>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/ROOT.war/WEB-INF/</filename> directory, for the above changes to take affect. The following is an example <filename>jboss-web.xml</filename> file, which changes the Apache Tomcat context path to <computeroutput>/tomcat-root</computeroutput>:
- </para>
-<programlisting role="XML"><![CDATA[
-<?xml version="1.0"?>
-<jboss-web>
- <context-root>/tomcat-root</context-root>
-</jboss-web>]]></programlisting>
-</section>
- </section>
- <section id="configuration-hibdialect">
- <title>Forcing the Database Dialect</title>
- <para>
- This sections describes how to override the Database (DB) dialect settings. Under most circumstances, the auto-detect feature works. If the Hibernate dialect is not working correctly, override the default behavior by following the instructions in this section.
- </para>
- <section>
- <title>Database Dialect Settings for JBoss Portal</title>
- <para>
- All <filename>hibernate.cfg.xml</filename> files in all JBoss Portal modules you intend to use need to be modified. The <filename>hibernate.cfg.xml</filename> files are found in the <filename>jboss-portal.sar/<replaceable>module</replaceable>/conf/hibernate/<replaceable>directory</replaceable>/</filename> directory, where <replaceable>module</replaceable> is the module name, and <replaceable>directory</replaceable> is a directory that, depending on the module, may or may not exist.
- </para>
- <para>
- To modify these files to force the DB dialect, un-comment the following line from each <filename>hibernate.cfg.xml</filename> file in each JBoss Portal module you intend to use, so that it looks like the following:
- </para>
-<programlisting role="XML"><![CDATA[
-<!-- Force the dialect instead of using autodetection -->
-<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
-]]></programlisting>
- <para>
- Note: this example is for a PostgreSQL database. If you use another database, you need to modify <computeroutput>org.hibernate.dialect.PostgreSQLDialect</computeroutput> to reflect the correct database. For a list of supported dialects, refer to the <ulink url="http://www.hibernate.org/hib_docs/v3/reference/en/html/session-configurat...">dialects list on the Hibernate website</ulink>.
- </para>
- </section>
- <section>
- <title>DB Dialect Settings for the CMS Component</title>
- <para>
- To modify the DB dialect setting for the JBoss Portal CMS component:
- </para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- Open the <filename>jboss-portal.sar/portal-cms.sar/conf/hibernate/cms/hibernate.cfg.xml</filename> file.
- </para>
- </listitem>
- <listitem>
- <para>
- Un-comment the following line, so that it looks as follows:
-
-<programlisting><![CDATA[
-<!-- Force the dialect instead of using autodetection -->
-<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
-]]></programlisting>
-</para>
- </listitem>
- </orderedlist>
- </para>
- <para>
- Note: this example is for a PostgreSQL database. If you use another database, you need to modify <computeroutput>org.hibernate.dialect.PostgreSQLDialect</computeroutput> to reflect the correct database. For a list of supported dialects, refer to the <ulink url="http://www.hibernate.org/hib_docs/v3/reference/en/html/session-configurat...">dialects list on the Hibernate website</ulink>.
- </para>
- </section>
- </section>
- <section id="emailConfiguration">
- <title>Configuring the Email Service</title>
- <para>
- If you have a standard setup and a mail server installed, the email service should work without any extra configuration. Most Linux distributions have a mail server installed by default. The email service, for example, can be used to verify a user's email address when a user subscribes, or for CMS workflow notifications.
- </para>
- <para>
- The email service is configured using the <filename>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/META-INF/jboss-service.xml</filename> file. The following is an example of the section which is used to configure the email service:
- </para>
-<programlisting role="XML"><![CDATA[
-<mbean
-code="org.jboss.portal.core.impl.mail.MailModuleImpl"
-name="portal:service=Module,type=Mail"
-xmbean-dd=""
-xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
-<xmbean/>
-<depends>jboss:service=Mail</depends>
-<depends>portal:service=Module,type=IdentityServiceController</depends>
-<attribute name="QueueCapacity">-1</attribute>
-<attribute name="Gateway">localhost</attribute>
-<attribute name="SmtpUser"></attribute>
-<attribute name="SmtpPassword"></attribute>
-<attribute name="JavaMailDebugEnabled">false</attribute>
-<attribute name="SMTPConnectionTimeout">100000</attribute>
-<attribute name="SMTPTimeout">10000</attribute>
-<attribute name="JNDIName">java:portal/MailModule</attribute>
-</mbean>]]>
-</programlisting>
-
- <para>
- A different SMTP server (other than localhost) can be configured, along with a SMTP username and an SMTP password. The following is an example configuration that uses the Gmail SMTP server:
- </para>
-<programlisting role="XML"><![CDATA[
-<mbean
-code="org.jboss.portal.core.impl.mail.MailModuleImpl"
-name="portal:service=Module,type=Mail"
-xmbean-dd=""
-xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
-<xmbean/>
-<depends>jboss:service=Mail</depends>
-<depends>portal:service=Module,type=IdentityServiceController</depends>
-<attribute name="QueueCapacity">-1</attribute>
-<attribute name="Gateway">smtp.gmail.com</attribute>
-<attribute name="SmtpUser">username(a)gmail.com</attribute>
-<attribute name="SmtpPassword">myPassword</attribute>
-<attribute name="JavaMailDebugEnabled">false</attribute>
-<attribute name="SMTPConnectionTimeout">100000</attribute>
-<attribute name="SMTPTimeout">10000</attribute>
-<attribute name="JNDIName">java:portal/MailModule</attribute>
-</mbean>]]>
-</programlisting>
- <para>
- Using this example, replace <computeroutput>username(a)gmail.com</computeroutput> and <computeroutput>myPassword</computeroutput> with your correct Gmail username and password.
- </para>
-</section>
- <section>
- <title>Configuring proxy settings</title>
- <para>There are a couple of scenarios where you need your proxy to be correctly defined at the <trademark class="trade">JVM</trademark> level so that you can access documents from Internet. It could be to get the thirdparty libraries if you decided to build JBoss Portal from the sources, to access RSS feeds or weather information in the samples portlet we provide or for your own needs.</para>
- <para>To configure the proxy settings, you need to know the proxy host and the port to use. Then,
- add them when starting Java.</para>
- <para>Usually setting up JAVA_OPTS environment variable to <literal>-Dhttp.proxyHost=YOUR_PROXY_HOST -Dhttp.proxyPort=YOUR_PROXY_PORT</literal>
- is enough.</para>
- </section>
- <section>
- <title>Disabling Dynamic Proxy Un-wrapping</title>
- <para>JBoss Portal uses the JBoss Microkernel for the service infrastructure. The JBoss Microkernel provides injection of services into other services, otherwise known as wiring. Due to the Microkernel being <trademark class="trade">JMX</trademark> based, it is only possible to inject dynamic proxies that talk to the MBeanServer. The overhead at runtime is minimal since the Microkernel implementation is highly optimized; however, when it is used with Java 5, a noticeable bottleneck occurs due to the fact that the implementation of the JMX API classes, <emphasis>javax.management.*</emphasis>, provided by the Java Platform, perform synchronization. This does not occur under <trademark class="trade">JDK</trademark> 1.4, since those classes are implemented by JBoss MX.
- </para>
- <para>
- JBoss Portal services use a special kind of Model MBean called <emphasis>JBossServiceModelMBean</emphasis>, which allows the un-wrapping of injected dynamic proxies, and replaces them with Plain Old Java Object (POJO) services. This removes the bottleneck when using Java 5, and also provides a performance boost on JDK 1.4. By default this feature is enabled, but it is possible to disable. To do this on Linux operating systems, change into the <filename>$JBOSS_HOME/bin/</filename> directory and run the following command:
- </para>
- <para>
-<programlisting>
-sh run.sh -Dportal.kernel.no_proxies=false
-</programlisting>
-</para>
-<para>
- On Windows, run the following command:
-</para>
-<para>
-<programlisting>
-run.bat -Dportal.kernel.no_proxies=false
-</programlisting>
-</para>
- </section>
-</chapter>
- <chapter id="changelog">
- <!-- <chapterinfo>
- <author>
- <firstname>Thomas</firstname>
- <surname>Heute</surname>
- </author>
- </chapterinfo>-->
- <title>Upgrading JBoss Portal 2.6 to 2.7</title>
- <para>
- <warning>
- <para>
- Before performing any instructions or operations in this chapter, back up your database and the entire JBoss EAP or JBoss AS directory!
- </para>
- </warning>
- </para>
- <para>
- JBoss Portal 2.7 compatibility with JBoss Portal 2.6 is very high. The main differences are the use of JSR-286 features to replace
- JBoss Portal specific features. The database schema hasn't changed.
- </para>
-
- <section id="manual_migration">
- <title>Usage of JBossActionRequest</title>
- <para>Usage of JBossActionRequest is not available directly anymore. From now on it is only accessible if the
- <emphasis>org.jboss.portlet.filter.JBossPortletFilter</emphasis> is applied on the portlet.
- To do so, first you will need to change the <emphasis>portlet.xml</emphasis> descriptor in order to declare
- the new portlet as a JSR-286 portlet so that the filter can be applied. For a portlet named <emphasis>MyFooPortlet</emphasis>
- it would now look like this:
- </para>
-<programlisting role="XML"><![CDATA[
-<portlet-app
- xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
- version="2.0">
-
- <filter>
- <filter-name>JBoss Portlet Filter</filter-name>
- <filter-class>org.jboss.portlet.filter.JBossPortletFilter</filter-class>
- <lifecycle>ACTION_PHASE</lifecycle>
- <lifecycle>RENDER_PHASE</lifecycle>
- </filter>
-
- <filter-mapping>
- <filter-name>JBoss Portlet Filter</filter-name>
- <portlet-name>MyFooPortlet</portlet-name>
- </filter-mapping>
-
-
- <portlet>
- <description>My foo portlet</description>
- <portlet-name>MyFooPortlet</portlet-name>
- ...
- </portlet>
-</portlet-app>
-
-]]></programlisting>
- <para>By not adding this filter on a portlet using JBossActionRequest/JBossActionResponse, an error message such as:
- <emphasis>The request isn't a JBossRenderRequest, you probably need to activate the JBoss Portlet Filter: org.jboss.portlet.filter.JBossPortletFilter on MyFooPortlet</emphasis>
- </para>
- </section>
-
-</chapter>
- <chapter id="tutorials">
- <!-- <chapterinfo>
- <author>
- <firstname>Chris</firstname>
- <surname>Laprun</surname>
- </author>
- <author>
- <firstname>Thomas</firstname>
- <surname>Heute</surname>
- </author>
- </chapterinfo>-->
- <title>Portlet Primer</title>
- <section id="portlet_primer">
- <title>JSR-168 and JSR-286 overview</title>
- <para>
- The Portlet Specifications aims at defining portlets that can be used by any
- <ulink url="http://www.jcp.org/en/jsr/detail?id=168">
- JSR-168 (Portlet 1.0)
- </ulink>
- or
- <ulink url="http://www.jcp.org/en/jsr/detail?id=286">
- JSR-286 (Portlet 2.0)
- </ulink>
- portlet container. Most Java EE portals include one, it is obviously the case for
- JBoss Portal which includes the JBoss Portlet container supporting the two
- versions. This chapter gives a brief overview of the Portlet Specifications but
- portlet developers are strongly encouraged to read the
- <ulink url="http://www.jcp.org/en/jsr/detail?id=286">
- JSR-286 Portlet Specification
- </ulink>
- .
- </para>
- <para>
- JBoss Portal is fully JSR-286 compliant, which means any JSR-168 or JSR-286
- portlet behaves as it is mandated by the respective specifications inside the
- portal.
- </para>
- <section>
- <title>Portal Pages</title>
- <para>
- A portal can be seen as pages with different areas, and inside areas,
- different windows, and each window having one portlet:
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/tutorials/SpecPortalDef.png" format="PNG" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- </section>
- <section>
- <title>Rendering Modes</title>
- <para>
- A portlet can have different view modes. Three modes are defined by the
- JSR-286 specification:
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- <emphasis>view</emphasis>
- - generates markup reflecting the current state of the portlet.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>edit</emphasis>
- - allows a user to customize the behavior of the portlet.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>help</emphasis>
- - provides information to the user as to how to use the portlet.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>Window States</title>
- <para>
- Window states are an indicator of how much page real-estate a portlet consumes
- on any given page. The three states defined by the JSR-168 specification are:
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- <emphasis>normal</emphasis>
- - a portlet shares this page with other portlets.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>minimized</emphasis>
- -a portlet may show very little information, or none at all.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>maximized</emphasis>
- - a portlet may be the only portlet displayed on this page.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- </section>
- <section id="tutorials_tutorials">
- <title>Tutorials</title>
- <para>
- The tutorials contained in this chapter are targeted toward portlet developers.
- Although they are a good starting and reference point, it is highly recommend
- that portlet developers read and understand the
- <ulink url="http://www.jcp.org/en/jsr/detail?id=286">
- JSR-286 Portlet Specification
- </ulink>
- . Feel free to use the
- <ulink url="http://jboss.org/index.html?module=bb&op=viewforum&f=215">
- JBoss Portal User Forums
- </ulink>
- for user-to-user help.
- </para>
- <section>
- <title>Deploying your first Portlet</title>
- <section>
- <title>Introduction</title>
- <para>
- This section describes how to deploy a portlet in JBoss Portal. You will
- find the
- <emphasis>SimplestHelloWorld</emphasis>
- portlet in the
- <literal>examples</literal>
- directory at the root of your JBoss Portal binary package.
- </para>
- </section>
- <section>
- <title>Compiling</title>
- <para>
- This example is using Maven to compile and build the web archive. If you
- don't have Maven already installed, you will find a version for your
- operating system
- <ulink url="http://maven.apache.org/download.html">here</ulink>
- </para>
- <para>
- To compile and package the application, go to the SimplestHelloWorld
- directory and type
- <literal>mvn package</literal>
- .
- </para>
- <para>
- Once successfully packaged, the result should be available in:
- <literal>SimplestHelloWorld/target/SimplestHelloWorld-0.0.1.war</literal>
- . Simply copy that file into
- <literal>JBOSS_HOME/server/default/deploy</literal>
- , then start JBoss Application Server if it was not already started.
- </para>
- <para>
- You should now see a new page called
- <literal>SimplestHelloWorld</literal>
- , with a window inside containing the portlet instance we have created, as
- seen below.
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/tutorials/first_portlet/deployed.png"/>
- </imageobject>
- </mediaobject>
-
- SimplestHelloWorldPortlet deployed on a new page.
-
- </para>
- </section>
- <section>
- <title>Package Structure</title>
- <para>
- Now that we have seen how to deploy an existing web application, let's have
- a look inside.
- </para>
- <para>
- Like other Java Platform, Enterprise Edition (Java EE) applications,
- portlets are packaged in WAR files. A typical portlet WAR file can include
- servlets, resource bundles, images, HTML,
- <trademark class="trade">JavaServer</trademark>
- Pages (
- <trademark class="trade">JSP</trademark>
- ), and other static or dynamic files. The following is an example of the
- directory structure of the HelloWorldPortlet portlet:
- </para>
- <programlistingco>
- <areaspec>
- <area id="tutorials.simplest.javaclass" coords="9"/>
- <area id="tutorials.simplest.defaultobject" coords="10"/>
- <area id="tutorials.simplest.portletinstances" coords="11"/>
- <area id="tutorials.simplest.portlet" coords="12"/>
- <area id="tutorials.simplest.web" coords="13"/>
- </areaspec>
- <programlisting><![CDATA[|-- SimplestHelloWorld-0.0.1.war
-| `-- WEB-INF
-| |-- classes
-| | `-- org
-| | `-- jboss
-| | `-- portal
-| | `-- portlet
-| | `-- samples
-| | `-- SimplestHelloWorldPortlet.class
-| |-- default-object.xml
-| |-- portlet-instances.xml
-| |-- portlet.xml
-| `-- web.xml]]>
- </programlisting>
- <calloutlist>
- <callout arearefs="tutorials.simplest.javaclass">
- <para>
- The compiled Java class implementing
- <emphasis>javax.portlet.Portlet</emphasis>
- (through
- <emphasis>javax.portlet.GenericPortlet</emphasis>
- )
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.defaultobject">
- <para>
- <emphasis>default-object.xml</emphasis>
- is an optional file, it is used to define the layout of the
- portal. It can be used to define the different portals, pages and
- windows. The same result can be obtained through the
- administration portal. Note that the definition of the layout is
- stored in database, this file is then used to populate the
- database during deployment which can be very useful during
- development.
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.portletinstances">
- <para>
- <emphasis>portlet-instances.xml</emphasis>
- is also optional, it allows to create a portlet instance from the
- SimpleHelloWorld portlet definition. Creating instances can also
- be done through the administration portal. Note that the
- definition of instances is stored in database, this file is then
- used to populate the database during deployment which can be very
- useful during development. Having portlet-instances.xml and
- default-object.xml included in this package ensures that the
- portlet will appear directly on the portal by just deploying the
- web application.
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.portlet">
- <para>
- This is the mandatory descriptor files for portlets. It is used
- during deployment..
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.web">
- <para>This is the mandatory descriptor for web applications.</para>
- </callout>
- </calloutlist>
- </programlistingco>
- </section>
-
- <section>
- <title>Portlet Class</title>
- <para>Let us study the Java class in detail.</para>
- <para>
- The following file is the
- <filename>
- SimplestHelloWorldPortlet/src/main/java/org/jboss/portal/portlet/samples/SimplestHelloWorldPortlet.java
- </filename>
- Java source.
- </para>
- <programlistingco>
- <areaspec>
- <area id="tutorials.simplest.extends" coords="10"/>
- <area id="tutorials.simplest.doview" coords="13"/>
- <area id="tutorials.simplest.writer" coords="15"/>
- <area id="tutorials.simplest.write" coords="16"/>
- <area id="tutorials.simplest.close" coords="17"/>
- </areaspec>
- <programlisting role="JAVA"><![CDATA[package org.jboss.portal.portlet.samples;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-
-import javax.portlet.GenericPortlet;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-
-public class SimplestHelloWorldPortlet extends GenericPortlet
-{
- public void doView(RenderRequest request,
- RenderResponse response) throws IOException
- {
- PrintWriter writer = response.getWriter();
- writer.write("Hello World !");
- writer.close();
- }
-}]]>
- </programlisting>
- <calloutlist>
- <callout arearefs="tutorials.simplest.extends">
- <para>
- All portlets must implement the
- <literal>javax.portlet.Portlet</literal>
- interface. The portlet API provides a convenient implementation of
- this interface, in the form of the
- <literal>javax.portlet.GenericPortlet</literal>
- class, which among other things, implements the
- <literal>Portlet render</literal>
- method to dispatch to abstract mode-specific methods to make it
- easier to support the standard portlet modes. As well, it provides
- a default implementation for the
- <literal>processAction</literal>
- ,
- <literal>init</literal>
- and
- <literal>destroy</literal>
- methods. It is recommended to extend
- <literal>GenericPortlet</literal>
- for most cases.
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.doview">
- <para>
- As we extend from
- <literal>GenericPortlet</literal>
- , and are only interested in supporting the
- <literal>view</literal>
- mode, only the
- <literal>doView</literal>
- method needs to be implemented, and the
- <literal>GenericPortlet</literal>
- <literal>render</literal>
- implemention calls our implementation when the
- <literal>view</literal>
- mode is requested.
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.writer">
- <para>
- Use the
- <emphasis>RenderResponse</emphasis>
- to obtain a writer to be used to produce content.
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.write">
- <para>Write the markup to display.</para>
- </callout>
- <callout arearefs="tutorials.simplest.close">
- <para>Closing the writer.</para>
- </callout>
- </calloutlist>
- </programlistingco>
- <para>
- <note>
- <title>Markup Fragments</title>
- <para>
- Portlets are responsible for generating markup fragments, as they are
- included on a page and are surrounded by other portlets. In
- particular, this means that a portlet outputting HTML must not output
- any markup that cannot be found in a
- <literal><body></literal>
- element.
- </para>
- </note>
- </para>
- </section>
- <section id="first_portlet_descriptors">
- <title>Application Descriptors</title>
- <para>
- JBoss Portal requires certain descriptors to be included in a portlet WAR
- file. Some of these descriptors are defined by the Portlet Specification,
- and others are specific to JBoss Portal.
- </para>
- <para>
- The following is an example of the
- <filename>SimplestHelloWorldPortlet/WEB-INF/portlet.xml</filename>
- file. This file must adhere to its definition in the JSR-286 Portlet
- Specification. You may define more than one portlet application in this
- file:
- </para>
- <programlistingco>
- <areaspec>
- <area id="tutorials.simplest.portletname" coords="8"/>
- <area id="tutorials.simplest.portletclass" coords="9"/>
- <area id="tutorials.simplest.supports" coords="12"/>
- <area id="tutorials.simplest.portletinfo" coords="15"/>
- </areaspec>
- <programlisting><![CDATA[
-<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
- http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
- version="2.0">
- <portlet>
- <portlet-name>SimplestHelloWorldPortlet</portlet-name>
- <portlet-class>
- org.jboss.portal.portlet.samples.SimplestHelloWorldPortlet
- </portlet-class>
- <supports>
- <mime-type>text/html</mime-type>
- </supports>
- <portlet-info>
- <title>Simplest Hello World Portlet</title>
- </portlet-info>
- </portlet>
-</portlet-app>]]>
- </programlisting>
- <calloutlist>
- <callout arearefs="tutorials.simplest.portletname">
- <para>
- Define the portlet name. It does not have to be the class name.
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.portletclass">
- <para>
- The Fully Qualified Name (FQN) of your portlet class must be
- declared here.
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.supports">
- <para>
- The
- <computeroutput><supports></computeroutput>
- element declares all of the markup types that a portlet supports
- in the
- <literal>render</literal>
- method. This is accomplished via the
- <computeroutput><mime-type></computeroutput>
- element, which is required for every portlet. The declared MIME
- types must match the capability of the portlet. As well, it allows
- you to pair which modes and window states are supported for each
- markup type. All portlets must support the
- <computeroutput>view</computeroutput>
- portlet mode, so this does not have to be declared. Use the
- <computeroutput><mime-type></computeroutput>
- element to define which markup type your portlet supports, which
- in this example, is
- <computeroutput>text/html</computeroutput>
- . This section tells the portal that it only outputs HTML.
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.portletinfo">
- <para>
- When rendered, the portlet's title is displayed as the header in
- the portlet window, unless it is overridden programmatically. In
- this example, the title would be
- <computeroutput>Simplest Hello World Portlet</computeroutput>
- .
- </para>
- </callout>
- </calloutlist>
- </programlistingco>
- <para>
- The
- <filename>
- SimplestHelloWorldPortlet/WEB-INF/portlet-instances.xml
- </filename>
- file is a JBoss Portal specific descriptor, that allows you to create
- instances of portlets. The
- <computeroutput><portlet-ref></computeroutput>
- value must match the
- <computeroutput><portlet-name></computeroutput>
- value given in the
- <filename>SimplestHelloWorldPortlet/WEB-INF/portlet.xml</filename>
- file. The
- <computeroutput><instance-id></computeroutput>
- value can be named anything, but it must match the
- <computeroutput><instance-ref></computeroutput>
- value given in the
- <filename>*-object.xml</filename>
- file, which in this example, would be the
- <filename>SimplestHelloWorldPortlet/WEB-INF/default-object.xml</filename>
- file.
- </para>
- <para>
- The following is an example of the
- <filename>
- SimplestHelloWorldPortlet/WEB-INF/portlet-instances.xml
- </filename>
- file:
- </para>
- <programlisting role="XML"><![CDATA[<?xml version="1.0" standalone="yes"?>
-<!DOCTYPE deployments PUBLIC
- "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
- "http://www.jboss.org/portlet/dtd/portlet-instances_2_6.dtd">
-<deployments>
- <deployment>
- <instance>
- <instance-id>SimplestHelloWorldInstance</instance-id>
- <portlet-ref>SimplestHelloWorldPortlet</portlet-ref>
- </instance>
- </deployment>
-</deployments>]]>
- </programlisting>
- <para>
- The
- <filename>*-object.xml</filename>
- file is a JBoss Portal specific descriptor that allow users to define the
- structure of their portal instances, and create and configure their windows
- and pages. In the following example:
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>a portlet window is created.</para>
- </listitem>
- <listitem>
- <para>
- specifies that the window displays the markup generated by the
- <computeroutput>SimplestHelloWorldInstance</computeroutput>
- portlet instance.
- </para>
- </listitem>
- <listitem>
- <para>
- the window is assigned to the page that we are creating and called
- <computeroutput>SimplestHelloWorld</computeroutput>
- page.
- </para>
- </listitem>
- <listitem>
- <para>
- the
- <computeroutput><region></computeroutput>
- element specifies where the window appears on the page.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- The following is an example
- <filename>SimplestHelloWorldPortlet/WEB-INF/default-object.xml</filename>
- file:
- </para>
- <programlistingco>
- <areaspec>
- <area id="tutorials.simplest.parentref" coords="7"/>
- <area id="tutorials.simplest.ifexists" coords="8"/>
- <area id="tutorials.simplest.pagename" coords="12"/>
- <area id="tutorials.simplest.windowname" coords="12"/>
- <area id="tutorials.simplest.instanceref" coords="13"/>
- <area id="tutorials.simplest.region" coords="14"/>
- <area id="tutorials.simplest.height" coords="15"/>
- </areaspec>
- <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE deployments PUBLIC
- "-//JBoss Portal//DTD Portal Object 2.6//EN"
- "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
-<deployments>
- <deployment>
- <parent-ref>default</parent-ref>
- <if-exists>overwrite</if-exists>
- <page>
- <page-name>SimplestHelloWorld</page-name>
- <window>
- <window-name>SimplestHelloWorldWindow</window-name>
- <instance-ref>SimplestHelloWorldInstance</instance-ref>
- <region>center</region>
- <height>0</height>
- </window>
- </page>
- </deployment>
-</deployments>]]>
- </programlisting>
- <calloutlist>
- <callout arearefs="tutorials.simplest.parentref">
- <para>
- Tells the portal where this portlet appears. In this case,
- <computeroutput>default.default</computeroutput>
- specifies that the portlet appears in the portal instance named
- <computeroutput>default</computeroutput>
- , and on the page named
- <computeroutput>default</computeroutput>
- .
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.ifexists">
- <para>
- Instructs the portal to overwrite or keep this object if it
- already exists. Accepted values are
- <computeroutput>overwrite</computeroutput>
- and
- <computeroutput>keep</computeroutput>
- . The
- <computeroutput>overwrite</computeroutput>
- option destroys the existing object, and creates a new one based
- on the content of the deployment. The
- <computeroutput>keep</computeroutput>
- option maintains the existing object deployment, or creates a new
- one if it does not exist.
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.pagename">
- <para>
- Here we are creating a new page to put the new window on. We give
- that new page a name that will be by default used on the tab of
- the default theme.
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.windowname">
- <para>
- A
- <emphasis role="bold">unique name</emphasis>
- given to the portlet window. This can be named anything.
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.instanceref">
- <para>
- The value of
- <computeroutput><instance-ref></computeroutput>
- must match the value of one of the
- <computeroutput><instance-id></computeroutput>
- elements found in the
- <filename>
- HelloWorldPortlet/WEB-INF/portlet-instances.xml
- </filename>
- file.
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.region">
- <para>
- Specifies where the window appears within the page layout.
- </para>
- </callout>
- <callout arearefs="tutorials.simplest.height">
- <para>
- Specifies where the window appears within the page layout.
- </para>
- </callout>
- </calloutlist>
- </programlistingco>
- <para>
- The following diagram illustrates the relationship between the
- <filename>portlet.xml</filename>
- ,
- <filename>portlet-instances.xml</filename>
- , and
- <filename>default-object.xml</filename>
- descriptors:
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/tutorials/first_portlet/desc_relationship.png" align="center" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
-
- <para>
- JBoss Portal 2.6 introduced the notion of
- <emphasis>content-type</emphasis>
- , which is a generic mechanism to specify what content displayed by a given
- portlet window. The
- <computeroutput>window</computeroutput>
- section of the previous example,
- <filename>SimplestHelloWorldPortlet/WEB-INF/default-object.xml</filename>
- , can be re-written to take advantage of the new content framework. The
- following is an example deployment descriptor that uses the new content
- framework:
- </para>
- <programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE deployments PUBLIC
- "-//JBoss Portal//DTD Portal Object 2.6//EN"
- "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
-<deployments>
- <deployment>
- <parent-ref>default.default</parent-ref>
- <if-exists>overwrite</if-exists>
- <window>
- <window-name>SimplestHelloWorldWindow</window-name>
- <content>
- <content-type>portlet</content-type>
- <content-uri>SimplestHelloWorldInstance</content-uri>
- </content>
- <region>center</region>
- <height>1</height>
- </window>
- </deployment>
-</deployments>]]>
- </programlisting>
- <para>
-
- This declaration is equivalent to the previous
- <filename>SimplestHelloWorldPortlet/WEB-INF/default-object.xml</filename>
- example. Use
- <computeroutput><content-type></computeroutput>
- to specify the content to display. In this example, the content being
- displayed by the
- <computeroutput>SimplestHelloWorldWindow</computeroutput>
- is a
- <computeroutput>portlet</computeroutput>
- . The
- <computeroutput><content-uri></computeroutput>
- element specifies which content to display, which in this example, is the
- <computeroutput>SimplestHelloWorldInstance</computeroutput>
- :
- </para>
- <programlisting role="XML"><![CDATA[<content>
- <content-type>portlet</content-type>
- <content-uri>SimplestHelloWorldInstance</content-uri>
-</content>]]>
- </programlisting>
- <para>
- To display certain content or a file, use the
- <computeroutput>cms</computeroutput>
- content-type, with the
- <computeroutput><content-uri></computeroutput>
- element being the path to the file in the CMS. This behavior is pluggable:
- you can plug in almost any type of content.
- </para>
- <formalpara>
- <title>Beware of context-path change</title>
- <para>
- If the context-path change the portal may not be able to find a
- reference on your portlets anymore. For that reason it's recommended to
- add the following descriptor
- <filename>WEB-INF/jboss-portlet.xml</filename>
- which is not mandatory:
- </para>
- </formalpara>
-<programlisting role="XML"><![CDATA[
-<!DOCTYPE portlet-app PUBLIC
- "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
-
-<portlet-app>
- <app-id>SimplestHelloWorld</app-id>
-</portlet-app>]]></programlisting>
- </section>
- </section>
- <section>
- <title>
- <trademark class="trade">JavaServer</trademark>
- Pages Portlet Example
- </title>
- <section>
- <title>Introduction</title>
- <para>
- Now we will add more features to the previous example and also use a JSP
- page to render the markup. We will use the portlet tag library to generate
- links to our portlet in different ways and use the other standard portlet
- modes. This example can be found in the directory
- <literal>JSPHelloUser</literal>.
- Use <literal>mvn package</literal> then copy <filename>JSPHelloUser/target/JSPHelloUser-0.0.1.war</filename>
- in the <literal>deploy</literal> directory of JBoss Application Server.
- Point your brwoser to <literal/>, you should see the following:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/tutorials/jsp_portlet/output.png" align="center" scalefit="1"/>
- </imageobject>
- </mediaobject>
- <note>
- <para>The <literal>EDIT</literal> button only appears with logged-in users, which is not the case
- on the screenshot</para>
- </note>
- </para>
- </section>
- <section>
- <title>Package Structure</title>
- <para>
- The structure doesn't change much at the exception of adding some JSP files
- detailed later.
- </para>
- <para>
- The JSPHelloUser portlet contains the traditional portlet and JBoss Portal
- specific application descriptors. The following is an example of the
- directory structure of the JSPHelloUser portlet:
- </para>
- <programlisting><![CDATA[JSPHelloUser-0.0.1.war
- |-- META-INF
- | |-- MANIFEST.MF
- | `-- maven
- | `-- org.jboss.portal.example
- | `-- JSPHelloUser
- | |-- pom.properties
- | `-- pom.xml
- |-- WEB-INF
- | |-- classes
- | | `-- org
- | | `-- jboss
- | | `-- portal
- | | `-- portlet
- | | `-- samples
- | | `-- JSPHelloUserPortlet.class
- | |-- default-object.xml
- | |-- jboss-portlet.xml
- | |-- portlet-instances.xml
- | |-- portlet.xml
- | `-- web.xml
- `-- jsp
- |-- edit.jsp
- |-- hello.jsp
- |-- help.jsp
- `-- welcome.jsp]]>
- </programlisting>
- </section>
- <section>
- <title>Portlet Class</title>
- <para>Let's study the Java class in detail.</para>
- <para>
- The following file is the
- <filename>
- JSPHelloUser/src/main/java/org/jboss/portal/portlet/samples/JSPHelloUserPortlet.java
- </filename>
- Java source. It is split in different pieces.
- </para>
- <programlistingco>
- <areaspec>
- <area id="tutorials.jsphello.doView" coords="18"/>
- <area id="tutorials.jsphello.renderParameter" coords="21"/>
- <area id="tutorials.jsphello.requestDispatcher" coords="25"/>
- <area id="tutorials.jsphello.include" coords="26"/>
- </areaspec>
- <programlisting role="JAVA"><![CDATA[package org.jboss.portal.portlet.samples;
-package org.jboss.portal.portlet.samples;
-
-import java.io.IOException;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.GenericPortlet;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.UnavailableException;
-
-public class JSPHelloUserPortlet extends GenericPortlet
-{
-
- public void doView(RenderRequest request, RenderResponse response)
- throws PortletException, IOException
- {
- String sYourName = (String) request.getParameter("yourname");
- if (sYourName != null)
- {
- request.setAttribute("yourname", sYourName);
- PortletRequestDispatcher prd =
- getPortletContext().getRequestDispatcher("/jsp/hello.jsp");
- prd.include(request, response);
- }
- else
- {
- PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/welcome.jsp");
- prd.include(request, response);
- }
- }
-...]]></programlisting>
- <calloutlist>
- <callout arearefs="tutorials.jsphello.doView">
- <para>
- As in the first portlet, we override the
- <emphasis>doView</emphasis>
- method.
- </para>
- </callout>
- <callout arearefs="tutorials.jsphello.renderParameter">
- <para>
- Here we try to obtain the value of the render parameter names
- <literal>yourname</literal>
- . If defined we want to redirect to the
- <filename>hello.jsp</filename>
- JSP page, otherwise to the
- <filename>welcome.jsp</filename>
- JSP page.
- </para>
- </callout>
- <callout arearefs="tutorials.jsphello.requestDispatcher">
- <para>
- Very similar to the Servlet way, we get a request dispatcher on a
- file located within the web archive.
- </para>
- </callout>
- <callout arearefs="tutorials.jsphello.include">
- <para>
- The last step is to perform the inclusion of the markup obtained
- from the JSP.
- </para>
- </callout>
- </calloutlist>
- </programlistingco>
- <para>
- We have seen the
- <literal>VIEW</literal>
- portlet mode, the spec defines two other modes that can be used called
- <literal>EDIT</literal>
- and
- <literal>HELP</literal>
- . In order to enable those modes, they will need to be defined in the
- <filename>portlet.xml</filename>
- descriptor as we will see later. Having those modes defined will enable the
- corresponding buttons on the portlet's window.
- </para>
- <para>
- The generic portlet that is inherited dispatches the different views to
- methods named:
- <literal>doView</literal>
- ,
- <literal>doHelp</literal>
- and
- <literal>doEdit</literal>
- . Let's watch the code for those two last portlet modes.
- </para>
- <programlisting role="JAVA"><![CDATA[...
- protected void doHelp(RenderRequest rRequest, RenderResponse rResponse) throws PortletException, IOException,
- UnavailableException
- {
- rResponse.setContentType("text/html");
- PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/help.jsp");
- prd.include(rRequest, rResponse);
- }
-
- protected void doEdit(RenderRequest rRequest, RenderResponse rResponse) throws PortletException, IOException,
- UnavailableException
- {
- rResponse.setContentType("text/html");
- PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/edit.jsp");
- prd.include(rRequest, rResponse);
- }
-...]]></programlisting>
-
- <para>
- If you have read the portlet specification carefully you should have notice
- that portlet calls happen in one or two phases. One when the portlet is
- just rendered, two when the portlet is actionned then rendered. An action
- phase is a phase where some state change. The render phase will have access
- to render parameters that will be passed each time the portlet is refreshed
- (with the exception of caching capabilities).
- </para>
- <para>
- The code to be executed during an action has to be implemented in the
- <emphasis>processAction</emphasis>
- method of the portlet.
- </para>
- <programlistingco>
- <areaspec>
- <area id="tutorials.jsphello.processAction" coords="2"/>
- <area id="tutorials.jsphello.getActionParameter" coords="5"/>
- <area id="tutorials.jsphello.setRenderParameter" coords="6"/>
- </areaspec>
- <programlisting role="JAVA"><![CDATA[...
- public void processAction(ActionRequest aRequest, ActionResponse aResponse) throws PortletException, IOException,
- UnavailableException
- {
- String sYourname = (String) aRequest.getParameter("yourname");
- aResponse.setRenderParameter("yourname", sYourname);
- }
-...]]></programlisting>
- <calloutlist>
- <callout arearefs="tutorials.jsphello.processAction">
- <para>
- <literal>processAction</literal>
- is the method from GernericPorlet to override for the
- <emphasis>action</emphasis>
- phase.
- </para>
- </callout>
- <callout arearefs="tutorials.jsphello.getActionParameter">
- <para>
- Here we retrieve the parameter obtained through an
- <emphasis>action URL</emphasis>
- .
- </para>
- </callout>
- <callout arearefs="tutorials.jsphello.setRenderParameter">
- <para>
- Here we need to keep the value of
- <literal>yourname</literal>
- to make it available in the rendering phase. With the previous
- line, we are simply copying an action parameter to a render
- parameter for the sake of this example.
- </para>
- </callout>
- </calloutlist>
- </programlistingco>
- </section>
- <section>
- <title>
- <trademark class="trade">JSP</trademark>
- files and the Portlet Tag Library
- </title>
- <para>Let's have a look inside the JSP pages.</para>
- <para>
- The
- <filename>help.jsp</filename>
- and
- <filename>edit.jsp</filename>
- files are very simple, they simply display some text. Note that we used CSS
- styles as defined in the portlet specification. It ensures that the portlet
- will look "good" within the theme and accross portal vendors.
- </para>
- <programlisting role="XHTML"><![CDATA[<div class="portlet-section-header">Help mode</div>
-<div class="portlet-section-body">This is the help mode, a convenient place to give the user some help information.</div>]]></programlisting>
- <programlisting role="XHTML"><![CDATA[<div class="portlet-section-header">Edit mode</div>
-<div class="portlet-section-body">This is the edit mode, a convenient place to let the user change his portlet preferences.</div>]]></programlisting>
- <para>
- Now let's have a look at the landing page, it contains the links and form
- to call our portlet:
- </para>
- <programlistingco>
- <areaspec>
- <area id="tutorials.jsphello.taglib" coords="1"/>
- <area id="tutorials.jsphello.method1" coords="13"/>
- <area id="tutorials.jsphello.method2.1" coords="20"/>
- <area id="tutorials.jsphello.method2.2" coords="24"/>
- <area id="tutorials.jsphello.method3.1" coords="30"/>
- <area id="tutorials.jsphello.method3.2" coords="31"/>
- </areaspec>
-
- <programlisting><![CDATA[<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
-
-<div class="portlet-section-header">Welcome !</div>
-
-<br/>
-
-<div class="portlet-font">Welcome on the JSP Hello User portlet,
-my name is JBoss Portal. What's yours ?</div>
-
-<br/>
-
-<div class="portlet-font">Method 1: We simply pass the parameter to the render phase:<br/>
-<a href="<portlet:renderURL><portlet:param name="yourname" value="John Doe"/>
- </portlet:renderURL>">John Doe</a></div>
-
-<br/>
-
-<div class="portlet-font">Method 2: We pass the parameter to the render phase, using valid XML:
-Please check the source code to see the difference with Method 1.
-<portlet:renderURL var="myRenderURL">
- <portlet:param name="yourname" value='John Doe'/>
-</portlet:renderURL>
-<br/>
-<a href="<%= myRenderURL %>">John Doe</a></div>
-
-<br/>
-
-<div class="portlet-font">Method 3: We use a form:<br/>
-
-<portlet:actionURL var="myActionURL"/>
-<form action="<%= myActionURL %>" method="POST">
- <span class="portlet-form-field-label">Name:</span>
- <input class="portlet-form-input-field" type="text" name="yourname"/>
- <input class="portlet-form-button" type="Submit"/>
-</form>
-</div>]]></programlisting>
- <calloutlist>
- <callout arearefs="tutorials.jsphello.taglib">
- <para>
- Since we will use the portlet taglib, we first need to declare it.
- </para>
- </callout>
- <callout arearefs="tutorials.jsphello.method1">
- <para>
- The first method showed here is the simplest one,
- <literal>portlet:renderURL</literal>
- will create a URL that will call the render phase of the current
- portlet and append the result at the place of the markup (Here
- within a tag...). We also added a parameter directly on the URL.
- </para>
- </callout>
- <callout arearefs="tutorials.jsphello.method2.1">
- <para>
- In this method instead of having a tag within another tag, which
- is not XML valid, we use the
- <literal>var</literal>
- attribute. Instead of printing the url the
- <literal>portlet:renderURL</literal>
- tag will store the result in the referenced variable (
- <literal>myRenderURL</literal>
- in our case).
- </para>
- </callout>
- <callout arearefs="tutorials.jsphello.method2.2">
- <para>
- The variable
- <literal>myRenderURL</literal>
- is used like any other JSP variable.
- </para>
- </callout>
- <callout arearefs="tutorials.jsphello.method3.1">
- <para>
- The third method mixes form submission and action request. Like in
- the second method, we used a temporary variable to put the created
- URL into.
- </para>
- </callout>
- <callout arearefs="tutorials.jsphello.method3.2">
- <para>The action URL is used in the HTML form.</para>
- </callout>
- </calloutlist>
- </programlistingco>
-
- <para>
- On the third method, first the action phase is triggered then later in the request, the render
- phase is triggered, which output some content back to the web browser based on the
- available render parameters.
- <mediaobject>
- <imageobject>
- <imagedata format="PNG" fileref="images/tutorials/jsp_portlet/process.png" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- </section>
- <section>
- <title>
- <trademark class="trade">JSF</trademark>
- example using the JBoss Portlet Bridge
- </title>
- <para>In order to write a portlet using JSF we need a piece of software called 'bridge' that
- lets us write a portlet application as if it was a JSF application, the bridge takes care of the
- interactions between the two layers.</para>
- <para>Such an example is available in examples/JSFHelloUser, it uses the JBoss Portlet Bridge.
- The configuration is slightly different from a JSP application, since it is a bit tricky it is usally a good
- idea to copy an existing application that starting from scratch.</para>
- <para>First, as any JSF application, the file <literal>faces-config.xml</literal> is required. It includes
- the following required information in it:
- <programlisting role="XML"><![CDATA[<faces-config>
-...
- <application>
- <view-handler>org.jboss.portletbridge.application.PortletViewHandler</view-handler>
- <state-manager>org.jboss.portletbridge.application.PortletStateManager</state-manager>
- </application>
-...
-</faces-config> ]]></programlisting>
- The portlet bridge libraries must be available and are usually bundled with the <literal>WEB-INF/lib</literal>
- directory of the web archive.</para>
- <para>The other difference compare to a regular portlet application, can be found in the portlet
- descriptor. All details about it can be found in the JSR-301 specification that the JBoss Portlet Bridge
- implements.
- <programlistingco>
- <areaspec>
- <area id="tutorials.jsf.portlet" coords="9"/>
- <area id="tutorials.jsf.view" coords="21"/>
- <area id="tutorials.jsf.edit" coords="26"/>
- <area id="tutorials.jsf.help" coords="31"/>
- </areaspec>
- <programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
- http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
- version="2.0">
- <portlet>
- <portlet-name>JSFHelloUserPortlet</portlet-name>
- <portlet-class>javax.portlet.faces.GenericFacesPortlet</portlet-class>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>view</portlet-mode>
- <portlet-mode>edit</portlet-mode>
- <portlet-mode>help</portlet-mode>
- </supports>
- <portlet-info>
- <title>JSF Hello User Portlet</title>
- </portlet-info>
-
- <init-param>
- <name>javax.portlet.faces.defaultViewId.view</name>
- <value>/jsf/welcome.jsp</value>
- </init-param>
-
- <init-param>
- <name>javax.portlet.faces.defaultViewId.edit</name>
- <value>/jsf/edit.jsp</value>
- </init-param>
-
- <init-param>
- <name>javax.portlet.faces.defaultViewId.help</name>
- <value>/jsf/help.jsp</value>
- </init-param>
-
- </portlet>
-</portlet-app>]]></programlisting>
- <calloutlist>
- <callout arearefs="tutorials.jsf.portlet"><para>All JSF portlets define <literal>javax.portlet.faces.GenericFacesPortlet</literal>
- as portlet class. This class is part of the JBoss Portlet Bridge</para></callout>
- <callout arearefs="tutorials.jsf.view"><para>This is a mandatory parameter to define what's the default page to display.</para></callout>
- <callout arearefs="tutorials.jsf.edit"><para>This parameter defines which page to display on the 'edit' mode.</para></callout>
- <callout arearefs="tutorials.jsf.help"><para>This parameter defines which page to display on the 'help' mode.</para></callout>
- </calloutlist>
- </programlistingco>
- </para>
- </section>
- </section>
- </section>
-</chapter>
- <chapter id="xmldescriptors">
- <!-- <chapterinfo>
- <author>
- <firstname>Thomas</firstname>
- <surname>Heute</surname>
- </author>
- <author>
- <firstname>Roy</firstname>
- <surname>Russo</surname>
- </author>
- </chapterinfo>-->
- <title>XML Descriptors</title>
- <section>
- <title>DTDs</title>
- <para>
- To use a DTD, add the following declaration to the start of the desired descriptors:
- </para>
-<programlisting role="XML"><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE deployments PUBLIC
-"-//JBoss Portal//DTD Portal Object 2.6//EN"
-"http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">]]>
-</programlisting>
- <para>
- If you do not use the DTD declaration, the previous mechanism for XML validation is used. The DTD is more strict, specifically with the order of XML elements. The following is an example from a <filename>*-object.xml</filename> descriptor, which is valid if you are not using the DTD, but is rejected if you are:
- </para>
- <programlisting role="XML"><![CDATA[
-<if-exists>overwrite</if-exists>
-<parent-ref>default.default</parent-ref>]]>
-</programlisting>
- <para>
- The correct element order, and one which is valid against the DTD, is as follows:
- </para>
-<programlisting role="XML"><![CDATA[
-<parent-ref>default.default</parent-ref>
-<if-exists>overwrite</if-exists>]]>
-</programlisting>
- <para>
- The following DTDs are available:
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- for <filename>-object.xml</filename> descriptors: <userinput>"-//JBoss Portal//DTD Portal Object 2.6//EN"</userinput>
- </para>
- </listitem>
- <listitem>
- <para>
- for <filename>jboss-app.xml</filename> descriptors: <userinput>"-//JBoss Portal//DTD JBoss Web Application 2.6//EN"</userinput>
- </para>
- </listitem>
- <listitem>
- <para>
- for <filename>jboss-portlet.xml</filename> descriptors: <userinput>"-//JBoss Portal//DTD JBoss Portlet 2.6//EN"</userinput>
- </para>
- </listitem>
- <listitem>
- <para>
- for <filename>portlet-instances.xml</filename> descriptors: <userinput>"-//JBoss Portal//DTD Portlet Instances 2.6//EN"</userinput>
- </para>
- </listitem>
- </itemizedlist>
-</para>
-<para>
- The DTDs are located in the <filename>$JBOSS_HOME/server/<replaceable>configuration</replaceable>/deploy/jboss-portal.sar/dtd/</filename> directory.
-</para>
- <section>
- <title>The JBoss Portlet DTD</title>
- <para>
- The following items refer to elements found in the JBoss Portlet DTD, <filename>$JBOSS_HOME/server/<replaceable>configuration</replaceable>/deploy/jboss-portal.sar/dtd/jboss-portlet_<replaceable>version_number</replaceable>.dtd</filename>:
- </para>
-<programlisting><![CDATA[
-<!ELEMENT portlet-app (remotable?,portlet*,service*)>]]>
-</programlisting>
- <para>
- Use the <computeroutput><remotable></computeroutput> element to configure the default behavior of portlets with respect to WSRP exposure: if no value is given, the value is either the value globally defined at the portlet application level, or <computeroutput>false</computeroutput>. Accepted values are <computeroutput>true</computeroutput> and <computeroutput>false</computeroutput>.
- </para>
- <para>
- You can configure specific settings of the portlet container for each portlet defined in the <filename>WEB-INF/portlet.xml</filename> file. Use the <computeroutput><service></computeroutput> element to inject services into the portlet context of applications.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT portlet (portlet-name,remotable?,ajax?,session-config?,transaction?,
-header-content?,portlet-info?)>]]>
-</programlisting>
- <para>
- Additional configuration of the portlet. The <computeroutput><portlet-name></computeroutput> element defines the portlet name. It must match a portlet defined in the <filename>WEB-INF/portlet.xml</filename> file for that application.
- </para>
- <para>
- Use the <computeroutput><remotable></computeroutput> element to configure the default behavior of portlets with respect to WSRP exposure: if no value is given, the value is either the value globally defined at the portlet application level, or <computeroutput>false</computeroutput>.
- </para>
- <para>
- The <computeroutput><trans-attribute></computeroutput> element specifies the behavior of the portlet when it is invoked at runtime with respect to the transactional context. Depending on how the portlet is
- invoked, a transaction may or may not exist before the portlet is invoked. The portal transaction is usually present in the local context. The default value is <computeroutput>NotSupported</computeroutput>, which means that the portal transaction is suspended for the duration of the portlet's invocation. Accepted values are <computeroutput>Required</computeroutput>, <computeroutput>Mandatory</computeroutput>, <computeroutput>Never</computeroutput>, <computeroutput>Supports</computeroutput>, <computeroutput>NotSupported</computeroutput>, and <computeroutput>RequiresNew</computeroutput>.
- </para>
- <para>
- The following is an example section from a <filename>WEB-INF/portlet.xml</filename> file, which uses the <computeroutput><portlet-name></computeroutput>, <computeroutput><remotable></computeroutput>, and <computeroutput><trans-attribute></computeroutput> elements:
- </para>
-<programlisting role="XML"><![CDATA[
-<portlet>
- <portlet-name>MyPortlet</portlet-name>
- <remotable>true</remotable>
- <trans-attribute>Required</trans-attribute>
-</portlet>]]>
-</programlisting>
-<programlisting><![CDATA[
-<!ELEMENT portlet-name (#PCDATA)>]]>
-</programlisting><para>
- The portlet name.
- </para>
- <programlisting><![CDATA[
-<!ELEMENT remotable (#PCDATA)>]]>
-</programlisting>
- <para>
- Accepted values are <computeroutput>true</computeroutput> and <computeroutput>false</computeroutput>.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT ajax (partial-refresh)>]]>
-</programlisting>
- <para>
- Use the <computeroutput>ajax</computeroutput> element to configure the Asynchronous JavaScript and XML (AJAX) capabilities of the portlet.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT partial-refresh (#PCDATA)>]]>
-</programlisting>
- <para>
- If a portlet uses the <computeroutput>true</computeroutput> value for the <computeroutput><partial-refresh></computeroutput> element, the portal uses partial-page refreshing and only renders that portlet. If the <computeroutput><partial-refresh></computeroutput> element uses a <computeroutput>false</computeroutput> value, the portal uses a full-page refresh when the portlet is refreshed.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT session-config (distributed)>]]>
-</programlisting>
- <para>
- The <computeroutput><session-config></computeroutput> element configures the portlet session for the portlet. The <computeroutput><distributed></computeroutput> element instructs the container to distribute the session attributes using portal session replication. This only applies to local portlets, not remote portlets.
- </para>
- <para>
- The following is an example of the <computeroutput><session-config></computeroutput> and <computeroutput><distributed></computeroutput> elements:
- </para>
-<programlisting role="XML"><![CDATA[
-<session-config>
- <distributed>true</distributed>
-</session-config>]]>
-</programlisting>
-<programlisting><![CDATA[
-<!ELEMENT distributed (#PCDATA)>]]>
-</programlisting>
- <para>
- Accepted values are <computeroutput>true</computeroutput> and <computeroutput>false</computeroutput>. The default value is <computeroutput>false</computeroutput>.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT transaction (trans-attribute)>]]>
-</programlisting>
- <para>
- The <computeroutput><transaction></computeroutput> element defines how the portlet behaves with regards to the transactional context. The <computeroutput><trans-attribute></computeroutput> element specifies the behavior of the portlet when it is invoked at runtime, with respect to the transactional context. Depending on how the portlet is invoked, a transaction may or may not exist before the portlet is invoked. The portal transaction is usually present in the local context.
- </para>
- <para>
- The following is an example of the <computeroutput><transaction></computeroutput> and <computeroutput><trans-attribute></computeroutput> elements:
- </para>
-<programlisting role="XML"><![CDATA[
-<transaction>
- <trans-attribute>Required</transaction>
-<transaction>]]>
-</programlisting>
-<programlisting><![CDATA[
-<!ELEMENT trans-attribute (#PCDATA)>]]>
-</programlisting>
- <para>
- The default value is <computeroutput>NotSupported</computeroutput>, which means that the portal transaction is suspended for the duration of the portlet's invocation. Accepted values are <computeroutput>Required</computeroutput>, <computeroutput>Mandatory</computeroutput>, <computeroutput>Never</computeroutput>, <computeroutput>Supports</computeroutput>, <computeroutput>NotSupported</computeroutput>, and <computeroutput>RequiresNew</computeroutput>.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT header-content (link|script|meta)*>]]>
-</programlisting>
- <para>
- Specify the content to be included in the portal aggregated page when the portlet is present on that page. This setting only applies when the portlet is used in the local mode.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT link EMPTY>]]>
-</programlisting>
- <para>
- No content is allowed inside a link element.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT script (#PCDATA)>]]>
-</programlisting>
- <para>
- Use the <computeroutput><script></computeroutput> element for inline script definitions.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT meta EMPTY>]]>
-</programlisting>
- <para>
- No content is allowed for the <computeroutput><meta></computeroutput> element.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT service (service-name,service-class,service-ref)>]]>
-</programlisting>
- <para>
- Declare a service that will be injected by the portlet container as an attribute of the portlet context.
- </para>
- <para>
- The following is an example of the <computeroutput><service></computeroutput> element:
- </para>
-<programlisting role="XML"><![CDATA[
-<service>
- <service-name>UserModule</service-name>
- <service-class>org.jboss.portal.identity.UserModule</service-class>
- <service-ref>:service=Module,type=User</service-ref>
-</service>]]>
-</programlisting>
- <para>
- To use an injected service in a portlet, perform a lookup of the <computeroutput><service-name></computeroutput>, for example, using the <computeroutput>init()</computeroutput> lifecycle method:
- </para>
-<programlisting role="JAVA"><![CDATA[
-public void init()
-{
- UserModule userModule = (UserModule)getPortletContext().getAttribute("UserModule");
-}]]>
-</programlisting>
-<programlisting><![CDATA[
-<!ELEMENT service-name (#PCDATA)>]]>
-</programlisting>
- <para>
- The <computeroutput><service-name></computeroutput> element defines the name that binds the service as a portlet context attribute.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT service-class (#PCDATA)>]]>
-</programlisting>
- <para>
- The <computeroutput><service-class></computeroutput> element defines the fully qualified name of the interface that the service implements.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT service-ref (#PCDATA)>]]>
-</programlisting>
- <para>
- The <computeroutput><service-ref></computeroutput> element defines the reference to the service. In the JMX Microkernel environment, this consist of the JMX name of the service MBean. For an MBean reference, if the domain is left out, the current domain of the portal is used.
- </para>
- </section>
- <section>
- <title>The JBoss Portlet Instance DTD</title>
- <para>
- The following items refer to elements found in the JBoss Portlet Instance DTD, <filename>$JBOSS_HOME/server/<replaceable>configuration</replaceable>/deploy/jboss-portal.sar/dtd/portlet-instances_<replaceable>version_number</replaceable>.dtd</filename>:
- </para>
-<programlisting><![CDATA[
-<!ELEMENT deployments (deployment*)>]]>
-</programlisting>
- <para>
- The <computeroutput><deployments></computeroutput> element is a container for <computeroutput><deployment></computeroutput> elements.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT deployment (if-exists?,instance)>]]>
-</programlisting>
- <para>
- The <computeroutput><deployment></computeroutput> element is a container for the <computeroutput><instance></computeroutput> element.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT if-exists (#PCDATA)>]]>
-</programlisting>
- <para>
- The <computeroutput><if-exists></computeroutput> element defines the action to take if an instance with the same name already exists. Accepted values are <computeroutput>overwrite</computeroutput> and <computeroutput>keep</computeroutput>. The <computeroutput>overwrite</computeroutput> option destroys the existing object, and creates a new one based on the content of the deployment. The <computeroutput>keep</computeroutput> option maintains the existing object deployment, or creates a new one if it does not exist.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT instance (instance-id,portlet-ref,display-name*,preferences?,
-security-constraint?, (display-name* | (resource-bundle, supported-locale+)))>]]>
-</programlisting>
- <para>
- The <computeroutput><instance></computeroutput> element is used in the <filename>WEB-INF/portlet-instances.xml</filename> file, which creates instances of portlets. The portlet will only be created and configured if the portlet is present, and if an instance with the same name does not already exist.
- </para>
- <para>
- The following is an example of the <computeroutput><instance></computeroutput> element, which also contains the <computeroutput><security-constraint></computeroutput> element. Descriptions of each element follow afterwards:
- </para>
-<programlisting role="XML"><![CDATA[
-<instance>
- <instance-id>MyPortletInstance</instance-id>
- <portlet-ref>MyPortlet</portlet-ref>
- <preferences>
- <preference>
- <name>abc</name>
- <value>def</value>
- </preference>
- </preferences>
- <security-constraint>
- <policy-permission>
- <role-name>User</role-name>
- <action-name>view</action-name>
- </policy-permission>
- </security-constraint>
-</instance>]]>
-</programlisting>
-<programlisting><![CDATA[
-<!ELEMENT instance-id (#PCDATA)>]]>
-</programlisting>
- <para>
- The instance identifier. The <computeroutput><instance-id></computeroutput> value can be named anything, but it must match the <computeroutput><instance-ref></computeroutput>value given in the <filename>*-object.xml</filename> file.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT portlet-ref (#PCDATA)>]]>
-</programlisting>
- <para>
- The <computeroutput><portlet-ref></computeroutput> element defines the portlet that an instance represents. The <computeroutput><portlet-ref></computeroutput> value must match the <computeroutput><portlet-name></computeroutput> given in the <filename>WEB-INF/portlet.xml</filename> file.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT preferences (preference+)>]]>
-</programlisting>
- <para>
- The <computeroutput><preferences></computeroutput> element configures an instance with a set of preferences.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT preference (name,value)>]]>
-</programlisting>
- <para>
- The <computeroutput><preference></computeroutput> element configures one preference, which is part of a set of preferences. Use the <computeroutput><preferences></computeroutput> element to define a set of preferences.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT name (#PCDATA)>]]>
-</programlisting>
- <para>
- A name.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT value (#PCDATA)>]]>
-</programlisting>
- <para>
- A string value.
- </para>
- <programlisting><![CDATA[
-<!ELEMENT security-constraint (policy-permission*)>]]>
-</programlisting>
- <para>
- The <computeroutput><security-constraint></computeroutput> element is a container for <computeroutput><policy-permission></computeroutput> elements. The following is an example of the <computeroutput><security-constraint></computeroutput> and <computeroutput><policy-permission></computeroutput> elements:
- </para>
-<programlisting role="XML"><![CDATA[
-<security-constraint>
- <policy-permission>
- <role-name>User</role-name>
- <action-name>view</action-name>
- </policy-permission>
-</security-constraint>
-
-<security-constraint>
- <policy-permission>
- <unchecked/>
- <action-name>view</action-name>
- </policy-permission>
-</security-constraint>]]>
-</programlisting>
-<programlisting><![CDATA[
-<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>]]>
-</programlisting>
- <para>
- The <computeroutput><policy-permission></computeroutput> element secures a specific portlet instance based on a user's role.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT action-name (#PCDATA)>]]>
-</programlisting>
- <para>
- The <computeroutput><action-name></computeroutput> element defines the access rights given to the role defined. Accepted values are:
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- <computeroutput>view</computeroutput>: users can view the page.
- </para>
- </listitem>
- <listitem>
- <para>
- <computeroutput>viewrecursive</computeroutput>: users can view the page and child pages.
- </para>
- </listitem>
- <listitem>
- <para>
- <computeroutput>personalize</computeroutput>: users are able personalize the page's theme.
- </para>
- </listitem>
- <listitem>
- <para>
- <computeroutput>personalizerecursive</computeroutput>: users are able personalize the page and child pages themes.
- </para>
- </listitem>
- </itemizedlist>
- </para>
-<programlisting><![CDATA[
-<!ELEMENT unchecked EMPTY>]]>
-</programlisting>
- <para>
- If present, the <computeroutput><unchecked></computeroutput> element defines anyone can view the instance.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT role-name (#PCDATA)>]]>
-</programlisting>
- <para>
- The <computeroutput><role-name></computeroutput> element defines a role that the security constraint will apply to. The following example only allows users that are part of the <computeroutput>EXAMPLEROLE</computeroutput> role to access the instance:
- </para>
-<programlisting role="XML"><![CDATA[
-<role-name>EXAMPLEROLE</role-name>]]>
-</programlisting>
- </section>
- <section>
- <title>The JBoss Portal Object DTD</title>
- <para>
- The following items refer to elements found in the JBoss Portal Object DTD, <filename>$JBOSS_HOME/server/<replaceable>configuration</replaceable>/deploy/jboss-portal.sar/dtd/portal-object_<replaceable>version_number</replaceable>.dtd</filename>:
- </para>
-<programlisting><![CDATA[
-<!ELEMENT deployments (deployment*)>]]>
-</programlisting>
- <para>
- The <computeroutput><deployments></computeroutput> element is a container for <computeroutput><deployment></computeroutput> elements.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT deployment (parent-ref?,if-exists?,(context|portal|page|window))>]]>
-</programlisting>
- <para>
- The <computeroutput><deployment></computeroutput> element is a generic container for portal object elements. The <computeroutput><parent-ref></computeroutput> child element gives the name of the parent object that the current object will use as parent. The optional <computeroutput><if-exists></computeroutput> element defines the action to take if an instance with the same name already exists. The default behavior of the <computeroutput><if-exists></computeroutput> element is to keep the existing object, and not to create a new object.
- </para>
- <para>
- The following is an example of the <computeroutput><deployment></computeroutput> and <computeroutput><parent-ref></computeroutput> elements:
- </para>
-<programlisting role="XML"><![CDATA[
-<deployment>
- <parent-ref>default</parent-ref>
- <page>
- ...
- </page>
-</deployment>]]>
-</programlisting>
- <para>
- All portal objects have a common configuration which can include:
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- a listener: specifies the ID of a listener in the listener registry. A listener object is able to listen to portal events, which apply to the portal node hierarchy.
- </para>
- </listitem>
- <listitem>
- <para>
- properties: a set of generic properties owned by the portal object. Certain properties drive the behavior of the portal object.
- </para>
- </listitem>
- <listitem>
- <para>
- security-constraint: defines the security configuration for the portal object.
- </para>
- </listitem>
- </itemizedlist>
- </para>
-<programlisting><![CDATA[
-<!ELEMENT parent-ref (#PCDATA)>]]>
-</programlisting>
- <para>
- The <computeroutput><parent-ref></computeroutput> element contains a reference to the parent object. The naming convention for naming objects is to concatenate the names of the path to the object, and separate the names using a period. If the path is empty, the empty string must be used. The <computeroutput><parent-ref></computeroutput> element tells the portal where the portlet appears. The syntax for the <computeroutput><parent-ref></computeroutput> element is <computeroutput><replaceable>portal-instance</replaceable>.<replaceable>portal-page</replaceable></computeroutput>.
- </para>
- <para>
- The following is an example of the root having an empty path:
- </para>
-<programlisting role="XML">
-<parent-ref />
-</programlisting>
- <para>
- The following specifies that the portlet appears in the portal instance named <computeroutput>default</computeroutput>:
- </para>
-<programlisting role="XML">
-<parent-ref>default</parent-ref>
-</programlisting>
- <para>
- The following specifies that the portlet appear in the portal instance named <computeroutput>default</computeroutput>, and on the page named <computeroutput>default</computeroutput>:
- </para>
-<programlisting role="XML">
-<parent-ref>default.default</parent-ref>
-</programlisting>
-<programlisting><![CDATA[
-<!ELEMENT if-exists (#PCDATA)>]]>
-</programlisting>
- <para>
- The <computeroutput><if-exists></computeroutput> element defines the action to take if an instance with the same name already exists. Accepted values are <computeroutput>overwrite</computeroutput> and <computeroutput>keep</computeroutput>. The <computeroutput>overwrite</computeroutput> option destroys the existing object, and creates a new one based on the content of the deployment. The <computeroutput>keep</computeroutput> option matains the existing object deployment, or creates a new one if it does not exist.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT context (context-name,properties?,listener?,security-constraint?,portal*,
-(display-name* | (resource-bundle, supported-locale+)))>]]>
-</programlisting>
- <para>
- The context type of the portal object. A context type represent a node in a tree, which does not have a visual representation, and only exists under the root. A context can only have children that use the <emphasis>portal</emphasis> type.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT context-name (#PCDATA)>]]>
-</programlisting>
- <para>
- The context name.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT portal (portal-name,supported-modes,supported-window-states?,properties?,listener?,
-security-constraint?,page*, (display-name* | (resource-bundle, supported-locale+)))>]]>
-</programlisting>
- <para>
- A portal object that uses the <emphasis>portal</emphasis> type. A portal type represents a virtual portal, and can only have children that use the <emphasis>page</emphasis> type. In addition to the common portal object elements, it also allows you to declare modes and window states that are supported.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT portal-name (#PCDATA)>]]>
-</programlisting>
- <para>
- The portal name.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT supported-modes (mode*)>]]>
-</programlisting>
- <para>
- The <computeroutput><supported-modes></computeroutput> elements defines the supported modes of the portal. Accepted values are <computeroutput>view</computeroutput>, <computeroutput>edit</computeroutput>, and <computeroutput>help</computeroutput>.
- </para>
- <para>
- The following is an example of the <computeroutput><supported-mode></computeroutput> and <computeroutput><mode></computeroutput> elements:
- </para>
-<programlisting role="XML"><![CDATA[
-<supported-mode>
- <mode>view</mode>
- <mode>edit</mode>
- <mode>help</mode>
-</supported-mode>]]>
-</programlisting>
-<programlisting><![CDATA[
-<!ELEMENT mode (#PCDATA)>]]>
-</programlisting>
- <para>
- The portlet mode value. If there are no declarations of modes or window states, the default values are <computeroutput>view</computeroutput>, <computeroutput>edit</computeroutput>, <computeroutput>help</computeroutput>, and <computeroutput>normal</computeroutput>, <computeroutput>minimized</computeroutput>, <computeroutput>maximized</computeroutput>, respectively.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT supported-window-states (window-state*)>]]>
-</programlisting>
- <para>
- Use the <computeroutput><supported-window-states></computeroutput> element to define the supported window states of the portal. The following is an example of the <computeroutput><supported-window-states></computeroutput> and <computeroutput><window-state></computeroutput> elements:
- </para>
-<programlisting role="XML"><![CDATA[
-<supported-window-states>
- <window-state>normal</window-state>
- <window-state>minimized</window-state>
- <window-state>maximized</window-state>
-</supported-window-states>]]>
-</programlisting>
-<programlisting><![CDATA[
-<!ELEMENT window-state (#PCDATA)>]]>
-</programlisting>
- <para>
- Use the <computeroutput><window-state></computeroutput> element to define a window states. Accepted values are <computeroutput>normal</computeroutput>, <computeroutput>minimized</computeroutput>, and <computeroutput>maximized</computeroutput>.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT page (page-name,properties?,listener?,security-constraint?,(page | window)*,
-(display-name* | (resource-bundle, supported-locale+)))>]]>
-</programlisting>
- <para>
- A portal object that uses the <emphasis>page</emphasis> type. A page type represents a page, and can only have children that use the <emphasis>page</emphasis> and <emphasis>window</emphasis> types. The children windows are the windows of the page, and the children pages are the subpages of the page.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT page-name (#PCDATA)>]]>
-</programlisting>
- <para>
- The page name.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT window (window-name,(instance-ref|content),region,height,initial-window-state?,
-initial-mode?,properties?,listener?, (display-name* | (resource-bundle, supported-locale+)))>]]>
-</programlisting>
- <para>
- A portal object that uses the <emphasis>window</emphasis> type. A window type represents a window. Besides the common properties, a window has content, and belongs to a region on the page.
- </para>
- <para>
- The <computeroutput><instance-ref></computeroutput> and <computeroutput><content></computeroutput> elements, configured in the <filename>WEB-INF/*-object.xml</filename> files, define the content of a window. The <computeroutput><content></computeroutput> element is generic, and describes any kind of content. The <computeroutput><instance-ref></computeroutput> element is a shortcut to define the content-type of the portlet, which points to a portlet instance. The value of <computeroutput><instance-ref></computeroutput> must match the value of one of the <computeroutput><instance-id></computeroutput> elements in the <filename>WEB-INF/portlet-instances.xml</filename> file.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT window-name (#PCDATA)>]]>
-</programlisting>
- <para>
- The window name value.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT instance-ref (#PCDATA)>]]>
-</programlisting>
- <para>
- Define the content of the window as a reference to a portlet instance. This value is the ID of a portlet instance, and must much the value of one of the <computeroutput><instance-id></computeroutput> elements in the <filename>WEB-INF/portlet-instances.xml</filename> file. The following is an example of the <computeroutput><instance-ref></computeroutput> element:
- </para>
-<programlisting role="XML">
-<instance-ref>MyPortletInstance</instance-ref>
-</programlisting>
-<programlisting><![CDATA[
-<!ELEMENT region (#PCDATA)>]]>
-</programlisting>
- <para>
- The region the window belongs to. The <computeroutput><region></computeroutput> element specifies where the window appears on the page.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT height (#PCDATA)>]]>
-</programlisting>
- <para>
- The height of the window in a particular region.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT listener (#PCDATA)>]]>
-</programlisting>
- <para>
- Define a listener for a portal object. This value is the ID of the listener.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT content (content-type,content-uri)>]]>
-</programlisting>
- <para>
- Define the content of a window in a generic manner. The content is defined by the type of content, and a URI, which acts as an identifier for the content. The following is an example of the <computeroutput><content></computeroutput> element, which is configured in the <filename>WEB-INF/*-object.xml</filename> files:
- </para>
-<programlisting role="XML"><![CDATA[
-<content>
- <content-type>portlet</content-type>
- <content-uri>MyPortletInstance</content-uri>
-</content>
-
-<content>
- <content-type>cms</content-type>
- <content-uri>/default/index.html</content-uri>
-</content>]]>
-</programlisting>
-<programlisting><![CDATA[
-<!ELEMENT content-type (#PCDATA)>]]>
-</programlisting>
- <para>
- The content type of the window. The <computeroutput><content-type></computeroutput> element specifies the content to display, for example, a <computeroutput>portlet</computeroutput>.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT content-uri (#PCDATA)>]]>
-</programlisting>
- <para>
- The content URI of the window. The <computeroutput><content-uri></computeroutput> element specifies which content to display, for example, a portlet instance. To display a file from the CMS, use the <computeroutput><content-uri></computeroutput> element to define the full path to that file in the CMS.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT properties (property*)>]]>
-</programlisting>
- <para>
- A set of generic properties for the portal object. The <computeroutput><properties></computeroutput> elements contain definitions specific to a portal object.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT property (name,value)>]]>
-</programlisting>
- <para>
- A generic string property. The following table lists accepted values. This table is not exhaustive:
- <table>
- <title>Properties</title>
- <tgroup cols="2" align="left" colsep="1" rowsep="1">
- <colspec colname="name"/>
- <colspec colname="description"/>
- <thead>
- <row>
- <entry>Name</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><computeroutput>layout.id</computeroutput></entry>
- <entry>Defines the layout to use for the portal object and sub-objects if they do not override the value.</entry>
- </row>
- <row>
- <entry><computeroutput>theme.id</computeroutput></entry>
- <entry>Defines the theme used for the portal object and sub-objects if they do not override the value.</entry>
- </row>
- <row id="xml.default.objectname.property">
- <entry><computeroutput>portal.defaultObjectName</computeroutput></entry>
- <entry>Defines the default child object. If applied to a <literal>context</literal>, it defines the default portal. If applied to a <literal>portal</literal>, it defines the default portal page.</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </para>
-<programlisting><![CDATA[
-<!ELEMENT name (#PCDATA)>]]>
-</programlisting>
- <para>
- A name value.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT value (#PCDATA)>]]>
-</programlisting>
- <para>
- A value.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT security-constraint (policy-permission*)>]]>
-</programlisting>
- <para>
- The <computeroutput><security-constraint></computeroutput> element is a container for <computeroutput><policy-permission></computeroutput> elements. The following is an example of the <computeroutput><security-constraint></computeroutput> and <computeroutput><policy-permission></computeroutput> elements:
- </para>
-<programlisting role="XML"><![CDATA[
-<security-constraint>
- <policy-permission>
- <role-name>User</role-name>
- <action-name>view</action-name>
- </policy-permission>
-</security-constraint>
-
-<security-constraint>
- <policy-permission>
- <unchecked/>
- <action-name>view</action-name>
- </policy-permission>
-</security-constraint>]]>
-</programlisting>
-<programlisting><![CDATA[
-<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>]]>
-</programlisting>
- <para>
- The <computeroutput><policy-permission></computeroutput> element is secures a specific portlet instance based on a user's role.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT action-name (#PCDATA)>]]>
-</programlisting>
- <para>
- The <computeroutput><action-name></computeroutput> element defines the access rights given to the role defined. Accepted values are:
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- <computeroutput>view</computeroutput>: users can view the page.
- </para>
- </listitem>
- <listitem>
- <para>
- <computeroutput>viewrecursive</computeroutput>: users can view the page and child pages.
- </para>
- </listitem>
- <listitem>
- <para>
- <computeroutput>personalize</computeroutput>: users are able personalize the page's theme.
- </para>
- </listitem>
- <listitem>
- <para>
- <computeroutput>personalizerecursive</computeroutput>: users are able personalize the page and child pages themes.
- </para>
- </listitem>
- </itemizedlist>
- </para>
-<programlisting><![CDATA[
-<!ELEMENT unchecked EMPTY>]]>
-</programlisting>
- <para>
- If present, the <computeroutput><unchecked></computeroutput> element defines that anyone can view the instance.
- </para>
-<programlisting><![CDATA[
-<!ELEMENT role-name (#PCDATA)>]]>
-</programlisting>
- <para>
- The <computeroutput><role-name></computeroutput> element defines a role that the security constraint applies to. The following example only allows users that are part of the <computeroutput>EXAMPLEROLE</computeroutput> role to access the instance:
- </para>
-<programlisting><![CDATA[
-<role-name>EXAMPLEROLE</role-name>]]>
-</programlisting>
- </section>
- <section>
- <title>The JBoss Portal App DTD</title>
- <para>
- The following items refer to elements found in the JBoss Portal App DTD, <filename>$JBOSS_HOME/server/<replaceable>configuration</replaceable>/jboss-portal.sar/dtd/jboss-app_<replaceable>version_number</replaceable>.dtd</filename>:
- </para>
-<programlisting><![CDATA[
-<Element <![CDATA[<!ELEMENT jboss-app (app-name?)>]]>
-</programlisting>
-<programlisting><![CDATA[
-<!DOCTYPE jboss-app PUBLIC
- "-//JBoss Portal//DTD JBoss Web Application 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-app_2_6.dtd">]]>
-</programlisting>
-<programlisting><![CDATA[
-<!ELEMENT app-name (#PCDATA)>]]>
-</programlisting>
- <para>
- When a web application is deployed, the context path under which it is deployed
- is taken as the application name. The application name value in the <computeroutput><app-name></computeroutput> element overrides it. When a component references a portlet, it needs to reference the application too, and if the portlet application WAR file is renamed,
- the reference is no longer valid; therefore, the <computeroutput><app-name></computeroutput> element is used to have an application name that does not depend upon the context path, under which the application is deployed.
- </para>
- </section>
- </section>
- <section id="descriptors_portlet">
- <title>Portlet Descriptors</title>
- <para>
- The following sections describe the descriptors that define portal objects, such as portals, pages, portlet instances, windows, and portlets. Refer to <xref linkend="tutorials_tutorials"/> and <xref linkend="desc_examples"/> for examples on using these descriptors within a portlet application.
- </para>
- <section id="desc_objectxml">
- <title><filename>*-object.xml</filename> Descriptors</title>
- <para>
- The <filename>*-object.xml</filename> descriptors define portal instances, pages, windows, and the window layout. As well, themes and layouts for specific portal instances, pages, and windows, can be defined. The following example defines a portlet window being added to the <computeroutput>default</computeroutput> page, in the <computeroutput>default</computeroutput> portal. For advanced functionality using these descriptors, refer to <xref linkend="desc_examples"/>:
- </para>
- <programlisting role="XML"><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE deployments PUBLIC
- "-//JBoss Portal//DTD Portal Object 2.6//EN"
- "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
-<deployments>
- <deployment>
- <parent-ref>default.default</parent-ref>
- <if-exists>overwrite</if-exists>
- <window>
- <window-name>HelloWorldJSPPortletWindow</window-name>
- <instance-ref>HelloWorldJSPPortletInstance</instance-ref>
- <region>center</region>
- <height>1</height>
- </window>
- </deployment>
-</deployments>]]></programlisting>
- <itemizedlist>
- <listitem>
- <para>
- <programlisting><![CDATA[<deployments>...</deployments>]]></programlisting>
- </para>
- <para>
- The <computeroutput><deployments></computeroutput> element encapsulates the entire document, and is a container for <computeroutput><deployment></computeroutput> elements. Multiple deployments can be specified within the <computeroutput><deployments></computeroutput> element.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<deployment>...</deployment>]]></programlisting>
- </para>
- <para>
- The <computeroutput><deployment></computeroutput> element specifies object deployments, such as portals, pages, windows, and so on.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<if-exists>...</if-exists>]]></programlisting>
- </para>
- <para>
- The <computeroutput><if-exists></computeroutput> element defines the action to take if an instance with the same name already exists. Accepted values are <computeroutput>overwrite</computeroutput> and <computeroutput>keep</computeroutput>. The <computeroutput>overwrite</computeroutput> option destroys the existing object, and creates a new one based on the content of the deployment. The <computeroutput>keep</computeroutput> option maintains the existing object deployment, or creates a new one if it does not exist.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<parent-ref>...</parent-ref>]]></programlisting>
- </para>
- <para>
- The <computeroutput><parent-ref></computeroutput> element contains a reference to the parent object. The naming convention for naming objects is to concatenate the names of the path to the object, and separate the names using a period. If the path is empty, the empty string must be used. The <computeroutput><parent-ref></computeroutput> element tells the portal where the portlet appears. The syntax for the <computeroutput><parent-ref></computeroutput> element is <computeroutput><replaceable>portal-instance</replaceable>.<replaceable>portal-page</replaceable></computeroutput>.
- </para>
- <para>
- In the example above, a window is defined, and assigned to <computeroutput>default.default</computeroutput>. This means the window appears on the <computeroutput>default</computeroutput> page, in the <computeroutput>default</computeroutput> portal.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<window>...</window>]]></programlisting>
- </para>
- <para>
- The <computeroutput><window></computeroutput> element defines a portlet window. The <computeroutput><window></computeroutput> element requires an <computeroutput><instance-ref></computeroutput> element, which assigns a portal instance to a window.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<window-name>...</window-name>]]></programlisting>
- </para>
- <para>
- The <computeroutput><window-name></computeroutput> element defines the <emphasis role="bold">unique name</emphasis> given to a portlet window. This can be named anything.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<instance-ref>...</instance-ref>]]></programlisting>
- </para>
- <para>
- The <computeroutput><instance-ref></computeroutput> elements define the portlet instances that windows represent. This value is the ID of a portlet instance, and must match the value of one of the <computeroutput><instance-id></computeroutput> elements in the <filename>WEB-INF/portlet-instances.xml</filename> file.
- </para>
- </listitem>
- <listitem>
- <para>
-<programlisting><![CDATA[
-<region>...</region>
-<height>...</height>]]></programlisting>
- </para>
- <para>
- The <computeroutput><region></computeroutput> and <computeroutput><height></computeroutput> elements define where the window appears within the page layout. The <computeroutput><region></computeroutput> element specifies where the window appears on the page. The <computeroutput><region></computeroutput> element often depends on other regions defined in the portal layout. The <computeroutput><height></computeroutput> element can be assigned a value between one and <replaceable>X</replaceable>.
- </para>
- </listitem>
- </itemizedlist>
- <para>The previous <filename>*-object.xml</filename> example makes reference to items found in other descriptor files. The following diagram illustrates the relationship between the <filename>portlet.xml</filename>, <filename>portlet-instances.xml</filename>, and <filename>*-object.xml</filename> descriptors:
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/tutorials/first_portlet/desc_relationship.png" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- <note>
- <title>Are <filename>*-object.xml</filename> descriptors required?</title>
- <para>
- Technically, they are not. The portal object hierarchy, such as creating portals, pages, instances, and organizing them on the page, can be defined using the management portlet, which is accessible to JBoss Portal administrators.
- </para>
- </note>
- </para>
- </section>
- <section id="desc_instancesxml">
- <title>The <filename>portlet-instances.xml</filename> Descriptor</title>
- <para>
- The <filename>portlet-instances.xml</filename> descriptor is JBoss Portal specific, and allows developers to instantiate one-or-many instances of one-or-many portlets. The benefit of this allows one portlet to be instantiated several times, with different preference parameters. The following example instantiates two separate instances of the <computeroutput>NewsPortlet</computeroutput>, both using different parameters. One instance draws feeds from Red Hat announcements, and the other from McDonalds announcements:
- </para>
- <para>
-<programlisting><![CDATA[
-<?xml version="1.0" standalone="yes"?>
-<!DOCTYPE deployments PUBLIC
- "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
- "http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
-<deployments>
- <deployment>
- <instance>
- <instance-id>NewsPortletInstance1</instance-id>
- <portlet-ref>NewsPortlet</portlet-ref>
- <preferences>
- <preference>
- <name>expires</name>
- <value>180</value>
- </preference>
- <preference>
- <name>RssXml</name>
- <value>http://finance.yahoo.com/rss/headline?s=rhat</value>
- </preference>
- </preferences>
- <security-constraint>
- <policy-permission>
- <action-name>view</action-name>
- <unchecked/>
- </policy-permission>
- </security-constraint>
- </instance>
- </deployment>
- <deployment>
- <instance>
- <instance-id>NewsPortletInstance2</instance-id>
- <portlet-ref>NewsPortlet</portlet-ref>
- <preferences>
- <preference>
- <name>expires</name>
- <value>180</value>
- </preference>
- <preference>
- <name>RssXml</name>
- <value>http://finance.yahoo.com/rss/headline?s=mcd</value>
- </preference>
- </preferences>
- <security-constraint>
- <policy-permission>
- <action-name>view</action-name>
- <unchecked/>
- </policy-permission>
- </security-constraint>
- </instance>
- </deployment>
-</deployments>
-]]></programlisting>
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- <programlisting><![CDATA[<deployments>...</deployments>]]></programlisting>
- </para>
- <para>
- The <computeroutput><deployments></computeroutput> element encapsulates the entire document, and is a container for <computeroutput><deployment></computeroutput> elements. Multiple deployments can be specified within the <computeroutput><deployments></computeroutput> element.
- </para>
- </listitem>
- <listitem>
- <para>
-<programlisting><![CDATA[
-<deployment>
- <instance>...</instance>
-</deployment>]]></programlisting>
- </para>
- <para>
- The <computeroutput><deployment></computeroutput> element, and the embedded <computeroutput><instance></computeroutput> element, specify a portlet instance. The <computeroutput><deployment></computeroutput> element specifies object deployments, such as portals, pages, windows, and so on. The <computeroutput><instance></computeroutput> element creates instances of portlets. The portlet will only be created and configured if the portlet is present, and if an instance with the same name does not already exist.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<instance-id>...</instance-id>]]></programlisting>
- </para>
- <para>
- The <computeroutput><instance-id></computeroutput> elements defines a <emphasis role="bold">unique name</emphasis> given to an instance of a portlet. The <computeroutput><instance-id></computeroutput> value can be named anything, but it must match the value of one of the <computeroutput><instance-ref></computeroutput> elements in the <filename>WEB-INF/*-object.xml</filename> file.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<portlet-ref>...</portlet-ref>]]></programlisting>
- </para>
- <para>
- The <computeroutput><portlet-ref></computeroutput> element defines the portlet that an instance represents. The <computeroutput><portlet-ref></computeroutput> value must match the <computeroutput><portlet-name></computeroutput> given in the <filename>WEB-INF/portlet.xml</filename> file.
- </para>
- </listitem>
- <listitem>
- <para>
-<programlisting><![CDATA[
-<preferences>
- <preference>...</preference>
-</preferences>]]></programlisting>
- </para>
- <para>
- The <computeroutput><preference></computeroutput> element configures a preference as a key-value pair. This value can be composed of a single string value, for example, the preference <emphasis>fruit</emphasis> can have the <emphasis>apple</emphasis> value. As well, this value can be composed of multiple strings, for example, the preference <emphasis>fruits</emphasis> can have values of <emphasis>apple</emphasis>, <emphasis>orange</emphasis>, and <emphasis>kiwi</emphasis>:
- </para>
- <para>
-<programlisting><![CDATA[
-<preferences>
- <preference>
- <name>fruits</name>
- <value>apple</value>
- <value>orange</value>
- <value>kiwi</value>
- </preference>
-</preferences>
-]]></programlisting>
- </para>
- <para>
- The <computeroutput><preference></computeroutput> element configures one preference, which is part of a set of preferences. Use the <computeroutput><preferences></computeroutput> element to define a set of preferences.
- </para>
- </listitem>
- <listitem>
- <para>
-<programlisting><![CDATA[<security-constraint>
- <policy-permission>
- <action-name>viewrecursive</action-name>
- <unchecked/>
- </policy-permission>
-</security-constraint>]]></programlisting>
- </para>
- <para>
- The <computeroutput><security-constraint></computeroutput> element is a container for <computeroutput><policy-permission></computeroutput> elements. This example demonstrates the <computeroutput><security-constraint></computeroutput> and <computeroutput><policy-permission></computeroutput> elements.
- </para>
- <para>
- The <computeroutput><action-name></computeroutput> element defines the access rights given to the role defined. Accepted values are:
- </para>
- <para>
- <itemizedlist>
- <listitem override="bullet">
- <para>
- <computeroutput>view</computeroutput>: users can view the page.
- </para>
- </listitem>
- <listitem override="bullet">
- <para>
- <computeroutput>viewrecursive</computeroutput>: users can view the page and child pages.
- </para>
- </listitem>
- <listitem override="bullet">
- <para>
- <computeroutput>personalize</computeroutput>: users are able personalize the page's theme.
- </para>
- </listitem>
- <listitem override="bullet">
- <para>
- <computeroutput>personalizerecursive</computeroutput>: users are able personalize the page and child pages themes.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- You must define a role that the security constraint will apply to:
- </para>
- <para>
- <itemizedlist>
- <listitem override="bullet">
- <para>
- <computeroutput>unchecked</computeroutput>: anyone can view the page.
- </para>
- </listitem>
- <listitem override="bullet">
- <para>
- <computeroutput><role-name>EXAMPLEROLE</role-name></computeroutput>: only allow users that are part of the <computeroutput>EXAMPLEROLE</computeroutput> role to access the instance.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
-</itemizedlist>
-</para>
- <para>
- The previous <filename>portlet-instances.xml</filename> example makes reference to items found in other descriptor files. The following diagram illustrates the relationship between the <filename>portlet.xml</filename>, <filename>portlet-instances.xml</filename>, and <filename>*-object.xml</filename> descriptors:
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/tutorials/first_portlet/desc_relationship.png" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <note>
- <title>Is the <filename>portlet-instances.xml</filename> descriptor required?</title>
- <para>
- Technically, it is not. The portal object hierarchy, such as creating portals, pages, instances, and organizing them on the page, can be defined using the management portlet, which is accessible to JBoss Portal administrators.
- </para>
- </note>
- </section>
- <section>
- <title>The <filename>jboss-portlet.xml</filename> Descriptor</title>
- <para>
- The <filename>jboss-portlet.xml</filename> descriptor allows you to use JBoss-specific functionality within your portlet application. This descriptor is covered by the <ulink url="http://www.jcp.org/en/jsr/detail?id=168">JSR-168 Portlet Specification</ulink>, and is normally packaged inside your portlet WAR file, alongside the other descriptors in these sections.
- </para>
- <section>
- <title>Injecting Header Content</title>
- <para>
- The following example injects a specific style sheet, <computeroutput>/images/management/management.css</computeroutput>, allowing the portlet to leverage a specific style:
- </para>
- <para>
-<programlisting><![CDATA[
-<?xml version="1.0" standalone="yes"?>
-<!DOCTYPE portlet-app PUBLIC
- "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
-<portlet-app>
- <portlet>
- <portlet-name>ManagementPortlet</portlet-name>
- <header-content>
- <link rel="stylesheet" type="text/css" href="/images/management/management.css"
- media="screen"/>
- </header-content>
- </portlet>
-</portlet-app>]]>
-</programlisting>
- </para>
- <para>
- Use the <computeroutput><header-content></computeroutput> and <computeroutput><link></computeroutput> elements to specify a style sheet.
- </para>
- </section>
- <section>
- <title>Injecting Services in the portlet Context</title>
- <para>
- The following example injects the <computeroutput>UserModule</computeroutput> service as an attribute to the portlet context:
- </para>
- <para>
-<programlisting><![CDATA[
-<?xml version="1.0" standalone="yes"?>
-<!DOCTYPE portlet-app PUBLIC
- "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
-<portlet-app>
- <service>
- <service-name>UserModule</service-name>
- <service-class>org.jboss.portal.identity.UserModule</service-class>
- <service-ref>:service=Module,type=User</service-ref>
- </service>
-</portlet-app>]]>
-</programlisting>
- </para>
- <para>
- This allows the portlet to leverage the service, for example:
- </para>
- <para>
-<programlisting><![CDATA[
-UserModule userModule = (UserModule) getPortletContext().getAttribute("UserModule");
-String userId = request.getParameters().getParameter("userid");
-User user = userModule.findUserById(userId);]]>
-</programlisting>
- </para>
- </section>
- <section>
- <title>Defining extra portlet Information</title>
- <para>
- As of JBoss Portal 2.6.3, icons can be defined for a portlet by using the <computeroutput><icon></computeroutput>, <computeroutput><small-icon></computeroutput>, and <computeroutput><large-icon></computeroutput> elements:
- </para>
- <para>
-<programlisting><![CDATA[
-<?xml version="1.0" standalone="yes"?>
-<!DOCTYPE portlet-app PUBLIC
- "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
-<portlet-app>
- <portlet>
- <portlet-name>ManagementPortlet</portlet-name>
- <portlet-info>
- <icon>
- <small-icon>/images/smallIcon.png</small-icon>
- <large-icon>/images/largeIcon.png</small-icon>
- </icon>
- </portlet-info>
- </portlet>
-</portlet-app>]]>
-</programlisting>
- </para>
- <para>
- References to icons can be absolute, for example, <emphasis>http://www.example.com/images/smallIcon.png</emphasis>, or relative to the web application context, for example, <computeroutput>/images/smallIcon.png</computeroutput>. Icons can be used by different parts of the portlet user interface.
- </para>
- </section>
- <section>
- <title>Portlet Session Replication in a Clustered Environment</title>
-
- <para>
- For information about portlet session replication in clustered environments, refer to <xref linkend="portlet_session_replication"/>.
- </para>
- <para>
- <note>
- <title>Is the <filename>jboss-portlet.xml</filename> descriptor required?</title>
- <para>
- Technically, it is not; however, it may be required to access JBoss-specific functionality that is not covered by the Portlet specification.
- </para>
- </note>
- </para>
- </section>
- </section>
- <section>
- <title>The <filename>portlet.xml</filename> Descriptor</title>
- <para>
- The <filename>portlet.xml</filename> descriptor is the standard portlet descriptor covered by the <ulink url="http://www.jcp.org/en/jsr/detail?id=168">JSR-168 Portlet Specification</ulink>. Developers are strongly encouraged to read the <ulink url="http://www.jcp.org/en/jsr/detail?id=168">JSR-168 Portlet Specification</ulink> items covering the correct use of this descriptor, as it is only covered briefly in these sections. Normally the <filename>portlet.xml</filename> descriptor is packaged inside your portlet WAR file, alongside the other descriptors in these sections. The following example is a modified version of the JBoss Portal UserPortlet definition:
- </para>
- <para>
-<programlisting><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<portlet-app
- xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
- http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
- version="1.0">
- <portlet>
- <description>Portlet providing user login/logout and profile management</description>
- <portlet-name>UserPortlet</portlet-name>
- <display-name>User Portlet</display-name>
- <portlet-class>org.jboss.portal.core.portlet.user.UserPortlet</portlet-class>
- <init-param>
- <description>Initialize the portlet with a default page to render</description>
- <name>>default-view</name>
- <value>/WEB-INF/jsf/objects.xhtml</value>
- </init-param>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>VIEW</portlet-mode>
- </supports>
- <supported-locale>en</supported-locale>
- <supported-locale>fr</supported-locale>
- <supported-locale>es</supported-locale>
- <resource-bundle>Resource</resource-bundle>
- <portlet-info>
- <title>User portlet</title>
- </portlet-info>
- </portlet>
-</portlet-app>]]>
-</programlisting>
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- <programlisting><![CDATA[<portlet-app>...</portlet-app>]]></programlisting>
- </para>
- <para>
- The <computeroutput><portlet-app></computeroutput> element encapsulates the entire document. Multiple portlets can be specified using the <computeroutput><portlet-app></computeroutput> element.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<portlet>...</portlet>]]></programlisting>
- </para>
- <para>
- The <computeroutput><portlet></computeroutput> element defines one portlet that is deployed within this archive.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<description>...</description>]]></programlisting>
- </para>
- <para>
- The <computeroutput><description></computeroutput> element is a verbal description of the portlet's function.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<portlet-name>...</portlet-name>]]></programlisting>
- </para>
- <para>
- The <computeroutput><portlet-name></computeroutput> element defines the portlet name. It does not have to be the class name.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<portlet-class>...</portlet-class>]]></programlisting>
- </para>
- <para>
- The <computeroutput><portlet-class></computeroutput> element defines the Fully Qualified Name (FQN) of the portlet class.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[
-<init-param>
- <name>...</name>
- <value>...</value>
-</init-param>]]></programlisting>
- </para>
- <para>
- The <computeroutput><init-param></computeroutput> element specifies initialization parameters to create an initial state inside your portlet class. This is usually used in the portlet's <emphasis>init()</emphasis> method, but not necessarily. Unlike a preference, an init-parameter is data that does not change at runtime and does not go into a database. If the value is changed in the descriptor, the change takes immediate effect after re-deploying the portlet. Multiple <computeroutput><init-param></computeroutput> elements can be used.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<supports>...</supports>]]></programlisting>
- </para>
- <para>
- The <computeroutput><supports></computeroutput> element declares all of the markup types that a portlet supports. Use the <computeroutput><mime-type></computeroutput> element to declare supported capabilities, for example, if the only outputs are text and HTML, use <computeroutput><mime-type>text/html</mime-type></computeroutput>. Use the <computeroutput><portlet-mode></computeroutput> element to define the supported portlet modes for the portlet. For example, all portlets must support the <computeroutput>view</computeroutput> portlet mode, which is defined using <computeroutput><portlet-mode>view</portlet-mode></computeroutput>.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<supported-locale>...</supported-locale>]]></programlisting>
- </para>
- <para>
- The <computeroutput><supported-locale></computeroutput> elements advertise the supported locales for the portlet. Use multiple <computeroutput><supported-locale></computeroutput> elements to specify multiple locales.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<resource-bundle>...</resource-bundle>]]></programlisting>
- </para>
- <para>
- The <computeroutput><resource-bundle></computeroutput> element specifies the resource bundle that contains the localized information for the specified locales.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[
-<portlet-info>
- <title>...</title>
-</portlet-info>]]></programlisting>
- </para>
- <para>
- The <computeroutput><title></computeroutput> element defines the portlet's title, which is displayed in the portlet window's title bar.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- <warning>
- <title>The <filename>portlet.xml</filename> Example</title>
- <para>
- This <filename>portlet.xml</filename> example is not a replacement for what is covered in the <ulink url="http://www.jcp.org/en/jsr/detail?id=168">JSR-168 Portlet Specification</ulink>.
- </para>
- </warning>
- </para>
- </section>
- </section>
- <section id="portaldescriptors">
- <title>JBoss Portal Descriptors</title>
- <para>
- This section describes Datasource descriptors, which are required for JBoss Portal to communicate with a database, and briefly covers the <filename>jboss-portal.sar/conf/config.xml</filename> descriptor, which can be used for configuring logging, and configuring which page a user goes to when they log in.
- </para>
- <section id="descriptor_ds">
- <title>Datasource Descriptors (<filename>portal-*-ds.xml</filename>)</title>
- <para>
- JBoss Portal requires a Datasource descriptor to be deployed alongside the <filename>jboss-portal.sar</filename>, in order to communicate with a database. This section explains where to obtain template Datasource descriptors, how to compile them from source, and how to configure them for your installation. For an in-depth introduction to datasources, refer to the JBoss AS documentation online on the <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfigDataSources">JBoss Datasource Wiki page</ulink>.
- </para>
- <section>
- <title>Datasource Descriptors included in Binary releases</title>
- <para>
- Several template Datasource descriptors are included in the binary and bundled distributions of JBoss Portal. They are commonly located in the <filename>jboss-portal-<replaceable>version</replaceable>/setup/</filename> directory:
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/setup/package.png" valign="middle"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- The <filename>jboss-portal-<replaceable>version</replaceable>/setup/</filename> directory contains sample Datasource descriptors for the MySQL, Microsoft SQL Server, PostgreSQL, and Oracle databases, which can be customized for your own database:
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/setup/dsfiles.png" valign="middle"/>
- </imageobject>
- </mediaobject>
- </para>
- </section>
- <section>
- <title>Building Datasource Descriptors from Source</title>
- <para>
- To build the Datasource descriptors from source:
- </para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- Obtain the JBoss Portal source code: <xref linkend="install_source"/>.
- </para>
- </listitem>
- <listitem>
- <para>
- Configure the <computeroutput>JBOSS_HOME</computeroutput> environment variable: <xref linkend="install_source_env"/>.
- </para>
- </listitem>
- <listitem>
- <para>
- Change into the <filename>JBOSS_PORTAL_SOURCE_DIRECTORY/build/</filename> directory. To build the JBoss Portal source code on Linux, run the <command>sh build.sh deploy</command> command, or, if you are running Windows, run the <command>build.bat deploy</command> command. If this is the first build, third-party libraries are obtained from an online repository, so you must be connected to the Internet. After building, if the <filename>JBOSS_PORTAL_SOURCE_DIRECTORY/thirdparty/</filename> directory does not exist, it is created, and populated with the files required for later steps. For further details, refer to <xref linkend="building_deploying_from_source"/>.
- </para>
- </listitem>
- <listitem>
- <para>
- Change into the <filename>JBOSS_PORTAL_SOURCE_DIRECTORY/core/</filename> directory, and run the <command>sh build.sh datasource</command> command, or, if you are running Windows, run the <command>build.bat datasource</command> command:
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/setup/build_ds.png" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- </listitem>
- </orderedlist>
- </para>
- <para>
- Note: if the JBoss Portal source was not built as per step 3, the <command>sh build.sh datasource</command> and <command>build.bat datasource</command> commands fail with an error, such as the following:
- </para>
- <para>
-<programlisting><![CDATA[
-BUILD FAILED
-java.io.FileNotFoundException: /jboss-portal-2.6.3.GA-src/core/../thirdparty/libraries.ent
-(No such file or directory)]]>
-</programlisting>
- </para>
- <para>
- The datasource build process produces the following directory and file structure, with the Datasource descriptors in the <filename>JBOSS_PORTAL_SOURCE_DIRECTORY/core/output/resources/setup</filename> directory:
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/setup/build_ds_dir.png"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- The following is an example Datasource descriptor for a PostgreSQL database:
- </para>
- <para>
-<programlisting><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<datasources>
- <local-tx-datasource>
- <jndi-name>PortalDS</jndi-name>
- <connection-url>jdbc:postgresql:jbossportal</connection-url>
- <driver-class>org.postgresql.Driver</driver-class>
- <user-name>portal</user-name>
- <password>portalpassword</password>
- </local-tx-datasource>
-</datasources>]]>
-</programlisting>
- </para>
- <para>
- Make sure the <computeroutput>user-name</computeroutput>, <computeroutput>password</computeroutput>, <computeroutput>connection-url</computeroutput>, and <computeroutput>driver-class</computeroutput>, are correct for your chosen database.
- </para>
- </section>
- </section>
- <section id="descriptor_debug">
- <title>Portlet Debugging (<filename>jboss-portal.sar/conf/config.xml</filename>)</title>
- <para>
- By default, JBoss Portal is configured to display all errors. This behavior can be configured by modifying the <filename>jboss-portal.sar/conf/config.xml</filename> file:
- </para>
- <para>
-<programlisting><![CDATA[
-<!-- When a window has restrictedaccess : show or hide values are permitted -->
-<entry key="core.render.window_access_denied">show</entry>
-<!-- When a window is unavailable : show or hide values are permitted -->
-<entry key="core.render.window_unavailable">show</entry>
-<!-- When a window produces an error : show, hide or message_only values are permitted -->
-<entry key="core.render.window_error">message_only</entry>
-<!-- When a window produces an internal error : show, hide are permitted -->
-<entry key="core.render.window_internal_error">show</entry>
-<!-- When a window is not found : show or hide values are permitted -->
-<entry key="core.render.window_not_found">show</entry>]]>
-</programlisting>
- </para>
- <para>
- For these parameters, accepted values are <computeroutput>show</computeroutput> and <computeroutput>hide</computeroutput>. Depending on the setting, and the actual error, either an error message is displayed, or a full stack trace within the portlet window occurs. Additionally, the <computeroutput>core.render.window_error</computeroutput> property supports the <computeroutput>message_only</computeroutput> value. The <computeroutput>message_only</computeroutput> value will only display an error message, whereas the <computeroutput>show</computeroutput> value will, if available, display the full stack trace.
- </para>
- </section>
- <section>
- <title>Log in to Dashboard</title>
- <para>
- By default, when a user logs in they are forwarded to the default page of the default portal. In order to
- forward a user to their Dashboard, set the <computeroutput>core.login.namespace</computeroutput> value to <computeroutput>dashboard</computeroutput> in the <filename>jboss-portal.sar/conf/config.xml</filename> file:
- </para>
- <para>
-<programlisting><![CDATA[
-<!-- Namespace to use when logging-in, use "dashboard" to directly
-log-in the dashboard otherwise use "default" -->
-<entry key="core.login.namespace">dashboard</entry>
-]]></programlisting>
- </para>
- </section>
- </section>
- <section id="desc_examples">
- <title>Descriptor Examples</title>
- <section id="desc_example_page">
- <title>Defining a new Portal Page</title>
- <para>
- The sample application descriptor in this section creates a new page, <computeroutput>MyPage</computeroutput>, in a portal. To illustrate this example, download the <ulink url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles/HelloWorl...">HelloWorldPortalPage</ulink> portlet. To use the HelloWorldPortalPage portlet:
- </para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- Download the <ulink url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles/HelloWorl...">HelloWorldPortalPage</ulink> portlet.
- </para>
- </listitem>
- <listitem>
- <para>
- Unzip the <filename>HelloWorldPortalPage</filename> ZIP file.
- </para>
- </listitem>
- <listitem>
- <para>
- To expand the WAR file, which gives you access to the XML descriptors, change into the <filename>HelloWorldPortalPage/</filename> directory, and run the <command>ant explode</command> command.
- </para>
- </listitem>
- <listitem>
- <para>
- If you did not expand the <filename>helloworldportalpage.war</filename> file, copy the <filename>helloworldportalpage.war</filename> file into the correct JBoss AS or JBoss EAP <filename>deploy/</filename> directory. If you expanded the <filename>helloworldportalpage.war</filename> file, copy the <filename>HelloWorldPortalPage/output/lib/exploded/helloworldportalpage.war/</filename> directory into the correct JBoss AS or JBoss EAP <filename>deploy/</filename> directory. For example, if you are using the <computeroutput>default</computeroutput> JBoss AS profile, copy the WAR file or the expanded directory into the <filename>$JBOSS_HOME/server/default/deploy/</filename> directory.
- </para>
- </listitem>
- </orderedlist>
- </para>
- <para>
- The HelloWorldPortalPage portlet is hot-deployable, so the JBoss EAP or JBoss AS server does not have to be restarted after deploying the HelloWorldPortalPage portlet. The following is an example of the <filename>HelloWorldPortalPage/WEB-INF/helloworld-object.xml</filename> descriptor:
- </para>
- <para>
-<programlisting><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE deployments PUBLIC
- "-//JBoss Portal//DTD Portal Object 2.6//EN"
- "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
-<deployments>
- <deployment>
- <if-exists>overwrite</if-exists>
- <parent-ref>default</parent-ref>
- <properties/>
- <page>
- <page-name>MyPage</page-name>
- <window>
- <window-name>HelloWorldPortletPageWindow</window-name>
- <instance-ref>HelloWorldPortletPageInstance</instance-ref>
- <region>center</region>
- <height>0</height>
- </window>
- <security-constraint>
- <policy-permission>
- <unchecked/>
- <action-name>viewrecursive</action-name>
- </policy-permission>
- </security-constraint>
- </page>
- </deployment>
-</deployments>]]>
-</programlisting>
- </para>
- <para>
- A depoloyment is composed of a <computeroutput><deployments></computeroutput> element, which is a container for <computeroutput><deployment></computeroutput> elements. In the previous example, a page is defined, the portlet is placed as a window on a page, and an instance of the portlet is created. The Mangement portlet (bundled with JBoss Portal) can modify portal instances, page position, and so on.
- </para>
- <para>
- The following list describes elements in a <filename>*-object.xml</filename> file:
- </para>
- <para>
- <itemizedlist>
- <listitem>
-<programlisting>
-<if-exists>
-</programlisting>
- <para>
- The <computeroutput><if-exists></computeroutput> element defines the action to take if an instance with the same name already exists. Accepted values are <computeroutput>overwrite</computeroutput> and <computeroutput>keep</computeroutput>. The <computeroutput>overwrite</computeroutput> option destroys the existing object, and creates a new one based on the content of the deployment. The <computeroutput>keep</computeroutput> option matains the existing object deployment, or creates a new one if it does not exist.
- </para>
- </listitem>
- <listitem>
-<programlisting>
-<parent-ref>
-</programlisting>
- <para>
- The <computeroutput><parent-ref></computeroutput> element contains a reference to the parent object. The naming convention for naming objects is to concatenate the names of the path to the object, and separate the names using a period. If the path is empty, the empty string must be used. The <computeroutput><parent-ref></computeroutput> element tells the portal where the portlet appears. The syntax for the <computeroutput><parent-ref></computeroutput> element is <computeroutput><replaceable>portal-instance</replaceable>.<replaceable>portal-page</replaceable></computeroutput>.
- </para>
- </listitem>
- <listitem>
-<programlisting>
-<properties>
-</programlisting>
- <para>
- A set of generic properties for the portal object. The <computeroutput><properties></computeroutput> elements contains definitions specific to a page. This is commonly used to define the specific theme and layout to use. If not defined, the default portal theme and layout are used.
- </para>
- </listitem>
- <listitem>
-<programlisting>
-<page>
-</programlisting>
- <para>
- The start of a page definition. Among others, the <computeroutput><page></computeroutput> element is a container for the <computeroutput><page-name></computeroutput>, <computeroutput><window></computeroutput>, and <computeroutput><security-constraint></computeroutput> elements.
- </para>
- </listitem>
- <listitem>
-<programlisting>
-<page-name>
-</programlisting>
- <para>
- The page name.
- </para>
- </listitem>
- <listitem>
-<programlisting>
-<window>
-</programlisting>
- <para>
- The <computeroutput><window></computeroutput> element defines a portlet window. The <computeroutput><window></computeroutput> element requires an <computeroutput><instance-ref></computeroutput> element, which assigns a portal instance to a window.
- </para>
- </listitem>
- <listitem>
-<programlisting>
-<window-name>
-</programlisting>
- <para>
- The <computeroutput><window-name></computeroutput> element defines the <emphasis role="bold">unique name</emphasis> given to a portlet window. This can be named anything.
- </para>
- </listitem>
- <listitem>
-<programlisting>
-<instance-ref>
-</programlisting>
- <para>
- The <computeroutput><instance-ref></computeroutput> elements define the portlet instances that windows represent. This value is the ID of a portlet instance, and must match the value of one of the <computeroutput><instance-id></computeroutput> elements in the <filename>WEB-INF/portlet-instances.xml</filename> file.
- </para>
- </listitem>
- <listitem>
-<programlisting>
-<region>...</region>
-<height>...</height>
-</programlisting>
- <para>
- The <computeroutput><region></computeroutput> and <computeroutput><height></computeroutput> elements define where the window appears within the page layout. The <computeroutput><region></computeroutput> element specifies where the window appears on the page. The <computeroutput><region></computeroutput> element often depends on other regions defined in the portal layout. The <computeroutput><height></computeroutput> element can be assigned a value between one and <replaceable>X</replaceable>.
- </para>
- </listitem>
- <listitem>
-<programlisting>
-<instance>
-</programlisting>
- <para>
- The <computeroutput><instance></computeroutput> element creates instances of portlets. The portlet will only be created and configured if the portlet is present, and if an instance with the same name does not already exist.
- </para>
- </listitem>
- <listitem>
-<programlisting>
-<instance-name>
-</programlisting>
- <para>
- The <computeroutput><instance-name></computeroutput> element maps to the <computeroutput><instance-ref></computeroutput> element.
- </para>
- </listitem>
- <listitem>
-<programlisting>
-<component-ref>
-</programlisting>
- <para>
- The <computeroutput><component-ref></computeroutput> element takes the name of the application, followed by the name of the portlet, as defined in the <filename>WEB-INF/portlet.xml</filename> file.
- </para>
- </listitem>
- </itemizedlist>
-</para>
-<para>
- The <computeroutput><security-constraint></computeroutput> element is a container for <computeroutput><policy-permission></computeroutput> elements. The following is an example of the <computeroutput><security-constraint></computeroutput> and <computeroutput><policy-permission></computeroutput> elements:
-</para>
-<para>
-<programlisting><![CDATA[
-<security-constraint>
- <policy-permission>
- <role-name>User</role-name>
- <action-name>view</action-name>
- </policy-permission>
-</security-constraint>
-
-<security-constraint>
- <policy-permission>
- <unchecked/>
- <action-name>view</action-name>
- </policy-permission>
-</security-constraint>]]>
-</programlisting>
-</para>
-<para>
-<programlisting>
-<action-name>
-</programlisting>
- </para>
- <para>
- The <computeroutput><action-name></computeroutput> element defines the access rights given to the role defined. Accepted values are:
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- <computeroutput>view</computeroutput>: users can view the page.
- </para>
- </listitem>
- <listitem>
- <para>
- <computeroutput>viewrecursive</computeroutput>: users can view the page and child pages.
- </para>
- </listitem>
- <listitem>
- <para>
- <computeroutput>personalize</computeroutput>: users are able personalize the page's theme.
- </para>
- </listitem>
- <listitem>
- <para>
- <computeroutput>personalizerecursive</computeroutput>: users are able personalize the page and child pages themes.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
-<programlisting>
-<unchecked/>
-</programlisting>
- </para>
- <para>
- If present, the <computeroutput><unchecked></computeroutput> element defines that anyone can view the instance.
- </para>
- <para>
-<programlisting>
-<role-name>
-</programlisting>
- </para>
- <para>
- The <computeroutput><role-name></computeroutput> element defines a role that the security constraint will apply to. The following example only allows users that are part of the <computeroutput>EXAMPLEROLE</computeroutput> role to access the instance:
- </para>
- <para>
-<programlisting>
-<role-name>EXAMPLEROLE</role-name>
-</programlisting>
- </para>
- </section>
- <section id="desc_example_portal">
- <title>Defining a new Portal Instance</title>
- <para>
- The sample application descriptor in this section creates a new portal instance, <computeroutput>HelloPortal</computeroutput>, that contains two pages. To illustrate this example, download the <ulink url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles/HelloWorl...">HelloWorldPortal</ulink> portlet. To use the HelloWorldPortal portlet:
- </para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- Download the <ulink url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles/HelloWorl...">HelloWorldPortal</ulink> portlet.
- </para>
- </listitem>
- <listitem>
- <para>
- Unzip the <filename>HelloWorldPortal</filename> ZIP file.
- </para>
- </listitem>
- <listitem>
- <para>
- To expand the WAR file, which gives you access to the XML descriptors, change into the <filename>HelloWorldPortal/</filename> directory, and run the <command>ant explode</command> command.
- </para>
- </listitem>
- <listitem>
- <para>
- If you did not expand the <filename>helloworldportal.war</filename> file, copy the <filename>helloworldportal.war</filename> file into the correct JBoss AS or JBoss EAP <filename>deploy/</filename> directory. If you expanded the <filename>helloworldportal.war</filename> file, copy the <filename>HelloWorldPortal/output/lib/exploded/helloworldportal.war/</filename> directory into the correct JBoss AS or JBoss EAP <filename>deploy/</filename> directory. For example, if you are using the <computeroutput>default</computeroutput> JBoss AS profile, copy the WAR file or the expanded directory into the <filename>$JBOSS_HOME/server/default/deploy/</filename> directory.
- </para>
- </listitem>
- </orderedlist>
- </para>
- <para>
- The HelloWorldPortal portlet is hot-deployable, so the JBoss EAP or JBoss AS server does not have to be restarted after deploying the HelloWorldPortal portlet. The following is an example of the <filename>HelloWorldPortal/WEB-INF/helloworld-object.xml</filename> descriptor:
- </para>
- <para>
-<programlisting><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE deployments PUBLIC
- "-//JBoss Portal//DTD Portal Object 2.6//EN"
- "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
-<deployments>
- <deployment>
- <parent-ref/>
- <if-exists>overwrite</if-exists>
- <portal>
- <portal-name>HelloPortal</portal-name>
- <supported-modes>
- <mode>view</mode>
- <mode>edit</mode>
- <mode>help</mode>
- </supported-modes>
- <supported-window-states>
- <window-state>normal</window-state>
- <window-state>minimized</window-state>
- <window-state>maximized</window-state>
- </supported-window-states>
- <properties>
- <!-- Set the layout for the default portal -->
- <!-- see also portal-layouts.xml -->
- <property>
- <name>layout.id</name>
- <value>generic</value>
- </property>
- <!-- Set the theme for the default portal -->
- <!-- see also portal-themes.xml -->
- <property>
- <name>theme.id</name>
- <value>renaissance</value>
- </property>
- <!-- set the default render set name (used by the render tag in layouts) -->
- <!-- see also portal-renderSet.xml -->
- <property>
- <name>theme.renderSetId</name>
- <value>divRenderer</value>
- </property>
- </properties>
- <security-constraint>
- <policy-permission>
- <action-name>personalizerecursive</action-name>
- <unchecked/>
- </policy-permission>
- </security-constraint>
- <page>
- <page-name>default</page-name>
- <security-constraint>
- <policy-permission>
- <action-name>viewrecursive</action-name>
- <unchecked/>
- </policy-permission>
- </security-constraint>
- <window>
- <window-name>MyPortletWindow</window-name>
- <instance-ref>MyPortletInstance</instance-ref>
- <region>center</region>
- <height>0</height>
- </window>
- </page>
- </portal>
- </deployment>
- <deployment>
- <parent-ref>HelloPortal</parent-ref>
- <if-exists>overwrite</if-exists>
- <page>
- <page-name>foobar</page-name>
- <security-constraint>
- <policy-permission>
- <action-name>viewrecursive</action-name>
- <unchecked/>
- </policy-permission>
- </security-constraint>
- <window>
- <window-name>MyPortletWindow</window-name>
- <instance-ref>MyPortletInstance</instance-ref>
- <region>center</region>
- <height>0</height>
- </window>
- </page>
- </deployment>
-</deployments>]]>
-</programlisting>
- </para>
- <para>
- When deployed, this example registers a new portal instance, <computeroutput>HelloPortal</computeroutput>, that contains two pages. To view the default page in the <computeroutput>HelloPortal</computeroutput> instance, navigate to <ulink url="http://localhost:8080/portal/portal/HelloPortal"/>, and for the second page, <ulink url="http://localhost:8080/portal/portal/HelloPortal/foobar"/>.
- </para>
- <para>
- <note>
- <title>Portal Instance <computeroutput>default</computeroutput> Page</title>
- <para>
- For a portal instance to be accessible via a Web browser, you must define a default page.
- </para>
- </note>
- </para>
- </section>
- </section>
-</chapter>
- <chapter id="urls">
- <!--<chapterinfo>
- <author>
- <firstname>Julien</firstname>
- <surname>Viet</surname>
- </author>
- <author>
- <firstname>Thomas</firstname>
- <surname>Heute</surname>
- </author>
- <author>
- <firstname>Roy</firstname>
- <surname>Russo</surname>
- </author>
- </chapterinfo>-->
- <title>Portal URLs</title>
- <section>
- <title>Introduction to Portals</title>
- <para>
- Portal URLs are often very complicated; however, it is possible to setup entry points in portals that follow simple patterns.
- </para>
- <para>
- Each portal container can contain multiple portals. Within a given portal, windows are organized into pages, with a page being a collection of windows associated to a name:
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/tutorials/SpecPortalDef.png" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- Before reading the following sections, be familiar with how to define pages and portal. Refer to <xref linkend="desc_example_page"/> for details.
- </para>
- </section>
- <section>
- <title>Accessing a Portal</title>
- <para>
- The <computeroutput>default</computeroutput> portal is used when no portal is specified. How selection is done:
- </para>
-
- <itemizedlist>
- <listitem>
- <para>
- <computeroutput>/portal/</computeroutput> points to the default page of the default portal.
- </para>
- </listitem>
- <listitem>
- <para>
- <computeroutput>/portal/<replaceable>portal-name</replaceable>/</computeroutput> points to the default page of the <replaceable>portal-name</replaceable> portal.
- </para>
- </listitem>
- </itemizedlist>
-
- <note><title>Note</title><para>The default page or portal can be specified either by using the admin portlet or by using the XML descriptors as explained in the <xref linkend="xml.default.objectname.property"/>.</para></note>
-
-
- </section>
- <section>
- <title>Accessing a Page</title>
- <para>
- Each portal can have multiple pages, with each portal having a default page. When a portal is selected, a page must be used, and all windows in that page are rendered. The page selection mechanism is as follows:
- </para>
- <para>
- <computeroutput>/portal/default/<replaceable>page-name</replaceable></computeroutput> renders the <replaceable>page-name</replaceable> page.
- </para>
- </section>
- <section>
- <title>Accessing CMS Content</title>
- <para>
- The <emphasis>CMSPortlet</emphasis> delivers content transparently, without modifying the displayed URL. It is desirable to display binary content, such as GIF, JPEG, PDF, ZIP, and so on, outside of the confines of the portal. For example, <computeroutput>/content/default/images/jboss_logo.gif</computeroutput> displays the <computeroutput>jboss_logo.gif</computeroutput> file outside of the portal.
- </para>
- <para>
- To display content outside of the portal, the portal interprets any path beginning with <computeroutput>/content</computeroutput> as a request for CMS content. As long as the <computeroutput><mime-type></computeroutput> is not <computeroutput>text/html</computeroutput>, or <computeroutput>text/text</computeroutput>, and the path to the content begins with <computeroutput>/content</computeroutput>, the content is rendered independently, outside of the portal.
- </para>
- </section>
- <!--
- <section>
- <title>Advanced portal urls</title>
- <para>JBoss Portal can consume and produce URLs in a very flexible manner. Consuming means
- that an URL is accepted by the portal, translated into some action and send a response to the
- browser. Producing means to create an URL for a particular action when the portal needs one.
- This part is an advanced topic explaining the internal mechanisms developped in JBoss Portal to
- produce and consumer URLs. It should be readen with care as it exposes internals of JBoss Portal
- that may change in later releases of the product.</para>
- <para>JBoss Portal url handling mechanism is based on several design patterns.</para>
- <section>
- <title>Portal Commands</title>
- <para></para>
- </section>
- <section>
- <title>Portal urls</title>
- <para>At runtime portal commands are converted back and forth into portal urls. Creation
- of urls and decoding of urls is now known at compile time, otherwise that would lead
- to a very inflexible portal since changing the behavior would imply to update the source
- code and recompile the portal, that would not be an acceptable solution. There is
- a well known design pattern which provides an elegant and powerful solution to this problem and
- is called Chain of Responsibility.</para>
- <para>Portal commands have a state which parameterizes them. For instance there is a command
- called <emphasis>ViewPageCommand</emphasis> which displays a portal page in the browser. The state
- of that command consist in the id of the page. There is a bidirectionnal mapping between portal urls
- and portal commands. Portal commands are created from URL using a service called <emphasis>CommandFactory</emphasis>,
- which takes a request object and provides a portal command. Conversely, portal urls are created from
- portal commands using a service called <emphasis>URLFactory</emphasis>.</para>
- <para>The task of decoding urls is performed by a set of command factories which are wired
- together in the configuration file. We can dist</para>
- </section>
- </section>
- -->
-</chapter>
- <chapter id="coordination">
- <!--<chapterinfo>
- <author>
- <firstname>Boleslaw</firstname>
- <surname>Dawidowicz</surname>
- </author>
- </chapterinfo>-->
- <title>JBoss Portal Explicit Coordination</title>
- <section>
- <title>Explicit vs implicit coordination</title>
- <para>
- Portlet 2.0 coordination features are mediated by the portal between several
- portlet windows, therefore the portal at runtime needs to be able to define
- relationships between windows. Relationship can be established from an implicit
- model (i.e a set of predicates applied on some state that will answer TRUE/FALSE
- to the question are the portlet windows foo and bar in a relationship) or from an
- explicit model (that states that foo and bar have a relationship). The implicit
- model is very good for defining default configuration as it does not require much
- configuration but is not able to cover the exceptional case, that's why we need
- to combine it with an explicit model that will take precedence over the implicit
- model, it is the well known principle of convention over configuration.
- </para>
- <para>
- Currently all explicit coordination happens only in the scope of the same page.
- </para>
- </section>
- <section>
- <title>Bindings and wirings</title>
-
- <section>
- <title>Event wiring</title>
-
- <para>
- Wires JSR-286 events. With implicit wirings the event producer and the
- consumer declares the same event namespace and local name to get event
- delivered in the scope of the same page. With explicit wiring any pairs of
- Window:Event can be connected.
- </para>
- </section>
- <section>
- <title>Parameter binding</title>
-
- <para>
- Binds JSR-286 shared parameters. With implicit binding parameters with the
- same public name are shared. With explicit binding any public parameters can
- share values. Windows for which such binding applies are explicitly defined.
- </para>
- </section>
- <section>
- <title>Alias binding</title>
-
- <para>
- Explicit alias binding define a name of page scoped parameter that will apply
- value to specified portlet windows public parameters.
- </para>
-
- <programlisting><![CDATA[http://localhost:8080/portal/portal/default/Coordination+Samples?aliasBinding1=someValue]]></programlisting>
- </section>
- </section>
- <section>
- <title>Coordination configuration</title>
-
- <para>
- Configuration takes place in -object.xml file. The <coordination> tag
- can be used in both <page> and <portal> tags. When used in
- <portal> tag only <implicit-mode> tag can be defined for wirings
- and bindings:
- </para>
-
- <programlisting role="XML"><![CDATA[<portal>
-
- ...
-
- <coordination>
- <bindings>
- <implicit-mode>TRUE</implicit-mode>
- </bindings>
- <wirings>
- <implicit-mode>FALSE</implicit-mode>
- </wirings>
- </coordination>
-
-</portal>]]></programlisting>
- <para>
- When used within the <page> tag coordination event wirings and bindings
- can be defined:</page></para>
-
- <programlisting role="XML"><![CDATA[<coordination>
-
- <wirings>
- <implicit-mode>TRUE</implicit-mode>
- <event-wiring>
- <name>eventWiring1</name>
- <sources>
- <window-coordination>
- <window-name>ShoppingCatalogPortletWindow1</window-name>
- <qname>{urn:jboss:portal:samples:event}CartEvent</qname>
- </window-coordination>
- </sources>
- <destinations>
- <window-coordination>
- <window-name>ShoppingCartPortletWindow2</window-name>
- <qname>{urn:jboss:portal:samples:event}CartEvent</qname>
- </window-coordination>
- <window-coordination>
- <window-name>ShoppingCartPortletWindow3</window-name>
- <qname>{urn:jboss:portal:samples:event}CartEvent</qname>
- </window-coordination>
- </destinations>
- </event-wiring>
- <event-wiring>
- <name>eventWiring2</name>
- <sources>
- <window-coordination>
- <window-name>ShoppingCatalogPortletWindow2</window-name>
- <qname>{urn:jboss:portal:samples:event}CartEvent</qname>
- </window-coordination>
- </sources>
- <destinations>
- <window-coordination>
- <window-name>ShoppingCartPortletWindow1</window-name>
- <qname>{urn:jboss:portal:samples:event}CartEvent</qname>
- </window-coordination>
- <window-coordination>
- <window-name>ShoppingCartPortletWindow4</window-name>
- <qname>{urn:jboss:portal:samples:event}CartEvent</qname>
- </window-coordination>
- </destinations>
- </event-wiring>
- </wirings>
-
-
- <bindings>
- <implicit-mode>FALSE</implicit-mode>
-
- <parameter-binding>
- <id>parameterBinding1</id>
- <window-coordination>
- <window-name>SomePortletWindow1</window-name>
- <qname>foo</qname>
- </window-coordination>
- <window-coordination>
- <window-name>SomePortletWindow2</window-name>
- <qname>foo</qname>
- </window-coordination>
- <window-coordination>
- <window-name>SomePortletWindow3</window-name>
- <qname>foo</qname>
- </window-coordination>
- </parameter-binding>
-
- <parameter-binding>
- <id>parameterBinding2</id>
- <window-coordination>
- <window-name>SomePortletWindow1</window-name>
- <qname>bar1</qname>
- </window-coordination>
- <window-coordination>
- <window-name>SomePortletWindow2</window-name>
- <qname>{urn:jboss:portal:samples:daa1}daa1</qname>
- </window-coordination>
- </parameter-binding>
-
- <alias-binding>
- <id>aliasBinding1</id>
- <qname>foo</qname>
- </alias-binding>
-
- <alias-binding>
- <id>aliasBinding2</id>
- <qname>bar1</qname>
- <qname>{urn:jboss:portal:samples:daa2}daa2</qname>
- </alias-binding>
-
- </bindings>
-</coordination>]]></programlisting>
-
- <section>
- <title><implicit-mode></title>
-
- <para>
- This tag can be applied for both <bindings> and <wirings>
- tags. It defines if implicit coordination is enabled or disabled for
- this given portal object. Value of this setting is cascaded to all
- children in portal object tree unless overwritten somewhere in the
- hierarchy. If no <implicit-mode> is defined in portal object tree
- default value is TRUE.
- </para>
- </section>
- </section>
- <section>
- <title>Coordination Samples</title>
- <para>
- JBoss Portal comes with several examples in 'Coordination Samples' page. Its good
- to follow them looking at the configuration file that can be found in
- portal-coordination-samples.war/WEB-INF/default-object.xml
- </para>
- </section>
-</chapter>
- <chapter id="errorhandling">
- <!-- <chapterinfo>
- <author>
- <firstname>Julien</firstname>
- <surname>Viet</surname>
- </author>
- </chapterinfo>-->
- <title>Error Handling Configuration</title>
- <para>
- The JBoss Portal request pipeline allows fine-grained, dynamic configuration of how JBoss Portal behaves when errors occur during runtime.
- </para>
- <section>
- <title>Error Types</title>
- <para>There are several types of errors that can occur during a request:
- <itemizedlist>
- <listitem>
- <para>
- <emphasis>Access denied</emphasis>: the user does not have the required permissions to access the resource.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>Error</emphasis>: an anticipated error, such as when a portlet throws an exception.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>Internal error</emphasis>: an unexpected error.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>Resource not found</emphasis>: the resource was not found.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>Resource unavailable</emphasis>: the resource was found, but was not serviceable.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>Control Policies</title>
- <para>If an error occurs, the request control-flow changes according to the configuration. This configuration is known as the <emphasis>control policy</emphasis>.
- </para>
- <section>
- <title>Policy Delegation and Cascading</title>
- <para>
- When a control policy is invoked, the response sent by the control flow can be changed. If the control policy ignores the error, the error is handled by the next policy. If the control policy provides a new response, the next policy is not invoked, since the new response is not an error.
- </para>
- <para>
- If a portlet in a page produces an exception, the following reactions are possible:
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- the error is displayed in the window.
- </para>
- </listitem>
- <listitem>
- <para>
- the window is removed from the aggregation.
- </para>
- </listitem>
- <listitem>
- <para>
- a portal error page is displayed.
- </para>
- </listitem>
- <listitem>
- <para>
- a HTTP 500 error response is sent to the Web browser.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>Default Policy</title>
- <para>The default policy applies when errors are not handled by another level. By default, errors are translated
- into the most appropriate HTTP response:
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- Access denied: <computeroutput>HTTP 403 Forbidden</computeroutput>
- </para>
- </listitem>
- <listitem>
- <para>
- Error: <computeroutput>HTTP 500 Internal Server Error</computeroutput>
- </para>
- </listitem>
- <listitem>
- <para>
- Internal error: <computeroutput>HTTP 500 Internal Server Error</computeroutput>
- </para>
- </listitem>
- <listitem>
- <para>
- Resource not found: <computeroutput>HTTP 404 Not Found</computeroutput>
- </para>
- </listitem>
- <listitem>
- <para>
- Resource unavailable: <computeroutput>HTTP 404 Not Found</computeroutput>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>Portal Policy</title>
- <para>
- The portal error-policy controls the response sent to the Web browser when an error occurs. A default error policy exists, which can be configured per portal. If an error occurs, the policy can either handle a redirect to a JSP page, or ignore it. If the error is ignored, it is handled by the default policy, otherwise a JSP page is invoked with the appropriate request attributes, allowing page customization.
- </para>
- </section>
- <section>
- <title>Page Policy</title>
- <para>
- The window error-policy controls how pages react to aggregation errors. Most of the time pages are an aggregation of several portlet windows, and the action to take when an error occurs differs from other policies. When an error occurs, the policy can either handle it, or ignore it. If the error is ignored, it is handled by the portal policy. Possible actions taken after such errors are:
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- remove the window from the aggregation.
- </para>
- </listitem>
- <listitem>
- <para>
- replace the markup of the window using a redirect to a JSP page.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- </section>
- <section>
- <title>Configuration using XML Descriptors</title>
- <para>
- Different policies are configured using portal object properties, allowing the error-handling policy for objects to be configured in XML descriptors -- the <filename>*-object.xml</filename> files -- for a portal deployment.
- </para>
- <section>
- <title>Portal Policy Properties</title>
- <para>
- A set of properties configure the the behavior of the portal policy. These properties are only taken into account for objects that use the <emphasis>portal</emphasis> type. The following table represents possible portal-policy properties:
- </para>
-
- <table frame="all"><title/>
- <tgroup cols="3" align="left" colsep="1">
- <colspec colname="c1"/>
- <colspec colname="c2"/>
- <colspec colname="c3"/>
- <thead>
- <row>
- <entry align="center">Property Name</entry>
- <entry align="center">Description</entry>
- <entry align="center">Possible Values</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry align="center"><computeroutput>control.portal.access_denied</computeroutput></entry>
- <entry align="center">when access is denied</entry>
- <entry align="center"><computeroutput>ignore</computeroutput> and <computeroutput>jsp</computeroutput></entry>
- </row>
- <row>
- <entry align="center"><computeroutput>control.portal.unavailable</computeroutput></entry>
- <entry align="center">when a resource is unavailable</entry>
- <entry align="center"><computeroutput>ignore</computeroutput> and <computeroutput>jsp</computeroutput></entry>
- </row>
- <row>
- <entry align="center"><computeroutput>control.portal.not_found</computeroutput></entry>
- <entry align="center">when a resource is not found</entry>
- <entry align="center"><computeroutput>ignore</computeroutput> and <computeroutput>jsp</computeroutput></entry>
- </row>
- <row>
- <entry align="center"><computeroutput>control.portal.internal_error</computeroutput></entry>
- <entry align="center">when an unexpected error occurs</entry>
- <entry align="center"><computeroutput>ignore</computeroutput> and <computeroutput>jsp</computeroutput></entry>
- </row>
- <row>
- <entry align="center"><computeroutput>control.portal.error</computeroutput></entry>
- <entry align="center">when an expected error occurs</entry>
- <entry align="center"><computeroutput>ignore</computeroutput> and <computeroutput>jsp</computeroutput></entry>
- </row>
- <row>
- <entry align="center"><computeroutput>control.portal.resource_uri</computeroutput></entry>
- <entry align="center">the path to the JSP used for redirections</entry>
- <entry align="center">a valid path to a JSP located in the <filename>portal-core.war/</filename> directory</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
-
- <para>
- The following portal configuration demonstrates the use of portal-policy properties:
- </para>
- <para>
-<programlisting><![CDATA[
-<portal>
- <portal-name>MyPortal</portal-name>
- ...
- <properties>
- <property>
- <name>control.portal.access_denied</name>
- <value>ignore</value>
- </property>
- <property>
- <name>control.portal.unavailable</name>
- <value>ignore</value>
- </property>
- <property>
- <name>control.portal.not_found</name>
- <value>ignore</value>
- </property>
- <property>
- <name>control.portal.internal_error</name>
- <value>jsp</value>
- </property>
- <property>
- <name>control.portal.error</name>
- <value>jsp</value>
- </property>
- <property>
- <name>control.portal.resource_uri</name>
- <value>/WEB-INF/jsp/error/portal.jsp</value>
- </property>
- ...
- </properties>
- ...
-</portal>
-]]></programlisting>
- </para>
- </section>
- <section>
- <title>Page Policy Properties</title>
- <para>
- A set of properties configure the behavior of the page policy. These properties are only taken into account for objects that use the <emphasis>portal</emphasis> type. The following table represents possible page-policy properties:
- </para>
- <para>
- <table frame="all"><title/>
- <tgroup cols="3" align="left" colsep="1">
- <colspec colname="c1"/>
- <colspec colname="c2"/>
- <colspec colname="c3"/>
- <thead>
- <row>
- <entry align="center">Property name</entry>
- <entry align="center">Description</entry>
- <entry align="center">Possible values</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry align="center"><computeroutput>control.page.access_denied</computeroutput></entry>
- <entry align="center">when access is denied</entry>
- <entry align="center"><computeroutput>ignore</computeroutput>, <computeroutput>jsp</computeroutput> and <computeroutput>hide</computeroutput></entry>
- </row>
- <row>
- <entry align="center"><computeroutput>control.page.unavailable</computeroutput></entry>
- <entry align="center">when a resource is unavailable</entry>
- <entry align="center"><computeroutput>ignore</computeroutput>, <computeroutput>jsp</computeroutput> and <computeroutput>hide</computeroutput></entry>
- </row>
- <row>
- <entry align="center"><computeroutput>control.page.not_found</computeroutput></entry>
- <entry align="center">when a resource is not found</entry>
- <entry align="center"><computeroutput>ignore</computeroutput>, <computeroutput>jsp</computeroutput> and <computeroutput>hide</computeroutput></entry>
- </row>
- <row>
- <entry align="center"><computeroutput>control.page.internal_error</computeroutput></entry>
- <entry align="center">when an unexpected error occurs</entry>
- <entry align="center"><computeroutput>ignore</computeroutput>, <computeroutput>jsp</computeroutput> and <computeroutput>hide</computeroutput></entry>
- </row>
- <row>
- <entry align="center"><computeroutput>control.page.error</computeroutput></entry>
- <entry align="center">when an expected error occurs</entry>
- <entry align="center"><computeroutput>ignore</computeroutput>, <computeroutput>jsp</computeroutput> and <computeroutput>hide</computeroutput></entry>
- </row>
- <row>
- <entry align="center"><computeroutput>control.page.resource_uri</computeroutput></entry>
- <entry align="center">the path to the JSP used for redirections</entry>
- <entry align="center"><computeroutput>ignore</computeroutput>, <computeroutput>jsp</computeroutput> and <computeroutput>hide</computeroutput></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </para>
- <para>
- The following page configuration demonstrates the use of page-policy properties:
- </para>
- <para>
-<programlisting><![CDATA[
-<page>
- <page-name>MyPortal</page-name>
- ...
- <properties>
- <property>
- <name>control.page.access_denied</name>
- <value>hide</value>
- </property>
- <property>
- <name>control.page.unavailable</name>
- <value>hide</value>
- </property>
- <property>
- <name>control.page.not_found</name>
- <value>hide</value>
- </property>
- <property>
- <name>control.page.internal_error</name>
- <value>jsp</value>
- </property>
- <property>
- <name>control.page.error</name>
- <value>jsp</value>
- </property>
- <property>
- <name>control.page.resource_uri</name>
- <value>/WEB-INF/jsp/error/page.jsp</value>
- </property>
- ...
- </properties>
- ...
-</page>
-]]></programlisting>
- </para>
- <para>
- <note>
- <title>Page Property Inheritance for Objects</title>
- <para>
- When page properties are configured for objects that use the <emphasis>portal</emphasis> type, the properties are inherited by pages in that portal.
- </para>
- </note>
- </para>
-</section>
- </section>
- <section>
- <title>Using <trademark class="trade">JSP</trademark> to Handle Errors</title>
- <para>
- As described in previous sections, error handling can be redirected to a <trademark class="trade">JSP</trademark> page. Two pages can be created to handle errors: one for the portal level, and the other for the page level. Portal level error-handling requires a page that produces a full page, and page-level handling requires a page that produces markup, but only for a window. When the page is invoked, a set of request attributes are passed. The following table represents possible request attributes:
- </para>
- <para>
- <table frame="all"><title/>
- <tgroup cols="3" align="left" colsep="1">
- <colspec colname="c1"/>
- <colspec colname="c2"/>
- <colspec colname="c3"/>
- <thead>
- <row>
- <entry align="center">Attribute Name</entry>
- <entry align="center">Attribute Description</entry>
- <entry align="center">Attribute Value</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry align="center"><computeroutput>org.jboss.portal.control.ERROR_TYPE</computeroutput></entry>
- <entry align="center">the error type</entry>
- <entry align="center">possible values are <computeroutput>ACCESS_DENIED</computeroutput>, <computeroutput>UNAVAILABLE</computeroutput>, <computeroutput>ERROR</computeroutput>, <computeroutput>INTERNAL_ERROR</computeroutput>, and <computeroutput>NOT_FOUND</computeroutput></entry>
- </row>
- <row>
- <entry align="center"><computeroutput>org.jboss.portal.control.CAUSE</computeroutput></entry>
- <entry align="center">a cause which is thrown, that can be null</entry>
- <entry align="center">the object is a subclass of <computeroutput>java.lang.Throwable</computeroutput></entry>
- </row>
- <row>
- <entry align="center"><computeroutput>org.jboss.portal.control.MESSAGE</computeroutput></entry>
- <entry align="center">an error message that can be null</entry>
- <entry align="center">text</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </para>
- <para>
- <note>
- <title><trademark class="trade">JSP</trademark> Location</title><para>
- The JavaServer Pages must be located in the <filename>jboss-portal.sar/portal-core.war/</filename> web application.</para>
- </note>
- </para>
- </section>
- <section>
- <title>Configuration using the Portal Management Application</title>
- <para>
- The error handling policy can be configured via the portal management application. To access the portal management application:
- </para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- Use a Web browser to navigate to <ulink url="http://localhost:8080/portal"/>.
- </para>
- </listitem>
- <listitem>
- <para>
- Click the <guibutton>Login</guibutton> button on the top right-hand of the welcome page, and log in as the <option>admin</option> user.
- </para>
- </listitem>
- <listitem>
- <para>
- Click the <guibutton>Admin</guibutton> tab on the top right-hand of the welcome page. Four tabs will appear on the left-hand side of the page.
- </para>
- </listitem>
- <listitem>
- <para>
- Click the <guibutton>Admin</guibutton> tab to open the portal management application, and then click the <guibutton>Portal Objects</guibutton> tab to display available portals.
- </para>
- </listitem>
- </orderedlist>
- </para>
- <para>
- Configuration options are available as part of the properties for each configuration level. You can specify the default error handling policy (at the root of the portal object hierarchy) for each portal, or each page, by clicking on the <guibutton>Properties</guibutton> button for each page or portal:
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/errorhandling/errorHandling_management.png" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- As well, you can specify how dashboards should behave with respect to error handling, by clicking on the <guibutton>Dashboards</guibutton> tab in the portal management application:
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/errorhandling/errorHandlingUI.png" align="center" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- The page specified with <computeroutput>On error redirect to this resource</computeroutput> is used when the <option>Redirect to the specified resource</option> action is selected for an error type, such as <computeroutput>When access to the page is denied</computeroutput>. After making changes, click the <guibutton>Update</guibutton> button for settings to take effect.
- </para>
- </section>
-</chapter>
- <chapter id="contentintegration">
-<!-- <chapterinfo>
- <author>
- <firstname>Julien</firstname>
- <surname>Viet</surname>
- </author>
- <author>
- <firstname>Thomas</firstname>
- <surname>Heute</surname>
- </author>
- </chapterinfo>-->
- <title>Content Integration</title>
- <para>Since JBoss Portal 2.6 it is possible to provide an easy integration of content within the portal. Up to the 2.4 version
- content integration had to be done by configuring a portlet to show some content from an URI and then place that
- portlet on a page. The new content integration capabilities allows to directly configure a page window with the content URI by
- removing the need to configure a portlet for that purpose.</para>
- <note><title>Note</title><para>We do not advocate to avoid the usage portlet preferences, we rather advocate that content configuration managed at the portal level
- simplifies the configuration: it helps to make content a first class citizen of the portal instead of having an intermediary
- portlet that holds the content for the portal. The portlet preferences can still be used to configure how content is displayed
- to the user.</para></note>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/content/before.png" scalefit="1"/>
- </imageobject>
-
- </mediaobject>
- <para>The portal uses portlets to configure content</para>
-
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/content/after.png" scalefit="1"/>
- </imageobject>
-
- </mediaobject>
- <para>The portal references directly the content and use portlet to interact with content</para>
-
- <section>
- <title>Window content</title>
- <para>The content of a window is defined by
- <itemizedlist>
- <listitem><para>The content URI which is the resource that the window is pointing to. It is an arbitrary string that
- the portal cannot interpret and is left up to the content provider to interpret.</para></listitem>
- <listitem><para>The window content type which defines how the portal interpret the window content
- <itemizedlist>
- <listitem><para>The default content type is for portlets and has the value <emphasis>portlet</emphasis>. In this
- case the content URI is the portlet instance id.</para></listitem>
- <listitem><para>The CMS content type allows to integrate content from the CMS at the page and it has the value
- <emphasis>cms</emphasis>. For that content type, the content URI is the CMS file path.</para></listitem>
- </itemizedlist></para>
- </listitem>
- <listitem><para>The content parameters which are a set of additional key/value string pairs holding state that is interpreted
- by the content provider.</para></listitem>
- </itemizedlist>
- </para>
- <para>At runtime when the portal needs to render a window it delegates the production of markup to a content provider.
- The portal comes with a preconfigured set of providers which handles the portlet and the cms content types. The most
- natural way to plug a content provider in the portal is to use a JSR 286 Portlet. Based on a few carefully chosen conventions
- it is possible to provide an efficient content integration with the benefit of using standards and without requiring
- the usage of a proprietary API.</para>
- </section>
- <section>
- <title>Content customization</title>
- <para>Content providers must be able to allow the user or administrator to chose content from the external resource
- it integrates in the portal in order to properly configure a portal window. A few interactions between the portal, the content
- provider and the portal user are necessary to achieve that goal. Here again it is possible to provide content
- customization using a JSR 286 Portlet. For that purpose two special portlet modes called
- <emphasis>edit_content</emphasis> and <emphasis>select_content</emphasis> has been introduced. It signals to the portlet
- that it is selecting or editing the content portion of the state of a portlet. <emphasis>select_content</emphasis> is
- used to select a new content to put in a window while <emphasis>edit_content</emphasis> is used to modify the previously
- defined content, often the two modes will display the same thing. The traditional edit mode is not used because the edit mode
- is more targeted to configure how the portlet shows content to the end user rather than what content it shows.</para>
-<mediaobject>
-<imageobject>
- <imagedata align="center" fileref="images/content/cms.png" scalefit="1"/>
- </imageobject>
-</mediaobject>
- <para>Example of content customization - CMS Portlet</para>
- </section>
- <section>
- <title>Content Driven Portlet</title>
- <para>Portlet components are used to integrate content into the portal. It relies on a few conventions which allow
- the portal and the portlet to communicate.
- </para>
- <section>
- <title>Displaying content</title>
- <para>At runtime the portal will call the portlet with the view mode when it displays content. It will send
- information about the content to display using the public render parameter <emphasis>urn:jboss:portal:content uri</emphasis> to the portlet. Therefore the portlet has
- just to read the render parameters and use them to properly display the content in the portlet. The public render parameters
- values are the key/value pairs that form the content properties and the resource URI of the content to display.</para>
- </section>
- <section>
- <title>Configuring content</title>
- <para>As explained before, the portal will call the portlet using the <emphasis>edit_content</emphasis> mode.
- In that mode the portlet and the portal will communicate using either action or render parameters. We have two use cases
- which are:
- <itemizedlist>
- <listitem><para>The portal needs to configure a new content item for a new window. In that use case the portal will not send special
- render parameters to the portlet and the initial set of render parameters will be empty. The portlet can
- then use render parameters in order to provide navigation in the content repository. For example the portlet
- can navigate the CMS tree and store the current CMS path in the render parameters. Whenever the portlet has decided
- to tell the portal that content has been selected by the user it needs to trigger a JSR-286 event with the uri and eventual parameters as payload.</para>
- </listitem>
- <listitem><para>The second use case happens when the portal needs to edit existing content. In such situation
- everything works as explained before except that the initial set of render parameters of the portlet
- will be prepopulated with the content uri URI and parameters.</para></listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>Step by step example of a content driven portlet</title>
- <para/>
- <section>
- <title>The Portlet skeleton</title>
- <para>Here is the base skeleton of the content portlet. The FSContentDrivenPortlet shows the files which are
- in the war file in which the portlet is deployed. The arbitrary name <emphasis>filesystem</emphasis>
- will be the content type interpreted by the portlet.
- </para>
- <programlisting><![CDATA[
-public class FSContentDrivenPortlet extends GenericPortlet
-{
-
- /** The edit_content mode. */
- public static final PortletMode EDIT_CONTENT_MODE = new PortletMode("edit_content");
-
- ...
-
-}
-]]></programlisting>
- </section>
- <section>
- <title>Overriding the dispatch method</title>
- <para>First the <emphasis>doDispatch(RenderRequest req, RenderResponse resp)</emphasis> is overridden in order
- to branch the request flow to a method that will take care of displaying the editor.</para>
- <programlisting><![CDATA[
-protected void doDispatch(RenderRequest req, RenderResponse resp)
- throws PortletException, PortletSecurityException, IOException
-{
- if (EDIT_CONTENT_MODE.equals(req.getPortletMode()))
- {
- doEditContent(req, resp);
- }
- else
- {
- super.doDispatch(req, resp);
- }
-}
-]]></programlisting>
- </section>
- <section>
- <title>Utilities methods</title>
- <para>The portlet also needs a few utilities methods which take care of converting content URI to a file
- back and forth. There is also an implementation of a file filter that keep only text files and avoid the
- WEB-INF directory of the war file for security reasons.</para>
- <programlisting><![CDATA[
-protected File getFile(String contentURI) throws IOException
-{
- String realPath = getPortletContext().getRealPath(contentURI);
- if (realPath == null)
- {
- throw new IOException("Cannot access war file content");
- }
- File file = new File(realPath);
- if (!file.exists())
- {
- throw new IOException("File " + contentURI + " does not exist");
- }
- return file;
-}
-]]></programlisting>
- <programlisting><![CDATA[
- protected String getContentURI(File file) throws IOException
- {
- String rootPath = getPortletContext().getRealPath("/");
- if (rootPath == null)
- {
- throw new IOException("Cannot access war file content");
- }
-
- // Make it canonical
- rootPath = new File(rootPath).getCanonicalPath();
-
- // Get the portion of the path that is significant for us
- String filePath = file.getCanonicalPath();
- return filePath.length() >=
- rootPath.length() ? filePath.substring(rootPath.length()) : null;
- }
-]]></programlisting>
- <programlisting><![CDATA[
- private final FileFilter filter = new FileFilter()
- {
- public boolean accept(File file)
- {
- String name = file.getName();
- if (file.isDirectory())
- {
- return !"WEB-INF".equals(name);
- }
- else if (file.isFile())
- {
- return name.endsWith(".txt");
- }
- else
- {
- return false;
- }
- }
- };
-]]></programlisting>
- </section>
- <section>
- <title>The editor</title>
- <para>The editor is probably the longest part of the portlet. It tries to stay simple though and goes directly
- to the point.</para>
- <mediaobject> <imageobject>
- <imagedata align="center" fileref="images/content/fs1.png" scalefit="1"/>
- </imageobject></mediaobject>
- <para>Content editor of FSContentDrivenPortlet in action</para>
- <programlisting><![CDATA[
-protected void doEditContent(RenderRequest req, RenderResponse resp)
- throws PortletException, PortletSecurityException, IOException
-{
- String uri = req.getParameter("current_uri");
- if (uri == null)
- {
- // Get the uri value optionally provided by the portal
- uri = req.getParameter("uri");
- }
-
- // Get the working directory directory
- File workingDir = null;
- String currentFileName = null;
- if (uri != null)
- {
- workingDir = getFile(uri).getParentFile();
- currentFileName = getFile(uri).getName();
- }
- else
- {
- // Otherwise try to get the current directory we are browsing,
- // if no current dir exist we use the root
- String currentDir = req.getParameter("current_dir");
- if (currentDir == null)
- {
- currentDir = "/";
- }
- workingDir = getFile(currentDir);
- }
-
- // Get the parent path
- String parentPath = getContentURI(workingDir.getParentFile());
-
- // Get the children of the selected file, we use a filter
- // to retain only text files and avoid WEB-INF dir
- File[] children = workingDir.listFiles(filter);
-
- // Configure the response
- resp.setContentType("text/html");
- PrintWriter writer = resp.getWriter();
-
- //
- writer.print("Directories:<br/>");
- writer.print("<ul>");
- PortletURL choseDirURL = resp.createRenderURL();
- if (parentPath != null)
- {
- choseDirURL.setParameter("current_dir", parentPath);
- writer.print("<li><a href=\"" + choseDirURL + "\">..</a></li>");
- }
- for (int i = 0;i < children.length;i++)
- {
- File child = children[i];
- if (child.isDirectory())
- {
- choseDirURL.setParameter("current_dir", getContentURI(child));
- writer.print("<li><a href=\"" + choseDirURL + "\">" + child.getName() +
- "</a></li>");
- }
- }
- writer.print("</ul><br/>");
-
- //
- writer.print("Files:<br/>");
- writer.print("<ul>");
- PortletURL selectFileURL = resp.createActionURL();
- selectFileURL.setParameter("content.action.select", "select");
- for (int i = 0;i < children.length;i++)
- {
- File child = children[i];
- if (child.isFile())
- {
- selectFileURL.setParameter("current_uri", getContentURI(child));
- if (child.getName().equals(currentFileName))
- {
- writer.print("<li><b>" + child.getName() + "</b></li>");
- }
- else
- {
- writer.print("<li><a href=\"" + selectFileURL + "\">" + child.getName() + "</a></li>");
- }
- }
- }
- writer.print("</ul><br/>");
-
- //
- writer.close();
-}
-]]></programlisting>
- </section>
- <section>
- <title>Viewing content at runtime</title>
- <para>Last but not least the portlet needs to implement the <emphasis>doView(RenderRequest req, RenderResponse resp)</emphasis>
- method in order to display the file that the portal window wants to show.</para>
- <programlisting><![CDATA[
-protected void doView(RenderRequest req, RenderResponse resp)
- throws PortletException, PortletSecurityException, IOException
-{
- // Get the URI provided by the portal
- String uri = req.getParameter("uri");
-
- // Configure the response
- resp.setContentType("text/html");
- PrintWriter writer = resp.getWriter();
-
- //
- if (uri == null)
- {
- writer.print("No selected file");
- }
- else
- {
- File file = getFile(uri);
- FileInputStream in = null;
- try
- {
- in = new FileInputStream(file);
- FileChannel channel = in.getChannel();
- byte[] bytes = new byte[(int)channel.size()];
- ByteBuffer buffer = ByteBuffer.wrap(bytes);
- channel.read(buffer);
- writer.write(new String(bytes, 0, bytes.length, "UTF8"));
- }
- catch (FileNotFoundException e)
- {
- writer.print("No such file " + uri);
- getPortletContext().log("Cannot find file " + uri, e);
- }
- finally
- {
- if (in != null)
- {
- in.close();
- }
- }
- }
-
- //
- writer.close();
-}
-]]></programlisting>
- </section>
- <section>
- <title>Hooking the portlet into the portal</title>
-
- <mediaobject><imageobject>
- <imagedata align="center" fileref="images/content/fs2.png" scalefit="1"/>
- </imageobject></mediaobject>
-
-<para>Management portlet with <emphasis>filesystem</emphasis> content type enabled</para>
-
- <para>Finally we need to make the portal aware of the fact that the portlet can edit and interpret content. For that
- we need a few descriptors. The <emphasis>portlet.xml</emphasis> descriptor will define our portlet, the
- <emphasis>portlet-instances.xml</emphasis> will create a single instance of our portlet. The
- <emphasis>web.xml</emphasis> descriptor will contain a servlet context listener that will hook the content
- type in the portal content type registry.</para>
- <para>First, we need to define the portlet's particular event and render parameters:</para>
- <programlisting><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
- version="2.0">
-
- <portlet>
- <description>File System Content Driven Portlet</description>
- <portlet-name>FSContentDrivenPortlet</portlet-name>
- <display-name>File System Content Driven Portlet</display-name>
- <portlet-class>org.jboss.portal.core.samples.basic.FSContentDrivenPortlet</portlet-class>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>VIEW</portlet-mode>
- <portlet-mode>EDIT_CONTENT</portlet-mode>
- </supports>
- <portlet-info>
- <title>File Portlet</title>
- <keywords>sample,test</keywords>
- </portlet-info>
- <supported-public-render-parameter>uri</supported-public-render-parameter>
- <supported-publishing-event xmlns:x="urn:jboss:portal:content">x:select</supported-publishing-event>
- </portlet>
-
- <public-render-parameter>
- <identifier>uri</identifier>
- <qname xmlns:c="urn:jboss:portal:content">c:uri</qname>
- </public-render-parameter>
-
- <event-definition>
- <qname xmlns:x="urn:jboss:portal:content">x:select</qname>
- <value-type>java.lang.String</value-type>
- </event-definition>
-
-</portlet-app>
-]]></programlisting>
- <para>Note that here we need to use a JSR-286 portlet, this portlet will use the event <emphasis>urn:jboss:portal:content select</emphasis> and have a payload of type
- <emphasis>java.lang.String</emphasis>. This event will be used to tell the portal the URI selected by the user. This same portlet will also be in charge of
- rendering the content based on that URI, it will then also need to access the public render parameter qualified with the name: <emphasis>urn:jboss:portal:content uri</emphasis>.
- </para>
- <para>The portlet.xml descriptor</para>
- <programlisting><![CDATA[
-<deployments>
- ...
- <deployment>
- <instance>
- <instance-id>FSContentDrivenPortletInstance</instance-id>
- <portlet-ref>FSContentDrivenPortlet</portlet-ref>
- </instance>
- </deployment>
- ...
-</deployments
-]]></programlisting>
- <para>The portlet-instances.xml descriptor</para>
- <programlisting><![CDATA[
-<web-app>
- ...
- <context-param>
- <param-name>org.jboss.portal.content_type</param-name>
- <param-value>filesystem</param-value>
- </context-param>
- <context-param>
- <param-name>org.jboss.portal.portlet_instance</param-name>
- <param-value>FSContentDrivenPortletInstance</param-value>
- </context-param>
- <listener>
- <listener-class>org.jboss.content.ContentTypeRegistration</listener-class>
- </listener>
- ...
-</web-app>
-]]></programlisting>
- <para>The web.xml descriptor</para>
- <warning><title>Caution</title><para>You don't need to add the listener class into your war file. As it is provided by the portal
- it will always be available.</para></warning>
- </section>
- </section>
- <!--
- <section>
- <title>Passing parameters along the URI</title>
- <para>In simple cases like in the example, it was enough to pass a URI, in some cases it can be helpful to pass
- other parameters, to do so, instead of having a payload of type <emphasis>java.lang.String</emphasis>,
- simply use the following class: <emphasis>org.jboss.portal.api.content.SelectedContent</emphasis>.
- </para>
- </para>
- </section>
- -->
- </section>
- <section>
- <title>Configuring window content in deployment descriptor</title>
- <para>How to create a portlet that will enable configuration of content at runtime has been covered above, however
- it is also possible to configure content in deployment descriptors. With our previous example it would give
- the following snippet placed in a <emphasis>*-portal.xml</emphasis> file:
- </para>
- <programlisting><![CDATA[
-<window>
-<window-name>MyWindow</window-name>
-<content>
- <content-type>filesystem</content-type>
- <content-uri>/dir1/foo.txt</content-uri>
-</content>
-<region>center</region>
-<height>1</height>
-</window>
-]]></programlisting>
- <mediaobject><imageobject>
- <imagedata align="center" fileref="images/content/fs3.png"/>
- </imageobject></mediaobject>
- <para>Final effect - portal window with FSContentDrivenPortlet</para>
- <note><title>Note</title><para>How to configure CMS file this way is covered in the CMS chapter: <xref linkend="configuration-cms_content"/></para></note>
- </section>
-</chapter>
- <chapter id="widgets">
- <!-- <chapterinfo>
- <author>
- <firstname>Emanuel</firstname>
- <surname>Muckenhuber</surname>
- </author>
- </chapterinfo>-->
- <title>Widget Integration</title>
- <section>
- <title>Introduction</title>
- <para>JBoss Portal supports the integration of Google gadgets and Netvibes (<ulink url="http://dev.netvibes.com/doc/uwa_specification">UWA</ulink> compatible)
- widgets out of the box. This integration allows you to display the content of the widget within a portlet.
- Both types can be added in the administration interface by editing the 'Page Layout' of a page or in the configuration of the users dashboard
- when selecting the appropriate 'Content type'.
- </para>
- </section>
- <section>
- <title>Widget portlet configuration</title>
- <para>It is possible to modify certain behavior of caching and fetching widgets by changing the init-param values of the portlet.</para>
- <para>
- <itemizedlist>
- <listitem>
- <para><emphasis role="bold">connectionTimeout</emphasis>.
-
- Connection timeout used for the directory lookup in milliseconds.
- </para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">widgetExpiration</emphasis>.
-
- Time in minutes for which a widget should be cached. After this time the cached widget information will be deleted and
- fetched again when the information are needed.
- </para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">queryExpiration</emphasis>.
-
- Times in minutes for which a directory query should be cached. After this time the cached query information will be deleted.
- </para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">fetchWidgetsOnDirectoryLookup</emphasis>.
-
- This parameter defines if all widgets from a directory lookup should be fetched at the time of the query or not.
- The default values is false. This means that widgets are only fetched on demand - when the information is really needed.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- The parameter for both widget types can be changed identically in either:
- <itemizedlist>
- <listitem><para><emphasis>jboss-portal.sar/portal-widget.war/WEB-INF/portlet.xml</emphasis> (for google gadgets)</para></listitem>
- <listitem><para>or <emphasis>jboss-portal.sar/portal-widget-netvibes.war/WEB-INF/portlet.xml</emphasis> (for netvibes widgets).</para></listitem>
- </itemizedlist>
- </para>
- <para>
- <programlisting><![CDATA[...
- <portlet>
- ...
- <init-param>
- <name>connectionTimeout</name>
- <value>5000</value>
- </init-param>
- <init-param>
- <name>widgetExpiration</name>
- <value>360</value>
- </init-param>
- <init-param>
- <name>queryExpiration</name>
- <value>60</value>
- </init-param>
- <init-param>
- <name>fetchWidgetsOnDirectoryLookup</name>
- <value>false</value>
- </init-param>
- ...
- </portlet>
-...]]></programlisting>
- </para>
- <para>
- For Netvibes widgets it is also possible to define a init-param called <emphasis role="bold">defaultHeight</emphasis> to set a specific
- default height if no height attribute is defined by the widget itself. The default value is 250.
- </para>
- </section>
-</chapter>
- <chapter id="portletmodes">
- <!-- <chapterinfo>
- <author>
- <firstname>Julien</firstname>
- <surname>Viet</surname>
- </author>
- </chapterinfo>-->
- <title>Portlet Modes</title>
- <para>JBoss Portal supports the standard portlet modes defined by the JSR-168 specification which are <emphasis>view</emphasis>,
- <emphasis>edit</emphasis> and <emphasis>help</emphasis>. In addition of that it also supports the <emphasis>admin</emphasis>
- portlet mode.
- </para>
- <section>
- <title>Admin Portlet Mode</title>
- <para>The admin mode defines a mode for the portlet which allows the administration of the portlet. Access to this mode
- is only granted to users having an appropriate role. In order to grant admin access to a portlet, the user must have a role which
- grants him the <emphasis>admin</emphasis> action permission on the portlet instance. This can be done in the
- instance deployment descriptor or using the administation portlet of the portal. </para>
- <section>
- <title>Portlet configuration</title>
- <para>In order to be able to use the admin mode, the portlet must declare it in the portlet deployment descriptor.</para>
- <programlisting><![CDATA[
-<portlet-app>
- ...
- <portlet>
- ...
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>admin</portlet-mode>
- </supports>
- ...
- </portlet>
- ...
- <custom-portlet-mode>
- <name>admin</name>
- </custom-portlet-mode>
- ...
-</portlet-app>
-]]></programlisting>
- </section>
- <section>
- <title>Declarative instance security configuration</title>
- <para>The following example shows the configuration of a portlet instance that grants the admin action permission
- to the <emphasis>Admin</emphasis> security role. It also grants the view action permission to all users.
- </para>
-<programlisting><![CDATA[
-...
-<instance>
- <instance-id>ModePortletInstance</instance-id>
- <portlet-ref>ModePortlet</portlet-ref>
- <security-constraint>
- <policy-permission>
- <action-name>admin</action-name>
- <role-name>Admin</role-name>
- </policy-permission>
- <policy-permission>
- <action-name>view</action-name>
- <unchecked/>
- </policy-permission>
- </security-constraint>
-</instance>
-...
-]]></programlisting>
- </section>
- <section>
- <title>Instance security configuration with the administration portlet</title>
- <para>At runtime the security configuration section of the administration portlet can be used to grant or revoke
- the admin access. It can be done by clicking the security action of the portlet instance and then use the
- security editor.</para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portletmodes/editor.png"/>
- </imageobject>
- </mediaobject>
- <para>Edit the security instance configuration</para>
-
- </section>
- </section>
-</chapter>
- <chapter id="portal_api">
-<!-- <chapterinfo>
- <author>
- <firstname>Julien</firstname>
- <surname>Viet</surname>
- </author>
- <author>
- <firstname>Thomas</firstname>
- <surname>Heute</surname>
- </author>
- </chapterinfo>-->
- <title>Portal API</title>
- <section>
- <title>Introduction</title>
-
- <para>JBoss Portal provides an Application Programming Interface (API) which allows to write code
- that interacts with the portal. The life time and validity of the API is tied to the major version which means
- that no changes should be required when code is written against the API provided by the JBoss Portal
- 2.x versions and used in a later version of JBoss Portal 2.x.</para>
-
- <para>The Portal API package prefix is <emphasis>org.jboss.portal.api</emphasis>. All of the classes that are part
- of this API are prefixed with this package name except for the <emphasis>org.jboss.portal.Mode</emphasis>
- and <emphasis>org.jboss.portal.WindowState</emphasis> classes. These two classes were defined before the official
- Portal API framework was created and so the names have been maintained for backward compatibility.</para>
- <para>The Portlet API defines two classes that represent a portion of the visual state of a Portlet which
- are <emphasis>javax.portlet.PortletMode</emphasis> and <emphasis>javax.portlet.WindowState</emphasis>. Likewise
- the Portal API defines similar classes named <emphasis>org.jboss.portal.Mode</emphasis> and
- <emphasis>org.jboss.portal.WindowState</emphasis> which offer comparable characteristics, the main differences are:</para>
-
- <itemizedlist>
- <listitem><para>Usage of factory methods to obtain instances.</para></listitem>
- <listitem><para>Classes implements the <emphasis>java.io.Serializable</emphasis> interface.</para></listitem>
- </itemizedlist>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/Mode.png"/>
- </imageobject>
- </mediaobject>
- <para>The Mode class</para>
-
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/WindowState.png"/>
- </imageobject>
-
- </mediaobject>
-
- <para>The WindowState class</para>
-
- <note><para>In the Portal API, the <emphasis>Mode</emphasis> interface is named like this because it does
- represent the mode of some visual object. The Portlet API names it <emphasis>PortletMode</emphasis> because
- it makes the assumption that the underlying object is of type Portlet.</para></note>
- </section>
- <section>
- <title>Portlet to Portal communication</title>
- <para>There are times when a portlet needs to signal the portal or share information with it. The portal is the only authority
- to decide if it will take into account that piece of information or ignore it. In JBoss Portal we use as much as possible the
- mechanisms offered by the portlet spec to achieve that communication.</para>
- <section>
- <title>Requesting a sign out</title>
- <para>
- If a portlet desires to sign out the user, it can let the portal know by triggering a JSR-286 portlet event.
- To do so, simply defines the event "signOut" in the namespace "urn:jboss:portal" as a publishing event.
- In the action phase of the portlet, trigger the event, as a payload you can specify a redirection URL. If the payload is null,
- it will redirect the user to the default page of the default portal.
- See the following snippet to use in the action phase, it will ask the portal to sign out the user and redirect him to the JBoss
- Portal blog:
- <programlisting role="java"><![CDATA[QName name = new QName("urn:jboss:portal", "signOut");
-response.setEvent(name, "http://blog.jboss-portal.org"); ]]></programlisting>
- </para>
- </section>
- <section>
- <title>Setting up the web browser title</title>
- <para>
- The JSR-286 specification introduced a new phase for setting up the HTML headers. It is commonly used to add stylesheets
- and javascript to the page. An extension of it for JBoss Portal lets you define the web browser title.
- To define the web browser title, a portlet simply needs to define a new header element "title". This could be done by a portlet overriding
- the method <literal>doHeaders(RenderRequest req, RenderResponse resp)</literal> to add such an element.
- <programlisting role="java"><![CDATA[public void doHeaders(RenderRequest req, RenderResponse resp)
-{
- Element element = resp.createElement("title");
- element.setTextContent("My new web browser title");
- resp.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, element);
-}]]></programlisting>
- <warning><para>It several portlets on a page defines a web browser title, only one of them will be displayed.
- We can consider that the title to be displayed will be randomly chosen.</para></warning>
- </para>
- </section>
- </section>
- <section>
- <title>Portal URL</title>
- <para>The Portal API defines the <emphasis>org.jboss.portal.api.PortalURL</emphasis> interface to represent
- URL managed by the portal.</para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/PortalURL.png"/>
- </imageobject>
- </mediaobject>
- <para>The PortalURL interface</para>
-
- <itemizedlist>
- <listitem><para>The <emphasis>setAuthenticated(Boolean wantAuthenticated)</emphasis> methods defines if the
- URL requires the authentication of the user. If the argument value is true then the user must be authenticated
- to access the URL, if the argument value is false then the user should not be authenticated. Finally if the argument value is
- null then it means that the URL authenticated mode should reuse the current mode.</para></listitem>
- <listitem><para>The <emphasis>setSecure(Boolean wantSecure)</emphasis> methods defines the same as above but for the
- transport guarantee offered by the underlying protocol which means most of the time the secure HTTP protocol (HTTPS).</para></listitem>
- <listitem><para>The <emphasis>setRelative(boolean relative)</emphasis> defines the output format of the URL and
- whether the created URL will be an URL relative to the same web server or will be the full URL.</para></listitem>
- <listitem><para>The <emphasis>toString()</emphasis> method will create the URL as a string.</para></listitem>
- </itemizedlist>
- </section>
- <section>
- <title>Portal session</title>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/PortalSession.png"/>
- </imageobject>
- </mediaobject>
- <para>The PortalSession interface</para>
-
- <para>It is possible to have access to a portion of the portal session to store objects. The <emphasis>org.jboss.portal.api.session.PortalSession</emphasis>
- interface defines its API and is similar to the <emphasis>javax.servlet.http.HttpSession</emphasis> except that it does
- not offer methods to invalidate the session as the session is managed by the portal.
- </para>
- </section>
-
- <section>
- <title>Portal runtime context</title>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/PortalRuntimeContext.png"/>
- </imageobject>
- </mediaobject>
- <para>The PortalRuntimeContext interface</para>
-
- <para>The <emphasis>org.jboss.portal.api.PortalRuntimeContext</emphasis> gives access to state or operations
- associated at runtime with the current user of the portal. The <emphasis>String getUserId()</emphasis> retrieve
- the user id and can return null if no user is associated with the context. It also gives access to the
- <emphasis>PortalSession</emphasis> instance associated with the current user. Finally it gives access to the
- <emphasis>NavigationalStateContext</emphasis> associated with the current user.</para>
- </section>
-
- <section>
- <title>Portal nodes</title>
- <para>The portal structure is a tree formed by nodes. It is possible to programmatically access the portal tree in order to
- </para>
- <itemizedlist>
- <listitem><para>discover the tree structure of the portal</para></listitem>
- <listitem><para>create URL that will render the different portal nodes</para></listitem>
- <listitem><para>access the properties of a specific node</para></listitem>
- </itemizedlist>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/PortalNode.png"/>
- </imageobject>
- </mediaobject>
- <para>The PortalNode interface</para>
-
- <para>As usual with tree structures, the main interface to study is the <emphasis>org.jboss.portal.api.node.PortalNode</emphasis>. That interface
- is intentionally intended for obtaining useful information from the tree. It is not possible to use it to modify
- the tree shape because it is not intended to be a management interface.</para>
- <programlisting><![CDATA[
-public interface PortalNode
-{
- int getType();
- String getName();
- String getDisplayName(Locale locale);
- Map getProperties();
- PortalNodeURL createURL(PortalRuntimeContext portalRuntimeContext);
- ...
-}
-]]></programlisting>
- <para>The interface offers methods to retrieve informations for a given node such as the node type, the node name
- or the properties of the node. The noticeable node types are:</para>
- <itemizedlist>
- <listitem><para>PortalNode.TYPE_PORTAL : the node represents a portal</para></listitem>
- <listitem><para>PortalNode.TYPE_PAGE : the node represents a portal page</para></listitem>
- <listitem><para>PortalNode.TYPE_WINDOW : the node represents a page window</para></listitem>
- </itemizedlist>
- <para>The <emphasis>org.jboss.portal.api.node.PortalNodeURL</emphasis> is an extension of the <emphasis>PortalURL</emphasis> interface
- which adds additional methods useful for setting parameters on the URL. There are no guarantees that the
- portal node will use the parameters. So far portal node URL parameters are only useful for nodes of type
- <emphasis>PortalNode.TYPE_WINDOW</emphasis> and they should be treated as portlet render parameters in the case of
- the portlet is a local portlet and is not a remote portlet. The method that creates portal node URL requires
- as parameter an instance of <emphasis>PortalRuntimeContext</emphasis>.</para>
- <para>The interface also offers methods to navigate the node hierarchy:</para>
- <programlisting><![CDATA[
-public interface PortalNode
-{
- ...
- PortalNode getChild(String name);
- Collection getChildren();
- PortalNode getRoot();
- PortalNode getParent();
- ...
-}
-]]></programlisting>
- </section>
- <section>
- <title>Portal navigational state</title>
- <para>The navigational state is a state managed by the portal that associates to each user the state triggered
- by its navigation. A well known part of the navigational state are the render parameters provided at runtime
- during the call of the method <emphasis>void render(RenderRequest req, RenderResponse resp)</emphasis>. The portal
- API offers an interface to query and update the navigational state of the portal. For now the API only exposes
- mode and window states of portal nodes of type window.</para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/NavigationalStateContext.png"/>
- </imageobject>
- </mediaobject>
- <para>The NavigationalStateContext interface</para>
-
- </section>
- <section>
- <title>Portal events</title>
- <para>Portal events are a powerful mechanism to be aware of what is happening in the portal at runtime. The base
- package for event is <emphasis>org.jboss.portal.api.event</emphasis> and it contains the common event classes
- and interfaces.
- </para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/PortalEvent.png"/>
- </imageobject>
- </mediaobject>
- <para>The PortalEvent class</para>
-
- <para>The <emphasis>org.jboss.portal.api.event.PortalEvent</emphasis> abstract class is the base class for
- all kind of portal events.
- </para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/PortalEventContext.png"/>
- </imageobject>
- </mediaobject>
- <para>The PortalEventContext interface</para>
-
- <para>
- The <emphasis>org.jboss.portal.api.event.PortalEventContext</emphasis> interface defines the context in which
- an event is created and propagated. It allows retrieval of the <emphasis>PortalRuntimeContext</emphasis> which
- can in turn be used to obtain the portal context.
- </para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/PortalEventListener.png"/>
- </imageobject>
- </mediaobject>
- <para>The PortalEventListener interface</para>
-
- <para>
- The <emphasis>org.jboss.portal.api.event.PortalEventListener</emphasis> interface defines the contract that
- class can implement in order to receive portal event notifications. It contains the method
- <emphasis>void onEvent(PortalEvent event)</emphasis> called by the portal framework.
- </para>
- <para>
- Listeners declaration requires a service to be deployed in JBoss that will instantiate the service implementation
- and register it with the service registry. We will see how to achieve that in the example section of this chapter.
- </para>
- <note>
- <para>The event propagation model uses one instance of a listener class to receive all portal events that
- may be routed to that class when appropriate. Therefore implementors needs to be aware of that model
- and must provide <emphasis role="bold">thread safe</emphasis> implementations.</para>
- </note>
- <section>
- <title>Portal node events</title>
- <para>Portal node events extend the abstract portal event framework in order to provide notifications
- about user interface events happening at runtime. For instance when the portal renders a page or a window,
- a corresponding event will be fired.</para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/PortalNodeEvent.png" scalefit="1"/>
- </imageobject>
- </mediaobject>
- <para>The portal node event class hierarchy</para>
-
- <para>The <emphasis>org.jboss.portal.api.node.event.PortalNodeEvent</emphasis> class extends the
- <emphasis>org.jboss.portal.api.node.PortalEvent</emphasis> class and is the base class for all events
- of portal nodes. It defines a single method <emphasis>PortalNode getNode()</emphasis> which can be
- used to retrieve the node targetted by the event.</para>
- <para>The <emphasis>org.jboss.portal.api.node.event.WindowEvent</emphasis> is an extension for portal nodes
- of type window. It provides access to the mode and window state of the window. It has 3 subclasses which
- represent different kind of event that can target windows.</para>
- <para>The <emphasis>org.jboss.portal.api.node.event.WindowNavigationEvent</emphasis> is fired when the
- window navigational state changes. For a portlet it means that the window is targetted by an URL of type
- render.</para>
- <para>The <emphasis>org.jboss.portal.api.node.event.WindowActionEvent</emphasis> is fired when the
- window is targetted by an action. For a portlet it means that the window is targetted by an URL of type
- action.</para>
- <para>The <emphasis>org.jboss.portal.api.node.event.WindowRenderEvent</emphasis> is fired when the
- window is going to be rendered by the portal.</para>
- <para>The <emphasis>org.jboss.portal.api.node.event.PageEvent</emphasis> is an extension for portal nodes
- of type page.</para>
- <para>The <emphasis>org.jboss.portal.api.node.event.PageRenderEvent</emphasis> is fired when the
- page is going to be rendered by the portal.</para>
- <section>
- <title>Portal node event propagation model</title>
- <para>
- A portal node event is fired when an event of interest happens to a portal node of the portal tree. The
- notification model is comparable to the <ulink url="http://en.wikipedia.org/wiki/DOM_Events#Event_flow">bubbling propagation model </ulink>
- defined by the DOM specification. When an event is fired, the event is propagated in the hierarchy from the most
- inner node where the event happens to the root node of the tree.
- </para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/eventpropagation.png"/>
- </imageobject>
- </mediaobject>
- <para>The portal node event propagation model</para>
-
-
- </section>
- <section>
- <title>Portal node event listener</title>
- <para>The <emphasis>org.jboss.portal.api.node.event.PortalNodeEventListener</emphasis> interface should
- be used instead of the too generic <emphasis>org.jboss.portal.api.event.PortalEventListener</emphasis> when
- it comes down of listening portal node events. Actually it does not replace it, the <emphasis>PortalEventListener</emphasis>
- interface semantic allows only traditional event delivering. The <emphasis>PortalNodeEventListener</emphasis>
- interface is designed to match the bubbling effect during an event delivery.</para>
- <para>The <emphasis>PortalNodeEvent onEvent(PortalNodeEventContext context, PortalNodeEvent event)</emphasis>
- method declares a <emphasis>PortalNodeEvent</emphasis> as return type. Commonly the method returns null;
- however, a returned PortalNodeEvent replaces the event in the listeners subsequently called during
- the event bubbling process.
- </para>
- </section>
- <section>
- <title>Portal node event context</title>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/PortalNodeEventContext.png"/>
- </imageobject>
- </mediaobject>
- <para>The PortalNodeEventContext interface</para>
-
- <para>The <emphasis>org.jboss.portal.api.node.event.PortalNodeEventContext</emphasis> interface extends
- the <emphasis>PortalEventContext</emphasis> interface and plays an important role
- in the event delivery model explained in the previous section. That interface gives full control over the
- delivery of the event to ascendant nodes in the hierarchy, even more it gives the possibility to replace
- the current event being delivered by a new event that will be transformed into the corresponding portal
- behavior. However there are no guarantees that the portal will turn the returned event into a portal
- behavior, here the portal provides a best effort policy, indeed sometime it is not possible to achieve
- the substitution of one event by another.</para>
- <para>Here the simplest implementation of a listener that does nothing except than correctly passing
- the control to a parent event listener if there is one.</para>
- <programlisting><![CDATA[
-public PortalNodeEvent onEvent(PortalNodeEventContext context, PortalNodeEvent event)
-{
- return context.dispatch();
-}
-]]></programlisting>
- <para>The method <emphasis>PortalNode getNode()</emphasis> returns the current node being selected
- during the event bubbler dispatching mechanism.</para>
- </section>
- </section>
- <section>
- <title>Portal session events</title>
- <para>The life cycle of the session of the portal associated with the user can also raise events. This kind of
- event is not bound to a portal node since it is triggered whenever a portal session is created or destroyed</para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/PortalSessionEvent.png"/>
- </imageobject>
- </mediaobject>
- <para>The PortalSessionEvent class</para>
-
- <para>There are two different types of events:
- <itemizedlist>
- <listitem><para>org.jboss.portal.api.session.event.PortalSessionEvent.SESSION_CREATED, fired when a new portal session is created</para></listitem>
- <listitem><para>org.jboss.portal.api.session.event.PortalSessionEvent.SESSION_DESTROYED, fired when a new portal session is destroyed</para></listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>Portal user events</title>
- <para>The life cycle of the portal user can also raise events such as its authentication. A subclass of the wider scope UserEvent class is
- provided and triggers events whenever a user signs in or out. The UserEvent object gives access to the user name of the logged-in user through
- the method <emphasis>String getId()</emphasis>.</para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/portalapi/user.event.png"/>
- </imageobject>
-
- </mediaobject>
- <para>The UserEvent class and UserAuthenticationEvent sub-classes</para>
-
- <para>The UserAuthenticationEvent triggers two events that can be catched:
- <itemizedlist>
- <listitem><para>org.jboss.portal.api.session.event.UserAuthenticationEvent.SIGN_IN, fired when a portal user signs in</para></listitem>
- <listitem><para>org.jboss.portal.api.session.event.UserAuthenticationEvent.SIGN_OUT, fired when a portal user signs out</para></listitem>
- </itemizedlist>
- </para>
- <para>Based on the UserEvent class other custom user related events could be added like one that would trigger when a new user is
- being registered</para>
- </section>
- </section>
- <section>
- <title>Examples</title>
- <para>The events mechanism is quite powerful, in this section of the chapter we will see few simple examples to explain how
- it works.</para>
- <section>
- <title>UserAuthenticationEvent example</title>
- <para>In this example, we will create a simple counter of the number of logged-in registered users. In order to
- do that we just need to keep track of Sign-in and Sign-out events.</para>
- <para>First, let's write our listener. It just a class that will implement <emphasis>org.jboss.portal.api.event.PortalEventListener</emphasis> and
- its unique method <emphasis>void onEvent(PortalEventContext eventContext, PortalEvent event)</emphasis>. Here is such an example:
- <programlisting role="java"><![CDATA[
-package org.jboss.portal.core.portlet.test.event;
-
-import[...]
-
-public class UserCounterListener implements PortalEventListener
-{
-
- /** Thread-safe long */
- private final SynchronizedLong counter = new SynchronizedLong(0);
-
- /** Thread-safe long */
- private final SynchronizedLong counterEver = new SynchronizedLong(0);
-
- public void onEvent(PortalEventContext eventContext, PortalEvent event)
- {
- if (event instanceof UserAuthenticationEvent)
- {
- UserAuthenticationEvent userEvent = (UserAuthenticationEvent)event;
- if (userEvent.getType() == UserAuthenticationEvent.SIGN_IN)
- {
- counter.increment();
- counterEver.increment();
- }
- else if (userEvent.getType() == UserAuthenticationEvent.SIGN_OUT)
- {
- counter.decrement();
- }
- System.out.println("Counter : " + counter.get());
- System.out.println("Counter ever: " + counterEver.get());
- }
- }
-}
- ]]></programlisting>
- On this method we simply filter down to UserAuthenticationEvent then depending on the type of authentication event we update the
- counters. <emphasis>counter</emphasis> keeps track of the registered and logged-in users, while counterEver only counts the number of
- times people logged-in the portal.</para>
- <para>Now that the Java class has been written we need to register it so that it can be called when the events are triggered. To do
- so we need to register it as an MBean. It can be done by editing the sar descriptor file:
- <emphasis>YourService.sar/META-INF/jboss-service.xml</emphasis> so that it looks like the following:
- <programlisting><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
- <mbean
- code="org.jboss.portal.core.event.PortalEventListenerServiceImpl"
- name="portal:service=ListenerService,type=counter_listener"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends
- optional-attribute-name="Registry"
- proxy-type="attribute">portal:service=ListenerRegistry</depends>
- <attribute name="RegistryId">counter_listener</attribute>
- <attribute name="ListenerClassName">
- org.jboss.portal.core.portlet.test.event.UserCounterListener
- </attribute>
- </mbean>
-</server>
- ]]></programlisting>
- This snippet can be kept as it is, providing you change the values:
- <itemizedlist>
- <listitem>
- <para><emphasis role="bold">name:</emphasis> Must follow the pattern: portal:service=ListenerService,type={{UNIQUENAME}}</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">RegistryId:</emphasis> Must match the type (here: counter_listener)</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">ListenerClassName:</emphasis> Full path to the listener
- (here: org.jboss.portal.core.portlet.test.event.UserCounterListener).</para>
- </listitem>
- </itemizedlist>
- </para>
- <para>That's it - we now have a user counter that will display it states each time a user logs-in our logs-out.</para>
- </section>
- <section>
- <title>Achieving Inter Portlet Communication with the events mechanism</title>
- <para>The first version of the Portlet Specification (JSR 168), regretfully, did not cover interaction between
- portlets. The side-effect of diverting the issue to the subsequent release of the specification, has
- forced portal vendors to each craft their own proprietary API to achieve inter portlet communication. Here we will
- see how we can use the event mechanism to pass parameters from one portlet to the other (and only to the other portlet).</para>
- <para>The overall scenario will be that Portlet B will need to be updated based on some parameter set on Portlet A.
- To achieve that we will use a portal node event.</para>
- <para>Portlet A is a simple Generic portlet that has a form that sends a color name:
- <programlisting><![CDATA[
-public class PortletA extends GenericPortlet
-{
- protected void doView(RenderRequest request, RenderResponse response)
- throws PortletException, PortletSecurityException, IOException
- {
- response.setContentType("text/html");
- PrintWriter writer = response.getWriter();
- writer.println("<form action=\"" + response.createActionURL() + "\" method=\"post\">");
- writer.println("<select name=\"color\">");
- writer.println("<option>blue</option>");
- writer.println("<option>red</option>");
- writer.println("<option>black</option>");
- writer.println("</select>");
- writer.println("<input type=\"submit\"/>");
- writer.println("</form>");
- writer.close();
- }
-}
- ]]></programlisting>
- </para>
- <para>The other portlet (Portlet B) that will receive parameters from Portlet A is also a simple Generic portlet:
- <programlisting><![CDATA[
-public class PortletB extends GenericPortlet
-{
-
- public void processAction(ActionRequest request, ActionResponse response)
- throws PortletException, PortletSecurityException, IOException
- {
- String color = request.getParameter("color");
- if (color != null)
- {
- response.setRenderParameter("color", color);
- }
- }
-
- protected void doView(RenderRequest request, RenderResponse response)
- throws PortletException, PortletSecurityException, IOException
- {
- String color = request.getParameter("color");
- response.setContentType("text/html");
- PrintWriter writer = response.getWriter();
- writer.println("<div" +
- (color == null ? "" : " style=\"color:" + color + ";\"") +
- ">some text in color</div>");
- writer.close();
- }
-
- // Inner listener explained after
-}
- ]]></programlisting>
- </para>
- <para>With those two portlets in hands, we just want to pass parameters from Portlet A to Portlet B (the color in
- as a request parameter in our case). In order to achieve this goal, we will write an inner Listener in Portlet B
- that will be triggered on any WindowActionEvent of Portlet A. This listener will create a new WindowActionEvent
- on the window of Portlet B.
- <programlisting role="java"><![CDATA[
-public static class Listener implements PortalNodeEventListener
-{
- public PortalNodeEvent onEvent(PortalNodeEventContext context, PortalNodeEvent event)
- {
- PortalNode node = event.getNode();
- // Get node name
- String nodeName = node.getName();
- // See if we need to create a new event or not
- WindowActionEvent newEvent = null;
- if (nodeName.equals("PortletAWindow") && event instanceof WindowActionEvent)
- {
- // Find window B
- WindowActionEvent wae = (WindowActionEvent)event;
- PortalNode windowB = node.resolve("../PortletBWindow");
- if (windowB != null)
- {
- // We can redirect
- newEvent = new WindowActionEvent(windowB);
- newEvent.setParameters(wae.getParameters());
-
- newEvent.setMode(wae.getMode());
- newEvent.setWindowState(WindowState.MAXIMIZED);
-
- // Redirect to the new event
- return newEvent;
- }
- }
- // Otherwise bubble up
- return context.dispatch();
- }
-}
- ]]></programlisting>
- </para>
- <para>
- It is important to note here some of the important items in this listener class.
- Logic used to determine if the requesting node was Portlet A.:
- <programlisting>nodeName.equals("PortletAWindow")</programlisting>
- </para>
- <para>
- Get the current window object so we can dispatch the event to it:
- <programlisting>PortalNode windowB = node.resolve("../PortletBWindow");</programlisting>
- </para>
- <para>
- Set the original parameter from Portlet A, so Portlet B can access them in its processAction():
- <programlisting>newEvent.setParameters(wae.getParameters());</programlisting>
- </para>
- <!--
- <para>
- Modify Portlet B windowmode and/or windowstate (ie, Maximize and place in Edit Mode):
- <programlisting>
-newEvent.setMode(wae.getMode()); // Mode.EDIT;
-newEvent.setWindowState(wae.getWindowState()); // WindowState.MAXIMIZED</programlisting>
- </para>
- -->
- <para>
- We still need to register our listener as an mbean:
- <programlisting role="xml">
-<![CDATA[<mbean
- code="org.jboss.portal.core.event.PortalEventListenerServiceImpl"
- name="portal:service=ListenerService,type=test_listener"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends
- optional-attribute-name="Registry"
- proxy-type="attribute">portal:service=ListenerRegistry</depends>
- <attribute name="RegistryId">test_listener</attribute>
- <attribute name="ListenerClassName">
- org.jboss.portal.core.samples.basic.event.PortletB$Listener
- </attribute>
-</mbean>]]></programlisting>
- For node events, we also need to declare on which node we want to listen, this is done by modifying
- the <literal>*-object.xml</literal> that defines your portal nodes. In this example we want to trigger
- the listener each time the window containing the portlet A is actioned. We can add the <literal>listener</literal>
- tag to specify that out listener with <literal>RegistryId</literal>=test_listener should be triggered
- on events on the embedding object.
- <programlisting>
-<![CDATA[...
- <window>
- <window-name>PortletAWindow</window-name>
- <instance-ref>PortletAInstance</instance-ref>
- <region>center</region>
- <height>0</height>
- <listener>test_listener</listener>
- </window>
-...]]>
- </programlisting>
- Of course we could have added it at the page level instead of the window level. Note that a unique listener
- can be specified, the event mechanism is primarily done to let the developer change the navigation state of the
- portal, this example being a nice side-effect of this feature.
- </para>
- <note><para>The portlet 2.0 specification (JSR 286) will cover Inter Portlet Communication so that portlets using it
- can work with different portal vendors.</para></note>
- </section>
- <section>
- <title>Link to other pages</title>
- <para>Linking to some other pages or portals is also out of the scope of the portlet
- specification. As seen previously JBoss Portal offers an API in order to create links
- to other portal nodes. The JBoss request gives access to the current window node from
- which we can navigate from.</para>
- <programlisting role="java">
-<![CDATA[
-// Get the ParentNode. Since we are inside a Window, the Parent is the Page
-PortalNode thisNode = req.getPortalNode().getParent();
-
-// Get the Node in the Portal hierarchy tree known as "../default"
-PortalNode linkToNode = thisNode.resolve("../default");
-
-// Create a RenderURL to the "../default" Page Node
-PortalNodeURL pageURL = resp.createRenderURL(linkToNode);
-
-// Output the Node's name and URL for users
-html.append("Page: " + linkToNode.getName() + " -> ");
-html.append("<a href=\"" + pageURL.toString() + "\">" + linkToNode.getName() + "</a>");
- ]]></programlisting>
- <para>From this, it is easy to create a menu or sitemap, the <emphasis>List getChildren()</emphasis>
- method will return all the child nodes on which the user has the view right access.</para>
- </section>
- <section>
- <title>Samples</title>
- <para>Those examples are available in the core-samples package in the sources of JBoss Portal.
- There are more examples of events usage in the samples delivered with JBoss Portal. One of them
- shows the usage of a portal node event to only have one window in normal mode at a time in a region.
- Anytime another window is being put in normal mode, all the other windows of the same regions
- are automatically minimized.</para>
- </section>
- </section>
-</chapter>
- <chapter id="clustering">
- <!--<chapterinfo>
- <author>
- <firstname>Julien</firstname>
- <surname>Viet</surname>
- </author>
- <author>
- <firstname>Roy</firstname>
- <surname>Russo</surname>
- </author>
- </chapterinfo>-->
- <title>Clustering Configuration</title>
- <para>This section covers configuring JBoss Portal for a clustered environment.</para>
- <section>
- <title>Introduction</title>
- <para>JBoss Portal leverages various clustered services that are found in JBoss Application Server. This section briefly details how each is leveraged:
- </para>
- <itemizedlist>
- <listitem>
- <para>
- <emphasis role="bold">JBoss Cache:</emphasis>
- Used to replicate data among the different hibernate session factories that are deployed in
- each node of the cluster.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">JBoss HA Singleton:</emphasis>
- <orderedlist>
- <listitem><para>Used to make the deployer a singleton on the cluster, in order to avoid
- concurrency issues when
- deploying the various *-object.xml files. Without that, each node would try to create the
- same objects in the database when it deploys an archive containing such descriptors.</para></listitem>
- <listitem><para>Used with JCR. The Apache Jackrabbit server is not able to run in a cluster
- by itself, therefore we make a singleton on the cluster. This provides HA-CMS, which is
- similar to the current HA JBossMQ provided in JBoss AS.</para></listitem>
- </orderedlist>
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">HA-JNDI:</emphasis>
- Used to replicate a proxy that will talk to the HA CMS on the cluster.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">Http Session Replication:</emphasis>
- Used to replicate the portal and the portlet sessions.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">JBoss SSO:</emphasis>
- Used to replicate the user identity, an authenticated user does not have to login again when failover occurs.
- </para>
- </listitem>
- </itemizedlist>
-
- <note><title>Note</title><para>JBoss Clustering details can be found in the
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossHA">Wiki</ulink>
- or the
- <ulink url="http://labs.jboss.com/jbossas/docs/">clustering documentation</ulink>.</para>
- </note>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/clustering/overview.png" scalefit="1"/>
- </imageobject></mediaobject>
- </section>
- <section>
- <title>Considerations</title>
- <para>When you want to run JBoss Portal on a cluster there are a few things to keep in mind:
- <itemizedlist>
- <listitem><para>Deploy the portal under the <emphasis role="bold">all</emphasis> application server configuration as it contains the clustering services that is leveraged by JBoss Portal.</para></listitem>
- <listitem><para>All the portal instances have to use the same datasource : the database is used to store the portal
- persistent state like pages. If you don't use a shared database then you will have consistency problems.</para></listitem>
- </itemizedlist></para>
- </section>
-
- <section>
- <title>JBoss Portal Clustered Services</title>
-
- <section id="PortalSessionReplication">
- <title>Portal Session Replication</title>
- <para>The portal associates with each user a http session in order to keep specific objects such as:
- <itemizedlist>
- <listitem><para>Navigational state : this is mainly the state of different portlet windows that the user will manipulate
- during its interactions with the portal. For instance a maximized portlet window with specific render parameters.</para></listitem>
- <listitem><para>WSRP objects : the WSRP protocol can require to provide specific cookies during interactions with a remote
- portlet.</para></listitem>
- </itemizedlist>
- Replicating the portal session ensures that this state will be kept in sync on the cluster, e.g The user will see exactly
- the same portlet window on every node of the cluster. The activation of the portal session replication is made through the
- configuration of the web application that is the main entry point of the portal. This setting is available in the file
- <emphasis>jboss-portal.sar/portal-server.war/WEB-INF/web.xml</emphasis></para>
- <para>
- <programlisting><![CDATA[
-<web-app>
- <description>JBoss Portal</description>
- <!-- Comment/Uncomment to enable portal session replication -->
- <distributable/>
- ...
-</web-app>
-]]></programlisting>
- </para>
- </section>
-
- <section>
- <title>Hibernate clustering</title>
- <para>JBoss Portal leverages hibernate for its database access. In order to improve performances it uses
- the caching features provided by hibernate. On a cluster the cache needs to be replicated in order
- to avoid state inconsistencies. Hibernate is configured with JBoss Cache which performs that synchronization transparently.
- Therefore the different hibernate services must be configured to use JBoss Cache. The following hibernate configurations
- needs to use a replicated JBoss Cache :
- <itemizedlist>
- <listitem><para><emphasis>jboss-portal.sar/conf/hibernate/user/hibernate.cfg.xml</emphasis></para></listitem>
- <listitem><para><emphasis>jboss-portal.sar/conf/hibernate/instances/hibernate.cfg.xml</emphasis></para></listitem>
- <listitem><para><emphasis>jboss-portal.sar/conf/hibernate/portal/hibernate.cfg.xml</emphasis></para></listitem>
- <listitem><para><emphasis>jboss-portal.sar/conf/hibernate/portlet/hibernate.cfg.xml</emphasis></para></listitem>
- </itemizedlist>
- The cache configuration should look like :
- <programlisting><![CDATA[
-<!--
- | Uncomment in clustered mode : use transactional replicated cache
- -->
- <property name="cache.provider_class">org.jboss.portal.core.hibernate.JMXTreeCacheProvider
- </property>
- <property name="cache.object_name">portal:service=TreeCacheProvider,type=hibernate
- </property>
-
-<!--
- | Comment in clustered mode
- <property name="cache.provider_configuration_file_resource_path">
- conf/hibernate/instance/ehcache.xml</property>
- <property name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
--->
-]]></programlisting>
- Also we need to ensure that the cache is deployed by having in the file <emphasis>jboss-portal.sar/META-INF/jboss-service.xml</emphasis>
- the cache service uncommented :
- <programlisting><![CDATA[
-<!--
- | Uncomment in clustered mode : replicated cache for hibernate
- -->
- <mbean
- code="org.jboss.cache.TreeCache"
- name="portal:service=TreeCache,type=hibernate">
- <depends>jboss:service=Naming</depends>
- <depends>jboss:service=TransactionManager</depends>
- <attribute name="TransactionManagerLookupClass">
- org.jboss.cache.JBossTransactionManagerLookup</attribute>
- <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
- <attribute name="CacheMode">REPL_SYNC</attribute>
- <attribute name="ClusterName">portal.hibernate</attribute>
- </mbean>
-
- <mbean
- code="org.jboss.portal.core.hibernate.JBossTreeCacheProvider"
- name="portal:service=TreeCacheProvider,type=hibernate">
- <depends optional-attribute-name="CacheName">portal:service=TreeCache,type=hibernate
- </depends>
- </mbean>
-]]></programlisting>
- More information can be found <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossCacheHibernate">here</ulink>.
- </para>
- </section>
-
- <section>
- <title>Identity clustering</title>
- <para>JBoss Portal leverages the servlet container authentication for its own authentication mechanism. When
- the user is authenticated on one particular node he will have to reauthenticate again if a different
- node of the cluster (during a failover for instance) is used. This is valid only for the <emphasis>FORM</emphasis>
- based authentication which is the default form of authentication that JBoss Portal uses. Fortunately JBoss
- provides transparent reauthentication of the user called JBoss clustered SSO. Its configuration can be found
- in <literal>$JBOSS_HOME/server/all/deploy/jboss-web.deployer/server.xml</literal> and you will need to
- uncomment the following valve:
- <programlisting><![CDATA[<Valve className="org.jboss.web.tomcat.service.sso.ClusteredSingleSignOn" />]]></programlisting>
-
- More information can be found <ulink url="http://www.jboss.org/wiki/Wiki.jsp?page=SingleSignOn">here</ulink>.
- </para>
- </section>
-
- <section>
- <title>CMS clustering</title>
- <para>The CMS backend storage relies on the Apache Jackrabbit project. Jackrabbit does not support clustering out of the box.
- So the portal run the Jackrabbit service on one node of the cluster using the
- <ulink url="http://www.onjava.com/pub/a/onjava/2003/08/20/jboss_clustering.html">HA-Singleton</ulink> technology.
- The file <emphasis>jboss-portal.sar/portal-cms.sar/META-INF/jboss-service.xml</emphasis> contains the configuration. We will
- not reproduce it in this documentation as the changes are quite complex and numerous. Access from all nodes of the cluster
- is provided by a proxy bound in HA-JNDI. In order to avoid any bottleneck JBoss Cache is leveraged to cache CMS content cluster
- wide.</para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/clustering/cms.png"/>
- </imageobject></mediaobject>
- </section>
-
- </section>
-
- <section>
- <title>Setup</title>
- <para>We are going to outline how to setup a two node cluster on the same machine in order to test JBoss Portal HA. The only
- missing part from the full fledged setup is the addition of a load balancer in front of Apache Tomcat. However a lot of documentation
- exist on the subject. A detailed step by step setup of Apache and mod_jk is available from the
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingMod_jk1.2WithJBoss">JBoss Wiki</ulink>.</para>
- <para>As we need two application servers running at the same time, we must avoid any conflict. For instance we will
- need Apache Tomcat to bind its socket on two different ports otherwise a network conflict will occur. We will leverage
- the service binding manager <ulink url="http://docs.jboss.org/jbossas/jboss4guide/r3/html/ch10.html">this chapter</ulink> of
- the JBoss AS documentation.</para>
- <para>The first step is to copy the <emphasis>all</emphasis> configuration of JBoss into two separate
- configurations that we name <emphasis>ports-01</emphasis> and <emphasis>ports-02</emphasis> :
- <programlisting><![CDATA[
->cd $JBOSS_HOME/server
->cp -r all ports-01
->cp -r all ports-02
-]]></programlisting>
- </para>
- <para>Edit the file <emphasis>$JBOSS_HOME/server/ports-01/conf/jboss-service.xml</emphasis> and uncomment
- the service binding manager :
- <programlisting><![CDATA[
-<mbean code="org.jboss.services.binding.ServiceBindingManager"
- name="jboss.system:service=ServiceBindingManager">
- <attribute name="ServerName">ports-01</attribute>
- <attribute name="StoreURL">
- ${jboss.home.url}/docs/examples/binding-manager/sample-bindings.xml</attribute>
- <attribute name="StoreFactoryClassName">org.jboss.services.binding.XMLServicesStoreFactory</attribute>
-</mbean>
-]]></programlisting>
- </para>
- <para>Edit the file <emphasis>$JBOSS_HOME/server/ports-02/conf/jboss-service.xml</emphasis>, uncomment
- the service binding manager and change the value <emphasis>ports-01</emphasis> into <emphasis>ports-02</emphasis>:
- <programlisting><![CDATA[
-<mbean code="org.jboss.services.binding.ServiceBindingManager"
- name="jboss.system:service=ServiceBindingManager">
- <attribute name="ServerName">ports-02</attribute>
- <attribute name="StoreURL">
- ${jboss.home.url}/docs/examples/binding-manager/sample-bindings.xml</attribute>
- <attribute name="StoreFactoryClassName">
- org.jboss.services.binding.XMLServicesStoreFactory</attribute>
-</mbean>]]></programlisting>
- </para>
- <para>Setup a database that will be shared by the two nodes and obviously we cannot use
- an embedded database. For instance using postgresql we would need to copy the file <emphasis>portal-postgresql-ds.xml</emphasis>
- into <emphasis>$JBOSS_HOME/server/ports-01/deploy</emphasis> and <emphasis>$JBOSS_HOME/server/ports-02/deploy</emphasis>.
- </para>
- <para>Copy JBoss Portal HA to the deploy directory of the two configurations.</para>
-
- <!-- adding instruction about jboss cache versioning -->
- <formalpara>
- <title>JBoss Cache</title>
- <para>
- To improve CMS performance JBoss Cache is leveraged to cache the content cluster wide.
- We recommend that you use the following version of JBoss Cache for best performance:
- </para>
-</formalpara>
- <itemizedlist>
- <listitem><para>
- <emphasis>JBoss Cache 1.4.0.SP1 and above</emphasis></para>
- </listitem>
- <listitem><para>
- <emphasis>JGroups 2.2.7 or 2.2.8</emphasis></para>
- </listitem>
- </itemizedlist>
- <para>
- When building from source the following command:
- <literal>{core}/build.xml deploy-ha</literal> automatically upgrades your JBoss Cache version.
- </para>
- <para>
- <emphasis>Alternative:</emphasis>
- If upgrading your JBoss Cache version is not an option, the following configuration
- change is needed in the
- <literal>jboss-portal-ha.sar/portal-cms.sar/META-INF/jboss-service.xml</literal>.
- Replace the following configuration in the
- <emphasis>cms.pm.cache:service=TreeCache</emphasis>
- Mbean:
- </para>
- <programlisting role="XML"><![CDATA[
-<!--
- Configuring the PortalCMSCacheLoader
- CacheLoader configuration for 1.4.0
--->
-<attribute name="CacheLoaderConfiguration">
- <config>
- <passivation>false</passivation>
- <preload></preload>
- <shared>false</shared>
- <cacheloader>
- <class>org.jboss.portal.cms.hibernate.state.PortalCMSCacheLoader</class>
- <properties></properties>
- <async>false</async>
- <fetchPersistentState>false</fetchPersistentState>
- <ignoreModifications>false</ignoreModifications>
- </cacheloader>
- </config>
-</attribute>]]>
- </programlisting>
- <para>
- with the following configuration:
- </para>
- <programlisting role="XML"><![CDATA[
-<!--
- Configuring the PortalCMSCacheLoader
- CacheLoader configuratoon for 1.2.4SP2
--->
-<attribute name="CacheLoaderClass">org.jboss.portal.cms.hibernate.state.PortalCMSCacheLoader
-</attribute>
-<attribute name="CacheLoaderConfig" replace="false"></attribute>
-<attribute name="CacheLoaderPassivation">false</attribute>
-<attribute name="CacheLoaderPreload"></attribute>
-<attribute name="CacheLoaderShared">false</attribute>
-<attribute name="CacheLoaderFetchTransientState">false</attribute>
-<attribute name="CacheLoaderFetchPersistentState">false</attribute>
-<attribute name="CacheLoaderAsynchronous">false</attribute>]]></programlisting>
-
-<para>Finally we can start both servers, open two shells and execute :
- <programlisting><![CDATA[
->cd $JBOSS_HOME/bin
->sh run.sh -c ports-01
-]]></programlisting>
- <programlisting><![CDATA[
->cd $JBOSS_HOME/bin
->sh run.sh -c ports-02
-]]></programlisting>
- </para>
- </section>
-
- <section id="portlet_session_replication">
- <title>Portlet Session Replication</title>
- <para>Web containers offer the capability to replicate sessions of web applications. In the context of a portal using portlets the use case is different. The portal itself is a web application
- that benefits of web application session replication. We have to make the distinction between local or remote portlets :
- <itemizedlist>
- <listitem><para>Local portlets are web applications deployed in the same virtual machine as the portal
- web application. At runtime the access to a portlet is done using the mechanism of request dispatching. The portlet
- session is actually a mere wrapper of the underlying http session of the web application in which the portlet
- is deployed.</para></listitem>
-<listitem><para>Remote portlets are accessed using a web service, we will not cover the replication in this chapter.</para></listitem>
- </itemizedlist></para>
- <para>The servlet specification is very loose on the subject of replication and does not state anything about
- the replication of sessions during a dispatched request. JBoss Portal offers a portlet session replication
- mechanism that leverages the usage of the portal session instead which has several advantages
- </para>
- <itemizedlist>
- <listitem><para>Replicate only the portlet that requires it.</para></listitem>
- <listitem><para>Portal session replication is just web application replication and is very standard.</para></listitem>
- </itemizedlist>
- <para>There are, however, some limitations. For example, you can only replicate portlet-scoped attributes of a portlet
- session. This means that any application-scoped attribute are not replicated.</para>
- <section>
- <title>JBoss Portal configuration</title>
- <para>The mandatory step to make JBoss Portal able to replicate portlet sessions is to configure
- the portal web application to be distributed as explained in <xref linkend="PortalSessionReplication"/></para>
- </section>
- <section>
- <title>Portlet configuration</title>
- <para>In order to activate portlet session replication you need to:</para>
- <itemizedlist>
- <listitem><para>Add a Portal-specific listener class to the <literal>/WEB-INF/web.xml</literal> file of your portlet web application</para></listitem>
- <listitem><para>Configure your portlet to be distributed in the <literal>/WEB-INF/jboss-portlet.xml</literal> file</para></listitem>
- </itemizedlist>
-
- <programlisting><![CDATA[
-<web-app>
- ...
- <listener>
- <listener-class> org.jboss.portal.portlet.session.SessionListener </listener-class>
- </listener>
- ...
-</web-app>
-]]></programlisting>
-
- <para>Example web.xml</para>
-
-<programlisting><![CDATA[
-<portlet-app>
- ...
- <portlet>
- <portlet-name>YourPortlet</portlet-name>
- ...
- <session-config>
- <distributed>true</distributed>
- </session-config>
- ...
- </portlet>
- ...
-</portlet-app>
-]]></programlisting>
-
- <para>Configure YourPortlet to be replicated in jboss-portlet.xml</para>
-
- </section>
- <section>
- <title>Limitations</title>
- <para>As we noted above there are advantages as well as limitations to the clustering configuration</para>
- <itemizedlist>
- <listitem><para>You can only replicate portlet scoped attributes of a portlet. The main reason of this
- is to keep consistency with the session state. If accessing a portlet would trigger replication
- of application scoped attribute during the rendering of a page then another portlet on the same
- page could use this attribute for generating its markup. Then the state seen by this second portlet
- would not necessarily be the same depending on the order in which the portlets on this page are rendered.</para></listitem>
-<listitem><para>Mutable objects need an explicit call to <emphasis>setAttribute(String name, Object value)</emphasis>
- on the portlet session object in order to trigger replication by the container.</para></listitem>
- </itemizedlist>
- <para>
- <programlisting><![CDATA[
-public void processAction(ActionRequest req, ActionResponse resp)
- throws PortletException, IOException
-{
- ...
- if ("addItem".equals(action))
- {
- PortletSession session = req.getPortletSession();
- ShoppingCart cart = (PortletSession)session.getAttribute("cart");
- cart.addItem(item);
-
- // Perform an explicit set in order to signal to the container that the object
- // state has changed
- session.setAttribute("cart", cart);
- }
- ...
-}
-]]></programlisting>
- </para>
- </section>
- </section>
-</chapter>
- <chapter id="wsrp">
-<!-- <chapterinfo>
- <author>
- <firstname>Julien</firstname>
- <surname>Viet</surname>
- </author>
- <author>
- <firstname>Chris</firstname>
- <surname>Laprun</surname>
- </author>
- </chapterinfo>-->
-
- <title>Web Services for Remote Portlets (WSRP)</title>
-
- <section>
- <title>Introduction</title>
- <para>The Web Services for Remote Portlets specification defines a web service interface for accessing and
- interacting with interactive presentation-oriented web services. It has been produced through the efforts of
- the Web Services for Remote Portlets (WSRP) OASIS Technical Committee. It is based on the requirements
- gathered and on the concrete proposals made to the committee.
- </para>
-
- <para>Scenarios that motivate WSRP functionality include:
- <itemizedlist>
- <listitem><para>Content hosts, such as portal servers, providing Portlets as presentation-oriented web services
- that can be used by aggregation engines.</para>
- </listitem>
- <listitem><para>Aggregating frameworks, including portal servers, consuming presentation-oriented web services
- offered by content providers and integrating them into the framework.</para>
- </listitem>
- </itemizedlist>
- </para>
-
- <para>More information on WSRP can be found on the
- <ulink url="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=wsrp">official website for WSRP</ulink>.
- We suggest reading the <ulink url="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=wsrp">primer
- </ulink> for a good, albeit technical, overview of WSRP.
- </para>
- </section>
-
- <section id="wsrp_support">
- <title>Level of support in JBoss Portal</title>
- <para>The WSRP Technical Committee defined
- <ulink url="http://www.oasis-open.org/committees/download.php/3073">WSRP Use Profiles</ulink>
- to help with WSRP interoperability. We will refer to terms defined in that document in
- this section.
- </para>
-
- <para>JBoss Portal provides a Simple level of support for our WSRP Producer except that out-of-band registration
- is not currently handled. We support in-band registration and persistent local state (which are
- defined at the Complex level).
- </para>
-
- <para>On the Consumer side, JBoss Portal provides a Medium level of support for WSRP, except that we only handle
- HTML markup (as Portal itself doesn't handle other markup types). We do support explicit portlet cloning and
- we fully support the PortletManagement interface.
- </para>
-
- <para>As far as caching goes, we have Level 1 Producer and Consumer. We support Cookie handling properly on the
- Consumer and our Producer requires initialization of cookies (as we have found that it improved interoperabilty
- with some consumers). We don't support custom window states or modes, as Portal doesn't either. We do, however,
- support CSS on both the Producer (though it's more a function of the portlets than inherent Producer
- capability) and Consumer.
- </para>
-
- <para>While we provide a complete implementation of WSRP 1.0, we do need to go through the
- <ulink url="http://www.oasis-open.org/committees/download.php/6018">Conformance statements</ulink>
- and perform more interoperability testing (an area that needs to be better supported by the WSRP Technical
- Committee and Community at large).
- </para>
- </section>
-
- <section>
- <title>Deploying JBoss Portal's WSRP services</title>
- <para>
- JBoss Portal provides a complete support of WSRP 1.0 standard interfaces and offers both consumer and producer
- services. WSRP support is provided by the <filename>portal-wsrp.sar</filename> service archive, included in
- the main <filename>jboss-portal.sar</filename> service archive, if you've obtained JBoss Portal from a binary
- distribution. If you don't intend on using WSRP, we recommend that you remove <filename>portal-wspr.sar</filename>
- from the main <filename>jboss-portal.sar</filename> service archive.
- </para>
- <para>If you've obtained the source distribution of JBoss Portal, you need to build and deploy the WSRP service
- separately. Please follow the instructions on how to install
- <ulink url="http://docs.jboss.com/jbportal/v2.6/reference-guide/en/html/installation....">JBoss
- Portal from the sources</ulink>. Once this is done, navigate to
- <filename>JBOSS_PORTAL_HOME_DIRECTORY/wsrp</filename> and type: <command>build deploy</command>
- At the end of the build process, <filename>portal-wsrp.sar</filename> is copied to
- <filename>JBOSS_HOME/server/default/deploy</filename>.
- </para>
-
- <section id="wsrp-ports">
- <title>Considerations to use WSRP when running Portal on a non-default port or hostname</title>
- <para>If you have modified the port number on which Portal runs or bound your Application Server to a specific
- host name, you will also need
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=WSRPChangePorts">update the port and/or hostname
- information for WSRP</ulink> as found on
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossPortal">JBoss Portal's wiki</ulink>.
- </para>
- </section>
-
- <section>
- <title>Considerations to use WSRP with SSL</title>
- <para>It is possible to use WSRP over SSL for secure exchange of data. Please refer to the
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=WSRPUseSSL">instructions</ulink>
- on how to do so from
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossPortal">JBoss Portal's wiki</ulink>.
- </para>
- </section>
- </section>
-
- <section>
- <title>Making a portlet remotable</title>
- <para>JBoss Portal does <emphasis role="bold">NOT</emphasis>, by default, expose local portlets for consumption by
- remote WSRP consumers. In order to make a portlet remotely available, it must be made "remotable" by adding a
- <literal>remotable</literal> element to the <filename>jboss-portlet.xml</filename> deployment descriptor for
- that portlet. If a <filename>jboss-portlet.xml</filename> file does not exist, one must be added to the
- <filename>WEB-INF</filename> folder of the web application containing the portlet.
- </para>
- <para>In the following example, the "BasicPortlet" portlet is specified as being remotable. The
- <literal>remotable</literal> element is optional.
- </para>
-
- <programlisting><![CDATA[
-<?xml version="1.0" standalone="yes"?>
-<!DOCTYPE portlet-app PUBLIC "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
-<portlet-app>
- <portlet>
- <portlet-name>BasicPortlet</portlet-name>
- <remotable>true</remotable>
- </portlet>
-</portlet-app>]]></programlisting>
-
- <para>
- It is also possible to specify that all the portlets declared within a given <filename>jboss-portlet.xml</filename>
- file have a specific "remotable" status by default. This is done by adding a single <literal>remotable</literal>
- element to the root <literal>portlet-app</literal> element. Usually, this feature will be used to remotely expose
- several portlets without having to specify the status for all the declared portlets. Let's look at an example:
- </para>
-
- <programlisting><![CDATA[
-<?xml version="1.0" standalone="yes"?>
-<!DOCTYPE portlet-app PUBLIC
- "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
-<portlet-app>
- <remotable>true</remotable>
- <portlet>
- <portlet-name>RemotelyExposedPortlet</portlet-name>
- ...
- </portlet>
- <portlet>
- <portlet-name>NotRemotelyExposedPortlet</portlet-name>
- <remotable>false</remotable>
- ...
- </portlet>
-</portlet-app>]]>
- </programlisting>
-
-
- <para>
- In the example above, we defined two portlets with a default "remotable" status set to true. This means that
- all portlets defined in this descriptor are, by default, exposed remotely by JBoss Portal's WSRP producer.
- Note, however, that it is possible to override the default behavior by adding a <literal>remotable</literal>
- element to a portlet description. In that case, the "remotable" status defined by the portlet takes precedence
- over the default. In the example above, the <literal>RemotelyExposedPortlet</literal> inherits the "remotable"
- status defined by default since it does not specify a <literal>remotable</literal> element in its description.
- The <literal>NotRemotelyExposedPortlet</literal>, however, overrides the default behavior and is not remotely
- exposed. Note that in the absence of a top-level <literal>remotable</literal> element, portlets are NOT
- remotely exposed.
- </para>
- </section>
-
- <section>
- <title>Consuming JBoss Portal's WSRP portlets from a remote Consumer</title>
- <para>WSRP Consumers vary a lot as far as how they are configured. Most of them require that you either specify
- the URL for the Producer's WSDL definition or the URLs for the individual endpoints. Please refer to your
- Consumer's documentation for specific instructions. For instructions on how to do so in JBoss Portal, please
- refer to <xref linkend="consumer_configuration"/>.
- </para>
- <para>
- JBoss Portal's Producer is automatically set up when you deploy a portal instance with the WSRP service.
- You can access the WSDL file at
- <filename>http://{hostname}:{port}/portal-wsrp/MarkupService?wsdl</filename>. You can access the endpoint URLs
- at:
- <itemizedlist>
- <listitem><para>
- <filename>http://{hostname}:{port}/portal-wsrp/ServiceDescriptionService</filename></para>
- </listitem>
- <listitem><para>
- <filename>http://{hostname}:{port}/portal-wsrp/MarkupService</filename></para>
- </listitem>
- <listitem><para>
- <filename>http://{hostname}:{port}/portal-wsrp/RegistrationService</filename></para>
- </listitem>
- <listitem>
- <para><filename>http://{hostname}:{port}/portal-wsrp/PortletManagementService</filename></para>
- </listitem>
- </itemizedlist>
- The default hostname is <literal>localhost</literal> and the default port is 8080.
- </para>
- </section>
-
- <section id="consumer_configuration">
- <title>Consuming remote WSRP portlets in JBoss Portal</title>
- <section>
- <title>Overview</title>
- <para>
- To be able to consume WSRP portlets exposed by a remote producer, JBoss Portal's WSRP consumer needs to know
- how to access that remote producer. One can configure access to a remote producer using WSRP Producer
- descriptors. Alternatively, a portlet is provided to configure remote producers.
- </para>
- <para>
- Once a remote producer has been configured, it can be made available
- in the list of portlet providers in the Management portlet on the Admin page of JBoss Portal. You can then
- examine the list of portlets that are exposed by this producer and configure the portlets just like you
- would for local portlets.
- </para>
- <para>
- JBoss Portal's default configuration exposes some of the sample portlets for remote consumption. As a way to
- test the WSRP service, a default consumer has been configured to consume these portlets. To make sure that
- the service indeed works, check that there is a portlet provider with the
- <literal>self</literal>
- identifier in the portlet providers list in the Management portlet of the Admin page. All local portlets
- marked as remotable are exposed as remote portlets via the
- <literal>self</literal>
- portlet
- provider so that you can check that they work as expected with WSRP. The
- <filename>portal-wsrp.sar</filename>
- file contains a WSRP Producer descriptor (<filename>default-wsrp.xml</filename>) that configures this
- default producer. This file can be edited or removed if needed.
- </para>
- </section>
-
- <section>
- <title>Configuring a remote producer walk-through</title>
- <para>
- Let's work through the steps of defining access to a remote producer so that its portlets can be
- consumed within JBoss Portal. We will configure access to BEA's public WSRP producer. We will first examine
- how to do so using the configuration portlet. We will then show how the same result can be accomplish with
- a producer descriptor.
- </para>
-
- <section id="consumer_gui">
- <title>Using the configuration portlet</title>
- <para>
- As of Portal 2.6, a configuration portlet is provided to configure access to remote WSRP Producers
- grahically. You can access it at
- <filename>http://{hostname}:{port}/portal/auth/portal/admin/WSRP</filename>
- or by logging in as a Portal administrator and clicking on the WSRP tab in the Admin portal. If all went
- well, you should see something similar to this:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/config_init.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- This screen presents all the configured producers associated with their status and possible actions on
- them. A Consumer can be active or inactive. Activating a Consumer means that it is ready to act as a
- portlet provider. Deactivating it will remove it from the list of available portlet providers. Note also
- that a Consumer can be marked as requiring refresh meaning that the information held about it might not
- be up to date and refreshing it from the remote Producer might be a good idea. This can happen for
- several reasons: the service description for that remote Producer has not been fetched yet, the cached
- version has expired or modifications have been made to the configuration that could potentially
- invalidate it, thus requiring re-validation of the information.
- </para>
-
- <para>
- Next, we create a new Consumer which we will call<literal>bea</literal>. Type "<literal>bea</literal>" in
- the
- "Create a consumer named:" field then click on "Create consumer":
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/config_create.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- You should now see a form allowing you to enter/modify the information about the Consumer.
- Set the cache expiration value to 300 seconds and enter the WSDL URL for the producer in the text field
- and press the "Refresh & Save" button:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/config_usewsdl.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- This will retrieve the service description associated with the Producer which WSRP is described by the
- WSDL file found at the URL you just entered. In our case, querying the service description will allow us
- to learn that the Producer requires registration and that it expects a value for the registration
- property named <literal>registration/consumerRole</literal>:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/config_refresh.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- <note><title>Note</title><para>At this point, there is no automated way to learn about which possible values (if any) are
- expected by the remote Producer. In the case of BEA's public producer, the possible values are
- indicated in the registration property description. This is not always the case... Please refer to
- the specific Producer's documentation.</para>
- </note>
- Enter "<literal>public</literal>" as the value for the registration property and press "Save &
- Refresh" once more. You should now
- see something similar to:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/config_end.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- The Consumer for the <literal>bea</literal> Producer should now be available as a portlet provider and
- is ready to be used.
- </para>
- <para>
- A producer is configured, by default, by retrieving the producer's information via a WSDL URL. There are
- rare cases, however, where URLs need to be provided for each of the producer's end points. You can do
- exactly that by unchecking the "Use WSDL?" checkbox, as is the case for the <literal>self</literal>
- producer:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/config_self.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- </section>
-
- <section>
- <title>Using a WSRP Producer XML descriptor</title>
-
- <para>We will create a <filename>public-bea-wsrp.xml</filename> descriptor. Note that the actual name does not
- matter as long as it ends with <filename>-wsrp.xml</filename>:
- </para>
- <programlisting role="XML"><![CDATA[
-<?xml version='1.0' encoding='UTF-8' ?>
-<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-wsrp-consumer_2_6.dtd">
-<deployments>
- <deployment>
- <wsrp-producer id="bea" expiration-cache="300">
- <endpoint-wsdl-url>http://wsrp.bea.com:7001/producer/producer?WSDL</endpoint-wsdl-url>
- <registration-data>
- <property>
- <name>registration/consumerRole</name>
- <lang>en</lang>
- <value>public</value>
- </property>
- </registration-data>
- </wsrp-producer>
- </deployment>
-</deployments>]]></programlisting>
- <para>
- This producer descriptor gives access to BEA's public WSRP producer. We will look at the details of the different elements later. Note for now the <literal>producer-id</literal> element with a "<literal>bea</literal>" value. Put this file in the deploy directory and start the server (with JBoss Portal and its WSRP service deployed).
- </para>
- <para>
- <note><title>Note</title><para>A DTD and an XML Schema for WSRP Producer XML descriptors are available in
- <filename>jboss-portal.sar/portal-wsrp.sar/dtd/jboss-wsrp-consumer_2_6.dtd</filename> and
- <filename>jboss-portal.sar/portal-wsrp.sar/xsd/jboss-wsrp-consumer_2_6.xsd</filename></para>
- </note>
- </para>
- </section>
-
- <section>
- <title>Configuring access to a remote portlet</title>
- <para>
- Let's now look at the Admin page and the Management portlet. Click on the "Portlet definitions" tab at
- the
- top. Once this is done, look at the list of available portlet providers. If all went well,
- you should see something similar to this:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/portlets.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- We have 3 available portlet providers:
- <literal>local, self</literal>
- and<literal>bea</literal>. The
- <literal>local</literal>
- portlet provider exposes all the portlets deployed in this particular instance of Portal. As
- explained above, the
- <literal>self</literal>
- provider refers to the default WSRP consumer bundled with Portal that consumes
- the portlets exposed by the default WSRP producer. The
- <literal>bea</literal>
- provider corresponds to BEA's public producer
- we just configured. Select it and click on "View portlets". You should now see something similar to:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/bea.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- From there on out, you should be able to configure WSRP portlets just as any other. In particular, you
- can create an instance of one of the remote portlets offered by BEA's public producer just like you would
- create an instance of a local portlet and then assign it to a window in a page. If you go to that page,
- you should see something similar to below for this portlet:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/result.png" align="center" valign="middle"/>
- </imageobject>
- </mediaobject>
- </para>
- </section>
- </section>
-
- <section>
- <title>WSRP Producer descriptors</title>
-
- <para>
- A WSRP Producer descriptor is an XML file which name ends in <filename>-wsrp.xml</filename> and
- which can be dropped in the deploy directory of the JBoss application server or nested in .sar files. It is
- possible to configure access to several different producers within a single descriptor or use one file per
- producer, depending on your needs. An XML Schema for the WSRP Producer descriptor format can be found at
- <filename>jboss-portal.sar/portal-wsrp.sar/xsd/jboss-wsrp-consumer_2_6.xsd</filename>, while a (legacy) DTD
- can be found at <filename>jboss-portal.sar/portal-wsrp.sar/dtd/jboss-wsrp-consumer_2_6.dtd</filename>.
-
- <note><title>Note</title><para>It is important to note how WSRP Producer descriptors are processed. They are read the first time the
- WSRP service starts and the associated information is then put in the Portal database. Subsequent launch
- of the WSRP service will use the database-stored information for all producers which identifier is
- already known to Portal. More specifically, all the descriptors are scanned for producer identifiers.
- Any identifier that is already known will be bypassed and the configuration associated with this remote
- producer in the database will be used. If a producer identifier is found that wasn't already in the
- database, that producer information will be processed and recorded in the database. Therefore, if you
- wish to delete a producer configuration, you need to delete the associated information in the database
- (this can be accomplished using the configuration portlet as we saw in <xref linkend="consumer_gui"/>)
- <emphasis>AND</emphasis> remove the associated information in any WSRP Producer descriptor (if such
- information exists) as the producer will be re-created the next time the WSRP is launched if that
- information is not removed.</para>
- </note>
- </para>
-
- <section>
- <title>Required configuration information</title>
-
- <para>Let's now look at which information needs to be provided to configure access to a remote producer.
- </para>
-
- <para>First, we need to provide an identifier for the producer we are configuring so that we can refer to it
- afterwards. This is accomplished via the mandatory
- <literal>id</literal>
- attribute of the
- <literal><wsrp-producer></literal>
- element.
- </para>
-
- <para>JBoss Portal also needs to learn about the remote producer's endpoints to be able to connect to the
- remote web services and perform WSRP invocations. Two options are currently supported to provide this
- information:
- </para>
-
- <para>
- <itemizedlist>
- <listitem><para>You can provide the URLs for each of the different WSRP interfaces offered by the remote
- producer via the
- <literal><endpoint-config></literal>
- element and its
- <literal><service-description-url></literal>,
- <literal><markup-url></literal>,
- <literal><registration-url></literal>
- and
- <literal><portlet-management-url></literal>
- children. These URLs are
- producer-specific so you will need to refer to your producer documentation or WSDL file to
- determine
- the appropriate values.</para>
- </listitem>
- <listitem><para>Alternatively, and this is the easiest way to configure your producer, you can provide a URL
- pointing to the WSDL description of the producer's WSRP services. This is accomplished via the
- <literal><endpoint-wsdl-url></literal>
- element. JBoss Portal will then
- heuristically determine, from the information contained in the WSDL file, how to connect
- appropriately
- to the remote WSRP services.
- <note><title>Note</title><para>It is important to note that, when using this method, JBoss Portal will try to match a port
- name to an interface based solely on the provided name. There are no standard names for these
- ports so it is possible (though rare) that this matching process fails. In this case, you should
- look at the WSDL file and provide the endpoint URLs manually, as per the previous method.</para>
- </note></para>
- </listitem>
- </itemizedlist>
- </para>
-
- <para>Both the
- <literal>id</literal>
- attribute and either
- <literal><endpoint-config></literal>
- or
- <literal><endpoint-wsdl-url></literal>
- elements
- are required for a functional remote producer configuration.
- </para>
- </section>
-
- <section>
- <title>Optional configuration</title>
- <para>It is also possible to provide addtional configuration, which, in some cases, might be important to
- establish a proper connection to the remote producer.
- </para>
-
- <para>One such optional configuration concerns caching. To prevent useless roundtrips between the local
- consumer and the remote producer, it is possible to cache some of the information sent by the producer
- (such
- as the list of offered portlets) for a given duration. The rate at which the information is refreshed is
- defined by the
- <literal>expiration-cache</literal>
- attribute of the
- <literal><wsrp-producer></literal>
- element which specifies the
- refreshing period in seconds. For example, providing a value of 120 for expiration-cache means that the
- producer information will not be refreshed for 2 minutes after it has been somehow accessed. If no value
- is provided, JBoss Portal will always access the remote producer regardless of whether the remote
- information has changed or not. Since, in most instances, the information provided by the producer does
- not
- change often, we recommend that you use this caching facility to minimize bandwidth usage.
- </para>
-
- <para>Additionally, some producers require consumers to register with them before authorizing them to access
- their offered portlets. If you know that information beforehand, you can provide the required registration
- information in the producer configuration so that the Portal consumer can register with the remote
- producer when required.
- <note><title>Note</title><para>At this time, though, only simple String properties are supported and it is not possible to
- configure complex registration data. This should however be sufficient for most cases.</para>
- </note>
- </para>
-
- <para>Registration configuration is done via the
- <literal><registration-data></literal>
- element. Since JBoss Portal can generate the mandatory information for you, if the remote producer does
- not
- require any registration properties, you only need to provide an empty
- <literal><registration-data></literal>
- element. Values for the registration properties
- required by the remote producer can be provided via
- <literal><property></literal>
- elements. See the example below for more details. Additionally, you can override the default consumer
- name
- automatically provided by JBoss Portal via the
- <literal><consumer-name></literal>
- element. If you choose to provide a consumer name, please remember that this should uniquely identify
- your
- consumer.
- </para>
- </section>
- </section>
-
- <section>
- <title>Examples</title>
-
- <para>
- Here is the configuration of the <literal>self</literal> producer as found in
- <filename>default-wsrp.xml</filename> with a cache expiring every five minutes:
- </para>
-
-
- <programlisting><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-wsrp-consumer_2_6.dtd">
-
-<deployments>
- <deployment>
- <wsrp-producer id="self" expiration-cache="300">
- <!--
- we need to use the individual endpoint configuration because the configuration via
- wsdl forces an immediate attempt to access the web service description which is not
- available yet at this point of deployment
- -->
- <endpoint-config>
- <service-description-url>
- http://localhost:8080/portal-wsrp/ServiceDescriptionService
- </service-description-url>
- <markup-url>http://localhost:8080/portal-wsrp/MarkupService</markup-url>
- <registration-url>
- http://localhost:8080/portal-wsrp/RegistrationService
- </registration-url>
- <portlet-management-url>
- http://localhost:8080/portal-wsrp/PortletManagementService
- </portlet-management-url>
- </endpoint-config>
- <registration-data/>
- </wsrp-producer>
- </deployment>
-</deployments>]]>
- </programlisting>
-
-
- <para>Here is an example of a WSRP descriptor with a 2 minute caching time and manual definition of the
- endpoint URLs:
- </para>
-
-
- <programlisting><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-wsrp-consumer_2_6.dtd">
-
-<deployments>
- <deployment>
- <wsrp-producer id="MyProducer" expiration-cache="120">
- <endpoint-config>
- <service-description-url>
- http://www.someproducer.com/portal-wsrp/ServiceDescriptionService
- </service-description-url>
- <markup-url>
- http://www.someproducer.com/portal-wsrp/MarkupService
- </markup-url>
- <registration-url>
- http://www.someproducer.com/portal-wsrp/RegistrationService
- </registration-url>
- <portlet-management-url>
- http://www.someproducer.com/portal-wsrp/PortletManagementService
- </portlet-management-url>
- </endpoint-config>
- </wsrp-producer>
- </deployment>
-</deployments>]]></programlisting>
-
-
- <para>Here is an example of a WSRP descriptor with endpoint definition via remote WSDL file, registration
- data and cache expiring every minute:
- </para>
-
-
- <programlisting><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-wsrp-consumer_2_6.dtd">
-
-<deployments>
- <deployment>
- <wsrp-producer id="AnotherProducer" expiration-cache="60">
- <endpoint-wsdl-url>http://example.com/producer/producer?WSDL</endpoint-wsdl-url>
- <registration-data>
- <property>
- <name>property name</name>
- <lang>en</lang>
- <value>property value</value>
- </property>
- </registration-data>
- </wsrp-producer>
- </deployment>
-</deployments>]]></programlisting>
-
- </section>
- </section>
-
- <section>
- <title>Consumers maintenance</title>
-
- <section>
- <title>Modifying a currently held registration</title>
-
- <section>
- <title>Registration modification for service upgrade</title>
- <para>
- Producers often offer several levels of service depending on consumers' subscription levels (for
- example).
- This is implemented at the WSRP level with the registration concept: producers assert which level of
- service to provide to consumers based on the values of given registration properties.
- </para>
- <para>
- It is therefore sometimes necessary to modify the registration that concretizes the service agreement
- between a consumer and a producer. An example of easily available producer offering different level of
- services is BEA's public producer. We configured access to that producer in
- <xref linkend="consumer_gui"/>.
- If you recall, the producer was requiring registration and required a value to be provided for the
- <literal>registration/consumerRole</literal>
- property. The description of that property indicated that
- three values were possible: <literal>public</literal>, <literal>partner</literal> or
- <literal>insider</literal> each corresponding to a different service level. We registered using the
- <literal>public</literal> service level. This gave us access to three portlets as shown here:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/bea.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- Suppose now that we would like to upgrade our service level to the "insider" level. We will need to
- tell BEA's producer that our registration data has been modified. Let's see how to do this. Assuming you
- have configured access to the producer as previously described, please go to the configuration screen for
- the <literal>bea</literal> producer and modify the value of the <literal>registration/consumerRole</literal>
- to <literal>insider</literal> instead of <literal>public</literal>:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/modify_reg_start.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- Now click on "Update properties" to save the change. A "Modify registration" button should now appear to
- let you send this new data to the remote producer:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/modify_reg_modify.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- Click on this new button and, if everything went well and your updated registration has been accepted by
- the remote producer, you should see something similar to:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/modify_reg_end.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- You can now check the list of available portlets from the <literal>bea</literal> provider and verify that
- new portlets are now available:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/bea_insider.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
-
- </section>
-
- <section id="reg_mod_error">
- <title>Registration modification on producer error</title>
-
- <para>
- It can also happen that a producer administrator decided to require more information from registered
- consumers. In this case, invoking operations on the producer will fail with an
- <literal>OperationFailedFault</literal>. JBoss Portal will attempt to help you in this
- situation. Let's walk through an example using the <literal>self</literal> producer. Let's assume that
- registration is required without any registration properties (as is the case by default). If you go to
- the configuration screen for this producer, you should see:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/config_self.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
-
- Now suppose that the administrator of the producer now requires a value to be provided for an
- <literal>email</literal> registration property. We will actually see how to do perform this operation
- in JBoss Portal when we examine how to configure Portal's producer in <xref linkend="producer_config"/>.
- Operations with this producer will now fail. If you suspect that a registration modification is required,
- you should go to the configuration screen for this remote producer and refresh the information held by
- the consumer by pressing "Refresh & Save":
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/modify_reg_self.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
-
- As you can see, the configuration screen now shows the currently held registration information and
- the expected information from the producer. Enter a value for the <literal>email</literal> property
- and then click on "Modify registration". If all went well and the producer accepted your new registration
- data, you should see something similar to:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/modify_reg_self_end.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
-
- <note><title>Note</title><para>As of WSRP 1, it is rather difficult to ascertain for sure what caused an
- <literal>OperationFailedFault</literal> as it is the generic exception returned by
- producers if something didn't quite happen as expected during a method invocation. This means that
- <literal>OperationFailedFault</literal> can be caused by several different reasons, one
- of them being a request to modify the registration data. Please take a look at the log files to see
- if you can gather more information as to what happened. WSRP 2 introduces an exception that is
- specific to a request to modify registrations thus reducing the ambiguity that currently exists.</para>
- </note>
- </para>
- </section>
- </section>
-
- <section>
- <title>Consumer operations</title>
- <para>
- Several operations are available from the consumer list view of the WSRP configuration portlet:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/consumer_operations.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- The available operations are:
- <itemizedlist>
- <listitem><para>Configure: displays the consumer details and allows user to edit them</para></listitem>
- <listitem>
- <para>Refresh: forces the consumer to retrieve the service description from the remote producer to refresh
- the local information (offered portlets, registration information, etc.)</para>
- </listitem>
- <listitem><para>
- Activate/Deactivate: activates/deactivates a consumer, governing whether it will be available to
- provide portlets and receive portlet invocations</para>
- </listitem>
- <listitem><para>
- Register/Deregister: registers/deregisters a consumer based on whether registration is required
- and/or acquired</para>
- </listitem>
- <listitem><para>Delete: destroys the consumer, after deregisterting it if it was registered</para></listitem>
- </itemizedlist>
- </para>
- </section>
-
- <section>
- <title>Erasing local registration data</title>
- <para>
- There are rare cases where it might be required to erase the local information without being able to
- deregister first. This is the case when a consumer is registered with a producer that has been modified by
- its administrator to not require registration anymore. If that ever was to happen (most likely, it won't),
- you can erase the local registration information from the consumer so that it can resume interacting with
- the remote producer. To do so, click on "Erase local registration" button next to the registration context
- information on the consumer configuration screen:
- </para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/erase_registration.png" align="center" valign="middle"/>
- </imageobject>
- </mediaobject>
- <para>
- <emphasis>Warning:</emphasis> This operation is dangerous as it can result in inability to interact with the remote producer if invoked when not required. A warning screen will be displayed to give you a chance to change your mind:
- </para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/erase_registration_warning.png" align="center" valign="middle"/>
- </imageobject>
- </mediaobject>
- </section>
- </section>
-
- <section id="producer_config">
- <title>Configuring JBoss Portal's WSRP Producer</title>
- <section>
- <title>Overview</title>
- <para>
- You can configure the behavior of Portal's WSRP Producer by using the WSRP administration interface, which
- is the preferred way, or by editing the <filename>conf/config.xml</filename> file found in
- <filename>portal-wsrp.sar</filename>. Several aspects can be modified with respects to whether
- registration is required for consumers to access the Producer's services. An XML Schema for the configuration
- format is available at <filename>jboss-portal.sar/portal-wsrp.sar/xsd/jboss-wsrp-producer_2_6.xsd</filename>,
- while a (legacy) DTD is available at
- <filename>jboss-portal.sar/portal-wsrp.sar/dtd/jboss-wsrp-producer_2_6.dtd</filename>
- </para>
- </section>
- <section>
- <title>Default configuration</title>
- <para>
- The default producer configuration is to require that consumers register with it before providing access its
- services but does not require any specific registration properties (apart from what is mandated by the
- WSRP standard). It does, however, require consumers to be registered before sending them a full service
- description. This means that our WSRP producer will not provide the list of offered portlets and other
- capabilities to unregistered consumers. The producer also uses the default
- <classname>RegistrationPolicy</classname> paired with the default
- <classname>RegistrationPropertyValidator</classname>. We will look into property
- validators in greater detail later in <xref linkend="registration-configuration"/>. Suffice to say for now
- that this allows users to customize how Portal's WSRP Producer decides whether a given registration property
- is valid or not.
- </para>
- <para>
- JBoss Portal 2.6.3 introduces a web interface to configure the producer's behavior. You can access it
- by clicking on the "Producer Configuration" tab of the "WSRP" page of the "admin" portal. Here's what you
- should see with the default configuration:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/producer_default.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- As would be expected, you can specify whether or not the producer will send the full service description to
- unregistered consumers, and, if it requires registration, which <classname>RegistrationPolicy</classname> to
- use (and, if needed, which <classname>RegistrationPropertyValidator</classname>), along with required
- registration property description for which consumers must provide acceptable values to successfully
- register.
- </para>
- </section>
-
- <section id="registration-configuration">
- <title>Registration configuration</title>
- <para>
- In order to require consumers to register with Portal's producer before interacting with it, you need to
- configure Portal's behavior with respect to registration. Registration is optional, as are registration
- properties. The producer can require registration without requiring consumers to pass any registration
- properties as is the case in the default configuration. Let's configure our producer starting with a blank
- state:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/producer_blank.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- We will allow unregistered consumers to see the list of offered portlets so we leave the first checkbox
- ("Access to full service description requires consumers to be registered.") unchecked. We will, however,
- specify that consumers will need to be registered to be able to interact with our producer. Check the second
- checkbox ("Requires registration. Modifying this information will trigger invalidation of consumer
- registrations."). The screen should now refresh and display:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/producer_registration.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- You can specify the fully-qualified name for your <classname>RegistrationPolicy</classname> and
- <classname>RegistrationPropertyValidator</classname> there. We will keep the default value. See
- <xref linkend="custom_registration"/> for more details. Let's add, however, a registration property called
- <literal>email</literal>. Click "Add property" and enter the appropriate information in the fields,
- providing a description for the registration property that can be used by consumers to figure out its
- purpose:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/wsrp/producer_email.png" align="center" valign="middle" scalefit="1"/>
- </imageobject>
- </mediaobject>
- Press "Save" to record your modifications.
-
- <note><title>Note</title><para>
- At this time, only String (xsd:string) properties are supported. If your application requires more
- complex properties, please let us know.</para>
- </note>
-
- <note><title>Note</title><para>
- If consumers are already registered with the producer, modifying the configuration of required
- registration
- information will trigger the invalidation of held registrations, requiring consumers to modify their
- registration before being able to access the producer again. We saw the consumer side of that process
- in <xref linkend="reg_mod_error"/>.</para>
- </note>
- </para>
-
- <section id="custom_registration">
- <title>Customization of Registration handling behavior</title>
- <para>
- Registration handling behavior can be customized by users to suit their Producer needs. This is
- accomplished by providing an implementation of the
- <classname>RegistrationPolicy</classname>
- interface. This interface defines methods that are called by Portal's Registration service so that
- decisions can be made appropriately. A default registration policy that provides basic
- behavior is provided and should be enough for most user needs.
- </para>
- <para>
- While the default registration policy provides default behavior for most registration-related aspects,
- there is still one aspect that requires configuration: whether a given value for a registration property
- is acceptable by the WSRP Producer. This is accomplished by plugging a
- <classname>RegistrationPropertyValidator</classname>
- in the default registration policy. This allows users to define their own validation mechanism.
- </para>
- <para>
- Please refer to the <trademark class="trade">Javadoc</trademark> for <classname>org.jboss.portal.registration.RegistrationPolicy</classname>
- and <classname>org.jboss.portal.Registration.policies.RegistrationPropertyValidator</classname> for more
- details on what is expected of each method.
- </para>
- <para>Defining a registration policy is required for the producer to be correctly configured. This is
- accomplished by specifying the qualified class name of the registration policy. Since we anticipate that
- most users will use the default registration policy, it is possible to provide the class
- name of your custom property validator instead to customize the default registration policy behavior.
- Note that property validators are only used by the default policy.
-
- <note><title>Note</title><para>Since the policy or the validator are defined via their class name and dynamically loaded, it is
- important that you make sure that the identified class is available to the application server. One way
- to accomplish that is to deploy your policy implementation as JAR file in your AS instance deploy
- directory. Note also that, since both policies and validators are dynamically instantiated, they must
- provide a default, no-argument constructor.</para>
- </note>
- </para>
- </section>
- </section>
- <section id="strict-mode">
- <title>WSRP validation mode</title>
- <para>The lack of conformance kit and the wording of the WSRP specification leaves room for differing
- interpretations, resulting in interoperability issues. It is therefore possible to encounter issues when
- using consumers from different vendors. We have experienced such issues and have introduced a way to relax
- the validation that our WSRP producer performs on the data provided by consumers to help with
- interoperability by accepting data that would normally be invalid. Note that we only relax our validation
- algorithm on aspects of the specification that are deemed harmless such as invalid language codes.
- </para>
- <para>
- By default, the WSRP producer is configured in strict mode. If you experience issues with a given consumer,
- you might want to try to relax the validation mode. This is accomplished by unchecking the "Use strict WSRP
- compliance." checkbox on the Producer configuration screen.
- </para>
- </section>
-
- </section>
-</chapter>
- <chapter id="security">
- <!-- <chapterinfo>
- <author>
- <firstname>Roy</firstname>
- <surname>Russo</surname>
- </author>
- <author>
- <firstname>Julien</firstname>
- <surname>Viet</surname>
- </author>
- </chapterinfo>-->
- <title>Security</title>
- <section id="securing_objects">
- <title>Securing Portal Objects</title>
- <para>
- This section describes how to secure portal objects (portal instances, pages, and portlet instances), using the
- JBoss
- Portal *-object.xml descriptor OR portlet-instances.xml descriptor. View the User Guide for information on how
- to secure objects using the
- Management Portlet.
- </para>
- <para>Securing portal objects declaratively, is done through the *-object.xml (
- <xref linkend="desc_objectxml"/>
- ), for Portal Instances and Pages, or the portlet-instances.xml (
- <xref linkend="desc_instancesxml"/>
- ) for Portlet Instances. The portion you will be adding to each object is denoted by the
- <emphasis><security-constraint></emphasis>
- tag:
- <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE deployments PUBLIC
- "-//JBoss Portal//DTD Portal Object 2.6//EN"
- "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
-<deployments>
- <deployment>
- <parent-ref>default</parent-ref>
- <if-exists>overwrite</if-exists>
- <properties/>
- <page>
- <page-name>MyPage</page-name>
- <window>
- <window-name>HelloWorldPortletPageWindow</window-name>
- <instance-ref>HelloWorldPortletPageInstance</instance-ref>
- <region>center</region>
- <height>0</height>
- </window>
- <security-constraint>
- <policy-permission>
- <action-name>viewrecursive</action-name>
- <unchecked/>
- </policy-permission>
- </security-constraint>
- </page>
- </deployment>
-</deployments>]]></programlisting>
- </para>
- <para>The basic principle of the security mechanism is that everything is restricted unless you grant privileges.
- You grant privilege on a portal node by adding a security constraint as explained here:
-
- <programlisting><![CDATA[<security-constraint>
- <policy-permission>
- <unchecked/>
- <action-name>viewrecursive</action-name>
- </policy-permission>
-</security-constraint>]]></programlisting>
- The example above will grant the view privilege to anyone (unchecked role) to the current object and any
- child object recursively.</para>
- <para>
- The security contraint portion is worth taking a look at, in an isolated fashion. It allows you to
- secure a specific window/page/portal-instance based on a user's role.
- </para>
- <para>
- <emphasis role="bold">Role definition:</emphasis>
- You must define a role that this security constraint will apply to. Possible values are:
- </para>
- <itemizedlist>
- <listitem>
- <para> <emphasis role="bold"><unchecked/></emphasis>
- Anyone can view this page.</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold"><role-name>SOMEROLE</role-name></emphasis>
- Access to this page is limited to the defined role.</para>
- </listitem>
- </itemizedlist>
- <para>
- <emphasis role="bold">Access Rights:</emphasis>
- You must define the access rights given to the role defined. Possible values are:
- </para>
- <itemizedlist>
- <listitem>
- <para> <emphasis role="bold">view</emphasis>
- Users can view the page.</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">viewrecursive</emphasis>
- Users can view the page and child pages.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">personalize</emphasis>
- Users are able to personalize the page's theme.</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">personalizerecursive</emphasis>
- Users are able to personalize the page AND its children's pages themes.</para>
- </listitem>
- </itemizedlist>
-
- <note>
- <title>Restricting access</title>
- <para>Out of the box the default portal as a viewrecursive right for all the users, it means that whenever a page
- is added, this page will be seen by any user. To restrict access to this page, the default portal security constraint
- must be changed from viewrecursive to view, and viewrecursive security constraints must be added to its children
- so that they can be viewed except the one you want to restrict access to.</para>
- </note>
- <para>
- We provide three live samples of this descriptor, here
- <xref linkend="desc_instancesxml"/>
- ,
- <xref linkend="desc_example_page"/>
- ,and
- <xref linkend="desc_example_portal"/>
- </para>
- </section>
-
- <section id="security.security_cms">
- <title>Securing the Content Management System</title>
- <para>
- The JBoss Portal CMS system consists of a directory structure of Files organized unto their respective Folders. Both Files and Folders are
- considered to be CMS resources that can be secured based on portal Roles and/or Users.
- </para>
- <para>
- The following features are supported by the fine grained security system of Portal CMS:
- <itemizedlist>
- <listitem><para>
- You can associate "Read", "Write", and "Manage" Permissions at the CMS node level. (Both Files and Folders are treated as CMS nodes)</para>
- </listitem>
- <listitem>
- <para>The Permissions are propagated recursively down a folder hierarchy</para>
- </listitem>
- <listitem>
- <para> Any Permissions specified explicitly on the CMS Node overrides the policy inherited via recursive propagation</para>
- </listitem>
- <listitem>
- <para>You can manage the Permissions using the CMS Admin GUI tool via the newly added "Secure Node" feature</para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- <table frame="all">
- <title> Portal CMS Permission Matrix: </title>
- <tgroup cols="3" align="left" colsep="1">
-
- <thead>
- <row>
- <entry align="center">Permissions</entry>
- <entry align="center">Allowed Actions</entry>
- <entry align="center">Implies</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry> Read </entry>
- <entry> Read Contents of Folder, File and its versions </entry>
- <entry> N/A </entry>
- </row>
- <row>
- <entry> Write</entry>
- <entry> Create and Update new Folder and File </entry>
- <entry> Read Access </entry>
- </row>
- <row>
- <entry> Manage </entry>
- <entry> Delete/Copy/Move/Rename Folders and Files</entry>
- <entry> Read and Write Access </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </para>
- <section id="security.security_cms_configuration">
- <title>CMS Security Configuration</title>
- <para>
- The configuration for the CMS Security service is specified in the
- <literal>jboss-portal.sar/portal-cms.sar/META-INF/jboss-service.xml</literal>
- file. The portion of the configuration relevant for securing the CMS service is listed as follows:
- <programlisting>
- <![CDATA[
- <!-- CMS Authorization Security Service -->
- <mbean
- code="org.jboss.portal.cms.security.AuthorizationManagerImpl"
- name="portal:service=AuthorizationManager,type=cms"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <attribute name="JNDIName">java:portal/cms/AuthorizationManager</attribute>
- <depends optional-attribute-name="Provider" proxy-type="attribute">
- portal:service=AuthorizationProvider,type=cms
- </depends>
- </mbean>
- <mbean
- code="org.jboss.portal.cms.security.AuthorizationProviderImpl"
- name="portal:service=AuthorizationProvider,type=cms"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <!--
- NOTE: cmsRootUserName denotes a single Portal user that has access to everything in the CMS. Denote this user
- carefully and should be synonymous to the 'root' user in UNIX operating systems. By default: this value is the built-in
- 'admin' user account. This can be changed to any other user account registered in your Portal
- -->
- <attribute name="CmsRootUserName">admin</attribute>
- <depends optional-attribute-name="IdentityServiceController" proxy-type="attribute">portal:service=Module,type=IdentityServiceController</depends>
- </mbean>
- <!-- ACL Security Interceptor -->
- <mbean
- code="org.jboss.portal.cms.impl.interceptors.ACLInterceptor"
- name="portal:service=Interceptor,type=Cms,name=ACL"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <attribute name="JNDIName">java:/portal/cms/ACLInterceptor</attribute>
- <attribute name="CmsSessionFactory">java:/portal/cms/CMSSessionFactory</attribute>
- <attribute name="IdentitySessionFactory">java:/portal/IdentitySessionFactory</attribute>
- <attribute name="DefaultPolicy">
- <policy>
- <!-- permissions on the root cms node -->
- <criteria name="path" value="/">
- <permission name="cms" action="read">
- <role name="Anonymous"/>
- </permission>
- <permission name="cms" action="write">
- <role name="User"/>
- </permission>
- <permission name="cms" action="manage">
- <role name="Admin"/>
- </permission>
- </criteria>
- <!-- permissions on the default cms node -->
- <criteria name="path" value="/default">
- <permission name="cms" action="read">
- <role name="Anonymous"/>
- </permission>
- <permission name="cms" action="write">
- <role name="User"/>
- </permission>
- <permission name="cms" action="manage">
- <role name="Admin"/>
- </permission>
- </criteria>
- <!-- permissions on the private/protected node -->
- <criteria name="path" value="/default/private">
- <permission name="cms" action="manage">
- <role name="Admin"/>
- </permission>
- </criteria>
- </policy>
- </attribute>
- <depends optional-attribute-name="AuthorizationManager" proxy-type="attribute">
- portal:service=AuthorizationManager,type=cms
- </depends>
- <depends>portal:service=Hibernate,type=CMS</depends>
- <depends>portal:service=Module,type=IdentityServiceController</depends>
- </mbean>]]>
- </programlisting>
- </para>
- <section id="security.security_cms_configuration_superuser">
- <title>CMS Super User</title>
- <para>
- A CMS Super User is a designated Portal User Account that has access to all resources/functions in the CMS. It is a concept similar to the
- super user concept in a Linux and UNIX security systems. This account should be carefully used and properly protected. By default, JBoss Portal designates the
- built-in 'admin' user account as a CMS Super User. This can be changed by modifying the <emphasis>cmsRootUserName</emphasis> value in the
- <literal>jboss-portal.sar/portal-cms.sar/META-INF/jboss-service.xml</literal> configuration.
- <programlisting>
- <![CDATA[
- <mbean
- code="org.jboss.portal.cms.security.AuthorizationProviderImpl"
- name="portal:service=AuthorizationProvider,type=cms"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <!--
- NOTE: cmsRootUserName denotes a single Portal user that has access to everything in the CMS. Denote this user
- carefully and should be synonymous to the 'root' user in UNIX operating systems. By default: this value is the built-in
- 'admin' user account. This can be changed to any other user account registered in your Portal
- -->
- <attribute name="CmsRootUserName">admin</attribute>
- <depends optional-attribute-name="IdentityServiceController" proxy-type="attribute">portal:service=Module,type=IdentityServiceController</depends>
- </mbean>
- ]]>
- </programlisting>
- </para>
- </section>
- <section id="security.security_cms_configuration_securityconsole">
- <title>CMS Security Console</title>
- <para>
- The CMS Security Console is used to assign proper permissions to all the nodes/content in the CMS. Besides protection on CMS content, this console itself
- needs to be secured against unauthorized acceess. Currently, the console can be accessed only by Portal users that are members of the specified Role. By default,
- JBoss Portal uses the built-in <emphasis>Admin</emphasis> role to allow access to this security console. This can be customized by modifying the value of
- <emphasis>defaultAdminRole</emphasis> option specified in <literal>jboss-portal.sar/conf/identity/standardidentity-config.xml</literal>
- </para>
- </section>
- </section>
- </section>
-
- <section id="security.security_authentication">
- <title>Authentication with JBoss Portal</title>
- <para>JBoss Portal relies on Java Platform, Enterprise Edition (Java EE) for the authentication of users. The Java EE authentication has its advantages and drawbacks. The main motivation for using Java EE security is the integration with the application server and the operational environment in which the portal is deployed. The servlet layer provides already the authentication functionality and obviously it is not a responsibility of the portal. Whenever a user is authenticated by the servlet layer its security identity is propagated throughout the call stack in the different layers of the Java EE stack. The weaknesses are the lack of an explicit logout mechanism and the lack of dynamicity in the mapping of URL as security resources. However JBoss Portal improves that behavior when it is possible to do so.</para>
- <section>
- <title>Authentication configuration</title>
- <para>JBoss Portal can be seen before all as a web application and therefore inherits all the configuration mechanisms
- related to web applications. The main entry point of the whole portal is the <emphasis>jboss-portal.sar/portal-server.war</emphasis>
- deployment which is the web application that defines and maps the portal servlet. Here you can configure various things
- <itemizedlist>
- <listitem><para>In the <emphasis>WEB-INF/web.xml</emphasis> you can change the authentication mode. The default
- authentication mechanism uses the form based authentication, however you can change it to any of the
- mechanism provided by the servlet specification.</para></listitem>
-<listitem><para>In the <emphasis>WEB-INF/jboss-web.xml</emphasis> you can change the security domain used by the portal.
- The default security domain used by the portal is <emphasis>java:/jaas/portal</emphasis>. That setting is specific
- to the JBoss Application Server and how it binds the Java EE security to the operational environment. A security domain
- is a scope defined at the Application Server Level and defines usually a JAAS authentication stack. The portal
- security domain authentication stack is defined in the <emphasis>jboss-portal.sar/conf/login-config.xml</emphasis>
- and is dynamically deployed with the portal. The JBoss Application Server documentation is certainly the best
- reference for that topic.</para>
- </listitem>
- <listitem><para>The files <emphasis>login.jsp</emphasis> and <emphasis>error.jsp</emphasis> represent the pages used
- the form based authentication process. More information can be found in any good servlet documentation.</para></listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>The portal servlet</title>
- <para>The portal defines a single servlet to take care of all portal requests. The class name of that servlet is
- <emphasis>org.jboss.portal.server.servlet.PortalServlet</emphasis>. That servlet needs to be declared two times with different
- configurations otherwise the portal would not be able to know about some request details which are importants.
- <itemizedlist>
- <listitem><para><emphasis>PortalServletWithPathMapping</emphasis> is used for path mapping mappings.</para></listitem>
- <listitem><para><emphasis>PortalServletWithDefaultServletMapping</emphasis> is used for the default servlet mapping.</para></listitem>
- </itemizedlist>
- The portal servlet is mapped four times with different semantics, the differences between the semantics are related to the transport layer.
- Each one of those for mappings will have the same request meaning for the portal beside the transport aspect. By default
- those mappings are
- <itemizedlist>
- <listitem><para><emphasis>/*</emphasis> : the default access, does not define any security constraint. This is the default
- access that everybody uses.</para></listitem>
- <listitem><para><emphasis>/sec/*</emphasis> : the secured access, requires https usage. It is triggered when
- a portlet is defined as secure or when a secure portlet link is created. It requires the configuration
- of the https connector in JBoss Web. The JBoss Application Server documentation provides more information
- about it.</para></listitem>
-<listitem><para><emphasis>/auth/*</emphasis> : the authenticated access, requires the user to be authenticated
- to be used.</para></listitem>
-<listitem><para><emphasis>/authsec/*</emphasis> : combine the two previous options into a single one.</para></listitem>
- </itemizedlist>
- Usually ones should not care much about those mappings as the portal will by itself switch to the most appropriate mapping.
- </para>
- </section>
- </section>
-
- <section id="security_authorization">
- <title>Authorization with JBoss Portal</title>
- <para>JBoss Portal defines a framework for authorization. The default implementation of that framework is based on
- the Java Authorization Contract for Containers (JACC) which is implemented by <trademark class="trade">J2EE</trademark> 1.4 Application Servers. This section of
- the documentation focuses on defining the framework and its usage and is not an attempt to define what authorization
- is or is not because it is out of scope of this context. Instead we will try to straightforwardly describe the
- framework and how it is used. No specific knowledge is expected about JACC although it is a recommended read.</para>
- <section>
- <title>The portal permission</title>
- <para>The <emphasis>org.jboss.portal.security.PortalPermission</emphasis> object is used to describe a permission for the portal. It extends the <emphasis>java.security.Permission</emphasis>
- class and any permission checked in the portal should extend the <emphasis>PortalPermission</emphasis> as well. That permission
- adds two fields to the <emphasis>Permission</emphasis> class
- <itemizedlist>
- <listitem><para>uri : is a string which represents an URI of the resource described by the permission.</para></listitem>
- <listitem><para>collection : an object of class <emphasis>org.jboss.portal.security.PortalPermissionCollection</emphasis> which
- is used when the permission act as a container for other permissions. If that object exists then the uri field should be null
- as a portal permission represents an uri or acts as a container in an exclusive manner.</para></listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>The authorization provider</title>
- <para>
- The <emphasis>org.jboss.portal.security.spi.provider.AuthorizationDomain</emphasis> is an interface which provides access to several services.
- <programlisting>
-public interface AuthorizationDomain
-{
- String getType();
- DomainConfigurator getConfigurator();
- PermissionRepository getPermissionRepository();
- PermissionFactory getPermissionFactory();
-}
- </programlisting>
- <itemizedlist>
- <listitem><para><emphasis>org.jboss.portal.security.spi.provider.DomainConfigurator</emphasis> provides configuration access
- to an authorization domain. The authorization schema is very simple as it consists of bindings between URI, roles and permissions.</para></listitem>
- <listitem><para><emphasis>org.jboss.portal.security.spi.provider.PermissionRepository</emphasis> provides runtime access to the authorization
- domain. Usually it is used to retrieve the permissions for a specific role and URI. It is used at runtime by the framework
- to take security decisions.</para></listitem>
-<listitem><para><emphasis>org.jboss.portal.security.spi.provider.PermissionFactory</emphasis> is a factory to instantiate permissions
- for the specific domain. It is used at runtime to create permissions objects of the appropriate type by the security framework.</para></listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>Making a programmatic security check</title>
- <para>Making a security check is an easy thing as it consists in creating a permission of the appropriate type and
- make a check against the <emphasis>org.jboss.portal.spi.auth.PortalAuthorizationManager</emphasis> service. That
- service is used by the portal to make security checks. It is connected to the different authorization providers
- in order to take decisions at runtime based on the type of the permission. Access to that service is done
- through the <emphasis>org.jboss.portal.spi.auth.PortalAuthorizationManagerFactory</emphasis>. The factory
- is a portal service which is usually injected in other services like that</para>
- <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<server>
- ...
- <mbean
- code='MyService"
- name="portal:service=MyService">
- <depends
- optional-attribute-name="PortalAuthorizationManagerFactory"
- proxy-type="attribute">portal:service=PortalAuthorizationManagerFactory</depends>
- ...
- </mbean>
- ...
-</server>]]></programlisting>
- <para>It can be injected in the servlet context of a war file in the file <emphasis>WEB-INF/jboss-portlet.xml</emphasis></para>
- <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE portlet-app PUBLIC
- "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
-<portlet-app>
- ...
- <service>
- <service-name>PortalAuthorizationManagerFactory</service-name>
- <service-class>
- org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory
- </service-class>
- <service-ref>:service=PortalAuthorizationManagerFactory</service-ref>
- </service>
- ...
-</portlet-app>]]></programlisting>
- <para>Here is an example of how a security check is made for a specific page</para>
- <programlisting>
-PortalAuthorizationManager pam = factory.getManager();
-PortalObjectId id = page.getId();
-PortalObjectPermission perm = new PortalObjectPermission(id, PortalObjectPermission.VIEW_MASK);
-if (pam.checkPermission(perm) == false)
-{
- System.out.println("Current user is not authorized to view page " + id);
-}</programlisting>
- </section>
- <section>
- <title>Configuring an authorization domain</title>
- <para>Configuring a domain can be done through the <emphasis>DomainConfigurator</emphasis> interface</para>
- <programlisting>
-public interface DomainConfigurator
-{
- Set getSecurityBindings(String uri);
- void setSecurityBindings(String uri, Set securityBindings)
- throws SecurityConfigurationException;
- void removeSecurityBindings(String uri) throws SecurityConfigurationException;
-}</programlisting>
- <para>The various methods of that interface allows to configure security bindings for a given resource where
- a resource is naturally identified by an URI. The <emphasis>org.jboss.portal.security.RoleSecurityBinding</emphasis>
- object is an object which encapsulate a role name and a set of actions bound to this role.
- </para>
- <programlisting>
-RoleSecurityBinding binding1 = new RoleSecurityBinding(Collections.singleton("view"), "Admin");
-RoleSecurityBinding binding2 = new RoleSecurityBinding(Collections.singleton("view"), "User");
-Set bindings = new HashSet();
-bindings.add(binding1);
-bindings.add(binding2);
-configurator.setSecurityBinding(pageURI, bindings); </programlisting>
- </section>
- </section>
-</chapter>
- <chapter id="identity">
- <!-- <chapterinfo>
- <author>
- <firstname>Boleslaw</firstname>
- <surname>Dawidowicz</surname>
- </author>
- </chapterinfo>-->
- <title>JBoss Portal Identity Management</title>
- <para>This chapter addresses identity management in JBoss Portal 2.6</para>
- <section id="management_api">
- <title>Identity management API</title>
- <para>Since JBoss Portal 2.6 there are 4 identity services and 2 identity related interfaces. The goal of
- having such a fine grained API is to enable flexible implementations based on different
- identity storage like relational databases or LDAP servers. The Membership service takes care of managing the relationship
- between user objects and role objects. The User Profile service is responsible for managing the profile of a user,
- it has database and LDAP implementations as well as a mode that combines data from both.
- </para>
- <itemizedlist>
- <listitem>
- <para>
- The <emphasis role="bold">org.jboss.portal.identity.User</emphasis>
- interface represents a user and exposes the following operations:
-
- <programlisting><![CDATA[
- /** The user identifier. */
- public Object getId();
-
- /** The user name. */
- public String getUserName();
-
- /** Set the password using proper encoding. */
- public void updatePassword(String password);
-
- /** Return true if the password is valid. */
- public boolean validatePassword(String password);
- ]]></programlisting>
- <warning>
- <para>
- Important Note! The proper usage of getId() method is:
- </para>
- <programlisting><![CDATA[
-// Always use it like this:
-user.getId().toString();
-
-// Do not use it like this:
-
-// We would get a Long object if we are using the database implementation
-(Long)user.getId();
-
-// We would get a String with an LDAP server
-(String)user.getId();
-]]></programlisting>
- <para>
- This is because the ID value depends on the User implementation. It'll probably be String object with the LDAP implementation and a Long object with the database implementation but it could be something else if one has chosen to make its own implementation.
- </para>
- </warning>
- </para>
- </listitem>
- <listitem>
- <para>
- The <emphasis role="bold">org.jboss.portal.identity.Role</emphasis> interface represents a Role
- and exposes the following operations:
-
- <programlisting><![CDATA[
-/** The role identifier. */
-public Object getId();
-
-/** The role name used in security rules. This name can not be modified */
-public String getName();
-
-/** The role display name used on screens. This name can be modified */
-public String getDisplayName();
-
-/** */
-public void setDisplayName(String name);
-]]></programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- The <emphasis role="bold">org.jboss.portal.identity.UserModule</emphasis>
- interface exposes operations for users management:
-
- <programlisting><![CDATA[
-/**Retrieve a user by its name.*/
-User findUserByUserName(String userName)
- throws IdentityException, IllegalArgumentException, NoSuchUserException;
-
-/**Retrieve a user by its id.*/
-User findUserById(Object id)
- throws IdentityException, IllegalArgumentException, NoSuchUserException;
-
-/**Retrieve a user by its id.*/
-User findUserById(String id)
- throws IdentityException, IllegalArgumentException, NoSuchUserException;
-
-/** Creates a new user with the specified name.*/
-User createUser(String userName, String password)
- throws IdentityException, IllegalArgumentException;
-
-/** Remove a user.*/
-void removeUser(Object id)
- throws IdentityException, IllegalArgumentException;
-
-/** Get a range of users.*/
-Set findUsers(int offset, int limit)
- throws IdentityException, IllegalArgumentException;
-
-/** Get a range of users.*/
-Set findUsersFilteredByUserName(String filter, int offset, int limit)
- throws IdentityException, IllegalArgumentException;
-
-/**Returns the number of users.*/
-int getUserCount() throws IdentityException, IllegalArgumentException;
-]]></programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- The <emphasis role="bold">org.jboss.portal.identity.RoleModule</emphasis>
- interface exposes operations for roles management:
-
- <programlisting><![CDATA[
-/** Retrieves a role by its name*/
-Role findRoleByName(String name)
- throws IdentityException, IllegalArgumentException;
-
-/**Retrieve a collection of role from the role names.*/
-Set findRolesByNames(String[] names)
- throws IdentityException, IllegalArgumentException;
-
-/** Retrieves a role by its id.*/
-Role findRoleById(Object id)
- throws IdentityException, IllegalArgumentException;
-
-/** Retrieves a role by its id.*/
-Role findRoleById(String id)
- throws IdentityException, IllegalArgumentException;
-
-/** Create a new role with the specified name.*/
-Role createRole(String name, String displayName)
- throws IdentityException, IllegalArgumentException;
-
-/** Remove a role.*/
-void removeRole(Object id)
- throws IdentityException, IllegalArgumentException;
-
-/** Returns the number of roles. */
-int getRolesCount()
- throws IdentityException;
-
-/** Get all the roles */
-Set findRoles() throws IdentityException;
-]]></programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- The <emphasis role="bold">MembershipModule</emphasis>
- interface exposes operations for obtaining or managing relationships beetween users and roles.
- The role of this service is to decouple relationship information from user and roles.
- Indeed while user role relationship is pretty straightforward with a relational database (using
- a many to many relationship with an intermediary table), with an LDAP server there a different
- ways to define relationships between users and roles.
-
- <programlisting><![CDATA[
-/** Return the set of role objects that a given user has.*/
-Set getRoles(User user) throws IdentityException, IllegalArgumentException;
-
-Set getUsers(Role role) throws IdentityException, IllegalArgumentException;
-
-/** Creates a relationship beetween a role and set of users. Other roles that have
- assotiontions with those users remain unaffected.*/
-void assignUsers(Role role, Set users) throws IdentityException, IllegalArgumentException;
-
-/** Creates a relationship beetween a user and set of roles. This operation will erase any
- other assotientions beetween the user and roles not specified in the provided set.*/
-void assignRoles(User user, Set roles) throws IdentityException, IllegalArgumentException;
-
-/** Returns role members based on rolename - depreciated method ethod here only
- for compatibility with old RoleModule interface */
-Set findRoleMembers(String roleName, int offset, int limit, String userNameFilter)
- throws IdentityException, IllegalArgumentException;
-]]></programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- The <emphasis role="bold">UserProfileModule</emphasis>
- interface exposes operations to access and manage informations stored in User profile:
-
- <programlisting><![CDATA[
-public Object getProperty(User user, String propertyName)
- throws IdentityException, IllegalArgumentException;
-
-public void setProperty(User user, String name, Object property)
- throws IdentityException, IllegalArgumentException;
-
-public Map getProperties(User user)
- throws IdentityException, IllegalArgumentException;
-
-public ProfileInfo getProfileInfo()
- throws IdentityException;
-]]></programlisting>
- <warning>
- <para>
- UserProfileModule.getProperty() method returns an Object.
- In most cases with DB backend it will always be String object. But normally you should check what
- object will be retrieved using getProfileInfo() method.</para>
- </warning>
- </para>
- </listitem>
- <listitem>
- <para>
- The <emphasis role="bold">ProfileInfo</emphasis>
- interface can be obtained using the
- <emphasis role="bold">UserProfileModule</emphasis>
- and exposes meta information of a profile:
-
- <programlisting><![CDATA[
-/** Returns a Map o PropertyInfo objects describing profile properties */
-public Map getPropertiesInfo();
-
-public PropertyInfo getPropertyInfo(String name);
-]]></programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">PropertyInfo</emphasis>
- interface expose methods to obtain information about accessible property in User profile
-
- <programlisting><![CDATA[
-public static final String ACCESS_MODE_READ_ONLY = "read-only";
-public static final String ACCESS_MODE_READ_WRITE = "read-write";
-public static final String USAGE_MANDATORY = "mandatory";
-public static final String USAGE_OPTIONAL = "optional";
-public static final String MAPPING_DB_TYPE_COLUMN = "column";
-public static final String MAPPING_DB_TYPE_DYNAMIC = "dynamic";
-
-public String getName();
-
-public String getType();
-
-public String getAccessMode();
-
-public String getUsage();
-
-public LocalizedString getDisplayName();
-
-public LocalizedString getDescription();
-
-public String getMappingDBType();
-
-public String getMappingLDAPValue();
-
-public String getMappingDBValue();
-
-public boolean isMappedDB();
-
-public boolean isMappedLDAP();
-]]></programlisting>
- </para>
- </listitem>
-
- </itemizedlist>
-
- <section>
- <title>How to obtain identity modules services ?</title>
- <para>
- The advocated way to get a reference to the identity modules is by using JNDI:
- </para>
- <programlisting>
-import org.jboss.portal.identity.UserModule;
-import org.jboss.portal.identity.RoleModule;
-import org.jboss.portal.identity.MembershipModule;
-import org.jboss.portal.identity.UserProfileModule;
-
-[...]
-
-(UserModule)new InitialContext().lookup("java:portal/UserModule");
-(RoleModule)new InitialContext().lookup("java:portal/RoleModule");
-(MembershipModule)new InitialContext().lookup("java:portal/MembershipModule");
-(UserProfileModule)new InitialContext().lookup("java:portal/UserProfileModule");</programlisting>
- <para>
- Another way to do this is, if you are fimiliar with JBoss Microkernel architecture is to
- get the <emphasis role="bold">IdentityServiceController</emphasis>
- mbean. You may want to inject it into your services like this:
- </para>
- <programlisting><![CDATA[
-<depends optional-attribute-name="IdentityServiceController" proxy-type="attribute">
- portal:service=Module,type=IdentityServiceController
-</depends>]]></programlisting>
- <para>
- or simply obtain in your code by doing a lookup using
- the <emphasis role="bold">portal:service=Module,type=IdentityServiceController</emphasis>
- name. Please refer to the JBoss Application Server documentation if you want to learn more
- about service MBeans. Once you obtained the object you can use it:
- </para>
-
- <programlisting>
-(UserModule)identityServiceController.getIdentityContext()
- .getObject(IdentityContext.TYPE_USER_MODULE);
-
-(RoleModule)identityServiceController.getIdentityContext()
- .getObject(IdentityContext.TYPE_ROLE_MODULE);
-
-(MembershipModule)identityServiceController.getIdentityContext()
- .getObject(IdentityContext.TYPE_MEMBERSHIP_MODULE);
-
-(UserProfileModule)identityServiceController.getIdentityContext()
- .getObject(IdentityContext.TYPE_USER_PROFILE_MODULE);
- </programlisting>
-
- </section>
- <section>
- <title>API changes since 2.4</title>
- <para>Because in JBoss Portal 2.4 there were only
- <emphasis role="bold">UserModule</emphasis>
- ,
- <emphasis role="bold">RoleModule</emphasis>
- ,
- <emphasis role="bold">User</emphasis>
- and
- <emphasis role="bold">Role</emphasis>
- interfaces some API usages changed. Here are the most important changes you will need to aply to your
- code while migrating your aplication to 2.6:
- </para>
- <itemizedlist>
- <listitem>
- <para>
- For the <emphasis role="bold">User</emphasis> interface:
-
- <programlisting><![CDATA[
-// Instead of: user.getEnabled()
-userProfileModule.getProperty(user, User.INFO_USER_ENABLED);
-
-// Instead of: user.setEnabled(value)
-userProfileModule.setProperty(user, User.INFO_USER_ENABLED, value);
-
-// In a similar way you should change rest of methods that are missing in User interface
-// in 2.6 by the call to the UserProfileModule
-
-// Instead of: user.getProperties()
-userProfileModule.getProperties(user);
-
-// Instead of: user.getGivenName()
-userProfileModule.getProperty(user, User.INFO_USER_NAME_GIVEN);
-
-// Instead of: user.getFamilyName()
-userProfileModule.getProperty(user, User.INFO_USER_NAME_FAMILY);
-
-// Instead of: user.getRealEmail()
-userProfileModule.getProperty(user, User.INFO_USER_EMAIL_REAL);
-
-// Instead of: user.getFakeEmail()
-userProfileModule.getProperty(user, User.INFO_USER_EMAIL_FAKE);
-
-// Instead of: user.getRegistrationDate()
-userProfileModule.getProperty(user, User.INFO_USER_REGISTRATION_DATE);
-
-// Instead of: user.getViewRealEmail()
-userProfileModule.getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL);
-
-// Instead of: user.getPreferredLocale()
-userProfileModule.getProperty(user, User.INFO_USER_LOCALE);
-
-// Instead of: user.getSignature()
-userProfileModule.getProperty(user, User.INFO_USER_SIGNATURE);
-
-// Instead of: user.getLastVisitDate()
-userProfileModule.getProperty(user, User.INFO_USER_LAST_LOGIN_DATE);]]></programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- The <emphasis role="bold">RoleModule</emphasis> interface:
-
- <programlisting><![CDATA[
-// Instead of
-// RoleModule.findRoleMembers(String roleName, int offset, int limit, String userNameFilter)
-// throws IdentityException;
-membershipModule.findRoleMembers(String roleName, int offset, int limit,
- String userNameFilter)
-
-// Instead of
-// RoleModule.setRoles(User user, Set roles) throws IdentityException;
-membershipModule.assignRoles(User user, Set roles)
-
-// Instead of
-// RoleModule.getRoles(User user) throws IdentityException;
-membershipModule.getRoles(User user)]]></programlisting>
- </para>
- </listitem>
- </itemizedlist>
- </section>
- </section>
- <section>
- <title>Identity configuration</title>
- <para>In order to understand identity configuration you need to understand its architecture.
- Different identity services like UserModule, RoleModule and etc are just plain Java classes that are instantiated and exposed
- by the portal. So an *example* of UserModule service could be a plain Java bean object that would be:
- </para>
- <itemizedlist>
- <listitem>
- <para><emphasis role="bold">Instantiated</emphasis> using reflection</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">Initialized/Started</emphasis> by invoking some methods</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">Registered/Exposed</emphasis> using JNDI and/or mbeans (JBoss Microkernel) services, so other services of the portal can use it</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">Managed</emphasis> in the matter of lifecycle - so it'll be stopped and unregistered during portal shutdown</para>
- </listitem>
- </itemizedlist>
- <para>
- As you see from this point of view, configuration just specifies what Java class will be used and how it should be used by portal as a service.
- </para>
- <note><title>Note</title><para>We use JBoss Microcontainer internally to manage the sub system made of those components so if you are interested in implementing
- custom services - look on the methods that are used by this framework.</para></note>
-
- <para>
- In JBoss Portal we provide a very flexible configuration. It is very easy to rearrange and customize services,
- provide alternative implementations, extend the existing ones or provide a custom identity model.
- </para>
- <para>To grasp the full picture of the configuration of identity services let's start from its root
- component. Whole configuration and setup of identity components is done by the
- <emphasis role="bold">IdentityServiceController</emphasis> service. It brings to life and registers all other services
- such as UserModule, RoleModule, MembershipModule and UserProfileModule.
- <emphasis role="bold">IdentityServiceController</emphasis> is defined in
- <emphasis>jboss-portal.sar/META-INF/jboss-service.xml</emphasis>
- </para>
-
- <programlisting><![CDATA[
-<mbean
- code="org.jboss.portal.identity.IdentityServiceControllerImpl"
- name="portal:service=Module,type=IdentityServiceController"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends>portal:service=Hibernate</depends>
- <attribute name="JndiName">java:/portal/IdentityServiceController</attribute>
- <attribute name="RegisterMBeans">true</attribute>
- <attribute name="ConfigFile">conf/identity/identity-config.xml</attribute>
- <attribute name="DefaultConfigFile">conf/identity/standardidentity-config.xml</attribute>
-</mbean>]]></programlisting>
- <para>
- We can specify a few options here:
- <itemizedlist>
- <listitem>
- <para>
- <emphasis role="bold">RegisterMBeans</emphasis> - defines if IdentityServiceController should
- register components which are instantiated as mbeans
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">ConfigFile</emphasis> - defines the location of the main identity services configuration file. It describes and configures all the components like UserModule, RoleModule... that need to be instantiated
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">DefaultConfigFile</emphasis> - defines the location of the configuration file containing
- the default values. For each component defined in <emphasis role="bold">ConfigFile</emphasis>, the IdentityServiceController
- will obtain a set of default options from this file. That helps to keep the main main configuration file
- simple, short and easy to read. Potentially it provides more powerful customizations.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <section>
- <title>Main configuration file architecture (identity-config.xml)</title>
- <para>
- The file describing portal identity services contains three sections:
- </para>
- <programlisting><![CDATA[
-<identity-configuration>
- <datasources>
- <!-- Datasources section -->
- <datasource> ... </datasource>
- <datasource> ... </datasource>
- ...
- </datasources>
- <modules>
- <!-- Modules section -->
- <module> ... </module>
- <module> ... </module>
- ...
- </modules>
- <options>
- <!-- Options section -->
- <option-group> ... </option-group>
- <option-group> ... </option-group>
- ...
- </options>
-</identity-configuration>]]></programlisting>
- <para>By default you can find it in <emphasis>jboss-portal.sar/conf/identity/identity-config.xml</emphasis></para>
- <section>
- <title>Datasources</title>
- <para>This section defines datasource components. They will be processed and instantiated before components in
- <emphasis role="bold">Module</emphasis> section, so they will be ready to serve them.</para>
-
- <note><title>Note</title>
- <para>This section isn't used with Database configuration as in JBoss Portal services exposing Hibernate
- are defined separately. It is used by LDAP configuration and we will use it as an example</para>
- </note>
- <programlisting><![CDATA[
-<datasource>
- <name>LDAP</name>
- <service-name>portal:service=Module,type=LDAPConnectionContext</service-name>
- <class>org.jboss.portal.identity.ldap.LDAPConnectionContext</class>
- <config>
- <option>
- <name>host</name>
- <value>jboss.com</value>
- </option>
- <option>
- <name>port</name>
- <value>10389</value>
- </option>
- <option>
- <name>adminDN</name>
- <value>cn=Directory Manager</value>
- </option>
- <option>
- <name>adminPassword</name>
- <value>xxxxx</value>
- </option>
-
- <!-- Other options here.... -->
-
- </config>
-</datasource>]]></programlisting>
-<note>
- <title>Note</title>
- <para>If you look into JBoss Portal configuration files you will find that <![CDATA[<service-name/> and <class/>]]>
- are specified in <emphasis role="bold">DefaultConfigFile</emphasis> and not in <emphasis role="bold">ConfigFile</emphasis>.
- So here is how it works: those two will be picked up from default configuration. The same rule is effective
- for the options - additional options will be picked up from default configuration. What is linking configuration in those two files
- is the <emphasis role="bold"><![CDATA[<name>]]></emphasis> tag.</para>
- </note>
- </section>
- <section>
- <title>Modules</title>
- <para>Modules are core service components like UserModule, RoleModule and etc. </para>
- <programlisting><![CDATA[
-<module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>User</type>
- <implementation>DB</implementation>
-
- <!--name of service and class for creating mbean-->
- <service-name>portal:service=Module,type=User</service-name>
- <class>org.jboss.portal.identity.db.HibernateUserModuleImpl</class>
-
- <!--set of options that are in the instantiated object-->
- <config>
- <option>
- <name>sessionFactoryJNDIName</name>
- <value>java:/portal/IdentitySessionFactory</value>
- </option>
- <option>
- <name>jNDIName</name>
- <value>java:/portal/UserModule</value>
- </option>
- </config>
-</module>]]></programlisting>
- <itemizedlist>
- <listitem>
- <para>
- <emphasis role="bold">implementation</emphasis> - defines the scope under which
- the configuration for different implementations of modules <emphasis role="bold">type</emphasis>s resides.
- It enables to define the default options of the configuration of the different implementations of
- same module types in one configuration file.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">type</emphasis> - must be unique name across all modules defined in the main
- configuration file. This is important as module will be stored with such name within IdentityContext
- registry at runtime. Standard names are used (User, Role, Membership, UserProfile). Together with
- <emphasis role="bold">implementation</emphasis> will create unique pair within file with default configuration values.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">service-name</emphasis> - will be used for the name when registered as an MBean.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">class</emphasis> - Java class that will be use to instantiate the module.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">config</emphasis> - contains options related to this module
- </para>
- </listitem>
- </itemizedlist>
- <note><title>Note</title><para>
- Here you can easily see the whole idea about having two config files - main one and the one with default values.
- The above code snippet with User module comes from <emphasis role="bold">standardidentity-config.xml</emphasis>, so the file
- that defines default configuration values. Because of this in the main configuration file the definition of
- User module will be as short as:
- <programlisting><![CDATA[
-<module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>User</type>
- <implementation>DB</implementation>
- <config/>
-</module>]]></programlisting>
- As you can see we specify only the type and the implementation - all the other values (service-name, class and set of options)
- are read from default configuration. But remember that you can still overwrite any of those values in the
- main config simply by overriding them.</para>
- </note>
-
- </section>
- <section>
- <title>Options</title>
- <para>This section provides common options that are accessible by identity modules. We set options
- here that may need to be shared. They are grouped, and can have many values:</para>
- <programlisting><![CDATA[
-<options>
-<!--Common options section-->
-<option-group>
- <group-name>common</group-name>
- <option>
- <name>userCtxDN</name>
- <value>ou=People,dc=example,dc=com</value>
- </option>
- <option>
- <name>uidAttributeID</name>
- <value>uid</value>
- </option>
- <option>
- <name>passwordAttributeID</name>
- <value>userPassword</value>
- </option>
- <option>
- <name>roleCtxDN</name>
- <value>ou=Roles,dc=example,dc=com</value>
- </option>
- <option>
- <name>ridAttributeId</name>
- <value>cn</value>
- </option>
- <option>
- <name>roleDisplayNameAttributeID</name>
- <value>cn</value>
- </option>
- <option>
- <name>membershipAttributeID</name>
- <value>member</value>
- </option>
- <option>
- <name>membershipAttributeIsDN</name>
- <value>true</value>
- </option>
-</option-group>
-<option-group>
- <group-name>userCreateAttibutes</group-name>
- <option>
- <name>objectClass</name>
- <value>top</value>
- <value>uidObject</value>
- <value>person</value>
- <value>inetUser</value>
- </option>
- <!--Schema requires those to have initial value-->
- <option>
- <name>cn</name>
- <value>none</value>
- </option>
- <option>
- <name>sn</name>
- <value>none</value>
- </option>
-</option-group>]]></programlisting>
- <note>
- <title>Note</title><para>
- In this section we use the same inheritance mechanism. When an option is not set, its value will be read
- from the default config file. But this also means that you may need to overwrite some values that
- are specific to your LDAP architecture. All the options will be described along with module implementations
- that use them.</para>
- </note>
- </section>
- </section>
- </section>
- <section id="user_profile_configuration">
- <title>User profile configuration</title>
- <para>UserProfileModule has additional configuration file that defines user properties. It is specified in configuration in:</para>
- <programlisting>
- <![CDATA[
- <module>
- <type>UserProfile</type>
- <implementation>DELEGATING</implementation>
-
- (...)
-
- <config>
-
- (...)
-
- <option>
- <name>profileConfigFile</name>
- <value>conf/identity/profile-config.xml</value>
- </option>
- </config>
- </module>
- ]]>
- </programlisting>
- <para>This means that you can configure user profile in <emphasis>jboss-portal.sar/conf/identity/profile-config.xml</emphasis></para>
-
- <programlisting>
- <![CDATA[
-<profile>
-
- <property>
- <name>user.name.nickName</name>
- <type>java.lang.String</type>
- <access-mode>read-only</access-mode>
- <usage>mandatory</usage>
- <display-name xml:lang="en">Name</display-name>
- <description xml:lang="en">The user name</description>
- <mapping>
- <database>
- <type>column</type>
- <value>jbp_uname</value>
- </database>
- </mapping>
- </property>
-
- <property>
- <name>user.business-info.online.email</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>mandatory</usage>
- <display-name xml:lang="en">Email</display-name>
- <description xml:lang="en">The user real email</description>
- <mapping>
- <database>
- <type>column</type>
- <value>jbp_realemail</value>
- </database>
- <ldap>
- <value>mail</value>
- </ldap>
- </mapping>
- </property>
-
- <property>
- <name>portal.user.location</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Location</display-name>
- <description xml:lang="en">The user location</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.location</value>
- </database>
- </mapping>
- </property>
-
- (...)
-
-</properties>
- ]]>
- </programlisting>
- <para> Configuration file contains properties definition that can be retrieved using the <emphasis role="bold">PropertyInfo</emphasis> interface.
- Each property used in portal has to be defined here.</para>
-
-<note><title>Note</title><para>Some information provided here can have a large impact on the behavior of the UserProfileModule. For instance
- <emphasis>access-mode</emphasis> can be made read-only and the value provided in <emphasis>type</emphasis> will be checked
- during <emphasis>setProperty()/getProperty()</emphasis> operations. On the other hand tags like <emphasis>usage</emphasis>,
- <emphasis>description</emphasis> or <emphasis>display-name</emphasis> have mostly informational meaning at the moment and
- are used by the management tools at runtime.</para></note>
-
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">name</emphasis> - property name. This value will be used to refer to the property in <emphasis>UserProfileModule</emphasis></para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">type</emphasis> - Java type of property. This type will be checked when in <emphasis>UserProfileModule</emphasis>
- methods invocation.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">access-mode</emphasis> - possible values are <emphasis>read-write</emphasis> and <emphasis>read-only</emphasis></para>
- </listitem>
-
- <listitem>
- <para><emphasis role="bold">usage</emphasis> - property usage can be <emphasis>mandatory</emphasis> or <emphasis>optional</emphasis>.</para>
- </listitem>
-
- <listitem>
- <para><emphasis role="bold">display-name</emphasis> - property display name.</para>
- </listitem>
-
- <listitem>
- <para><emphasis role="bold">description</emphasis> - description of property.</para>
- </listitem>
-
- <listitem>
- <para>
- <emphasis role="bold">mapping</emphasis> - defines how property is mapped in the underlaying storage mechanism. It can be mapped in <emphasis>database</emphasis>
- either as a <emphasis>column</emphasis> or <emphasis>dynamic</emphasis> value. It can also be mapped as <emphasis>ldap</emphasis> attribute.
-
- <note><title>Note</title><para>In current implementation <emphasis>column</emphasis> and <emphasis>dynamic</emphasis> mappings have the same effect, as database mappings are defined in hibernate configuration.</para></note>
-
- <note><title>Note</title>
- <para>Property can have both <emphasis>ldap</emphasis> and <emphasis>database</emphasis> mappings. In such situation when LDAP support is enabled <emphasis>ldap</emphasis> mapping will take precedense. Also even when using LDAP some properties will be mapped to LDAP and some to database. Its because LDAP schema doesn't support all attributes proper to for portal properties. To solve this we have <emphasis role="bold">DelegatingUserProfileModuleImpl</emphasis> that will delegate method invocation to
- <emphasis>ldap</emphasis> or <emphasis>database</emphasis> related <emphasis>UserProfile</emphasis> module. When <emphasis>LDAP</emphasis> support is enabled and property need to be stored in database user will be synchronized into database when needed. This behavior can be configured.</para>
- </note>
- </para>
- </listitem>
- </itemizedlist>
-
-
- </section>
-
- <section>
- <title>Identity modules implementations</title>
-
- <note><title>Note</title><para>Identity modules implementations related to LDAP are described in <xref linkend="ldap.ldap_identity_modules"/>.
- </para></note>
- <section>
- <title>Database modules</title>
- <para>JBoss portal comes with a set of database related identity modules implementations done using Hibernate - those are configured
- by default. Those are not very
- configurable in <emphasis>identity-config.xml</emphasis> file. The reason is that to keep backwards compatibility of database schema with previous
- portal version, we reused most of hibernate implementation. If you want to tweak the hibernate mappings you should look into files in
- <emphasis role="bold">jboss-portal.sar/conf/hibernate</emphasis>. Also those modules rely on hibernate <emphasis>SessionFactory</emphasis> components
- that are created in <emphasis>SessionFactoryBinder</emphasis> mbeans defined in <emphasis>jboss-portal.sar/META-INF/jboss-service.xml</emphasis></para>
- <para>Classes implementing identity modules:
- <itemizedlist>
- <listitem>
- <para>
- <emphasis role="bold">org.jboss.portal.identity.db.HibernateUserModuleImpl</emphasis> - implementaing <emphasis>UserModule</emphasis> interface</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">org.jboss.portal.identity.db.HibernateRoleModuleImpl</emphasis> - implementaing <emphasis>RoleModule</emphasis> interface</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">org.jboss.portal.identity.db.HibernateMembershipModuleImpl</emphasis> - implementaing <emphasis>MembershipModule</emphasis> interface</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">org.jboss.portal.identity.db.HibernateUserProfileModuleImpl</emphasis> - implementing <emphasis>UserProfileModule</emphasis> interface</para>
- </listitem>
- </itemizedlist>
- </para>
- <para>For each of those modules you can alter two config options:
- <itemizedlist>
- <listitem><para>
- <emphasis>sessionFactoryJNDIName</emphasis> - JNDI name under which hibernate SessionFactory object is registered</para>
- </listitem>
- <listitem>
- <para><emphasis>jNDIName</emphasis> - JNDI name under which this module should be registered</para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- <section id="identity.management_api">
- <title>Delegating UserProfile module</title>
- <para>
- Delegating UserProfileModule implementation has very specific role. When we use a storage mechanism like LDAP we may not be able to map all
- user properties into LDAP attributes because of schema limitations. To solve this problem we still can use the database to store user properties
- that do not exist in the LDAP schema.
- The Delegating user profile module will recognize if a property is mapped as <emphasis role="bold">ldap</emphasis> or <emphasis role="bold">database</emphasis>
- and delegate <emphasis>setProperty()/getProperty()</emphasis> method invocation to proper module implementation. This is implemented in
- <emphasis role="bold">org.jboss.portal.identity.DelegatingUserProfileModuleImpl</emphasis>. If property is mapped either as
- <emphasis role="bold">ldap</emphasis> and <emphasis role="bold">database</emphasis> the <emphasis role="bold">ldap</emphasis> mapping will
- have higher priority.
- </para>
- <programlisting>
- <![CDATA[
-<module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>UserProfile</type>
- <implementation>DELEGATING</implementation>
-
- <!--name of service and class for creating mbean-->
- <service-name>portal:service=Module,type=UserProfile</service-name>
- <class>org.jboss.portal.identity.DelegatingUserProfileModuleImpl</class>
- <!--set of options that are set in instantiated object-->
- <config>
- <option>
- <name>jNDIName</name>
- <value>java:/portal/UserProfileModule</value>
- </option>
- <option>
- <name>dbModuleJNDIName</name>
- <value>java:/portal/DBUserProfileModule</value>
- </option>
- <option>
- <name>profileConfigFile</name>
- <value>conf/identity/profile-config.xml</value>
- </option>
- </config>
-</module>]]>
- </programlisting>
- <para>
- Module options are:
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">dbModuleJNDIName</emphasis> - JNDI name under which database implementation of UserProfileModule is registered.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">ldapModuleJNDIName</emphasis> - JNDI name under which ldap implementation of UserProfileModule is registered.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">profileConfigFile</emphasis> - configuration file for user properties.</para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>Database UserProfile module implementation</title>
- <para>Because of the behavior described in the previous section, database UserProfileModule requires some special features. If a user is present in
- LDAP server but a writable property isn't mapped as an LDAP attribute, such property requires to be stored in the database. In order to achieve
- such result the user need to be synchronized from LDAP into the database first.</para>
- <para>Class <emphasis>org.jboss.portal.identity.db.HibernateUserProfileModuleImpl</emphasis> has additional synchronization features.
- Here are the options: </para>
-
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">synchronizeNonExistingUsers</emphasis> - when set to "true" if the user subject to the operation does not exist, then it will
- created it in database. By default it is "true".</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">acceptOtherImplementations</emphasis> - if set to "true" module will accept user objects other than
- <emphasis>org.jboss.portal.identity.db.HibernateUserImpl</emphasis>. This is needed to enable cooperation with UserModule implementations other
- than <emphasis>org.jboss.portal.identity.db.HibernateUserModuleImpl</emphasis>. The default value is set "true".</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">defaultSynchronizePassword</emphasis> - if this option is set, the value will be used as a password for synchronized user.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">randomSynchronizePassword</emphasis> - if this option is set to "true" synchronized user will have random generated password. This is mostly used for the security reasons. Default value is "false".</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">sessionFactoryJNDIName</emphasis> - JNDI name under which this user will be registered.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">profileConfigFile</emphasis> - file with user profile configuration. If this option is not set, and we use delegating UserProfileModule, profile configuration will be obtained from it.</para>
- </listitem>
- </itemizedlist>
-
- </section>
- </section>
-</chapter>
- <chapter id="identityportlets">
-<!-- <chapterinfo>
- <author>
- <firstname>Emanuel</firstname>
- <surname>Muckenhuber</surname>
- </author>
- </chapterinfo>-->
- <title>JBoss Portal Identity Portlets</title>
- <section id="identity_portlet_introduction">
- <title>Introduction</title>
- <para>
- Since JBoss Portal 2.6.2 two new Identity Portlets are
- shipped by default:
- <itemizedlist>
- <listitem>
- <para>The User Portlet</para>
- </listitem>
- <listitem>
- <para>The Identity Management Portlet</para>
- </listitem>
- </itemizedlist>
- As the names indicate - the User Portlet is responsible for
- actions related to the end user. Whereas the Identity Management
- Portlet contains all the functionality for managing users and roles.
- </para>
-<warning><title>Caution</title><para>
-The Identity portlets will evolve over time, therefore usage and configuration might change.</para>
-</warning>
- <section>
- <title>Features</title>
- <para>
- The identity portlets provide the following features:
- <itemizedlist>
- <listitem>
- <para>Email verification: The users can receive an email with a link on which they must click to confirm the
- creation of the new account. (Disabled by default,see <xref linkend="identity_portlet_configuration_jbpm"/>)</para>
- </listitem>
- <listitem>
- <para>Captcha support: The users are prompted to copy letters from a deformed image. (Disabled by default, see <xref linkend="identity_portlet_configuration_captcha"/>)</para>
- </listitem>
- <listitem>
- <para>Lost password: The users can receive a new password by email, any user with access to the admin portlet can also reset another user's password and send the new one by email in one click. (Disabled by default, see <xref linkend="identity_portlet_configuration_lost_password"/>)</para>
- </listitem>
- <listitem>
- <para>jBPM based user registration: Several business processes are available out of the box (this includes administration approval), this can
- be extended to custom ones. See <xref linkend="identity_portlet_configuration_jbpm"/>.</para>
- </listitem>
- <listitem>
- <para>User and role management: Ability for the administrator to add and edit users as well as adding, </para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- </section>
- <section>
- <title>Configuration</title>
- <para>
- This section covers the configuration of the Identity
- Portlets.
- </para>
- <section id="identity_portlet_configuration_captcha">
- <title>Captcha support</title>
- <para>
- CAPTCHA is an acronym for <literal>Completely Automated Public
- Turing test to tell Computers and Humans Apart</literal>. This is
- providing a mechanism to prevent automated programs
- from using different services. The User
- Portlet uses JCaptcha to provide a challenge-response.
- </para>
- <note><para>By default the captcha service needs a XServer to
- generate the images. For using the captcha service
- without a XServer make sure you run the JVM with the
- following option:
- <programlisting>-Djava.awt.headless=true</programlisting></para>
- </note>
- <para/>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/identityportlets/user_register.png"/>
- </imageobject>
-
- </mediaobject>
- <para>The registration page with captcha.</para>
- <para>
- The captcha support can be enabled by changing the
- portlet preference 'captcha' to 'true'. If enabled,
- captcha will be used for the registration and lost
- password action.
- </para>
- <programlisting><![CDATA[...
-<portlet>
-...
- <display-name>User portlet</display-name>
-...
- <portlet-preferences>
- <preference>
- <name>captcha</name>
- <value>true</value>
- </preference>
- </portlet-preferences>
-</portlet>
-...]]></programlisting>
- </section>
- <section id="identity_portlet_configuration_lost_password">
- <title>Lost password</title>
- <para>
- The lost password feature enables the end user to reset
- his password by entering his username.
- </para>
- <note>
- <title>Note</title><para>This feature requires a properly configured MailModule. See <xref linkend="emailConfiguration"/>.</para>
- </note>
- <para/>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/identityportlets/lost_password.png"/>
- </imageobject>
-
- </mediaobject>
- <para>
- The lost password page with captcha enabled.
- </para>
- <para>
- The lost password feature can be enabled by changing the
- portlet preference 'lostPassword' to 'true'. If captcha
- is enabled it will be also used for verifying the lost
- password action.
- </para>
- <programlisting><![CDATA[...
-<portlet>
-...
- <display-name>User portlet</display-name>
-...
- <portlet-preferences>
- <preference>
- <name>lostPassword</name>
- <value>true</value>
- </preference>
- </portlet-preferences>
-</portlet>
-...]]></programlisting>
- </section>
- <section id="identity_portlet_configuration_reset_password">
- <title>Reset password</title>
- <para>
- The reset password feature is similar to the lost
- password feature, but it is used in the User Management
- Portlet to reset the password of a user. That means
- changing the password of a user is slightly simplified,
- because a random password will be generated and sent to
- the users e-mail address.
- </para>
- <programlisting><![CDATA[...
-<portlet>
-...
- <display-name>User management portlet</display-name>
-...
- <portlet-preferences>
- <preference>
- <name>resetPassword</name>
- <value>true</value>
- </preference>
- </portlet-preferences>
-</portlet>
-...]]></programlisting>
- </section>
- <section id="identity_portlet_configuration_jbpm">
- <title>jBPM based user registration</title>
- <para>
- JBoss Portal supports three different subscription modes by default:
- <itemizedlist>
- <listitem>
- <para>Automatic subscription (no jBPM required), the users can register and directly login.</para>
- </listitem>
- <listitem>
- <para>E-Mail validation, the users need to click on a link sent by email before being able to login.</para>
- </listitem>
- <listitem>
- <para>E-Mail validation and admin approval, the users need to validate their email, then an admin needs to
- approve the newly created account.</para>
- </listitem>
- </itemizedlist>
- </para>
- <note><title>Note</title><para>
- The subscription mode has to be defined in the configuration file as explained here: <xref linkend="identity_portlet_configuration_file"/>.</para>
- </note>
- <warning><title>Caution</title><para>
- Make sure that the application server is restarted after re-deploying the Identity Portlets. This is required to make sure that
- the registration and approval process works properly! </para>
- </warning>
-
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/identityportlets/pending_users.png"/>
- </imageobject>
-
- </mediaobject>
- <para>
- Approve or reject pending registrations (<emphasis>jbp_identity_validation_approval_workflow</emphasis>).
- </para>
- </section>
- <section id="identity_portlet_configuration_file">
- <title>The configuration file</title>
- <para>
- The Identity Portlets use some metadata which can be
- easily changed in the main configuration file, which is
- located at <literal>jboss-portal.sar/portal-identity.sar/conf/identity-ui-configuration.xml</literal> as shown here:
- </para>
- <programlisting><![CDATA[<identity-ui-configuration>
-
- <subscription-mode>automatic</subscription-mode>
- <admin-subscription-mode>automatic</admin-subscription-mode>
- <overwrite-workflow>false</overwrite-workflow>
- <email-domain>jboss.org</email-domain>
- <email-from>no-reply(a)jboss.com</email-from>
- <password-generation-characters>a...Z</password-generation-characters>
- <default-roles>
- <role>User</role>
- </default-roles>
-
- <!-- user interface components -->
- <ui-components>
- <ui-component name="givenname">
- <property-ref>user.name.given</property-ref>
- </ui-component>
- <ui-component name="familyname">
- <property-ref>user.name.family</property-ref>
- </ui-component>
- ...
-</identity-ui-configuration>]]></programlisting>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- <emphasis role="bold">
- subscription-mode:
- </emphasis>
- defines the User Portlet registration process
- <itemizedlist>
- <listitem><para>
- <emphasis>automatic:</emphasis> no validation nor approval (default)</para>
- </listitem>
- <listitem><para>
- <emphasis>jbp_identity_validation_workflow:</emphasis> e-mail validation, no approval</para>
- </listitem>
- <listitem><para>
- <emphasis>jbp_identity_validation_approval_workflow:</emphasis> e-mail validation and approval</para>
- </listitem>
- <listitem><para>
- <emphasis>custom:</emphasis> Take a look at Customizing the workflow</para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- admin-subscription-mode:
- </emphasis>
- jBPM process used in the User Management Portlet for creating users
- <itemizedlist>
- <listitem><para>
- <emphasis>automatic:</emphasis>
- no validation nor approval (default)</para>
- </listitem>
- <listitem><para>
- <emphasis>jbp_identity_validation_workflow:</emphasis>
- e-mail validation, no approval</para>
- </listitem>
- <listitem><para>
- <emphasis>jbp_identity_validation_approval_workflow:</emphasis>
- e-mail validation and approval</para>
- </listitem>
- <listitem><para>
- <emphasis>custom:</emphasis>
- Take a look at Customizing the
- workflow</para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- overwrite-workflow:
- </emphasis>
- if set to 'true' the workflow will be overwritten during the next startup (default: false)
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- email-domain:
- </emphasis>
- e-mail domain used in the validation e-mail by the template (can be anything)
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">email-from:</emphasis>
- e-mail fro field used by the validation e-mail
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- password-generation-characters:
- </emphasis>
- characters to use to generate a random password
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- default-roles:
- </emphasis>
- one or more default roles
- <itemizedlist>
- <listitem><para>
- available element: <emphasis role="bold">role</emphasis></para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- ui-components:
- </emphasis>
- Defines the available user interface components. Take a look at the next section
- for further details.
- </para>
- </listitem>
- </itemizedlist>
- Due to the differentiation between subscription-mode and
- admin-subscription-mode it is possible to require e-mail
- validation and approval for new registrations and e-mail
- validation only when a user is created in the user
- management portlet.
- </para>
- </section>
- <section>
- <title>Customize e-mail templates</title>
- <para>
- The email templates can be found in the folder: <emphasis>portal-identity.sar/conf/templates/</emphasis>
- </para>
- <para>
- New languages can be added by creating a new file like: <emphasis>emailTemplate_fr.tpl</emphasis>
- </para>
- </section>
- </section>
- <section id="identity_portlet_configuration_ui_components">
- <title>User interface customization</title>
- <para>
- The following three examples describe common use cases for customizing the User Portlet.
- <itemizedlist>
- <listitem>
- <para>
- <emphasis role="bold">Example 1:</emphasis>
- Describes how to tag a input field as required
- and add it to the registration page.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">Example 2:</emphasis>
- Shows how to create a simple dropdown menu.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">Example 3:</emphasis>
- Describes how to add new properties.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <note>
- <title>Note</title><para>This is not a JavaServer Faces tutorial. Basic knowledge of
- this technology is a precondition for customizing the User
- Portlet Interface.</para>
- </note>
- <section id="identity_portlet_configuration_example1">
- <title>Example 1: required fields</title>
- <para>
- This example explains how to change optional properties to
- required properties, of course once this is done, we will also need to
- add the corresponding fields in the registration page.
- <!-- sbr/ -->
- Here are the modifications in <emphasis>portal-identity.sar/conf/identity-ui-configuration.xml</emphasis>,
- we simply changed the required element to true on our two fields corresponding to the given and family names.
- </para>
- <programlisting><![CDATA[<identity-ui-configuration>
-...
- <!-- user interface components -->
- ...
- <ui-component name="givenname">
- <property-ref>user.name.given</property-ref>
- <required>true</required>
- </ui-component>
- <ui-component name="familyname">
- <property-ref>user.name.family</property-ref>
- <required>true</required>
- </ui-component>
- ...
-</identity-ui-configuration>]]></programlisting>
- <para>
- Now that we changed those values to "required" we need to give a chance to the user to enter those
- values, here are the changes done in <emphasis>portal-identity.sar/portal-identity.war/WEB-INF/jsf/common/register.xhtml</emphasis>
- </para>
- <programlisting><![CDATA[
-...
- <h:outputText value="#{bundle.IDENTITY_GIVENNAME}"/>
- <h:inputText id="givenname" value="#{manager.uiUser.attribute.givenname}"
- required="#{metadataservice.givenname.required}"/>
- <h:panelGroup />
- <h:message for="givenname" />
-
- <h:outputText value="#{bundle.IDENTITY_FAMILYNAME}"/>
- <h:inputText id="lastname" value="#{manager.uiUser.attribute.familyname}"
- required="#{metadataservice.familyname.required}"/>
- <h:panelGroup />
- <h:message for="lastname"/>
-...]]></programlisting>
- <para>
- That's it - from now on the given name and family name will be
- required on registration.
- We dynamically obtain the values from the descriptor. Now if i just wanted to make them back to optional,
- i would change the values only in the descriptor, letting the user enter or not those values.
- </para>
- </section>
- <section id="identity_portlet_configuration_example2">
- <title>
- Example 2: dynamic values (dropdown menu with predefined values)
- </title>
- <para>
- If the data to enter is a choice instead of a free-text value, you can also define those
- in the descriptor like shown here:
- </para>
- <programlisting><![CDATA[<identity-ui-configuration>
-...
- <!-- user interface components -->
- ...
- <ui-component name="interests">
- <property-ref>portal.user.interests</property-ref>
- <values>
- <value key="board">snowboarding</value>
- <value key="ski">skiing</value>
- <value key="sledge">sledging</value>
- </values>
- </ui-component>
- ...
-</identity-ui-configuration>]]></programlisting>
- <para>
- <emphasis>
- In portal-identity.sar/portal-identity.war/WEB-INF/jsf/common/profile.xhtml
- </emphasis>
- - change inputText to a selectOneMenu:
- </para>
- <programlisting><![CDATA[
- ...
- <h:outputText value="#{bundle.IDENTITY_INTERESTS}"/>
- <h:selectOneMenu id="interests" value="#{manager.uiUser.attribute.interests}"
- required="#{metadataservice.interests.required}">
- <f:selectItems value="#{metadataservice.interests.values}" />
- </h.selectOneMenu>
- <h:panelGroup />
- <h:message for="interests"/>
-...
-]]></programlisting>
- <para>
- For localizing dynamic values it is also possible to use the resource bundle.
- This can be done by adding the key with a prefix (to i.e. <emphasis>Identity.properties</emphasis>) like in the following listing.
- The key will be stored in the users property and is used to identify the element. The value of the configuration file will only be used if no localization information is found.
- </para>
- <programlisting><![CDATA[
-...
-IDENTITY_DYNAMIC_VALUE_BOARD=localized snowboarding
-IDENTITY_DYNAMIC_VALUE_SKI=localized skiing
-IDENTITY_DYNAMIC_VALUE_SLEDGE=localized sledging
-...
-]]></programlisting>
- <note>
- <para>If the value is not required a blank element will be
- added at the top.</para>
- </note>
- </section>
- <section id="identity_portlet_configuration_example3">
- <title>Example 3: adding new properties</title>
- <note>
- <title>Note</title><para>Please make sure you read at least the section about
- user profile configuration: <xref linkend="user_profile_configuration"/>, to add a new value on
- the interface it also has to be defined in your model, as shown on Step 1.</para>
- </note>
- <para>
- <emphasis role="bold">step 1:</emphasis>
- add a new property to <emphasis>profile-config.xml</emphasis> e.g. a dynamic property called gender:
- </para>
- <programlisting><![CDATA[
-...
- <property>
- <name>user.gender</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Gender</display-name>
- <description xml:lang="en">The gender</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>user.gender</value>
- </database>
- </mapping>
- </property>
-...
-]]></programlisting>
- <note>
- <title>Note</title><para>It is recommended to use the 'User Information Attribute Names' from the <ulink url="http://jcp.org/en/jsr/detail?id=168">Portlet Specification</ulink> for defining properties.</para>
- </note>
- <para>
- <emphasis role="bold">step 2:</emphasis>
- add the property to the identity-ui-configuration: (<emphasis>portal-identity.sar/conf/identity-ui-configuration.xml</emphasis>)
- </para>
- <programlisting><![CDATA[
-...
- <ui-component name="gender">
- <property-ref>user.gender</property-ref>
- <required>true</required>
- <values>
- <value key="male">Male</value>
- <value key="female">Female</value>
- </values>
- </ui-component>
-...
-]]></programlisting>
- <note>
- <title>Note</title><para>The property-ref must match a property from the
- <emphasis>profile-config.xml</emphasis>.</para>
- </note>
- <para>
- <emphasis role="bold">step 3:</emphasis>
- add your custom ui-component to the profile page: (<emphasis>portal-identity.sar/portal-identity.war/WEB-INF/jsf/profile.xhtml</emphasis>)
- </para>
- <programlisting><![CDATA[
-...
- <h:outputText value="#{bundle.IDENTITY_GENDER}"/>
- <h:selectOneMenu id="gender" value="#{manager.uiUser.attribute.gender}"
- required="#{metadataservice.gender.required}">
- <f:selectItems value="#{metadataservice.gender.values}" />
- </h.selectOneMenu>
- <h:panelGroup />
- <h:message for="gender"/>
-...
-]]></programlisting>
-
-<note><title>Note</title><para>Don't forget to add the localization elements.</para></note>
-
-</section>
- <section>
- <title>Illustration</title>
- <para>
-
- </para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/identityportlets/illustration.png" scalefit="1"/>
- </imageobject>
-
- </mediaobject>
- <para>
- Illustration of the relationship between the
- configuration files.
- </para>
- <para>
- The JSF-View in more detail:
-<itemizedlist>
- <listitem>
- <para>
- <emphasis role="bold"> manager.uiUser.attribute:</emphasis>
- manages and stores the dynamic properties
- <itemizedlist>
- <listitem>
- <para>
- <emphasis role="bold">examples:</emphasis> <emphasis>manager.uiUser.attribute.gender</emphasis>,
- <emphasis>manager.uiUser.attribute.interests</emphasis>
- <programlisting><![CDATA[<h:inputText id="gender" value="#{manager.uiUser.attribute.gender}" />]]></programlisting>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- metadataservice
- </emphasis>
- <itemizedlist>
- <listitem>
- <para>
- <emphasis role="bold">
- required
- </emphasis>
- - references the required attribute from the ui-component<!-- sbr/ -->
- example: <emphasis>metadataservice.gender.required</emphasis>
- <programlisting><![CDATA[<h:inputText id="gender" value="#{manager.uiUser.attribute.gender}" required="#{metadataservice.gender.required}"/>]]></programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- values
- </emphasis>
- - references the values list from the ui-component<!-- sbr/ -->
- example: <emphasis>metadataservice.gender.values</emphasis>
- <programlisting><![CDATA[<h:selectOneMenu id="interests" value="#{manager.uiUser.attribute.interests}">
- <f:selectItems value="#{metadataservice.interests.values}" />
-</h:selectOneMenu>]]></programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- validator
- </emphasis>
- - references the name of a registered JSF validator<!-- sbr/ -->
- example:<emphasis>metadataservice.gender.validator</emphasis>
- - the first validator of the validator list<!-- sbr/ -->
- example: <emphasis>metadataservice.gender.validators[0]</emphasis>
- - the validator list with an index<!-- sbr/ -->
- <programlisting><![CDATA[<f:validator validatorId="#{metadataservice.gender.validator}"/>]]></programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- converter
- </emphasis>
- - references the name of a registered JSF converter<!-- sbr/ -->
- example: <emphasis>metadataservice.gender.converter</emphasis>
- <programlisting><![CDATA[<f:converter converterId="#{metadataservice.gender.converter}"/>]]></programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">
- readOnly
- </emphasis>
- - references the access-mode of <emphasis>profile-config.xml</emphasis><!-- sbr/ -->
- possible usage i.e. in <emphasis>/WEB-INF/jsf/common/profile.xhtml</emphasis>
- <programlisting><![CDATA[<h:inputText value="#{manager.uiUser.attribute.nickname}" disabled="#{metadataservice.nickname.readOnly}" />]]></programlisting>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <warning>
- <para>The values of the profile-config.xml have a higher
- priority than the values in the user portlet
- configuration. That means if the 'usage' is 'mandatory'
- in <emphasis>profile-config.xml</emphasis>
- and 'required' is 'false' it will be overwritten by the
- value from the profile config!</para>
- </warning>
- </section>
- <section>
- <title>Customizing the View Profile page</title>
- <para>
- By default not all values of the user profile will be displayed on the <emphasis>View profile</emphasis> page. For customization it is possible
- to add further properties to the page by editing the file: <emphasis>portal-identity.sar/portal-identity.war/WEB-INF/jsf/profile/viewProfile.xhtml</emphasis>
- </para>
- </section>
- </section>
- <section>
- <title>Customizing the workflow</title>
- <note><para>For more details about jBPM please read the <ulink url="http://docs.jboss.com/jbpm/v3/userguide/index.html">jBPM documentation</ulink></para></note>
- <para>
- The process definitions are located in:
- <emphasis>portal-identity.sar/conf/processes</emphasis>. To create a custom workflow, you can extend the existing process description file: <emphasis>custom.xml</emphasis>.
- </para>
- <para>
- Available variables in the business process:
- <itemizedlist>
- <listitem>
- <para>
- <emphasis role="bold">name:</emphasis>
- portalURL
- <!-- sbr/ -->
- <emphasis role="bold">type:</emphasis>
- <emphasis>java.lang.String</emphasis>
- <!-- sbr/ -->
- <emphasis role="bold">description:</emphasis>
- represents the full url of the portal e.g.
- <emphasis>
- http://localhost:8080/portal
- </emphasis>
- <!-- sbr/ -->
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">name:</emphasis>
- locale
- <!-- sbr/ -->
- <emphasis role="bold">type:</emphasis>
- <emphasis>java.util.Locale</emphasis>
- <!-- sbr/ -->
- <emphasis role="bold">description:</emphasis>
- the requested locale at registration
- <!-- sbr/ -->
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">name:</emphasis>
- email
- <!-- sbr/ -->
- <emphasis role="bold">type:</emphasis>
- <emphasis>java.lang.String</emphasis>
- <!-- sbr/ -->
- <emphasis role="bold">description:</emphasis>
- the e-mail address of the user in case of registration.<!-- sbr/ -->
- In case of changing the e-mail the new e-mail address.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">name:</emphasis>
- user
- <!-- sbr/ -->
- <emphasis role="bold">type:</emphasis>
- <emphasis>
- org.jboss.portal.core.identity.services.workflow.UserContainer
- </emphasis>
- <!-- sbr/ -->
- <emphasis role="bold">description:</emphasis>
- Seralizable Object containing user information through the jBPM process <!-- sbr/ -->
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">name:</emphasis>
- validationHash
- <!-- sbr/ -->
- <emphasis role="bold">type:</emphasis>
- <emphasis>java.lang.String</emphasis>
- <!-- sbr/ -->
- <emphasis role="bold">description:</emphasis>
- hash used for the validation part. Only available after executing SendValidationEmailAction<!-- sbr/ -->
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <note><title>Note</title><para>
- Make sure that the filename and the process name match! e.g.
- <emphasis>conf/processes/custom.xml</emphasis>
- and process-definition name="custom".</para>
- </note>
- <para>
- When using a custom workflow it is possible to customize the
- status message after registering in the locale bundle: ( e.g.
- <emphasis>portal-identity.sar/conf/bundles/Identity.properties</emphasis>)
- </para>
- <programlisting><![CDATA[
-
-IDENTITY_VERIFICATION_STATUS_REGISTER_CUSTOM=Customized message here
-
-]]></programlisting>
- <section>
- <title>Duration of process validity</title>
- <para>
- By default requests (e.g. e-mail validation and registrations) expire after some time in the validation state.
- Therefore it is not required to add additional maintenance mechanism to invalidate a request. The default expiration time is 2 days,
- but is quite easy to change the timing by editing the <emphasis>duedate</emphasis> attribute in the process definition.
- changes in: <emphasis>portal-identity.sar/conf/processes/*.xml</emphasis>
- </para>
- <programlisting><![CDATA[<process-definition>
-...
- <state name="validate_email">
- <timer name="time_to_expire" duedate="2 days" transition="timedOut" />
- </state>
-...
-</process-definition>]]></programlisting>
-
- <para>
- For further information take a look at the <ulink url="http://docs.jboss.com/jbpm/v3/userguide/index.html">jBPM documentation</ulink> on <emphasis>Duration</emphasis>.
- </para>
- </section>
-</section>
- <section>
- <title>Disabling the Identity Portlets</title>
- <para>
- Due to the fact that the former user portlets are still
- included in JBoss Portal 2.6.2 it is possible to activate
- it in the Portal Admin interface, by using the PortletInstances:
- <itemizedlist>
- <listitem><para>
- <emphasis>UserPortletInstance:</emphasis> The former user portlet</para>
- </listitem>
- <listitem><para>
- <emphasis>RolePortletInstance:</emphasis> The former role managment portlet</para>
- </listitem>
- </itemizedlist>
- </para>
- <section>
- <title>Enabling the Identity Portlets</title>
- <para>
- When migrating from former versions of JBoss Portal the Identity User Portlets won't be displayed by default,
- but windows can be created on basis of the existing Portlet Instances which are deployed by default. (The instances
- names being <literal>IdentityUserPortletInstance</literal> and <literal>IdentityAdminPortletInstance</literal>.)
- </para>
- </section>
- </section>
-</chapter>
- <chapter id="authentication">
- <!-- <chapterinfo>
- <author>
- <firstname>Boleslaw</firstname>
- <surname>Dawidowicz</surname>
- </author>
- </chapterinfo>-->
- <title>Authentication and Authorization</title>
- <para>This chapter describes the authentication mechanisms in JBoss Portal</para>
- <section id="authentication_in_portal">
- <title>Authentication in JBoss Portal</title>
- <para>JBoss Portal is heavily standard based so it leverages <emphasis>Java Authentication and Authorization Service (JAAS)</emphasis>
- in JBoss Application Server. Because of this it can be configured in a very flexible manner and other
- authentication solutions can be plugged in easily.
- To better understand authentication mechanisms in JBoss Portal please refer to
- <xref linkend="security.security_authentication"/>.
- To learn more about JAAS look for proper documentation on
- <ulink url="http://java.sun.com/javase/6/docs/technotes/guides/security/">Java Security</ulink> website.
- To learn more about security in JBoss Application Server please read
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossSX">JBossSX</ulink> documentation.
- </para>
- <section id="authentication_configuration">
- <title>Configuration</title>
- <para>You can configure the JAAS authentication stack in <emphasis>jboss-portal.sar/conf/login-config.xml</emphasis>.
- It is important to remember that authorization in portal starts at the JAAS level -
- configured <emphasis>LoginModule</emphasis>s apply proper <emphasis>Principal</emphasis> objects representing
- the roles of authenticated user. As you can see in <emphasis>jboss-portal.sar/portal-server.war/WEB-INF/web.xml</emphasis> portal
- servlet is secured with specified role ("<emphasis>Authenticated</emphasis>"). In the default portal configuration
- this role is dynamically added by <emphasis>IdentityLoginModule</emphasis>. If you reconfigure the default JAAS authentication
- chain with other <emphasis>LoginModule</emphasis> implementations, you should remember that you must deal with that
- security constraints in order to be able to access portal. For example if you place only one <emphasis>LoginModule</emphasis>
- that will authenticate users against LDAP server you may consider adding all users in your LDAP tree to such role.
- </para>
- </section>
- </section>
- <section id="portal_login_modules">
- <title>JAAS Login Modules</title>
- <para>JBoss Portal comes with a few implementations of JAAS <emphasis>LoginModule</emphasis> interface</para>
- <section>
- <title>org.jboss.portal.identity.auth.IdentityLoginModule</title>
- <para>This is the standard portal LoginModule implementation that uses portal identity modules in order to search users and roles.
- By default it is the only configured LoginModule in the portal authentication stack. Its behavior can be altered with the following options:
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">userModuleJNDIName</emphasis> - JNDI name of portal UserModule.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">roleModuleJNDIName</emphasis> - JNDI name of portal RoleModule.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">membershipModuleJNDIName</emphasis> - JNDI name of portal MembershipModule.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">additionalRole</emphasis> - additional user <emphasis>Principal</emphasis> that will be added to user <emphasis>Subject</emphasis>.
- This is important as in default portal configuration it is the role that portal servlet is secured with.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">havingRole</emphasis> - only users belonging to role specified with this option will be authenticated.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">unauthenticatedIdentity</emphasis> - the principal to use when a null username and password are seen.</para>
- </listitem>
- </itemizedlist>
- <note><title>Note</title><para>IdentityLoginModule extends org.jboss.security.auth.spi.UsernamePasswordLoginModule so if you are familiar with JBossSX you can apply
- few other options like "password-stacking". Please refer to JBossSX documentation.</para></note>
- </para>
- </section>
- <section>
- <title>org.jboss.portal.identity.auth.DBIdentityLoginModule</title>
- <para>This <emphasis>LoginModule</emphasis> implementation extends JBossSX <emphasis>org.jboss.security.auth.spi.DatabaseServerLoginModule</emphasis> and can be
- used to authenticate against Database. The main purpose of this module is to be configured directly against portal database (instead of using portal identity
- modules like in IdentityLoginModule). So if you are using custom LoginModule implementation you can place this module with "sufficient" flag. This can
- be extremely useful. For example if you authenticate against LDAP server using JBossSX <emphasis>LdapLoginModule</emphasis> you can
- fallback to users present in portal database and not present in LDAP like "admin" user. Please look into
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=DatabaseServerLoginModule">this</ulink> wiki page to learn more about
- <emphasis>DatabaseServerLoginModule</emphasis> configuration</para>
- <para>
- Options are:
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">dsJndiName</emphasis> - The name of the DataSource of the database containing the Principals and Roles tables</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">principalsQuery</emphasis> - The prepared statement query, equivalent to: <emphasis>"select Password from Principals where PrincipalID=?"</emphasis></para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">rolesQuery</emphasis> - The prepared statement query, equivalent to: <emphasis>"select Role, RoleGroup from Roles where PrincipalID=?"</emphasis></para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">hashAlgorithm</emphasis> - The name of the <emphasis>java.security.MessageDigest</emphasis> algorithm to use to hash the password.
- There is no default so this option must be specified to enable hashing. When hashAlgorithm is specified, the clear text password obtained from the <emphasis>CallbackHandler</emphasis>
- is hashed before it is passed to UsernamePasswordLoginModule.validatePassword as the inputPassword argument. The expectedPassword as stored in the users.properties
- file must be comparably hashed.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">hashEncoding</emphasis> - The string format for the hashed pass and st be either "base64" or "hex". Base64 is the default.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">additionalRole</emphasis> - additional user <emphasis>Principal</emphasis> that will be added to user <emphasis>Subject</emphasis>.</para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- Configuration using portal database will look like this:
- <programlisting>
- <![CDATA[
-<login-module code = "org.jboss.portal.identity.auth.DBIdentityLoginModule"
- flag="sufficient">
- <module-option name="dsJndiName">java:/PortalDS</module-option>
- <module-option name="principalsQuery">
- SELECT jbp_password FROM jbp_users WHERE jbp_uname=?
- </module-option/>
- <module-option name="rolesQuery">
- SELECT jbp_roles.jbp_name, 'Roles' FROM jbp_role_membership INNER JOIN
- jbp_roles ON jbp_role_membership.jbp_rid = jbp_roles.jbp_rid INNER JOIN jbp_users ON
- jbp_role_membership.jbp_uid = jbp_users.jbp_uid WHERE jbp_users.jbp_uname=?
- </module-option>
- <module-option name="hashAlgorithm">MD5</module-option>
- <module-option name="hashEncoding">HEX</module-option>
- <module-option name="additionalRole">Authenticated</module-option>
-</login-module>
- ]]>
- </programlisting>
-
- <note><title>Note</title><para>SQL query should be in single line. This code snipped was formatted like this only to fit documentation page.</para></note>
- </para>
- </section>
- <section>
- <title>org.jboss.portal.identity.auth.SynchronizingLdapLoginModule</title>
- <para>
- This module can be used instead of the IdentityLoginModule to bind to LDAP.
- <emphasis>org.jboss.portal.identity.auth.SynchronizingLDAPLoginModule</emphasis> class is a wrapper around
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=LdapLoginModule">LdapLoginModule</ulink> from JBossSX.
- It extends it so all configuration that can be applied to <emphasis>LdapExtLoginModule</emphasis> remains valid here. For a user that
- was authenticated successfully it will try to call the identity modules from portal, then check if such user
- exists or not, and if does not exist it will try to create it. Then for all roles assigned to this authenticated principal it will
- try to check and create them using identity modules. This behavior can be altered using following options:
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">userModuleJNDIName</emphasis> - JNDI name of portal UserModule. This option is <emphasis>obligatory</emphasis>
- if <emphasis>synchronizeIdentity</emphasis> option is set to <emphasis>true</emphasis></para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">roleModuleJNDIName</emphasis> - JNDI name of portal RoleModule. This option is <emphasis>obligatory</emphasis>
- if <emphasis>synchronizeIdentity</emphasis> and <emphasis>synchronizeRoles</emphasis> options are set to <emphasis>true</emphasis></para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">membershipModuleJNDIName</emphasis> - JNDI name of portal MembershipModule. This option is <emphasis>obligatory</emphasis>
- if <emphasis>synchronizeIdentity</emphasis> and <emphasis>synchronizeRoles</emphasis> options are set to <emphasis>true</emphasis></para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">userProfileModuleJNDIName</emphasis> - JNDI name of portal UserProfileModule. This option is <emphasis>obligatory</emphasis>
- if <emphasis>synchronizeIdentity</emphasis> option is set to <emphasis>true</emphasis></para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">synchronizeIdentity</emphasis> - if set to <emphasis>true</emphasis> module will check if
- successfully authenticated user exist in portal and if not it will try to create it. If user exists module will update its password
- to the one that was just validated.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">synchronizeRoles</emphasis> - if set to <emphasis>true</emphasis> module will iterate over all roles assigned to
- authenticated user and for each it will try to check if such role exists in portal and if not it will try to create it. This option is
- checked only if <emphasis>synchronizeIdentity</emphasis> is set to true;</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">additionalRole</emphasis> - module will add this role name to the group of principals assigned to the authenticated user.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">defaultAssignedRole</emphasis> - if <emphasis>synchronizeIdentity</emphasis> is set to true, module will try to assign
- portal role with such name to the authenticated user. If such role doesn't exist in portal, module will try to create it. </para>
- </listitem>
- </itemizedlist>
- For obvious reasons this is designed to use with portal identity modules configured with DB and not LDAP</para>
- </section>
- <section>
- <title>org.jboss.portal.identity.auth.SynchronizingLdapExtLoginModule</title>
- <para>All options that apply for <emphasis>SynchronizingLdapLoginModule</emphasis> also apply here. It's the same kind of wrapper
- made around <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=LdapExtLoginModule">LdapExtLoginModule</ulink> from JBossSX.
- Sample configuration can look like this:</para>
- <programlisting><![CDATA[
- <login-module code="org.jboss.portal.identity.auth.SynchronizingLDAPExtLoginModule"
- flag="required">
- <module-option name="synchronizeIdentity">true</module-option>
- <module-option name="synchronizeRoles">true</module-option>
- <module-option name="additionalRole">Authenticated</module-option>
- <module-option name="defaultAssignedRole">User</module-option>
- <module-option name="userModuleJNDIName">java:/portal/UserModule</module-option>
- <module-option name="roleModuleJNDIName">java:/portal/RoleModule</module-option>
- <module-option name="membershipModuleJNDIName">java:/portal/MembershipModule
- </module-option>
- <module-option name="userProfileModuleJNDIName">java:/portal/UserProfileModule
- </module-option>
- <module-option name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory
- </module-option>
- <module-option name="java.naming.provider.url">ldap://example.com:10389/
- </module-option>
- <module-option name="java.naming.security.authentication">simple</module-option>
- <module-option name="bindDN">cn=Directory Manager</module-option>
- <module-option name="bindCredential">secret</module-option>
- <module-option name="baseCtxDN">ou=People,dc=example,dc=com</module-option>
- <module-option name="baseFilter">(uid={0})</module-option>
- <module-option name="rolesCtxDN">ou=Roles,dc=example,dc=com</module-option>
- <module-option name="roleFilter">(member={1})</module-option>
- <module-option name="roleAttributeID">cn</module-option>
- <module-option name="roleRecursion">-1</module-option>
- <module-option name="searchTimeLimit">10000</module-option>
- <module-option name="searchScope">SUBTREE_SCOPE</module-option>
- <module-option name="allowEmptyPasswords">false</module-option>
-</login-module>]]>
- </programlisting>
- </section>
- <section id="authentication.synchronizing_login_module">
- <title>org.jboss.portal.identity.auth.SynchronizingLoginModule</title>
- <para>
- This module is designed to provide synchronization support for any other LoginModule placed in the authentication stack.
- It leverages the fact that in JAAS authentication process occurs in two phases. In first phase when login() method is invoked
- it always returns "true". Because of this behavior <emphasis>SynchronizingLoginModule</emphasis> should be always used with
- "optional" flag.
- More over it should be placed after the module we want to leverage as a source for synchronization and that module should have "required" flag set.
- During the second phase when commit() method is invoked it gets user <emphasis>Subject</emphasis> and its <emphasis>Principal</emphasis>s
- and tries to synchronize them into storage configured for portal identity modules. For this purposes such options are supported:
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">userModuleJNDIName</emphasis> - JNDI name of portal UserModule. This option is <emphasis>obligatory</emphasis>
- if <emphasis>synchronizeIdentity</emphasis> option is set to <emphasis>true</emphasis></para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">roleModuleJNDIName</emphasis> - JNDI name of portal RoleModule. This option is <emphasis>obligatory</emphasis>
- if <emphasis>synchronizeIdentity</emphasis> and <emphasis>synchronizeRoles</emphasis> options are set to <emphasis>true</emphasis></para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">membershipModuleJNDIName</emphasis> - JNDI name of portal MembershipModule. This option is <emphasis>obligatory</emphasis>
- if <emphasis>synchronizeIdentity</emphasis> and <emphasis>synchronizeRoles</emphasis> options are set to <emphasis>true</emphasis></para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">userProfileModuleJNDIName</emphasis> - JNDI name of portal UserProfileModule. This option is <emphasis>obligatory</emphasis>
- if <emphasis>synchronizeIdentity</emphasis> option is set to <emphasis>true</emphasis></para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">synchronizeIdentity</emphasis> - if set to <emphasis>true</emphasis> module will check if
- successfully authenticated user exist in portal and if not it will try to create it. If user exists module will update its password
- to the one that was just validated.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">synchronizeRoles</emphasis> - if set to <emphasis>true</emphasis> module will iterate over all roles assigned to
- authenticated user and for each it will try to check if such role exists in portal and if not it will try to create it. This option is
- checked only if <emphasis>synchronizeIdentity</emphasis> is set to true;</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">additionalRole</emphasis> - module will add this role name to the group of principals assigned to the authenticated user.</para>
- </listitem>
- <listitem><para>
- <emphasis role="bold">defaultAssignedRole</emphasis> - if <emphasis>synchronizeIdentity</emphasis> is set to true, module will try to assign
- portal role with such name to the authenticated user. If such role doesn't exist in portal, module will try to create it.</para>
- </listitem>
- </itemizedlist>
- <note><title>Note</title><para>Example of usage in LDAP authentication can be found in <xref linkend="ldap.synchronizing"/>.</para></note>
- </para>
- </section>
- </section>
-</chapter>
- <chapter id="ldap">
-<!-- <chapterinfo>
- <author>
- <firstname>Boleslaw</firstname>
- <surname>Dawidowicz</surname>
- </author>
- </chapterinfo>-->
- <title>LDAP</title>
- <para>This chapter describes how to setup LDAP support in JBoss Portal</para>
- <note><title>Note</title>
- <para>To be able to fully understand this chapter you should also read <xref linkend="identity"/> and
- <xref linkend="authentication"/> before. </para></note>
- <section>
- <title>How to enable LDAP usage in JBoss Portal</title>
- <para>We'll describe here the simple steps that you will need to perform to enable LDAP support in JBoss Portal.
- For additional information you need to read more about configuration of identity and specific implementations of identity modules</para>
- <para>There are two ways to achieve this:</para>
- <itemizedlist>
- <listitem>
- <para>
- <emphasis role="bold">jboss-portal.sar/META-INF/jboss-service.xml</emphasis>
- in section:
- </para>
- <programlisting><![CDATA[
-<mbean
- code="org.jboss.portal.identity.IdentityServiceControllerImpl"
- name="portal:service=Module,type=IdentityServiceController"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends>portal:service=Hibernate</depends>
- <attribute name="JndiName">java:/portal/IdentityServiceController</attribute>
- <attribute name="RegisterMBeans">true</attribute>
- <attribute name="ConfigFile">conf/identity/identity-config.xml</attribute>
- <attribute name="DefaultConfigFile">conf/identity/standardidentity-config.xml</attribute>
-</mbean>]]></programlisting>
- <para>
- change
- <emphasis role="bold">identity-config.xml</emphasis>
- to
- <emphasis role="bold">ldap_identity-config.xml</emphasis>
- </para>
- </listitem>
- <listitem>
- <para>Swap the names or content of files in
- <emphasis role="bold">jboss-portal.sar/conf/identity/identity-config.xml</emphasis>
- and
- <emphasis role="bold">jboss-portal.sar/conf/identity/ldap_identity-config.xml</emphasis>
-
- </para>
- </listitem>
- </itemizedlist>
- <para>
- After doing one of the above changes you need to edit configuration file that you choose to
- use (identity-config.xml or ldap_identity-config.xml) and configure LDAP connection options in section:
- </para>
- <programlisting><![CDATA[
-<datasource>
- <name>LDAP</name>
- <config>
- <option>
- <name>host</name>
- <value>jboss.com</value>
- </option>
- <option>
- <name>port</name>
- <value>10389</value>
- </option>
- <option>
- <name>adminDN</name>
- <value>cn=Directory Manager</value>
- </option>
- <option>
- <name>adminPassword</name>
- <value>qpq123qpq</value>
- </option>
- </config>
-</datasource>]]></programlisting>
- <para>
- You also need to specify options for your LDAP tree (described in configuration documentation) like those:
- </para>
- <programlisting><![CDATA[
-<option-group>
- <group-name>common</group-name>
- <option>
- <name>userCtxDN</name>
- <value>ou=People,dc=portal26,dc=jboss,dc=com</value>
- </option>
- <option>
- <name>roleCtxDN</name>
- <value>ou=Roles,dc=portal26,dc=jboss,dc=com</value>
- </option>
-</option-group>]]></programlisting>
-
- <note><title>Note</title><para>
- Under <emphasis role="bold">PORTAL_SOURCES/identity/src/resources/example/</emphasis> you can find a sample ldif that
- you can use to populate LDAP server and quickly start playing with it.</para>
- </note>
-
- </section>
- <section>
- <title>Configuration of LDAP connection</title>
- <section>
- <title>Connection Pooling</title>
- <para>JBoss Portal uses <ulink url="http://java.sun.com/products/jndi/tutorial/ldap/connect/pool.html">connection pooling</ulink> provided by <ulink url="http://java.sun.com/products/jndi/">JNDI</ulink>, and is enabled by default. Use the following options to configure connection pooling settings:</para>
- <programlisting><![CDATA[
-<datasource>
- <name>LDAP</name>
- <config>
- ...
- <!-- com.sun.jndi.ldap.connect.pool -->
- <option>
- <name>pooling</name>
- <value>true</value>
- </option>
-
- <!-- com.sun.jndi.ldap.connect.pool.protocol -->
- <option>
- <name>poolingProtocol</name>
- <value>plain ssl</value>
- </option>
-
- <!-- com.sun.jndi.ldap.connect.pool.timeout -->
- <option>
- <name>poolingTimeout</name>
- <value>300000</value>
- </option>
-
- <!-- com.sun.jndi.ldap.connect.pool.debug -->
- <option>
- <name>pooling</name>
- <value> ... </value>
- </option>
-
- <!-- com.sun.jndi.ldap.connect.pool.initsize -->
- <option>
- <name>poolingInitsize</name>
- <value> ... </value>
- </option>
-
- <!-- com.sun.jndi.ldap.connect.pool.maxsize -->
- <option>
- <name>poolingMaxsize</name>
- <value> ... </value>
- </option>
-
- <!-- com.sun.jndi.ldap.connect.pool.prefsize -->
- <option>
- <name>poolingPrefsize</name>
- <value> ... </value>
- </option>
-
- ...
- </config>
-</datasource>]]></programlisting>
- <para>
- Remember, as it is described in the <ulink url="http://java.sun.com/products/jndi/tutorial/ldap/connect/config.html">JNDI documentation</ulink>, these options are system properties, not environment properties, and as such, they affect all connection pooling requests in the <trademark class="trade">Java runtime environment</trademark>.
- </para>
-
- </section>
- <section>
- <title>SSL</title>
- <para>The setup is very similar to the one described in LdapLoginModule <ulink url="http://www.jboss.org/wiki/Wiki.jsp?page=LdapLoginModule">wiki page</ulink></para>
- <para>You need to modify your identity configuration file and add "protocol"</para>
- <programlisting><![CDATA[
-<datasource>
- <name>LDAP</name>
- <config>
- ...
- <option>
- <name>protocol</name>
- <value>ssl</value>
- </option>
- ...
- </config>
-</datasource>]]></programlisting>
- <para>
- Then you need to have LDAP server certificate imported into your keystore. You can use following command:
- <programlisting>keytool -import -file ldapcert.der -keystore ldap.truststore</programlisting>
- </para>
- <para>
- Now you need to change the settings to use the alternative truststore. That can be done in the properties-service.xml in deploy directory:
- <programlisting><![CDATA[
-<attribute name="Properties">
- javax.net.ssl.trustStore=../some/path/to/ldap.truststore
- javax.net.ssl.trustStorePassword=somepw
-</attribute>]]></programlisting>
- </para>
- </section>
- <section>
- <title>ExternalContext</title>
- <para>Instead of configuring your own connection you can use JNDI context federation mechanism in JBoss Application Server. Configuration of
- ExternalContext is described in <ulink url="http://docs.jboss.com/jbossas/guides/j2eeguide/r2/en/html_single/#d0e6877">JBoss Application Server documentation</ulink></para>
- <para>When you have ExternalContext configured you can use it in JBoss Portal by providing proper JNDI name in the configuration:
- <programlisting><![CDATA[
-<datasource>
- <name>LDAP</name>
- <config>
- <option>
- <name>externalContextJndiName</name>
- <value>external/ldap/jboss</value>
- </option>
- </config>
-</datasource>]]></programlisting>
-<note><title>Note</title><para>When using "externalContextJndiName" you don't need to specify any other option for this datasource</para></note>
- </para>
- </section>
- </section>
- <section id="ldap.ldap_identity_modules">
- <title>LDAP Identity Modules</title>
- <para>JBoss Portal comes with base LDAP implementation of all identity modules.</para>
- <section>
- <title>Common settings</title>
- <para>For all modules you can set two config options:
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">jNDIName</emphasis> - JNDI name under which this module will be registered</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">connectionJNDIName</emphasis> - JNDI name under which LDAP datasource is registered </para>
- </listitem>
- </itemizedlist>
- <note><title>Note</title><para>Most configuration of LDAP identity modules is done in <emphasis>options</emphasis> section by adding module specific options
- in <emphasis>"common"</emphasis> option-group or in other module specific groups.</para></note>
- </para>
- </section>
- <section>
- <title>UserModule</title>
- <para>
- <table frame="all">
- <title>Comparision of UserModule implementations</title>
- <tgroup cols="3" align="left" colsep="1">
- <colspec colname="c1"/>
- <colspec colname="c2"/>
- <colspec colname="c3"/>
- <thead>
- <row>
- <entry align="center" morerows="1">Features</entry>
- <entry align="center" namest="c2" nameend="c3">UserModule</entry>
- </row>
- <row>
- <entry align="center">LDAPUserModuleImpl</entry>
- <entry align="center">LDAPExtUserModuleImpl</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>User creation</entry>
- <entry align="center">X</entry>
- <entry align="center">-</entry>
- </row>
- <row>
- <entry>User removal</entry>
- <entry align="center">X</entry>
- <entry align="center">-</entry>
- </row>
- <row>
- <entry>User search</entry>
- <entry align="center">Flat - one level scope</entry>
- <entry align="center">Flexible filter - sub tree scope</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </para>
- <section>
- <title>LDAPUserModuleImpl</title>
- <para>This is the base implementation of LDAP <emphasis>UserModule</emphasis>. It supports user creation, but will retrieve users and create them
- in strictly specified place in LDAP tree.</para>
- <para>To enable it in your configuration you should have:
- <programlisting><![CDATA[
-<module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>User</type>
- <implementation>LDAP</implementation>
- <config/>
-</module>]]></programlisting>
- </para>
- <para>org.jboss.portal.identity.ldap.LDAPUserModuleImpl configuration option-groups options:
- </para>
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">common</emphasis>:
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">userCtxDN</emphasis> - DN that will be used as context for user searches</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">uidAttributeID</emphasis> - attribute name under which user name is specified. Default value is "uid"</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">passwordAttributeID</emphasis> - attribute name under which user password is specified. Default value is "userPassword"</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">principalDNPrefix</emphasis> and <emphasis role="bold">principalDNSuffix</emphasis></para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">searchTimeLimit</emphasis> - The timeout in milliseconds for the user searches. Defaults to 10000 (10 seconds).</para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">userCreateAttibutes</emphasis>: This option-group defines a set of ldap attributes that will be set on user entry creation.
- Option name will be used as attribute name, and option values as attribute values. This enables to fulfill LDAP schema requirements.</para>
- </listitem>
- </itemizedlist>
-
- <para> Example configuration:
- <programlisting>
- <![CDATA[
-<option-group>
- <group-name>common</group-name>
- <option>
- <name>userCtxDN</name>
- <value>ou=People,o=portal,dc=my-domain,dc=com</value>
- </option>
- <option>
- <name>uidAttributeID</name>
- <value>uid</value>
- </option>
- <option>
- <name>passwordAttributeID</name>
- <value>userPassword</value>
- </option>
-</option-group>
-<option-group>
- <group-name>userCreateAttibutes</group-name>
- <option>
- <name>objectClass</name>
- <!--This objectclasses should work with Red Hat Directory-->
- <value>top</value>
- <value>person</value>
- <value>inetOrgPerson</value>
- </option>
- <!--Schema requires those to have initial value-->
- <option>
- <name>cn</name>
- <value>none</value>
- </option>
- <option>
- <name>sn</name>
- <value>none</value>
- </option>
-</option-group>]]></programlisting>
-
- </para>
- </section>
- <section>
- <title>LDAPExtUserModuleImpl</title>
- <para>Aim of this implementation is to give more flexibility for users retrieval. You can specify LDAP filter
- that will be used for searches. This module doesn't support user creation and removal</para>
- <para>To enable it in your configuration you should have:
- <programlisting><![CDATA[
-<module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>User</type>
- <implementation>LDAP</implementation>
- <class>org.jboss.portal.identity.ldap.LDAPExtUserModuleImpl</class>
- <config/>
-</module]]>
- </programlisting>
- </para>
- <para>org.jboss.portal.identity.ldap.LDAPExtUserModuleImpl configuration option-groups options:
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">common</emphasis>:
- <itemizedlist>
- <listitem>
- <para> <emphasis role="bold">userCtxDN</emphasis> - DN that will be used as context for user searches. More than one value can be specified.</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">userSearchFilter</emphasis> - ldap filter to search users with. {0} will be substitute with user name. Example filter can look like this:
- "(uid={0})". This substituion behavior comes from the standard <emphasis>DirContext.search(Name, String, Object, SearchControls cons)</emphasis> method</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">uidAttributeID</emphasis> - attribute name under which user name is specified. Default value is "uid"</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">searchTimeLimit</emphasis> - The timeout in milliseconds for the user searches. Defaults to 10000 (10 seconds).</para>
- </listitem>
- <!--<listitem>
- <emphasis role="bold">searchScope</emphasis> - Sets the search scope to one of the strings. The default is SUBTREE_SCOPE.
- <itemizedlist>
- <listitem>
- <emphasis role="bold">OBJECT_SCOPE</emphasis> - only search the named users context.
- </listitem>
- <listitem>
- <emphasis role="bold">ONELEVEL_SCOPE</emphasis> - search directly under the named users context.
- </listitem>
- <listitem>
- <emphasis role="bold">SUBTREE_SCOPE</emphasis> - If the users context is not a <emphasis>DirContext</emphasis>, search only the object.
- If the users context is a <emphasis>DirContext</emphasis>, search the subtree rooted at the named object, including the named object itself.
- </listitem>
- </itemizedlist>
- </listitem>-->
- </itemizedlist>
- </para>
- </listitem>
- </itemizedlist>
-
- </para>
- </section>
- </section>
- <section>
- <title>RoleModule</title>
- <para>
- <table frame="all">
- <title>Comparision of RoleModule implementations</title>
- <tgroup cols="3">
-
- <thead>
- <row>
- <entry align="center">Features</entry>
- <entry align="center">RoleModule</entry>
- </row>
- <row>
- <entry align="center">LDAPRoleModuleImpl</entry>
- <entry align="center">LDAPExtRoleModuleImpl</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>Role creation</entry>
- <entry align="center">X</entry>
- <entry align="center">-</entry>
- </row>
- <row>
- <entry>Role removal</entry>
- <entry align="center">X</entry>
- <entry align="center">-</entry>
- </row>
- <row>
- <entry>Role search</entry>
- <entry align="center">Flat - one level scope</entry>
- <entry align="center">Flexible filter - sub tree scope</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </para>
- <section>
- <title>LDAPRoleModuleImpl</title>
- <para>This is the base implementation of LDAP <emphasis>RoleModule</emphasis>. It supports user creation, but will retrieve roles and create them
- in strictly specified place in LDAP tree.</para>
- <para>To enable it in your configuration you should have:
- <programlisting><![CDATA[
-<module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>Role</type>
- <implementation>LDAP</implementation>
- <config/>
-</module>]]>
- </programlisting>
- </para>
- <para>org.jboss.portal.identity.ldap.LDAPRoleModuleImpl configuration option-groups options:
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">common</emphasis>:
- <itemizedlist>
- <listitem>
- <para><emphasis role="bold">roleCtxDN</emphasis> - DN that will be used as context for role searches.</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">ridAttributeID</emphasis> - attribute name under which role name is specified. Default value is "cn".</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">roleDisplayNameAttributeID</emphasis> - attribute name under which role display name is specified. Default value is "cn".</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">searchTimeLimit</emphasis> - The timeout in milliseconds for the roles searches. Defaults to 10000 (10 seconds).</para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>LDAPExtRoleModuleImpl</title>
- <para>Aim of this implementation is to give more flexibility for roles retrieval. You can specify LDAP filter
- that will be used for searches. This module doesn't support role creation and removal.</para>
- <para>This module doesn't support role creation and removal</para>
- <para>To enable it in your configuration you should have:</para>
- <programlisting><![CDATA[
-<module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>Role</type>
- <implementation>LDAP</implementation>
- <class>org.jboss.portal.identity.ldap.LDAPExtRoleModuleImpl</class>
- <config/>
-</module>]]>
- </programlisting>
-
- <para>org.jboss.portal.identity.ldap.LDAPExtRoleModuleImpl configuration option-groups options:
- </para>
- <itemizedlist>
- <listitem>
- <para> <emphasis role="bold">common</emphasis>:
- <itemizedlist>
- <listitem>
- <para> <emphasis role="bold">roleCtxDN</emphasis> - DN that will be used as context for role searches. More than one value can be specified.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">roleSearchFilter</emphasis> - ldap filter to search roles with. {0} will be substitute with role name. Example filter can look like this:
- "(cn={0})". This substituion behavior comes from the standard <emphasis>DirContext.search(Name, String, Object, SearchControls cons)</emphasis> method.</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">ridAttributeID</emphasis> - attribute name under which role name is specified. Default value is "cn".</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">roleDisplayNameAttributeID</emphasis> - attribute name under which role display name is specified. Default value is "cn".</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">searchTimeLimit</emphasis> - The timeout in milliseconds for the roles searches. Defaults to 10000 (10 seconds).</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">searchScope</emphasis> - Sets the search scope to one of the strings. The default is SUBTREE_SCOPE.
- <itemizedlist>
- <listitem>
- <para><emphasis role="bold">OBJECT_SCOPE</emphasis> - only search the named roles context.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">ONELEVEL_SCOPE</emphasis> - search directly under the named roles context.</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">SUBTREE_SCOPE</emphasis> - If the roles context is not a <emphasis>DirContext</emphasis>, search only the object.
- If the roles context is a <emphasis>DirContext</emphasis>, search the subtree rooted at the named object, including the named object itself.</para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- </itemizedlist>
-
-
- <note><title>Note</title><para>In <emphasis>UserModule</emphasis> there are two methods that handle offset/limit (pagination) behavior.
- <programlisting>
- <![CDATA[
-/** Get a range of users.*/
-Set findUsers(int offset, int limit) throws IdentityException, IllegalArgumentException;
-
-/** Get a range of users.*/
-Set findUsersFilteredByUserName(String filter, int offset, int limit)
- throws IdentityException, IllegalArgumentException;
- ]]>
- </programlisting>
- Pagination support is not widely implemented in LDAP servers. Because <emphasis>UserModule</emphasis>
- implementations rely on JNDI and are targetted to be LDAP server agnostic those methods aren't very effecient.
- As long as you don't rely on portal user management and use dedicated tools for user provisioning it
- shouldn't bother you. Otherwise you should consider extending the implementation and providing
- solution dedicated to your LDAP server.</para>
- </note>
- </section>
- </section>
- <section>
- <title>MembershipModule</title>
- <para>
- <table frame="all">
- <title>Comparision of MembershipModule implementations</title>
- <tgroup cols="3" align="left">
-
- <thead>
- <row>
- <entry align="center">Features</entry>
- <entry align="center">MembershipModule</entry>
- </row>
- <row>
- <entry align="center">LDAPStaticGroupMembershipModuleImpl</entry>
- <entry align="center">LDAPStaticRoleMembershipModuleImpl</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>Role assignment stored in LDAP role entry</entry>
- <entry align="center">X</entry>
- <entry align="center">-</entry>
- </row>
- <row>
- <entry>Role assignment stored in LDAP user entry</entry>
- <entry align="center">-</entry>
- <entry align="center">X</entry>
- </row>
- <row>
- <entry>User/Role relationship creation</entry>
- <entry align="center">X</entry>
- <entry align="center">X</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </para>
- <section>
- <title>LDAPStaticGroupMembershipModuleImpl</title>
- <para>This module support tree shape where role entries keep information about users that are their members.</para>
- <para>To enable it in your configuration you should have:
- <programlisting><![CDATA[
-<module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>Membership</type>
- <implementation>LDAP</implementation>
- <config/>
-</module>]]>
- </programlisting>
- </para>
- <para>org.jboss.portal.identity.ldap.LDAPStaticGroupMembershipModuleImpl configuration option-groups options:
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">common</emphasis>:
- <itemizedlist>
- <listitem>
- <para> <emphasis role="bold">membershipAttributeID</emphasis> - LDAP attribute that defines member users ids. This will be used to retrieved users from role entry.</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">membershipAttributeIsDN</emphasis> - defines if values of attribute defined in <emphasis>membershipAttributeID</emphasis> are fully qualified
- LDAP DNs.</para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>LDAPStaticRoleMembershipModuleImpl</title>
- <para>This module support tree shape where user entries keep information about roles that they belong to.</para>
- <para>To enable it in your configuration you should have:
- <programlisting><![CDATA[
-<module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>Membership</type>
- <implementation>LDAP</implementation>
- <class>org.jboss.portal.identity.ldap.LDAPStaticRoleMembershipModuleImpl</class>
- <config/>
-</module>]]>
- </programlisting>
- </para>
- <para>org.jboss.portal.identity.ldap.LDAPStaticRoleMembershipModuleImpl configuration option-groups options:
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">common</emphasis>:
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">membershipAttributeID</emphasis> - LDAP attribute that defines role ids that user belongs to. This will be used to retrieved roles
- from user entry.</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">membershipAttributeIsDN</emphasis> - defines if values of attribute defined in <emphasis>membershipAttributeID</emphasis> are fully qualified
- LDAP DNs.</para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- </section>
- <section>
- <title>UserProfileModule</title>
- <section>
- <title>LDAPUserProfileModuleImpl</title>
- <para>This is standard implementation that enables to retrieve user properties from atributes in LDAP entries.</para>
- <para>To enable it in your configuration you should have:
- <programlisting><![CDATA[
-<module>
- <type>UserProfile</type>
- <implementation>DELEGATING</implementation>
- <config>
- <option>
- <name>ldapModuleJNDIName</name>
- <value>java:/portal/LDAPUserProfileModule</value>
- </option>
- </config>
-</module>
-<module>
- <type>DBDelegateUserProfile</type>
- <implementation>DB</implementation>
- <config>
- <option>
- <name>randomSynchronizePassword</name>
- <value>true</value>
- </option>
- </config>
-</module>
-<module>
- <type>LDAPDelegateUserProfile</type>
- <implementation>LDAP</implementation>
- <config/>
-</module>]]>
- </programlisting>
- <note><title>Note</title><para>Using such configuration you will have LDAP MembershipModule along with DB MembershipModule and Delegating MembershipModule. Please read
- <xref linkend="identity.management_api"/> to see why this is important.</para>
- </note>
- </para>
- <para>org.jboss.portal.identity.ldap.LDAPUserModuleImpl configuration option-groups options:
- <itemizedlist>
- <listitem>
- <para><emphasis role="bold">common</emphasis>:
- <itemizedlist>
- <listitem>
- <para> <emphasis role="bold">profileConfigFile</emphasis> - file with user profile configuration. If this option is not set, and we use delegating UserProfileModule,
- profile configuration will be obtained from it.</para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- </section>
- </section>
- <section>
- <title>LDAP server tree shapes</title>
- <para>JBoss Portal supports full user/role management for simple LDAP tree shapes. Some more flexible
- trees can be supported by <emphasis>LdapExtUserModuleImpl</emphasis> and <emphasis>LdapExtRoleModuleImpl</emphasis>
- - but without user/role creation and removal capabilities.
- However if you have complex LDAP tree you should consider using
- <xref linkend="authentication.synchronizing_login_module"/> described in
- <xref linkend="authentication"/> along with dedicated tools for user
- provisioning provided with LDAP server.</para>
- <para>
- In following subsections we will describe two base LDAP tree shapes along with example LDIFs and portal
- identity modules configurations. Those two examples differ only by using different <emphasis>MembershipModule</emphasis>
- implementations and describe only tree shapes with supported user/role creation and removal capabilities.
- </para>
- <section>
- <title>Keeping users membership in role entries</title>
- <para>In this example, information about users/roles assignment is stored in roles entries using LDAP
- "<emphasis>member</emphasis>". Of course any other attribute that comes with schema can be used for this.</para>
- <para>Example tree shape in LDAP browser
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/ldap/tree1-1.png" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/ldap/tree1-2.png" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <section>
- <title>Example LDIF</title>
- <para>
- <programlisting><![CDATA[
-dn: dc=example,dc=com
-objectclass: top
-objectclass: dcObject
-objectclass: organization
-dc: example
-o: example
-
-dn: ou=People,dc=example,dc=com
-objectclass: top
-objectclass: organizationalUnit
-ou: People
-
-dn: uid=user,ou=People,dc=example,dc=com
-objectclass: top
-objectclass: inetOrgPerson
-objectclass: person
-uid: user
-cn: JBoss Portal user
-sn: user
-userPassword: user
-mail: email(a)email.com
-
-dn: uid=admin,ou=People,dc=example,dc=com
-objectclass: top
-objectclass: inetOrgPerson
-objectclass: person
-uid: admin
-cn: JBoss Portal admin
-sn: admin
-userPassword: admin
-mail: email(a)email.com
-
-dn: ou=Roles,dc=example,dc=com
-objectclass: top
-objectclass: organizationalUnit
-ou: Roles
-
-dn: cn=User,ou=Roles,dc=example,dc=com
-objectClass: top
-objectClass: groupOfNames
-cn: User
-description: the JBoss Portal user group
-member: uid=user,ou=People,dc=example,dc=com
-
-dn: cn=Admin,ou=Roles,dc=example,dc=com
-objectClass: top
-objectClass: groupOfNames
-cn: Echo
-description: the JBoss Portal admin group
-member: uid=admin,ou=People,dc=example,dc=com]]></programlisting>
- </para>
- </section>
- <section>
- <title>Example identity configuration</title>
- <para>
- <programlisting><![CDATA[
- <modules>
- <module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>User</type>
- <implementation>LDAP</implementation>
- <config/>
- </module>
- <module>
- <type>Role</type>
- <implementation>LDAP</implementation>
- <config/>
- </module>
- <module>
- <type>Membership</type>
- <implementation>LDAP</implementation>
- <config/>
- </module>
- <module>
- <type>UserProfile</type>
- <implementation>DELEGATING</implementation>
- <config>
- <option>
- <name>ldapModuleJNDIName</name>
- <value>java:/portal/LDAPUserProfileModule</value>
- </option>
- </config>
- </module>
- <module>
- <type>DBDelegateUserProfile</type>
- <implementation>DB</implementation>
- <config>
- <option>
- <name>randomSynchronizePassword</name>
- <value>true</value>
- </option>
- </config>
- </module>
- <module>
- <type>LDAPDelegateUserProfile</type>
- <implementation>LDAP</implementation>
- <config/>
- </module>
-</modules>
-
-<options>
- <option-group>
- <group-name>common</group-name>
- <option>
- <name>userCtxDN</name>
- <value>ou=People,dc=example,dc=com</value>
- </option>
- <option>
- <name>roleCtxDN</name>
- <value>ou=Roles,dc=example,dc=com</value>
- </option>
- </option-group>
- <option-group>
- <group-name>userCreateAttibutes</group-name>
- <option>
- <name>objectClass</name>
- <!--This objectclasses should work with Red Hat Directory-->
- <value>top</value>
- <value>person</value>
- <value>inetOrgPerson</value>
- </option>
- <!--Schema requires those to have initial value-->
- <option>
- <name>cn</name>
- <value>none</value>
- </option>
- <option>
- <name>sn</name>
- <value>none</value>
- </option>
- </option-group>
- <option-group>
- <group-name>roleCreateAttibutes</group-name>
- <!--Schema requires those to have initial value-->
- <option>
- <name>cn</name>
- <value>none</value>
- </option>
- <!--Some directory servers require this attribute to be valid DN-->
- <!--For safety reasons point to the admin user here-->
- <option>
- <name>member</name>
- <value>uid=admin,ou=People,dc=example,dc=com</value>
- </option>
- </option-group>
-</options>]]></programlisting>
- </para>
- </section>
-
- </section>
- <section>
- <title>Keeping users membership in user entries</title>
- <para>In this example, information about users/roles assignment is stored in user entries using LDAP
- "<emphasis>memberOf</emphasis>". Of course any other attribute that comes with schema can be used for this.</para>
- <para>Example tree shape in LDAP browser
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/ldap/tree2-3.png" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/ldap/tree2-4.png" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
- <section>
- <title>Example LDIF</title>
- <para>
- <programlisting><![CDATA[
-dn: dc=example,dc=com
-objectclass: top
-objectclass: dcObject
-objectclass: organization
-dc: example
-o: example
-
-dn: o=example2,dc=example,dc=com
-objectclass: top
-objectclass: organization
-o: example2
-
-dn: ou=People,o=example2,dc=example,dc=com
-objectclass: top
-objectclass: organizationalUnit
-ou: People
-
-dn: uid=admin,ou=People,o=example2,dc=example,dc=com
-objectclass: top
-objectclass: inetOrgPerson
-objectclass: inetUser
-uid: admin
-cn: JBoss Portal admin
-sn: admin
-userPassword: admin
-mail: email(a)email.com
-memberOf: cn=Admin,ou=Roles,o=example2,dc=example,dc=com
-
-dn: uid=user,ou=People,o=example2,dc=example,dc=com
-objectclass: top
-objectclass: inetOrgPerson
-objectclass: inetUser
-uid: user
-cn: JBoss Portal user
-sn: user
-userPassword: user
-mail: email(a)email.com
-memberOf: cn=User,ou=Roles,o=example2,dc=example,dc=com
-
-dn: ou=Roles,o=example2,dc=example,dc=com
-objectclass: top
-objectclass: organizationalUnit
-ou: Roles
-
-dn: cn=User,ou=Roles,o=example2,dc=example,dc=com
-objectClass: top
-objectClass: organizationalRole
-cn: User
-description: the JBoss Portal user group
-
-dn: cn=Admin,ou=Roles,o=example2,dc=example,dc=com
-objectClass: top
-objectClass: organizationalRole
-cn: Echo
-description: the JBoss Portal admin group]]></programlisting>
- </para>
- </section>
- <section>
- <title>Example identity configuration</title>
- <para>
- <programlisting><![CDATA[
- <modules>
- <module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>User</type>
- <implementation>LDAP</implementation>
- <config/>
- </module>
- <module>
- <type>Role</type>
- <implementation>LDAP</implementation>
- <config/>
- </module>
- <module>
- <type>Membership</type>
- <implementation>LDAP</implementation>
- <class>org.jboss.portal.identity.ldap.LDAPStaticRoleMembershipModuleImpl</class>
- <config/>
- </module>
- <module>
- <type>UserProfile</type>
- <implementation>DELEGATING</implementation>
- <config>
- <option>
- <name>ldapModuleJNDIName</name>
- <value>java:/portal/LDAPUserProfileModule</value>
- </option>
- </config>
- </module>
- <module>
- <type>DBDelegateUserProfile</type>
- <implementation>DB</implementation>
- <config>
- <option>
- <name>randomSynchronizePassword</name>
- <value>true</value>
- </option>
- </config>
- </module>
- <module>
- <type>LDAPDelegateUserProfile</type>
- <implementation>LDAP</implementation>
- <config/>
- </module>
-</modules>
-
-<options>
- <option-group>
- <group-name>common</group-name>
- <option>
- <name>userCtxDN</name>
- <value>ou=People,dc=example,dc=com</value>
- </option>
- <option>
- <name>roleCtxDN</name>
- <value>ou=Roles,dc=example,dc=com</value>
- </option>
- <option>
- <name>membershipAttributeID</name>
- <value>memberOf</value>
- </option>
- </option-group>
- <option-group>
- <group-name>userCreateAttibutes</group-name>
- <option>
- <name>objectClass</name>
- <!--This objectclasses should work with Red Hat Directory-->
- <value>top</value>
- <value>person</value>
- <value>inetOrgPerson</value>
- </option>
- <!--Schema requires those to have initial value-->
- <option>
- <name>cn</name>
- <value>none</value>
- </option>
- <option>
- <name>sn</name>
- <value>none</value>
- </option>
- </option-group>
- <option-group>
- <group-name>roleCreateAttibutes</group-name>
- <!--Schema requires those to have initial value-->
- <option>
- <name>cn</name>
- <value>none</value>
- </option>
- <!--Some directory servers require this attribute to be valid DN-->
- <!--For safety reasons point to the admin user here-->
- <option>
- <name>member</name>
- <value>uid=admin,ou=People,dc=example,dc=com</value>
- </option>
- </option-group>
-</options>]]></programlisting>
- </para>
- </section>
- </section>
- </section>
- <section id="ldap.synchronizing">
- <title>Synchronizing LDAP configuration</title>
- <para>
- Like it was described in previous section, you can meet some limitations in identity modules support for more
- complex LDAP tree shapes. To workaround this you can use identity synchronization on JAAS level. JBoss Portal comes with
- <xref linkend="authentication.synchronizing_login_module"/> that can be easily
- configured with other authentication solutions that support JAAS framework. Here we want to provide a simple
- example on how it can be integrated with
- <emphasis><ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=LdapExtLoginModule">LdapExtLoginModule</ulink>
- from <emphasis>JBossSX</emphasis> framework.</emphasis>
- </para>
- <para>
- First of all portal identity modules should be configured to work with portal database - default configuration.
- This is important as we will leverage them, and we want to synchronize users identity into default portal storage
- mechanism. So lets look at simple configuration that should take place in
- <emphasis>jboss-portal.sar/conf/login-config.xml</emphasis>
- <programlisting><![CDATA[
-<policy>
- <!-- For the JCR CMS -->
- <application-policy name="cms">
- <authentication>
- <login-module code="org.apache.jackrabbit.core.security.SimpleLoginModule"
- flag="required"/>
- </authentication>
- </application-policy>
-
- <application-policy name="portal">
- <authentication>
-
- <login-module code="org.jboss.security.auth.spi.LdapExtLoginModule" flag="required">
- <module-option name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory
- </module-option>
- <module-option name="java.naming.provider.url">ldap://example.com:10389/
- </module-option>
- <module-option name="java.naming.security.authentication">simple</module-option>
- <module-option name="bindDN">cn=Directory Manager</module-option>
- <module-option name="bindCredential">lolo</module-option>
- <module-option name="baseCtxDN">ou=People,dc=example,dc=com</module-option>
- <module-option name="baseFilter">(uid={0})</module-option>
- <module-option name="rolesCtxDN">ou=Roles,dc=example,dc=com</module-option>
- <module-option name="roleFilter">(member={1})</module-option>
- <module-option name="roleAttributeID">cn</module-option>
- <module-option name="roleRecursion">-1</module-option>
- <module-option name="searchTimeLimit">10000</module-option>
- <module-option name="searchScope">SUBTREE_SCOPE</module-option>
- <module-option name="allowEmptyPasswords">false</module-option>
- </login-module>
-
- <login-module code="org.jboss.portal.identity.auth.SynchronizingLoginModule"
- flag="optional">
- <module-option name="synchronizeIdentity">true</module-option>
- <module-option name="synchronizeRoles">true</module-option>
- <module-option name="additionalRole">Authenticated</module-option>
- <module-option name="defaultAssignedRole">User</module-option>
- <module-option name="userModuleJNDIName">java:/portal/UserModule</module-option>
- <module-option name="roleModuleJNDIName">java:/portal/RoleModule</module-option>
- <module-option name="membershipModuleJNDIName">java:/portal/MembershipModule
- </module-option>
- <module-option name="userProfileModuleJNDIName">java:/portal/UserProfileModule
- </module-option>
- </login-module>
-
- </authentication>
- </application-policy>
-</policy>]]></programlisting>
- </para>
- <para>
- Few things are important in this configuration:
- <itemizedlist>
- <listitem><para><emphasis>LdapExtLoginModule</emphasis> has <emphasis>flag="required"</emphasis> set
- which means that if this single <emphasis>LoginModule</emphasis> return <emphasis>fail</emphasis>
- from authentication request whole process will fail. <emphasis>SynchronizingLoginModule</emphasis>
- has <emphasis>flag="optional"</emphasis>. Such combination is critical as
- <emphasis>SynchronizingLoginModule</emphasis> always authenticates user sucessfully no matter what
- credentials were provided. You always must have at least one <emphasis>LoginModule</emphasis> that you
- will rely on.</para>
- </listitem>
- <listitem>
- <para><emphasis>SynchronizingLoginModule</emphasis> is always the <emphasis>last</emphasis> one in whole
- authentication chain. This is because in <emphasis>commit</emphasis> phase it will take users
- <emphasis>Subject</emphasis> and its <emphasis>Principals</emphasis> (roles) assigned by previous
- <emphasis>LoginModule</emphasis>s and try to synchronize them. Roles assigned to authenticated user by
- <emphasis>LoginModule</emphasis>s after it won't be handled.</para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>Supported LDAP servers</title>
- <para>LDAP servers support depends on few conditions. In most cases they differ in schema support - various objectClass
- objects are not present by default in server schema. Sometimes it can be workarounded by manually
- extending schema.</para>
- <para>
- Servers can be
- <itemizedlist>
- <listitem><para><emphasis>Supported</emphasis></para></listitem>
- <listitem><para><emphasis>Not Supported</emphasis></para></listitem>
- <listitem><para><emphasis>Experimental</emphasis> - implementation can work with such server but it's not well tested so shouldn't be considered for production.</para></listitem>
- </itemizedlist>
- </para>
- <table frame="all">
- <title>Support of identity modules with different LDAP servers</title>
- <tgroup cols="8" align="left" colsep="1">
- <colspec colname="c1"/>
- <colspec colname="c2"/>
- <colspec colname="c3"/>
- <colspec colname="c4"/>
- <colspec colname="c5"/>
- <colspec colname="c6"/>
- <colspec colname="c7"/>
- <colspec colname="c8"/>
- <thead>
- <row>
- <entry align="center" morerows="1">LDAP Server</entry>
- <entry align="center" namest="c2" nameend="c3">UserModule</entry>
- <entry align="center" namest="c4" nameend="c5">RoleModule</entry>
- <entry align="center" namest="c6" nameend="c7">MembershipModule</entry>
- <entry align="center">UserProfileModule</entry>
- </row>
- <row>
- <entry>LDAPUserModuleImpl</entry>
- <entry>LDAPExtUserModuleImpl</entry>
- <entry>LDAPRoleModuleImpl</entry>
- <entry>LDAPExtRoleModuleImpl</entry>
- <entry>LDAPStaticGroupMembershipModuleImpl</entry>
- <entry>LDAPStaticRoleMembershipModuleImpl</entry>
- <entry>LDAPUserProfileModuleImpl</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>Red Hat Directory Server</entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- </row>
- <row>
- <entry>OpenDS</entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Not Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- </row>
- <row>
- <entry>OpenLDAP</entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- <entry align="center"><emphasis>Not Supported</emphasis></entry>
- <entry align="center"><emphasis>Supported</emphasis></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </section>
-</chapter>
- <chapter id="sso">
-<!-- <chapterinfo>
- <author>
- <firstname>Boleslaw</firstname>
- <surname>Dawidowicz</surname>
- </author>
- <author>
- <firstname>Sohil</firstname>
- <surname>Shah</surname>
- </author>
- </chapterinfo>-->
- <title>Single Sign On</title>
- <para>This chapter describes how to setup SSO in JBoss Portal</para>
- <section>
- <title>Overview of SSO in portal</title>
- <para>Portal as an integration and aggregation platform provides some form of SSO by itself. When you log into
- the portal you gain access to many systems through portlets using a single identity. Still in many cases you
- need to integrate the portal infrastructure with other SSO enabled systems. There are many different Identity Management
- solutions on the market. In most cases each SSO framework provides its own way to plug into Java EE application. For custom configurations
- you need to have a good understanding of <xref linkend="identity"/> and <xref linkend="authentication"/> authentication mechanisms.</para>
- </section>
-
- <section>
- <title>Using an Apache Tomcat Valve</title>
- <para>JBoss Application Server embeds Apache Tomcat as the default servlet container. Tomcat provides a builtin SSO support
- using a valve. The Single Sign On Valve caches credentials on the server side, and then invisibly authenticate users when they
- reach different web applications. Credentials are stored in a host-wide session which means that SSO will be effective throughout the session.
- </para>
- <section>
- <title>Enabling the Apache Tomcat SSO Valve</title>
- <para>
- To enable SSO valve in Apache Tomcat you should uncomment the following line
- <programlisting><![CDATA[<Valve className=’org.apache.catalina.authenticator.SingleSignOn’/>]]></programlisting>
- in the <literal>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml</literal> file.
- More information can be found <ulink url="http://www.jboss.org/wiki/Wiki.jsp?page=SingleSignOn">here</ulink>.
- </para>
- </section>
- <section>
- <title>Example of usage</title>
- <para>
- Lets look a little bit closer and configure SSO between portal and other web application. As an example
- we'll use <emphasis>jmx-console</emphasis> web-app that comes with every JBoss Application Server installation.
- You can find more information on how to secure <emphasis>jmx-console</emphasis> in <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=SecureTheJmxConsole">JBoss AS wiki</ulink>.
- </para>
- <orderedlist>
- <listitem>
- <para>Take a clean install of <emphasis>JBoss Application Server</emphasis></para>
- </listitem>
- <listitem>
- <para>Edit <emphasis>$JBOSS_HOME/server/default/deploy/jmx-console.war/WEB-INF/web.xml</emphasis> file and make sure it contains following content:</para>
- <programlisting>
- <![CDATA[
-<security-constraint>
- <web-resource-collection>
- <web-resource-name>HtmlAdaptor</web-resource-name>
- <description>An example security config that only allows users with the
- role JBossAdmin to access the HTML JMX console web application
- </description>
- <url-pattern>/*</url-pattern>
- <http-method>GET</http-method>
- <http-method>POST</http-method>
- </web-resource-collection>
- <auth-constraint>
- <role-name>Admin</role-name>
- </auth-constraint>
-</security-constraint>
-
-<security-constraint>
- <web-resource-collection>
- <web-resource-name>Public</web-resource-name>
- <url-pattern>/public/*</url-pattern>
- <http-method>GET</http-method>
- <http-method>POST</http-method>
- </web-resource-collection>
-</security-constraint>
-
-<login-config>
- <auth-method>BASIC</auth-method>
- <realm-name>jmx-console</realm-name>
-</login-config>
-
-<security-role>
- <role-name>Admin</role-name>
-</security-role>]]>
- </programlisting>
- <para>This will secure <emphasis>jmx-console</emphasis> web application using BASIC browser authentication and restrict access for
- users with <emphasis>Admin</emphasis> role only.</para>
- </listitem>
- <listitem>
- <para>
- Edit <emphasis>$JBOSS_HOME/server/default/conf/props/jmx-console-roles.properties</emphasis> file and make it contain:
-
- <programlisting>
- <![CDATA[
-admin=JBossAdmin,HttpInvoker,Admin]]>
- </programlisting>
-
- This file is a simple identity store for this web application authentication. It will make user <emphasis>admin</emphasis> belongs to <emphasis>Admin</emphasis> role.
- </para>
- </listitem>
- <listitem>
- <para>Deploy JBoss Portal</para>
- </listitem>
- <listitem>
- <para>Run JBoss Application Server</para>
- </listitem>
- <listitem>
- <para>Now you can check that when you go to
- <itemizedlist>
- <listitem><para>
- <emphasis>http://localhost:8080/portal</emphasis></para>
- </listitem>
- <listitem>
- <para> <emphasis>http://localhost:8080/jmx-console</emphasis></para>
- </listitem>
- </itemizedlist>
- you need to authenticate separately into each of those web applications.
- </para>
- </listitem>
- <listitem>
- <para>Shutdown Application Server</para>
- </listitem>
- <listitem>
- <para>
- Uncomment the following line
- <programlisting><![CDATA[<Valve className=’org.apache.catalina.authenticator.SingleSignOn’/>]]></programlisting>
- in the <literal>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml</literal> file.
- More information can be found <ulink url="http://www.jboss.org/wiki/Wiki.jsp?page=SingleSignOn">here</ulink>.
- </para>
- <para>
- Run JBoss Application Server.
- </para>
- </listitem>
- </orderedlist>
- <para>
- Now if you log into portal as user <emphasis>admin</emphasis> with password <emphasis>admin</emphasis>, you won't
- be asked for credentials when accessing <emphasis>jmx-console</emphasis>. This should work in both directions.
- </para>
- <note><title>Note</title><para>Please note that in this example <emphasis>jmx-console</emphasis> uses <emphasis>BASIC</emphasis> authentication method.
- This means that user credentials are cached on the client side by browser and passed on each request. Once authenticated to clear
- authentication cache you may need to restart browser.</para></note>
- </section>
- </section>
- <section>
- <title>CAS - Central Authentication Service</title>
- <para>This Single Sign On plugin enables seamless integration between JBoss Portal and the CAS Single Sign On Framework.
- Details about CAS can be found <ulink url="http://www.ja-sig.org/products/cas/">here</ulink></para>
- <section>
- <title>Integration steps</title>
- <note><title>Note</title><para>The steps below assume that CAS server and JBoss Portal will be deployed on the same JBoss Application Server instance.
- CAS will be configured to leverage identity services exposed by JBoss Portal to perform authentication. Procedure may be
- slightly different for other deployment scenarios. Both JBoss Portal and CAS will need to be configured to authenticate against
- same database or LDAP server. Please see CAS documentation to learn how to setup it up against proper identity store.</para></note>
-<note><title>Note</title><para>Configuration below assumes that JBoss Application Server is HTTPS enabled and operates on standard ports: 80 (for HTTP) and 443 (for HTTPS).</para></note>
-
- <orderedlist>
- <listitem>
- <para>Install CAS server (v 3.0.7). This should be as simple as deploying single <emphasis>cas.war</emphasis> file.</para>
- </listitem>
- <listitem>
- <para> Copy <emphasis>portal-identity-lib.jar</emphasis> and <emphasis>portal-identity-sso-lib.jar</emphasis> files from
- <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/lib</emphasis> to
- <emphasis>$JBOSS_HOME/server/default/deploy/cas.war/WEB-INF/lib</emphasis>.</para>
- </listitem>
- <listitem>
- <para> Edit <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/portal-server.war/WEB-INF/context.xml</emphasis> file and enable proper Apache Tomcat Valve
- by uncommenting following lines:
- <programlisting>
- <![CDATA[
-<Valve className="org.jboss.portal.identity.sso.cas.CASAuthenticationValve"
- casLogin="https://localhost/cas/login"
- casValidate="https://localhost/cas/serviceValidate"
- casServerName="localhost"
- authType="FORM"
-/>
- ]]>
- </programlisting>
- Update valve options as follow:
- <itemizedlist>
- <listitem>
- <para> <emphasis>casLogin: </emphasis> URL of your CAS Authentication Server</para>
- </listitem>
- <listitem>
- <para> <emphasis>casValidate: </emphasis> URL of your CAS Authentication Server validation service</para>
- </listitem>
- <listitem>
- <para> <emphasis>casServerName:</emphasis> the hostname:port combination of your CAS Authentication Server</para>
- </listitem>
- </itemizedlist>
- <note><title>Note</title><para>CAS client requires to use SSL connection. To learn how to setup JBoss Application Server to use HTTPS see here</para></note>
- </para>
- </listitem>
- <listitem>
- <para> Copy <emphasis>casclient.jar</emphasis> into <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/lib</emphasis>.
- You can download this file from CAS homepage or from JBoss repository under <emphasis>http://repository.jboss.com/cas/3.0.7/lib/</emphasis>
- <note><title>Note</title><para>The CAS engine does not accept self-signed SSL certificates. This requirement is fine for production use where a production
- level SSL certificate is available. However, for testing purposes, this can get a little annoying. Hence, if you are having this issue,
- you can use <emphasis>casclient-lenient.jar</emphasis> instead.</para></note>
- </para>
- </listitem>
- <listitem>
- <para> Edit <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/META-INF/jboss-service.xml</emphasis> file and uncomment following lines:
- <programlisting>
- <![CDATA[
-<mbean
- code="org.jboss.portal.identity.sso.cas.CASAuthenticationService"
- name="portal:service=Module,type=CASAuthenticationService"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends>portal:service=Module,type=IdentityServiceController</depends>
- <attribute name="HavingRole"></attribute>
-</mbean>
- ]]>
- </programlisting>
- This will expose special service in JBoss Portal that can be leveraged by CAS AuthenticationHandler if the server is deployed on the same
- application server instance. This AuthenticationHandler will be enabled in next 2 steps.</para>
- </listitem>
- <listitem>
- <para> Edit <emphasis>$JBOSS_HOME/server/default/deploy/cas.war/WEB-INF/deployerConfigContext.xml</emphasis> and add following line in the
- <emphasis>authenticationHandlers</emphasis> section:
- <programlisting>
- <![CDATA[
-<bean class="org.jboss.portal.identity.sso.cas.CASAuthenticationHandler" />
- ]]>
- </programlisting>
- This can replace default <emphasis>SimpleTestUsernamePasswordAuthenticationHandler</emphasis> so whole part of this config file can look
- as follows:
-
- <programlisting>
- <![CDATA[<property name="authenticationHandlers">
- <list>
- <!--
- | This is the authentication handler that authenticates services by means of callback via SSL, thereby validating
- | a server side SSL certificate.
- +-->
- <bean
- class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler">
- <property
- name="httpClient"
- ref="httpClient" />
- </bean>
-
- <!--
- | This is the authentication handler declaration that every CAS deployer will need to change before deploying CAS
- | into production. The default SimpleTestUsernamePasswordAuthenticationHandler authenticates UsernamePasswordCredentials
- | where the username equals the password. You will need to replace this with an AuthenticationHandler that implements your
- | local authentication strategy. You might accomplish this by coding a new such handler and declaring
- | edu.someschool.its.cas.MySpecialHandler here, or you might use one of the handlers provided in the adaptors modules.
- +-->
- <bean class="org.jboss.portal.identity.sso.cas.CASAuthenticationHandler" />
- </list>
-</property>]]>
- </programlisting>
- </para>
- </listitem>
- </orderedlist>
-
- <para>
- To test the integration:
- <itemizedlist>
- <listitem><para>Go to your portal. Typically, http://localhost:8080/portal</para></listitem>
- <listitem><para>Click on the "Login" link on the main portal page</para></listitem>
- <listitem><para>This should bring up the CAS Authentication Server's login screen instead of the default JBoss Portal login screen</para></listitem>
- <listitem><para>Input your portal username and password. For built-in portal login try user:user or admin:admin</para></listitem>
- <listitem><para>If login is successful, you should be redirected back to the portal with the appropriate user logged in</para></listitem>
- </itemizedlist>
- </para>
-
- </section>
- </section>
- <section>
- <title><trademark class="trade">Java</trademark> Open Single Sign-On (JOSSO)</title>
- <para>JBoss Portal enables seamless integration with JOSSO server. More details on JOSSO can be found
- <ulink url="http://www.josso.org/">here</ulink></para>
- <note><title>Note</title><para>The steps below assume that JOSS server and JBoss Portal will be deployed on the same JBoss Application Server instance.
- JOSSO will be configured to leverage identity services exposed by JBoss Portal to perform authentication. Procedure may be
- slightly different for other deployment scenarios. Both JBoss Portal and JOSSO will need to be configured to authenticate against
- same database or LDAP server. Please see JOSSO documentation to learn how to setup it up against proper identity store.</para></note>
-<note><title>Note</title><para>Configuration below assumes that JOSSO is already installed and deployed in the JBoss Application Server. This involves adding proper jar files
- into the classpath and altering several configuration files (adding Apache Tomcat Valves, security realm and specific JOSSO configuration files).
- For JBoss setup please refer to JOSSO <ulink url="http://www.josso.org/jboss4-howto.html">documentation</ulink></para></note>
- <section>
- <title>Integration steps</title>
-
- <para>
- <orderedlist>
- <listitem>
- <para> Copy <emphasis>portal-identity-lib.jar</emphasis> and <emphasis>portal-identity-sso-lib.jar</emphasis> files from
- <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/lib</emphasis> to
- <emphasis>$JBOSS_HOME/server/default/deploy/josso.ear/josso.war/WEB-INF/lib</emphasis>.</para>
- </listitem>
- <listitem>
- <para> Edit <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/portal-server.war/WEB-INF/context.xml</emphasis> file and enable proper Apache Tomcat Valve
- by uncommenting following lines:
- <programlisting>
- <![CDATA[
-<Valve className="org.jboss.portal.identity.sso.josso.JOSSOLogoutValve"/>
- ]]>
-</programlisting></para>
- </listitem>
- <listitem>
- <para>Edit <emphasis>$JBOSS_HOME/server/default/config/josso-agent-config.xml</emphasis> and mapping for portal web application:
- <programlisting>
- <![CDATA[
-<partner-apps>
-
- ...
-
- <partner-app>
- <context>/portal</context>
- </partner-app>
-
- ...
-
- </partner-apps>
- ]]>
- </programlisting>
- Complete config file can look as follows:
- <programlisting>
- <![CDATA[
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<agent>
- <class>org.josso.jb4.agent.JBossCatalinaSSOAgent</class>
- <gatewayLoginUrl>http://localhost:8080/josso/signon/login.do</gatewayLoginUrl>
- <gatewayLogoutUrl>http://localhost:8080/josso/signon/logout.do</gatewayLogoutUrl>
- <service-locator>
- <class>org.josso.gateway.WebserviceGatewayServiceLocator</class>
- <endpoint>localhost:8080</endpoint>
- </service-locator>
- <partner-apps>
- <partner-app>
- <context>/partnerapp</context>
- </partner-app>
- <partner-app>
- <context>/portal</context>
- </partner-app>
- </partner-apps>
-</agent>
- ]]>
-</programlisting></para>
- </listitem>
- <listitem>
- <para> Edit <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/portal-server.war/login.jsp</emphasis> and
- <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/portal-server.war/erros.jsp</emphasis> and uncomment following line:
- <programlisting>
- <![CDATA[
-<%
- response.sendRedirect(request.getContextPath() + "/josso_login/");
-%>
- ]]>
- </programlisting>
- (make sure to remove java style comment '/* */' - not the xml one).</para>
- </listitem>
- <listitem>
- <para> Edit <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/META-INF/jboss-service.xml</emphasis> file and uncomment following lines:
- <programlisting>
- <![CDATA[
-<mbean
- code="org.jboss.portal.identity.sso.josso.JOSSOIdentityServiceImpl"
- name="portal:service=Module,type=JOSSOIdentityService"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends>portal:service=Module,type=IdentityServiceController</depends>
-</mbean>
- ]]>
- </programlisting>
- This will expose a special service in JBoss Portal that can be leveraged by JOSSO Credential and Identity Stores if the server is deployed on the same
- application server instance.</para>
- </listitem>
- <listitem>
- <para> Edit <emphasis>$JBOSS_HOME/server/default/deploy/josso.ear/josso.war/WEB-INF/classes/josso-gateway-config.xml</emphasis> and configure following elements:
- <itemizedlist>
- <listitem>
- <para> <emphasis>Credential Store: </emphasis>
- <programlisting>
- <![CDATA[
-<!-- Basic Authentication Scheme -->
-<authentication-scheme>
- <name>basic-authentication</name>
- <class>org.josso.auth.scheme.BindUsernamePasswordAuthScheme</class>
-
- <!-- ================================================= -->
- <!-- JBoss Portal Credential Store -->
- <!-- ================================================= -->
- <credential-store>
- <class>org.jboss.portal.identity.sso.josso.JOSSOIdentityStore</class>
- </credential-store>
-
-
- <!-- ================================================= -->
- <!-- Credential Store Key adapter -->
- <!-- ================================================= -->
- <credential-store-key-adapter>
- <class>org.josso.gateway.identity.service.store.SimpleIdentityStoreKeyAdapter</class>
- </credential-store-key-adapter>
-
-</authentication-scheme>
- ]]>
-</programlisting></para>
- </listitem>
- <listitem>
- <para> <emphasis>SSO Identity Store: </emphasis>
- <programlisting>
- <![CDATA[
-<sso-identity-manager>
-
- <class>org.josso.gateway.identity.service.SSOIdentityManagerImpl</class>
-
- <!-- ================================================= -->
- <!-- JBoss Portal Credential Store -->
- <!-- ================================================= -->
- <sso-identity-store>
- <class>org.jboss.portal.identity.sso.josso.JOSSOIdentityStore</class>
- </sso-identity-store>
-
- <!-- ================================================= -->
- <!-- Identity Store Key adapter -->
- <!-- ================================================= -->
- <sso-identity-store-key-adapter>
- <class>org.josso.gateway.identity.service.store.SimpleIdentityStoreKeyAdapter</class>
- </sso-identity-store-key-adapter>
-
-</sso-identity-manager>
- ]]>
-</programlisting></para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- </orderedlist>
- </para>
- <para>
- To test the integration:
- <itemizedlist>
- <listitem><para>Go to your portal. Typically, http://localhost:8080/portal</para></listitem>
- <listitem><para>Click on the "Login" link on the main portal page</para></listitem>
- <listitem><para>This should bring up the JOSSO login screen instead of the default JBoss Portal login screen</para></listitem>
- <listitem><para>Input your portal username and password. For built-in portal login try user:user or admin:admin</para></listitem>
- <listitem><para>If login is successful, you should be redirected back to the portal with the appropriate user logged in</para></listitem>
- </itemizedlist>
- </para>
- </section>
- </section>
-
-</chapter>
- <chapter id="cmsPortlet">
- <!--<chapterinfo>
- <author>
- <firstname>Roy</firstname>
- <surname>Russo</surname>
- </author>
- <author>
- <firstname>Thomas</firstname>
- <surname>Heute</surname>
- </author>
- </chapterinfo>-->
- <title>CMS Portlet</title>
- <para>JBoss Portal packages a Web Content Management System capable of serving and allowing
- administration of web content. This chapter describes the CMS Portlet which is responsible for
- serving resources requested, the following chapter describes the CMSAdmin Portlet and all
- administration functionality.</para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/cms/cms_ss_1.gif" align="center" valign="middle" scalefit="1"/>
- </imageobject>
-</mediaobject>
- <section>
- <title>Introduction</title>
- <para>The CMS Portlet displays content from the file store inside a portlet window, or, in the
- case of binary content, outside of the portlet window altogether.</para>
- </section>
- <section>
- <title>Features</title>
- <para>The CMSPortlet handles all requests for all content types.</para>
- <para>The methodology of serving content within the CMSPortlet, allows for some beneficial
- features, like:</para>
- <orderedlist>
-
- <listitem><para>Search-engine friendly URLs: http://domain/[portal]/content/company.html</para></listitem>
- <listitem><para>Serve binaries with simple urls independent of the portal:
- http://domain/content/products.pdf</para></listitem>
- <listitem><para>Deploy several instances of the CMSPortlet on any page and configure them to
- display different start pages.</para></listitem>
- <listitem><para>Localization support: CMSPortlet will display content based on the user request
- locale, or display content using the default locale setting.</para></listitem>
- </orderedlist>
- </section>
- <section id="configuration-cms_content">
- <title>CMS content</title>
- <para>Since 2.6 displaying CMS content in the portal is done using the new content integration
- feature. Each window of the portal can be configured to display CMS content directly instead of
- having to configure the CMS portlet as it used to be.
- </para>
- <section>
- <title>Configuring a window to display CMS content</title>
- <para>Showing CMS content in a portal window can be done in the deployment descriptor quite easily
- <programlisting><![CDATA[<window>
- <window-name>MyCMSWindow</window-name>
- <content>
- <content-type>cms</content-type>
- <content-uri>/default/index.html</content-uri>
- </content>
- <region>center</region>
- <height>1</height>
-</window>
-]]></programlisting>
- At the first display of the window, the content is initialized with the content uri value.
- When the user clicks on a link that navigates to another CMS file, the CMS file will be shown in the
- same window.
- </para>
- </section>
- </section>
- <section>
- <title>CMS Configuration</title>
- <section>
- <title>Display CMS content</title>
- <para>Since 2.6 displaying CMS content in the portal is done using the new content integration
- feature.
-
-
- The portal is also able to map urls content to the CMS through a specific window.
- The CMS portlet default page is defined as a preference and can be overridden like any
- other preference up to the user's preference level. The default CMS portlet displayed
- when you install JBoss Portal for the first time is describe in the following file:
- <emphasis>jboss-portal.sar/portal-core.war/WEB-INF/portlet.xml</emphasis>
- .
- </para>
- <programlisting><![CDATA[<portlet-preferences>
- <preference>
- <name>indexpage</name>
- <value>/default/index.html</value>
- </preference>
-</portlet-preferences>]]></programlisting>
- <para>
- The preference key is "indexpage". To change the default page, just make sure to create
- an HTML document using the CMS Admin portlet then change the value of "indexpage" to
- the corresponding path.
- </para>
- </section>
- <section>
- <title>Service Configuration</title>
- <section>
- <title>Tuning Apache Jackrabbit</title>
- <para>JBoss Portal uses Apache Jackrabbit as its Java Content Repository implementation.
- Configuration of the service descriptor, allows for changing many of the variables
- associated with the service.</para>
- <para>Here is the default configuration for the CMS repository found under
- <literal>portal-cms.sar/META-INF-INF/jboss-service.xml</literal>
- </para>
- <programlisting><![CDATA[...
-<attribute name="DoChecking">true</attribute>
-<attribute name="DefaultContentLocation">portal/cms/conf/default-content/default/</attribute>
-<attribute name="DefaultLocale">en</attribute>
-<attribute name="RepositoryName">PortalRepository</attribute>
-<attribute name="HomeDir">${jboss.server.data.dir}${/}portal${/}cms${/}conf</attribute>]]>
-...</programlisting>
- <para>Below is a list of items found in the service descriptor and their definitions. Only
- items commonly changed are covered here and it is recommended you do not change any others
- unless you are very brave.</para>
- <para>
- <itemizedlist>
- <listitem><para>
- <emphasis role="bold">DoChecking:</emphasis>
- Should the portal attempt to check for the
- existence of the repository configuration files and default content on startup?</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">DefaultContentLocation:</emphasis>
- Location of the default content used to
- pre-populate the repository.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">DefaultLocale:</emphasis>
- Two-letter abbreviation of the default
- locale the portal should use when fetching content for users. A complete ISO-639 list
- can be found
- <ulink url="http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt">here</ulink>
- .</para>
- </listitem>
- <listitem>
- <para> <emphasis role="bold">HomeDir:</emphasis>
- Location of configuration information for the
- repository when in 100% FileSystem store mode. Otherwise, its in the database.</para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>Changing the url under which the content should be accessible</title>
- <para>
- By default, the content will be accessible to a url like this: http://www.example.com/content/[...], if
- you need or prefer to change "content" to something else you will need to edit the following file:
- <literal>portal-cms.sar/META-INF-INF/jboss-service.xml</literal>
- and change the value of Prefix to something else. Please note that you cannot change it to "nothing", you
- need to provide a value.
- </para>
- <programlisting><![CDATA[...
-<mbean
- code="org.jboss.portal.core.cms.CMSObjectCommandFactory"
- name="portal:commandFactory=CMSObject"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.common.system.JBossServiceModelMBean">
- <xmbean/>
- <attribute name="Prefix">content</attribute>
- <attribute name="TargetWindowRef">default.default.CMSPortletWindow</attribute>
- <depends optional-attribute-name="Factory" proxy-type="attribute">
- portal:commandFactory=Delegating
- </depends>
- <depends optional-attribute-name="CMSService" proxy-type="attribute">
- portal:service=CMS
- </depends>
-</mbean>
-...]]>
- </programlisting>
- <itemizedlist>
- <listitem>
- <para><emphasis role="bold">Prefix:</emphasis>
- This is the context path prefix that will
- trigger the portal to render content. By default, navigating to a URL such as
- http://localhost:8080/[portal_context]/content/Test.PDF will trigger the portal to
- display the PDF isolated from the portal pages. The path following the
- <emphasis>Prefix</emphasis>
- has to be absolute when fetching content.</para>
- </listitem>
- </itemizedlist>
- </section>
- </section>
- <section id="configuration-cms">
- <title>Configuring the Content Store Location</title>
- <para>By default, the JBoss Portal CMS stores all node properties, references, and binary
- content in the database, using the portal datasource. The location of some of these items
- is configurable, and there are 3 options:
- <itemizedlist>
- <listitem>
- <para>
- <xref linkend="configuration-cms_fs"/>
- </para>
- </listitem>
- <listitem>
- <para>
- <xref linkend="configuration-cms_db"/>
- </para>
- </listitem>
- <listitem>
- <para>
- <xref linkend="configuration-cms_mixed"/>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <section id="configuration-cms_fs">
- <title>100% Filesystem Storage</title>
- <para>To enable 100% Filesystem storage, you must edit the file:
- <emphasis>jboss-portal.sar/portal-cms.sar/META-INF/jboss-service.xml</emphasis>
- . You will note that the file is set to use the HibernateStore
- and HibernatePersistenceManager classes, by default. To have the CMS use 100% file
- system storage, simply comment these blocks. Then, you should uncomment to use the
- LocalFileSystem and XMLPersistenceManager classes. Follow these steps to activate 100% FS storage:
- </para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- Comment out the following blocks (there are 3 in total):
- <programlisting><![CDATA[
-<!-- HibernateStore: uses RDBMS + Hibernate for storage -->
-<FileSystem class="org.jboss.portal.cms.hibernate.HibernateStore">
-...
-</FileSystem>
-]]></programlisting>
- And uncomment the blocks under them (there are 3 in total):
- <programlisting><![CDATA[
-<!-- LocalFileSystem: uses FileSystem for storage. -->
-<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
-...
-</FileSystem>]]></programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- Now comment out the following blocks (there are 2 in total):
- <programlisting><![CDATA[
-<!-- HibernatePersistentManager: uses RDBMS + Hibernate for storage -->
-<PersistenceManager class="org.jboss.portal.cms.hibernate.state.HibernatePersistenceManager">
-...
-</PersistenceManager>]]></programlisting>
- And uncomment the blocks under them (there are 2 in total):
- <programlisting><![CDATA[
-<!-- XMLPersistenceManager: uses FileSystem for storage -->
-<PersistenceManager class="org.apache.jackrabbit.core.state.xml.XMLPersistenceManager"/>
-]]></programlisting>
- </para>
- </listitem>
- </orderedlist>
- </para>
- <para>
- <warning><title>Caution</title><para>
- If you do any change at the workspaces configuration you will need to delete the file
- <emphasis>$JBOSS_HOME/server/xxx/data/portal/cms/conf/workspaces/default/workspace.xml</emphasis>
- before restarting JBoss or redeploying JBoss Portal. If you forget to do that, the changes
- won't affect the CMS.
- For the same reason, you also need to delete that file if you recompile JBoss Portal after
- changing the name of the datasource.
- Note that on a cluster environment, you need to remove that file (if it exists) on all the nodes.
- </para></warning>
- </para>
- </section>
- <section id="configuration-cms_db">
- <title>100% Database Storage</title>
- <para>This is the default configuration for the CMS store. Please view the original
- <emphasis>jboss-portal.sar/portal-cms.sar/META-INF/jboss-service.xml</emphasis>
- , for guidance on how to reset it.
- </para>
- </section>
- <section id="configuration-cms_mixed">
- <title>Mixed Storage</title>
- <para>Mixed storage consists of meta-data being stored in the DB and blobs being stored on the Filesystem.
- This is the recommended setting for those of you that serve large files or stream media content.</para>
- <para>
- Setting the repository this way is simple. Change every instance in the file
- <emphasis>jboss-portal.sar/portal-cms.sar/META-INF/jboss-service.xml</emphasis>
- , from:
- <programlisting><![CDATA[<param name="externalBLOBs" value="false"/>]]></programlisting>
- to:
- <programlisting><![CDATA[<param name="externalBLOBs" value="true"/>]]></programlisting>
- </para>
- <para>
- <warning><title>Caution</title><para>
- If you do any change at the workspaces configuration you will need to delete the file
- <emphasis>$JBOSS_HOME/server/xxx/data/portal/cms/conf/workspaces/default/workspace.xml</emphasis>
- before restarting JBoss or redeploying JBoss Portal. If you forget to do that, the changes
- won't affect the CMS.
- For the same reason, you also need to delete that file if you recompile JBoss Portal after
- changing the name of the datasource.
- Note that on a cluster environment, you need to remove that file (if it exists) on all the nodes.
- </para></warning>
- </para>
- </section>
- </section>
- </section>
- <!-- <section>
- <title>Portlet Preferences</title>
- <para>TODO</para>
- </section>-->
- <section>
- <title>Localization Support</title>
- <para>The CMS Portlet now serves content based on the user's locale setting. For example: if a
- user's locale is set to Spanish in his browser, and he requests URL:
- <emphasis>default/index.html</emphasis>
- , the CMSPortlet will first try and retrieve the
- Spanish version of that file. If a Spanish version is not found, it will then try and
- retrieve the default language version set for the CMSPortlet.
- </para>
- </section>
- <section>
- <title>CMS Service</title>
- <para>
- The CMS portlet calls a CMS service that can be reused in your own portlets.
- </para>
- <section>
- <title>CMS Interceptors</title>
- <para>
- Since JBoss Portal 2.4 you can add your own interceptor stack to the CMS service.
- The interceptors are called around each command (Get a file, write a file, create a folder...),
- this is a very easy way to customize some actions based on your needs.
- </para>
- <para>
- To create your own interceptor you just need to extend the
- <literal>org.jboss.portal.cms.CMSInterceptor</literal>
- class and provide the content of the
- <literal>invoke(JCRCommand)</literal>
- method. Do not forget to make a call
- to
- <literal>JCRCommand.invokeNext()</literal>
- or the command will never be executed.
- </para>
- <para>
- JBoss Portal relies on the interceptor mechanism to integrate its Fine Grained Security Service and
- the Publish/Approve Workflow Service
- </para>
- <para>
- To add or remove an interceptor, you just need to edit the following file:
- <literal>portal-cms-sar/META-INF/jboss-service.xml</literal>.
- It works the same way as the server interceptor, for each interceptor you need to define an MBean then add it
- to the cms interceptor stack. For example, if you have the 2 default interceptors, you should have the following
- lines in the jboss-service.xml file:
- <programlisting><![CDATA[<!-- ACL Security Interceptor -->
-<mbean code="org.jboss.portal.cms.impl.interceptors.ACLInterceptor"
- name="portal:service=Interceptor,type=Cms,name=ACL" xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean />
- <attribute name="JNDIName">
- java:/portal/cms/ACLInterceptor
- </attribute>
- <attribute name="CmsSessionFactory">
- java:/portal/cms/CMSSessionFactory
- </attribute>
- <attribute name="IdentitySessionFactory">
- java:/portal/IdentitySessionFactory
- </attribute>
- <attribute name="DefaultPolicy">
- <policy>
- <!-- permissions on the root cms node -->
- <criteria name="path" value="/">
- <permission name="cms" action="read">
- <role name="Anonymous" />
- </permission>
- <permission name="cms" action="write">
- <role name="User" />
- </permission>
- <permission name="cms" action="manage">
- <role name="Admin" />
- </permission>
- </criteria>
- <!-- permissions on the default cms node -->
- <criteria name="path" value="/default">
- <permission name="cms" action="read">
- <role name="Anonymous" />
- </permission>
- <permission name="cms" action="write">
- <role name="User" />
- </permission>
- <permission name="cms" action="manage">
- <role name="Admin" />
- </permission>
- </criteria>
- <!-- permissions on the private/protected node -->
- <criteria name="path" value="/default/private">
- <permission name="cms" action="manage">
- <role name="Admin" />
- </permission>
- </criteria>
- </policy>
- </attribute>
- <depends optional-attribute-name="AuthorizationManager"
- proxy-type="attribute">
- portal:service=AuthorizationManager,type=cms
- </depends>
- <depends>portal:service=Hibernate,type=CMS</depends>
- <depends>
- portal:service=Module,type=IdentityServiceController
- </depends>
-</mbean>
-
-<!-- Approval Workflow Interceptor -->
-<mbean
- code="org.jboss.portal.cms.impl.interceptors.ApprovalWorkflowInterceptor"
- name="portal:service=Interceptor,type=Cms,name=ApprovalWorkflow"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean />
- <attribute name="JNDIName">
- java:/portal/cms/ApprovalWorkflowInterceptor
- </attribute>
- <depends>portal:service=Hibernate,type=CMS</depends>
-</mbean>
-
-<!-- CMS Interceptor Registration -->
-<mbean
- code="org.jboss.portal.server.impl.invocation.JBossInterceptorStackFactory"
- name="portal:service=InterceptorStackFactory,type=Cms" xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean />
- <depends-list optional-attribute-name="InterceptorNames">
- <depends-list-element>
- portal:service=Interceptor,type=Cms,name=ACL
- </depends-list-element>
- <depends-list-element>
- portal:service=Interceptor,type=Cms,name=ApprovalWorkflow
- </depends-list-element>
- </depends-list>
-</mbean>
- ]]>
- </programlisting>
- The first two MBeans define the interceptors and the third MBean, define which interceptors to add to
- the CMS service.
- </para>
- <para>
- If you create your own interceptor <literal>org.example.myCMSInterceptor</literal>, the service descriptor file will look like:
- <programlisting><![CDATA[<mbean code="org.example.myCMSInterceptor"
- name="portal:service=Interceptor,type=Cms,name=MyName" xmbean-dd=""
- xmbean-code="org.jboss.portal.common.system.JBossServiceModelMBean">
- <xmbean />
-</mbean>
-
-<!-- ACL Security Interceptor -->
-<mbean code="org.jboss.portal.cms.impl.interceptors.ACLInterceptor"
- name="portal:service=Interceptor,type=Cms,name=ACL" xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean />
- <attribute name="JNDIName">
- java:/portal/cms/ACLInterceptor
- </attribute>
- <attribute name="CmsSessionFactory">
- java:/portal/cms/CMSSessionFactory
- </attribute>
- <attribute name="IdentitySessionFactory">
- java:/portal/IdentitySessionFactory
- </attribute>
- <attribute name="DefaultPolicy">
- <policy>
- <!-- permissions on the root cms node -->
- <criteria name="path" value="/">
- <permission name="cms" action="read">
- <role name="Anonymous" />
- </permission>
- <permission name="cms" action="write">
- <role name="User" />
- </permission>
- <permission name="cms" action="manage">
- <role name="Admin" />
- </permission>
- </criteria>
- <!-- permissions on the default cms node -->
- <criteria name="path" value="/default">
- <permission name="cms" action="read">
- <role name="Anonymous" />
- </permission>
- <permission name="cms" action="write">
- <role name="User" />
- </permission>
- <permission name="cms" action="manage">
- <role name="Admin" />
- </permission>
- </criteria>
- <!-- permissions on the private/protected node -->
- <criteria name="path" value="/default/private">
- <permission name="cms" action="manage">
- <role name="Admin" />
- </permission>
- </criteria>
- </policy>
- </attribute>
- <depends optional-attribute-name="AuthorizationManager"
- proxy-type="attribute">
- portal:service=AuthorizationManager,type=cms
- </depends>
- <depends>portal:service=Hibernate,type=CMS</depends>
- <depends>
- portal:service=Module,type=IdentityServiceController
- </depends>
-</mbean>
-
-<!-- Approval Workflow Interceptor -->
-<mbean
- code="org.jboss.portal.cms.impl.interceptors.ApprovalWorkflowInterceptor"
- name="portal:service=Interceptor,type=Cms,name=ApprovalWorkflow"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean />
- <attribute name="JNDIName">
- java:/portal/cms/ApprovalWorkflowInterceptor
- </attribute>
- <depends>portal:service=Hibernate,type=CMS</depends>
-</mbean>
-<mbean
- code="org.jboss.portal.server.impl.invocation.JBossInterceptorStackFactory"
- name="portal:service=InterceptorStackFactory,type=Cms" xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean />
- <depends-list optional-attribute-name="InterceptorNames">
- <depends-list-element>
- portal:service=Interceptor,type=Cms,name=ACL
- </depends-list-element>
- <depends-list-element>
- portal:service=Interceptor,type=Cms,name=ApprovalWorkflow
- </depends-list-element>
- </depends-list>
-</mbean>
-
-<!-- CMS Interceptor Registration -->
-<mbean
- code="org.jboss.portal.server.impl.invocation.JBossInterceptorStack"
- name="portal:service=InterceptorStack,type=Cms" xmbean-dd=""
- xmbean-code="org.jboss.portal.common.system.JBossServiceModelMBean">
- <xmbean />
- <depends-list optional-attribute-name="InterceptorNames">
- <depends-list-element>
- portal:service=Interceptor,type=Cms,name=ACL
- </depends-list-element>
- <depends-list-element>
- portal:service=Interceptor,type=Cms,name=ApprovalWorkflow
- </depends-list-element>
- <depends-list-element>
- portal:service=Interceptor,type=Cms,name=MyName
- </depends-list-element>
- </depends-list>
-</mbean>
-]]></programlisting>
- </para>
- <note>
- <para>
- The interceptor order is important !
- </para>
- </note>
- <para>
- To check that the interceptors have been correctly added, you can check the JMX console, by going to:
- <literal>http://localhost.localdomain:8080/jmx-console/HtmlAdaptor?action=inspectM...</literal>
- You should notice all the interceptors in the attribute "interceptors".
- </para>
- </section>
- </section>
-</chapter>
- <chapter id="workflow">
- <!-- <chapterinfo>
- <author>
- <firstname>Sohil</firstname>
- <surname>Shah</surname>
- <email>sshah @ redhat dot com</email>
- </author>
- </chapterinfo>-->
- <title>Portal Workflow</title>
- <para>
- JBoss Portal packages a Workflow Service based on jBPM. This service provides you with the jBPM services that your
- portal can use to build out the end-user/application workflows that should meet your portal's requirements.
- </para>
- <section>
- <title>jBPM Workflow Engine Integration</title>
- <para>
- The jBPM Workflow service is packaged as an mbean and takes care of all the low-level jBPM related functions.
- The configuration is found in <filename>portal-workflow.sar/META-INF/jboss-service.xml</filename>.
- </para>
- </section>
- <section>
- <title>CMS Publish/Approve Workflow Service</title>
- <para>
- The CMS Publish/Approval Workflow feature is turned on by default, so that every file that is created or
- updated needs to go through an <emphasis role="bold">approval process</emphasis> before it can be published to
- go live. The current implementation creates a pending queue for managers. The managers can then either approve
- or reject the publishing of the document in question.
- </para>
- <section>
- <title>How to activate this feature?</title>
- <para>
- The CMS Publish/Approval Workflow feature can be activated by uncommenting the
- <literal>ApprovePublishWorkflow</literal> attribute of the <literal>portal:service=CMS</literal> mbean in
- <filename>portal-cms.sar/META-INF/jboss-service.xml</filename>:
- <programlisting><![CDATA[
-<mbean
- code="@cms.service.code@"
- name="portal:service=CMS"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
-
- ...
-
- <!-- Add this to activate publish/approval workflow integration -->
- <!-- <depends optional-attribute-name="ApprovePublishWorkflow" proxy-type="attribute">portal:service=ApprovePublish,type=Workflow</depends> -->
-
- ...
-</mbean>]]></programlisting>
- </para>
- </section>
- <section>
- <title>How to configure this feature?</title>
- <para>
- The workflow service can be configured by editing the <literal>portal:service=ApprovePublish,type=Workflow</literal>
- mbean found in <filename>portal-cms.sar/META-INF/jboss-service.xml</filename>.
- <programlisting>
- <![CDATA[
-<!-- ApprovePublish workflow service -->
- <mbean
- code="org.jboss.portal.cms.workflow.ApprovePublishImpl"
- name="portal:service=ApprovePublish,type=Workflow"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="WorkflowService" proxy-type="attribute">
- portal:service=Workflow,type=WorkflowService
- </depends>
- <depends optional-attribute-name="IdentityServiceController" proxy-type="attribute">
- portal:service=Module,type=IdentityServiceController
- </depends>
- <!-- JBPM process definition -->
- <attribute name="Process">
- <!-- cms approval workflow -->
- <process-definition name="approval_workflow">
- <start-state>
- <transition to="request_approval"/>
- </start-state>
- <task-node name="request_approval" signal="first">
- <task name="approve_publish">
- <assignment class="org.jboss.portal.cms.workflow.PublishAssignmentHandler"/>
- <event type="task-start">
- <action class="org.jboss.portal.cms.workflow.FinalizePublish"/>
- </event>
- <exception-handler>
- <action class="org.jboss.portal.cms.workflow.TaskExceptionHandler"/>
- </exception-handler>
- </task>
- <transition name="approval" to="end"/>
- <transition name="rejection" to="end"/>
- </task-node>
- <end-state name="end"/>
- </process-definition>
- </attribute>
- <!--
- overwrite = false creates the process first time if does not exist, for
- subsequent server restarts, this process definition remains in tact
-
- overwrite = true creates the process first time if does not exist,
- for subsequent server restarts, it creates a new version of the process definition
- which will be used for processes created from then onwards. Old processes created
- for an older version of the definition remain in tact and use their corresponding
- process definition.
-
- Typically use overwrite=false and overwrite=true only when a new process definition
- related to this workflow needs to be deployed
- -->
- <attribute name="Overwrite">false</attribute>
- <!--
- A comma separated list of portal roles that are designated
- to act as workflow managers. They are allowed to
- approve/reject content publish requests
- -->
- <attribute name="ManagerRoles">Admin</attribute>
- <attribute name="JNDIName">java:portal/ApprovePublishWorkflow</attribute>
- </mbean>]]></programlisting>
- </para>
- <para>
- Of note in this configuration are the <literal>Process</literal> and <literal>ManagerRoles</literal>
- attributes. The <literal>Process</literal> attribute is used to provide the jBPM process definition to be
- followed by the workflow service during the approval process. This follows the standard jBPM syntax
- for process definition. <literal>ManagerRoles</literal>, on the other hand, is a comma-delimited list of
- user roles that are being marked as "managers" who can approve the publication of CMS documents.
- </para>
- </section>
- </section>
-</chapter>
- <chapter id="navtabs">
- <!--<chapterinfo>
- <author>
- <firstname>Roy</firstname>
- <surname>Russo</surname>
- </author>
- <author>
- <firstname>Thomas</firstname>
- <surname>Heute</surname>
- </author>
- </chapterinfo>-->
- <title>Navigation Tabs</title>
- <para>The navigation tabs allow users to navigate the portal pages. This section describes some of the functionality
- available in configuring them.
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/navtabs/navtabs_ss.gif" align="center" valign="middle"/>
- </imageobject>
- </mediaobject>
- </para>
- <section>
- <title>Explicit ordering of tabs</title>
- <para>Explicit ordering of the tab display, is accomplished via page properties that are defined in your
- <emphasis>*-object.xml</emphasis>
- (
- <xref linkend="desc_objectxml"/>
- ). Ordering is accomplished using the
- <emphasis>order</emphasis>
- tag at the page level as a page property.
- <programlisting><![CDATA[
-<page>
- <page-name>default</page-name>
- <properties>
- <property>
- <name>order</name>
- <value>1</value>
- </property>
- </properties>
- ...
-</page>]]></programlisting>
- </para>
- </section>
- <section>
- <title>Translating tab labels</title>
- <para>Labels on tabs can be defined in multiple languages. Two different ways can be used, the first one consist at
- defining several display name for page objects, the second one consists of defining a resource bundle where to find
- the localized display-name. Both methods have advantages and drawbacks.</para>
- <section>
- <title>Method one: Multiple <literal>display-name</literal></title>
- <para>In the <filename>*-object.xml</filename> descriptor under the <literal>page</literal> element, it is possible
- to define a display-name per locale. Here is an example:
- <programlisting><![CDATA[
-<page>
- <page-name>News</page-name>
- <display-name xml:lang="en">News</display-name>
- <display-name xml:lang="it">Novita'</display-name>
- <display-name xml:lang="es">Noticias</display-name>
- <display-name xml:lang="fr">Actualités</display-name>
- ...
-</page>
- ]]></programlisting>
- Here we defined a display name for four different languages. The advantage of this method is that it is simple and the
- display name is kept along the metadata. The drawback of this method is that if you may end up with different places
- to keep your localized data. If you are using resource bundles for other elements, the second method might be simpler
- when you add new supported languages.
- </para>
- </section>
- <section>
- <title>Defining a resource bundle and supported locales</title>
- <para>If you are already using resource bundles for localization you may prefer to point to those files. To do so you
- can define the name of your ressource bundle. The files should be in the classloader of the war containing the <filename>*-object.xml</filename>
- where you define them, meaning in the same war file.</para>
- <para>Here is an example:
- <programlisting><![CDATA[
-<page>
- <page-name>Weather</page-name>
- <supported-locale>fr</supported-locale>
- <supported-locale>en</supported-locale>
- ...
-</page>
- ]]></programlisting>
- With one or the other method, accessing the portal will now display the tab names with the preferred locale if a localized
- value exists.
- </para>
- <warning><para>If you change the values in the descriptor (method 1) or in the resource bundles (method 2) you need to use
- the <literal><if-exists>overwrite</if-exists></literal> so that the values are updated</para></warning>
- </section>
- </section>
-</chapter>
- <chapter id="themeandlayouts">
- <!-- <chapterinfo>
- <author>
- <firstname>Martin</firstname>
- <surname>Holzner</surname>
- </author>
- <author>
- <firstname>Mark</firstname>
- <surname>Fernandes</surname>
- </author>
- <author>
- <firstname>Thomas</firstname>
- <surname>Heute</surname>
- </author>
- </chapterinfo>-->
- <title>Layouts and Themes</title>
- <section>
- <title>Overview</title>
- <para>Portals usually render the markup fragments of several portlets, and aggregate these
- fragments into one page that ultimately gets sent back as response. Each portlet on that
- page will be decorated by the portal to limit the real estate the portlet has on the page,
- but also to allow the portal to inject extra functionality on a per portlet basis. Classic
- examples of this injection are the maximize, minimize and mode change links that will
- appear in the portlet window , together with the title.
- </para>
- <para>Layouts and themes allow to manipulate the look and feel of the portal. Layouts are
- responsible to render markup that will wrap the markup fragments produced by the individual
- portlets. Themes, on the other hand, are responsible to style and enhance this markup.
- </para>
- <para>In JBoss Portal, layouts are implemented as a JSP or a Servlet. Themes are implemented using CSS Style sheets, <trademark class="trade">JavaScript</trademark> and images. The binding element between layouts and themes are the class and id attributes of the rendered markup.
- </para>
- <para>JBoss Portal has the concept of regions on a page. When a page is defined, and portlet
- windows are assigned to the page, the region, and order inside the region, has to be
- specified as well. For portal layouts this has significant meaning. It defines the top most
- markup container that can wrap portlet content (other then the static markup in the JSP
- itself). In other words: from a layout perspective all portlets of a page are assigned to
- one or more regions. Each region can contain one or more portlets. To render the page
- content to return from a portal request, the portal has to render the layout JSP, and for
- each region, all the portlets in the region.
- </para>
- <para>Since the markup around each region, and around each portlet inside that region, is
- effectively the same for all the pages of a portal, it makes sense to encapsulate it in its
- own entity.
- </para>
- <para>To implement this encapsulation there are several ways:</para>
- <itemizedlist>
-
- <listitem><para>JSP pages that get included from the layout JSP for each region/portlet</para></listitem>
- <listitem><para>a taglib that allows to place region, window, and decoration tags into the layout JSP</para>
- </listitem>
- <listitem><para>a taglib that uses a pluggable API to delegate the markup generation to a set of classes</para>
- </listitem>
- </itemizedlist>
-
- <para>
- In JBoss Portal you can currently see two out of these approaches, namely
- the first and the last. Examples for the first can be found in the portal-core.war,
- implemented by the nodesk and phalanx layouts. Examples for the third approach can be found
- in the same war, implemented by the industrial and Nphalanx layout. What encapsulates the
- markup generation for each region, window, and portlet decoration in this last approach is
- what's called the RenderSet.
- </para>
- <para>The RenderSet consist of four interfaces that correspond with the four markup
- containers that wrap the markup fragments of one of more portlets:
- </para>
- <itemizedlist>
-
- <listitem><para>Region</para></listitem>
- <listitem><para>Window</para></listitem>
- <listitem><para>Decoration</para></listitem>
- <listitem><para>Portlet Content</para></listitem>
- </itemizedlist>
-
- <para>While we want to leave it open to you to decide which way to implement your layouts and
- themes, we strongly believe that the last approach is superior, and allows for far more
- flexibility, and clearer separation of duties between portal developers and web designers.
- </para>
- <!--
- <para>Portal layouts also have the concept of a layout strategy. The layout strategy is a
- pluggable API, and lets the layout developer have a last say about the content to be
- rendered. The strategy is called right after the portal has determined what needs to be
- rendered as part of the current request. So the strategy is invoked right between the point
- where the portal knows what needs to be done, and before the actual work is initiated. The
- strategy gets all the details about what is going to happen, and it can take measures to
- influence those details.
- <itemizedlist>
- <para>Some simple examples of those measures are:</para>
- <listitem>ommit one of the portlets from being rendered</listitem>
- <listitem>change the portlet mode or window state of a portlet before it gets rendered</listitem>
- <listitem>change the layout to be used for this request</listitem>
- <listitem>...and many more</listitem>
- </itemizedlist>
- </para>
- -->
- <para>The last topic to introduce in this overview is the one of portal themes. A theme is a
- collection of web design artifacts. It defines a set of CSS, JavaScript and image files
- that together decide about the look and feel of the portal page. The theme can take a wide
- spectrum of control over the look and feel. It can limit itself to decide fonts and colors,
- or it can take over a lot more and decide the placement (location) of portlets and much
- more.
- </para>
- </section>
- <section>
- <title>Header</title>
- <section>
- <title>Overview</title>
- <para>The default header is divided into two parts, links to pages displayed as tabs and links
- to navigate between portals and dahsboards as well as loggin in and out. Those two parts are
- included into the template thanks to the layout as defined in <xref linkend="layouts"/>.
- In fact, the region named, <literal>dashboardnav</literal> will include the navigation links,
- while the region named <literal>navigation</literal> will include the navigation tabs.
- It is then easy to hide one and/or the other by removing the corresponding inclusion in the
- layout.
- </para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/portal-header.gif" scalefit="1"/>
- </imageobject>
- </mediaobject>
- <para>Screenshot of the header with the 'renaissance' theme</para>
-
- <note><title>Note</title><para>Here, we use split content from rendering by using a CSS style sheet, it allows us to change the
- display by switching the CSS without affecting the content. THe Maple theme will display the links
- on the left side with a different font for example. THis is up to you to choose or not this approach</para>
- </note>
- <para>To customize the header there are several options detailed after.
- <itemizedlist>
- <listitem><para>The first option would simply require to modify
- the theme CSS, by doing this you could change the fonts, the way tabs are rendered, colors and many
- other things but not change the content.</para></listitem>
- <listitem><para>The second option is to modify the provided JSP files, <literal>header.jsp</literal> and
- <literal>tabs.jsp</literal>. It gives you more flexibility than the previous solution on modifying
- the content. Links to legacy application could easily be added, URLs could be arranged differently, the CSS
- approach could be replaced by good old HTML, CSS style names could be changed... The drawback of
- this method compare to the next one is the limitation in what is accessible from the JSP.</para></listitem>
- <!-- listitem>The third option is the most flexible and let you inject whatever you want, it consists in
- replacing the default <literal>PageCustomizerInterceptor</literal> by your own.</listitem-->
- </itemizedlist>
- </para>
- <section>
- <title>Writing his own <trademark class="trade">JSP</trademark> pages</title>
- <para>The content of those two parts are displayed thanks to two different <trademark class="trade">JSP</trademark> pages. By default
- you would find those pages in the directory <literal>portal-core.war/WEB-INF/jsp/header/</literal>.
- The file <literal>header.jsp</literal> is used to display the links that are displayed on the upper
- right of the default theme. The file <literal>tabs.jsp</literal> is used to display the pages tabs
- appearing on the left.
- </para>
- <para> Again, you have several choices, either to edit the included JSP files directly or create your own,
- store them in a web application then edit the following file: <literal>jboss-portal.sar/META-INF/jboss-service.xml</literal>.
- The interesting part in that file is the following:
- <programlisting><![CDATA[<mbean
- code="org.jboss.portal.core.aspects.controller.PageCustomizerInterceptor"
- name="portal:service=Interceptor,type=Command,name=PageCustomizer"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <attribute name="TargetContextPath">/portal-core</attribute>
- <attribute name="HeaderPath">/WEB-INF/jsp/header/header.jsp</attribute>
- <attribute name="TabsPath">/WEB-INF/jsp/header/tabs.jsp</attribute>
- <depends
- optional-attribute-name="PortalAuthorizationManagerFactory"
- proxy-type="attribute">portal:service=PortalAuthorizationManagerFactory</depends>
-</mbean>]]></programlisting>
- The three attributes are:
- <itemizedlist>
- <listitem><para>TargetContextPath: Defines the web application context where the JSP files are located</para></listitem>
- <listitem><para>HeaderPath: Defines the location (in the web application previously defined) of the JSP in charge of writing the header links</para></listitem>
- <listitem><para>TabsPath: Defines the location (in the web application previously defined) of the JSP in charge of writing the pages links (note that it doesn't have to be renderer as tabs)</para></listitem>
- </itemizedlist>
- </para>
- <para>Writing the header JSP</para>
- <para>A couple of request attributes are set so that they can be used by the JSP, here is the list of attributes and their meaning:
- <itemizedlist>
- <listitem><para><literal>org.jboss.portal.header.USER</literal>: A <literal>org.jboss.portal.identity.User</literal> object of the logged-in user, null if the user is not logged-in.</para></listitem>
- <listitem><para><literal>org.jboss.portal.header.LOGIN_URL</literal>: URL to logging-in.</para></listitem>
- <listitem><para><literal>org.jboss.portal.header.DASHBOARD_URL</literal>: URL to the dashboard, null if the user is already on the dashboard, null if the user is on the default portal already.</para></listitem>
- <listitem><para><literal>org.jboss.portal.header.DEFAULT_PORTAL_URL</literal>: URL to the default page of the portal named 'default', null if the user is on the default portal already.</para></listitem>
- <listitem><para><literal>org.jboss.portal.header.ADMIN_PORTAL_URL</literal>: URL to the default page of the admin portal (named 'admin'), null if the user is on the admin portal already.</para></listitem>
- <listitem><para><literal>org.jboss.portal.header.EDIT_DASHBOARD_URL</literal>: URL to the page content editor of the dashboard, set only if the user is on the dashboard, null otherwise.</para></listitem>
- <listitem><para><literal>org.jboss.portal.header.COPY_TO_DASHBOARD_URL</literal>: URL to copy a page from a portal to the personal dashboard, null if the user is on the dashboard.</para></listitem>
- <listitem><para><literal>org.jboss.portal.header.SIGN_OUT_URL</literal>: URL to log out the portal.</para></listitem>
- </itemizedlist>
- Every attribute that is an URL attribute is an object implementing the <emphasis>org.jboss.portal.api.PortalURL</emphasis> interface.
- Therefore it is possible to generate the URL using the <emphasis>toString()</emphasis> method and change various things related
- to the URL.
- With that in hand, if someone just wanted to display the logged-in username and a link to log out, he could write:
- <programlisting><![CDATA[<%@ page import="org.jboss.portal.identity.User" %>
-
-<%
- User user = (User) request.getAttribute("org.jboss.portal.header.USER");
- PortalURL signOutURL = (PortalURL)request.getAttribute("org.jboss.portal.header.SIGN_OUT_URL");
- PortalURL loginURL = (PortalURL)request.getAttribute("org.jboss.portal.header.LOGIN_URL");
-
-
- if (user == null)
- {
-%>
- <a href="<%= loginURL %>">Login</a>
-<%
- }
- else
- {
-%>
-Logged in as: <%= user.getUserName() %>
-<br/>
-<a href="<%= signOutURL %>">Logout</a>
-<%
- }
-%>]]></programlisting>
- </para>
- <para>Writing the tabs JSP</para>
- <para>A couple of request attributes are set so that they can be used by the JSP, here is the list of attributes and their meaning:
- <itemizedlist>
- <listitem><para><literal>org.jboss.portal.api.PORTAL_NODE</literal>: A <literal>org.jboss.portal.api.node.PortalNode</literal> object of the root Portal node. Authorized children and siblings
- of this object are accessible.</para></listitem>
- <listitem><para><literal>org.jboss.portal.api.PORTAL_RUNTIME_CONTEXT</literal>: A <literal>org.jboss.portal.api.PortalRuntimeContext</literal> object that can be used to render URLs.</para></listitem>
- </itemizedlist>
- </para>
- <para>The default file in charge of displaying the tabs can be found in: <literal>portal-core.war/WEB-INF/jsp/header/</literal></para>
- </section>
- <!-- section>
- <title>Modifying the default PageCustomizerInterceptor</title>
- <para>Instead of modifying the class directly, create your own Interceptor
- (I suggest you copy the default PageCustomizerInterceptor look at the source in
- <literal>core/src/main/org/jboss/portal/core/aspects/controller</literal>) then add it to:
- <literal>portal-core.sar/META-INF/jboss-service.xml</literal> the same way it
- is done by the default Interceptor. Then replace the default one by your own in
- the following part:
-<programlisting><![CDATA[
-<mbean
- code="org.jboss.portal.server.impl.invocation.JBossInterceptorStackFactory"
- name="portal:service=InterceptorStackFactory,type=Command"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends-list optional-attribute-name="InterceptorNames">
- <depends-list-element>portal:service=Interceptor,type=Command,name=Ajax</depends-list-element>
- <depends-list-element>portal:service=Interceptor,type=Command,name=NavigationalState</depends-list-element>
- <depends-list-element>portal:service=Interceptor,type=Command,name=PortalNode</depends-list-element>
- <depends-list-element>portal:service=Interceptor,type=Command,name=PolicyEnforcement</depends-list-element>
- <depends-list-element>portal:service=Interceptor,type=Command,name=PageCustomizer</depends-list-element>
- <depends-list-element>portal:service=Interceptor,type=Command,name=EventBroadcaster</depends-list-element>
- </depends-list>
-</mbean>
-]]></programlisting>
- Just replace the PageCustomizer by one of your own.
- </para>
- </section-->
- </section>
- </section>
- <section id="layouts">
- <title>Layouts</title>
- <section>
- <title>How to define a Layout</title>
- <para>Layouts are used by the portal to produce the actual markup of a portal response.
- After all the portlets on a page have been rendered and have produced their markup
- fragments, the layout is responsible for aggregating all these pieces, mix them with
- some ingredients from the portal itself, and at the end write the response back to the
- requesting client.
- </para>
- <para>Layouts can be either a JSP or a Servlet. The portal determines the layout to use
- via the configured properties of the portal, or the requested page. Both, portal and
- pages, can define the layout to use in order to render their content. In case both
- define a layout, the layout defined for the page will overwrite the one defined for the
- portal.
- </para>
- <para>A Layout is defined in the layout descriptor named portal-layouts.xml. This
- descriptor must be part of the portal application, and is picked up by the layout
- deployer. If the layout deployer detects such a descriptor in a web application, it will
- parse the content and register the layouts with the layout service of the portal. Here
- is an example of such a descriptor file:
- <programlisting><![CDATA[<layouts>
- <layout>
- <name>phalanx</name>
- <uri>/phalanx/index.jsp</uri>
- </layout>
- <layout>
- <name>industrial</name>
- <uri>/industrial/index.jsp</uri>
- <uri state="maximized">/industrial/maximized.jsp</uri>
- </layout>
-</layouts>]]></programlisting>
- </para>
- </section>
- <section>
- <title>How to use a Layout</title>
- <section>
- <title>Declarative use</title>
- <para>Portals and pages can be configured to use a particular layout. The connection to
- the desired layout is made in the portal descriptor (YourNameHere-object.xml). Here
- is an example of such a portal descriptor:
- <programlisting><![CDATA[<portal>
- <portal-name>default</portal-name>
- <properties>
- <!-- Set the layout for the default portal -->
- <!-- see also portal-layouts.xml -->
- <property>
- <name>layout.id</name>
- <value>phalanx</value>
- </property>
- </properties>
- <pages>
- <page>
- <page-name>theme test</page-name>
- <properties>
- <!-- set a difference layout for this page -->
- <property>
- <name>layout.id</name>
- <value>industrial</value>
- </property>
- </properties>
- </page>
- </pages>
-</portal>]]></programlisting>
- The name specified for the layout to use has to
- match one of the names defined in the portal-layouts.xml descriptor of one of the
- deployed applications.
- </para>
- <para>As you can see, the portal or page property points to the layout to use via the
- name of the layout. The name has been given to the layout in the layout descriptor.
- It is in that layout descriptor where the name gets linked to the physical resource
- (the JSP or Servlet) that will actually render the layout.
- </para>
- </section>
- <section>
- <title>Programmatic use</title>
- <para>To access a layout from code, you need to get a reference to the LayoutService
- interface. The layout service is an mbean that allows access to the PortalLayout
- interface for each layout that was defined in a portal layout descriptor. As a layout
- developer you should never have to deal with the layout service directly. Your layout
- hooks are the portal and page properties to configure the layout, and the layout
- strategy, where you can change the layout to use for the current request, before the
- actual render process begins.
- </para>
- </section>
- </section>
- <section>
- <title>Where to place the Descriptor files</title>
- <para>Both descriptors, the portal and the theme descriptor, are located in the WEB-INF/
- folder of the deployed portal application. Note that this is not limited to the
- portal-core.war, but can be added to any WAR that you deploy to the same server. The
- Portal runtime will detect the deployed application and introspect the WEB-INF folder
- for known descriptors like the two mentioned here. If present, the appropriate meta data
- is formed and added to the portal runtime. From that time on the resources in that
- application are available to be used by the portal. This is an elegant way to
- dynamically add new layouts or themes to the portal without having to bring down , or
- even rebuild the core portal itself.
- </para>
- </section>
- <!--
- <section>
- <title>How to connect a Layout to a Layout Strategy</title>
- <para>As you might have noticed already, a layout definition consists of a name and one or
- more uri elements. We have already seen the function of the name element. Now let's take
- a closer look at the uri element. In the example above, the phalanx layout defined one
- uri element only, the industrial layout defines two. What you can see in the industrial
- layout is the option of defining different uri's for different states. In this example ,
- we configured the layout to use a different JSP if the layout state is maximized. If no
- such separation is made in the layout descriptor, then the portal will always use the
- same JSP for this layout. Note that the 'state' attribute value works together with the
- state that was set by the layout strategy. Please refere to the section about the layout
- strategy for more details.
- </para>
- </section>
- -->
- <section>
- <title>Layout <trademark class="trade">JSP</trademark> tags</title>
- <para>The portal comes with a set of <trademark class="trade">JSP</trademark> tags that allow the layout developer faster
- development.
- </para>
- <para>There are currently two taglibs, containing tags for different approaches to
- layouts:
- </para>
- <itemizedlist>
-
- <listitem><para>portal-layout.tld</para></listitem>
- <listitem><para>theme-basic-lib.tld</para></listitem>
- </itemizedlist>
-
- <para>The theme-basic-lib.tld contains a list of tags that allow a JSP writer to access
- the state of the rendered page content. It is built on the assumption that regions,
- portlet windows and portlet decoration is managed inside the JSP.
- </para>
- <para>The portal-layout.tld contains tags that work under the assumption that the
- RenderSet will take care of how regions, portlet windows and the portlet decoration will
- be rendered. The advantage of this approach is that the resulting JSP is much simpler
- and easier to read and maintain.
- </para>
- <para>Here is an example layout JSP that uses tags from the latter:
- <programlisting>
- <![CDATA[<%@ taglib uri="/WEB-INF/theme/portal-layout.tld" prefix="p" %>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title><p:title default="My Great Portal"/></title>
- <meta http-equiv="Content-Type" content="text/html;" />
- <p:theme themeName='renaissance' />
- <p:headerContent />
- </head>
- <body id="body">
- <div id="portal-container">
- <div id="sizer">
- <div id="expander">
- <div id="logoName"></div>
- <table border="0" cellpadding="0" cellspacing="0" id="header-container">
- <tr>
- <td align="center" valign="top" id="header">
- <div id="spacer"></div>
- </td>
- </tr>
- </table>
- <div id="content-container">
- <p:region regionName='This-Is-The-Page-Region-To-Query-The-Page'
- regionID='This-Is-The-Tag-ID-Attribute-To-Match-The-CSS-Selector'/>
- <p:region regionName='left' regionID='regionA'/>
- <p:region regionName='center' regionID='regionB'/>
- <hr class="cleaner" />
- <div id="footer-container" class="portal-copyright">Powered by
- <a class="portal-copyright"
- href="http://www.jboss.com/products/jbossportal">
- JBoss Portal
- </a>
- </div>
- </div>
- </div>
- </div>
- </div>
- </body>
-</html>]]></programlisting>
- </para>
- <section>
- <title>The title tag</title>
- <para>The title tag is used to insert the web browser title defined by a portlet which
- is part of the page rendering. The default attribute defines the title to use if no
- portlet defined a web browser title.
- </para>
- </section>
- <section>
- <title>The theme tag</title>
- <para>The theme tag looks for the determined theme of the current request (see
- Portal Themes for more details). If no theme was determined, this tag allows an
- optional attribute 'themeName' that can be used to specify a default theme to use
- as a last resort. Based on the determined theme name, the ThemeService is called
- to lookup the theme with this name and to get the resources associated with this
- theme. The resulting style and link elements are injected, making sure that war
- context URLS are resolved appropriately.
- </para>
- </section>
- <section>
- <title>The headerContent tag</title>
- <para>This tags allows portlets to inject content into the header. More details
- about this function are mentioned in the 'other Theme Functions' section of this
- document.
- </para>
- </section>
- <section>
- <title>The region tag</title>
- <para>The region tag renders all the portlets in the specified region of the current
- page, using the determined RenderSet to produce the markup that surrounds the
- individual portlet markup fragments. The regionName attribute functions as a query
- param into the current page. It determines from what page region the portlets will
- be rendered in this tag. The regionID attribute is what the RenderSet can use to
- generate a CSS selector for this particular region. In case of the divRenderer, a
- DIV tag with an id attribute corresponding to the provided value will be rendered
- for this region. This id in turn can be picked up by the CSS to style the region.
- </para>
- </section>
- </section>
- </section>
- <!--
-<section>
-<title>Layout Strategy</title>
-<section>
-<title>What is a Layout Strategy</title>
-<para>The layout strategy is a pluggable API that allows the layout developer to influence
-the content of the page that is about to be rendered. Based on the current request URL,
-the portal determined the portal and page that needs to be rendered. The page contains a
-list of portlets, and those portlets are in a particular navigational state. The
-navigational state consists of the portlet mode and the window state of the portlet.
-This information, togeher with the determined layout, the region and order assignments
-of each portlet, the allowed window states and portlet modes for both, the portal and
-the individual portlets, is passed to the layout strategy before the actual rendering is
-invoked. The layout strategy can check what is about to be rendered, and take action in
-a limited way to influence the content that is about to be rendered.
-</para>
-</section>
-<section>
-<title>How can I use a Layout Strategy</title>
-<section>
-<title>Define a Strategy</title>
-<para>A layout strategy is defined in the strategy descriptor. The descriptor is named
- portal-strategies.xml, and is located in the WEB-INF/layout folder of any web
- application deployed to the server. Here is an example of such a descriptor:
- <programlisting>
- <![CDATA[<portal-strategies>
- <set name="default">
- <strategy content-type="text/html">
- <implementation>org.jboss.portal.theme.impl.strategy.DefaultStrategyImpl</implementation>
- </strategy>
- </set>
- <set name="maximizedRegion">
- <strategy content-type="text/html">
- <implementation>org.jboss.portal.theme.impl.strategy.MaximizingStrategyImpl</implementation>
- </strategy>
- </set>
- </portal-strategies>
- ]]></programlisting>
- Layout strategies are defined as sets. A set consists of one or
- more strategy definitions, separated by content type they are assigned for. The idea
- behind this is to allow the layout developer to apply different strategies based on
- requested content type. Each set has a name that is unique in the application context
- it is deployed in. The strategy can be refered to by this name. As a result of that
- it is considered a named layout strategy in contrast to an anonymous strategy as
- described below.
-</para>
-</section>
-<section>
-<title>Specify the Strategy to use</title>
-<para>The strategy that will be used for a portal request is defined as a property of
- the current layout, the requested portal, or the requested page. If the layout
- defines a strategy to use it will overwrite all other assignments. If there is no
- particular strategy defined for the layout, then the page property will overwrite the
- portal property. If no strategy can be determined, then a last attempt will be made
- to use the strategy with the name 'default'. If no strategy can be determined at all,
- the request will proceed normally without invoking any strategy. Here is an example
- layout descriptor that defines a strategy for the layouts defined:
- <programlisting>
- <![CDATA[
- <layouts>
- <strategy content-type="text/html">
- <implementation>com.novell.portal.strategy.MaximizingStrategy</implementation>
- </strategy>
-
- <layout>
- <name>generic</name>
- <uri>/generic/index.jsp</uri>
- <uri state="maximized">/generic/maximized.jsp</uri>
- </layout>
- </layouts>
- ]]></programlisting>
- In this case the strategy is anonymous and directly assigned to
- the generic layout. The strategy cannot be discovered independently from the generic
- layout. Here is an example portal descriptor that points to a strategy for the
- portal, and for a particular page:
- <programlisting>
- <![CDATA[
- <portal>
- <portal-name>default</portal-name>
- <properties>
- <property>
- <name>layout.strategyId</name>
- <value>default</value>
- </property>
- </properties>
- <pages>
- <default-page>theme test</default-page>
- <page>
- <page-name>theme test</page-name>
- <properties>
- -->
- <!-- set a difference layout strategy for this page -->
- <!--
- <property>
- <name>layout.strategyId</name>
- <value>maximizedRegion</value>
- </property>
- </properties>
- <window>
- <window-name>CatalogPortletWindow</window-name>
- <instance-ref>CatalogPortletInstance</instance-ref>
- <region>left</region>
- <height>0</height>
- </window>
- </page>
- </pages>
- </portal>
- ]]></programlisting>
- As you can see, analogous to how layouts are refered to, the
- strategy name is the linking element between the portal descriptor and the layout
- strategy descriptor. The content type is determined at runtime, and serves as a
- secondary query parameter to get the correct strategy for this content type out of
- the set that matches the name provided in the portal descriptor.
- </para>
- </section>
- </section>
- <section>
- <title>Linking the Strategy and the Layout</title>
- <para>As mentioned above, the layout descriptor can link a strategy directly to the
- layout. This will overwrite all other defined strategies for the portal or the page, for
- any page that uses this layout.
- </para>
- <para>The layout strategy can set a state to return to the portal as a result of the
- strategy evaluation. This state will be matched with the state attribute of the uri
- element of the layout. If there is a match, then the uri that matches this state will be
- used as the layout for the current request. So, if the strategy sets a state of
- 'maximized' , the portal will try to use the layout resource that is pointed to for that
- particular state in the currently selected layout. As you might remember from the
- previous layout section, a layout can point to another JSP or Servlet based on the state
- attribute of the uri element, like so:
- <programlisting><![CDATA[
- <layouts>
- <layout>
- <name>industrial</name>
- <uri>/industrial/index.jsp</uri>
- <uri state="maximized">/industrial/maximized.jsp</uri>
- </layout>
- </layouts>]]></programlisting>
- In this case all reuquests that don't return a state
- 'maximized' from the evaluation of the strategy will use the /industrial/index.jsp as
- the layout. However, if the evaluation of the strategy returns a state of 'maximized'
- then the request will use /industrial/maximized.jsp as the layout.
- </para>
- </section>
- </section>
- -->
- <section>
- <title>RenderSets</title>
- <section>
- <title>What is a RenderSet</title>
- <para>A RenderSet can be used to produce the markup containers around portlets and portlet
- regions. The markup for each region, and each portlet window in a region is identical.
- Further more, it is most likely identical across several layouts. The way portlets are
- arranged and decorated will most likely not change across layouts. What will change is
- the look and feel of the decoration, the images, fonts, and colors used to render each
- portlet window on the page. This is clearly a task for the web designer, and hence
- should be realized via the portal theme. The layout only needs to provide enough
- information to the theme so that it can do its job. The RenderSet is exactly that link
- between the layout and the theme that takes the information available in the portal and
- renders markup containing the current state of the page and each portlet on it. It makes
- sure that the markup around each region and portlet contains the selectors that the
- theme CSS needs to style the page content appropriately.
- </para>
- <para>A RenderSet consists of the implementations of four interfaces. Each of those
- interfaces corresponds to a markup container on the page.
- </para>
- <para>Here are the four markup containers and their interface representation:</para>
- <itemizedlist>
-
- <listitem><para>Region - RegionRenderer</para></listitem>
- <listitem><para>Window - WindowRenderer</para></listitem>
- <listitem><para>Decoration - DecorationRenderer</para></listitem>
- <listitem><para>Portlet Content - PortletRenderer</para></listitem>
- </itemizedlist>
- <para>
- All the renderer interfaces are specified in the
- org.jboss.portal.theme.render package.
- </para>
- <para>The four markup containers are hierarchical. The region contains one or more
- windows. A window contains the portlet decoration and the portlet content.
- </para>
- <para>The region is responsible for arranging the positioning and order of each portlet
- window. Should they be arranged in a row or a column? If there are more then one portlet
- window in a region, in what order should they appear?
- </para>
- <para>The window is responsible for placing the window decoration, including the portlet
- title, over the portlet content, or under, or next to it.
- </para>
- <para>The decoration is responsible for inserting the correct markup with the links to the
- portlet modes and window states currently available for each portlet.
- </para>
- <para>The portlet content is responsible for inserting the actually rendered markup
- fragment that was produced by the portlet itself.
- </para>
- </section>
- <section>
- <title>How is a RenderSet defined</title>
- <para>Similar to layouts, render sets must be defined in a RenderSet descriptor. The
- RenderSet descriptor is located in the WEB-INF/layout folder of a web application, and
- is named portal-renderSet.xml. Here is an example descriptor:
- <programlisting>
- <![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<portal-renderSet>
- <renderSet name="divRenderer">
- <set content-type="text/html">
- <region-renderer>org.jboss.portal.theme.impl.render.DivRegionRenderer</region-renderer>
- <window-renderer>org.jboss.portal.theme.impl.render.DivWindowRenderer</window-renderer>
- <portlet-renderer>org.jboss.portal.theme.impl.render.DivPortletRenderer</portlet-renderer>
- <decoration-renderer>
- org.jboss.portal.theme.impl.render.DivDecorationRenderer
- </decoration-renderer>
- </set>
- </renderSet>
- <renderSet name="emptyRenderer">
- <set content-type="text/html">
- <region-renderer>org.jboss.portal.theme.impl.render.EmptyRegionRenderer</region-renderer>
- <window-renderer>org.jboss.portal.theme.impl.render.EmptyWindowRenderer</window-renderer>
- <portlet-renderer>
- org.jboss.portal.theme.impl.render.EmptyPortletRenderer
- </portlet-renderer>
- <decoration-renderer>
- org.jboss.portal.theme.impl.render.EmptyDecorationRenderer
- </decoration-renderer>
- </set>
- </renderSet>
-</portal-renderSet>
- ]]></programlisting>
- </para>
- </section>
- <section>
- <title>How to specify what RenderSet to use</title>
- <para>Analogous to how a strategy is specified, the RenderSet can be specified as a portal
- or page property, or a particular layout can specify an anonymous RenderSet to use. Here
- is an example of a portal descriptor:
- <programlisting>
- <![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<portal>
- <portal-name>default</portal-name>
- <properties>
- <!-- use the divRenderer for this portal -->
- <property>
- <name>theme.renderSetId</name>
- <value>divRenderer</value>
- </property>
- </properties>
- <pages>
- <default-page>default</default-page>
- <page>
- <page-name>default</page-name>
- <properties>
- <!-- overwrite the portal's renderset for this page -->
- <property>
- <name>theme.renderSetId</name>
- <value>emptyRenderer</value>
- </property>
- </properties>
- <window>
- <window-name>TestPortletWindow</window-name>
- <instance-ref>TestPortletInstance</instance-ref>
- <region>center</region>
- <height>0</height>
- </window>
- </page>
- </pages>
-</portal>]]></programlisting>
- Here is an example of a layout descriptor with an anonymous
- RenderSet:
- <programlisting>
- <![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<layouts>
-<renderSet>
-<set content-type="text/html">
-<region-renderer>org.foo.theme.render.MyRegionRenderer</region-renderer>
-<window-renderer>org.foo.theme.render.MyWindowRenderer</window-renderer>
-<portlet-renderer>org.foo.theme.render.MyPortletRenderer</portlet-renderer>
-<decoration-renderer>org.foo.theme.render.MyDecorationRenderer</decoration-renderer>
-</set>
-</renderSet>
-<layout>
-<name>generic</name>
-<uri>/generic/index.jsp</uri>
-<uri state="maximized">/generic/maximized.jsp</uri>
-</layout>
-</layouts>]]></programlisting>
- Again, analogous to layout strategies, the anonymous RenderSet
- overwrites the one specified for the page, and that overwrites the one specified for the
- portal. In other words: all pages that use the layout that defines an anonymous
- RenderSet will use that RenderSet, and ignore what is defined as RenderSet for the
- portal or the page.
- </para>
- <para>
- In addition to specifying the renderSet for a portal or a page, each individual portlet window
- can define what renderSet to use for the one of the three aspects of a window, the window renderer,
- the decoration renderer, and the portlet renderer. This feature allow you to use the the window renderer
- implementation from one renderSet, and the decoration renderer from another.
- Here is an example for a window that uses the implementations of the emptyRenderer renderSet for all three
- aspects:
- <programlisting>
- <![CDATA[<window>
- <window-name>NavigationPortletWindow</window-name>
- <instance-ref>NavigationPortletInstance</instance-ref>
- <region>navigation</region>
- <height>0</height>
- <!-- overwrite portal and page properties set for the renderSet for this window -->
- <properties>
- <!-- use the window renderer from the emptyRenderer renderSet -->
- <property>
- <name>theme.windowRendererId</name>
- <value>emptyRenderer</value>
- </property>
- <!-- use the decoration renderer from the emptyRenderer renderSet -->
- <property>
- <name>theme.decorationRendererId</name>
- <value>emptyRenderer</value>
- </property>
- <!-- use the portlet renderer from the emptyRenderer renderSet -->
- <property>
- <name>theme.portletRendererId</name>
- <value>emptyRenderer</value>
- </property>
- </properties>
-</window>]]></programlisting>
-
- </para>
- </section>
- </section>
- <section>
- <title>Themes</title>
- <section>
- <title>What is a Theme</title>
- <para>A portal theme is a collection of CSS styles, JavaScript files, and images, that all
- work together to style and enhance the rendered markup of the portal page. The theme
- works together with the layout and the RenderSet in producing the content and final look
- and feel of the portal response. Through clean separation of markup and styles a much
- more flexible and powerful approach to theming portals is possible. While this approach
- is not enforced, it is strongly encouraged. If you follow the definitions of the
- Theme Style Guide (see later), it is not necessary to change the layout or the strategy,
- or the RenderSet to achieve very different look and feels for the portal. All you need
- to change is the theme. Since the theme has no binary dependencies, it is very simple to
- swap, or change individual items of it. No compile or redeploy is necessary. Themes
- can be added or removed while the portal is active. Themes can be deployed in separate
- web applications furthering even more the flexibility of this approach. Web developers
- don't have to work with JSP pages. They can stay in their favorite design tool and simple
- work against the exploded war content that is deployed into the portal. The results can
- be validated life in the portal.
- </para>
- </section>
- <section>
- <title>How to define a Theme</title>
- <para>Themes can be added as part of any web application that is deployed to the portal
- server. All what is needed is a theme descriptor file that is part of the deployed
- archive. This descriptor indicates to the portal what themes and theme resources are
- becoming available to the portal. The theme deployer scans the descriptor and adds the
- theme(s) to the ThemeService, which in turn makes the themes available for consumption
- by the portal. Here is an example of a theme descriptor:
- <programlisting>
- <![CDATA[<themes>
-<theme>
-<name>nodesk</name>
-<link href="/nodesk/css/portal_style.css" rel="stylesheet" type="text/css" />
-<link rel="shortcut icon" href="/images/favicon.ico" />
-</theme>
-<theme>
-<name>phalanx</name>
-<link href="/phalanx/css/portal_style.css" rel="stylesheet" type="text/css" />
-<link rel="shortcut icon" href="/images/favicon.ico" />
-</theme>
-
-<theme>
-<name>industrial-CSSSelect</name>
-<link rel="stylesheet" id="main_css" href="/industrial/portal_style.css" type="text/css" />
-<link rel="shortcut icon" href="/industrial/images/favicon.ico" />
-
-<script language="JavaScript" type="text/javascript">
-// MAF - script to switch current tab and css in layout...
-function switchCss(currentTab,colNum) {
-var obj = currentTab;
-var objParent = obj.parentNode;
-
-if (document.getElementById("current") != null) {
-var o = document.getElementById("current");
-o.setAttribute("id","");
-o.className = 'hoverOff';
-objParent.setAttribute("id","current");
-}
-
-var css = document.getElementById("main_css");
-source = css.href;
-if (colNum == "3Col") {
-if (source.indexOf("portal_style.css" != -1)) {
-source = source.replace("portal_style.css","portal_style_3Col.css");
-}
-if (source.indexOf("portal_style_1Col.css" != -1)) {
-source = source.replace("portal_style_1Col.css","portal_style_3Col.css");
-}
-}
-if (colNum == "2Col") {
-if (source.indexOf("portal_style_3Col.css" != -1)) {
-source = source.replace("portal_style_3Col.css","portal_style.css");
-}
-if (source.indexOf("portal_style_1Col.css" != -1)) {
-source = source.replace("portal_style_1Col.css","portal_style.css");
-}
-}
-if (colNum == "1Col") {
-if (source.indexOf("portal_style_3Col.css" != -1)) {
-source = source.replace("portal_style_3Col.css","portal_style_1Col.css");
-}
-if (source.indexOf("portal_style.css" != -1)) {
-source = source.replace("portal_style.css","portal_style_1Col.css");
-}
-}
-
-css.href = source;
-}
-</script>
-</theme>
-</themes>]]></programlisting>
- </para>
- <para>Themes are defined in the portal-themes.xml theme descriptor, which is located in
- the WEB-INF/ folder of the web application.
- </para>
- </section>
- <section>
- <title>How to use a Theme</title>
- <para>Again, analogous to the way it is done for layouts, themes are specified in the
- portal descriptor as a portal or page property. The page property overwrites the portal
- property. In addition to these two options, themes can also be specified as part of the
- theme JSP tag , that is placed on the layout JSP. Here is an example portal descriptor
- that specifies the phalanx theme as the theme for the entire portal, and the industrial
- theme for the theme test page:
- <programlisting>
- <![CDATA[<portal>
- <portal-name>default</portal-name>
- <properties>
- <!-- Set the theme for the default portal -->
- <property>
- <name>layout.id</name>
- <value>phalanx</value>
- </property>
- </properties>
- <pages>
- <page>
- <page-name>theme test</page-name>
- <properties>
- <!-- set a difference layout for this page -->
- <property>
- <name>layout.id</name>
- <value>industrial</value>
- </property>
- </properties>
- <window>
- <window-name>CatalogPortletWindow</window-name>
- <instance-ref>CatalogPortletInstance</instance-ref>
- <region>left</region>
- <height>0</height>
- </window>
- </page>
- </pages>
-</portal>]]></programlisting>
- And here is an example of a layout JSP that defines a default
- theme to use if no other theme was defined for the portal or page:
- <programlisting>
- <![CDATA[<%@ taglib uri="/WEB-INF/theme/portal-layout.tld" prefix="p" %>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title><%= "JBoss Portal :: 2.2 early (Industrial)" %></title>
- <meta http-equiv="Content-Type" content="text/html;" />
- <p:theme themeName='industrial' />
- <p:headerContent />
- </head>
- <body id="body">
- <div id="portal-container">
- <div id="sizer">
- <div id="expander">
- <div id="logoName"></div>
- <table border="0" cellpadding="0" cellspacing="0"
- id="header-container">
- <tr>
- <td align="center" valign="top" id="header">
- <div id="spacer"></div>
- </td>
- </tr>
- </table>
- <div id="content-container">
- <p:region
- regionName='This-Is-The-Page-Region-To-Query-The-Page'
- regionID='This-Is-The-Tag-ID-Attribute-To-Match-The-CSS-Selector' />
- <p:region regionName='left' regionID='regionA' />
- <p:region regionName='center' regionID='regionB' />
- <hr class="cleaner" />
- <div id="footer-container" class="portal-copyright">
- Powered by
- <a class="portal-copyright"
- href="http://www.jboss.com/products/jbossportal">
- JBoss Portal
- </a>
- <br />
- Theme by
- <a class="portal-copyright"
- href="http://www.novell.com">
- Novell
- </a>
- </div>
- </div>
- </div>
- </div>
- </div>
- </body>
-</html>]]></programlisting>
- For the function of the individual tags in this example, please
- refer to the layout section of this document.
- </para>
- </section>
- <section>
- <title>How to write your own Theme</title>
- <para>Ask your favorite web designer and/or consult the Theme Style Guide in this document.</para>
- </section>
- </section>
- <section>
- <title>Other Theme Functionalities and Features</title>
- <para>This section contains all the functionalities that don't fit with any of the other
- topics. Bits and pieces of useful functions that are related to the theme and layout
- functionality.
- </para>
- <section>
- <title>Content Rewriting and Header Content Injection</title>
- <para>Portlets can have their content rewritten by the portal. This is useful if you want
- to uniquely namespace markup (JavaScript functions for example) in the scope of a page.
- The rewrite functionality can be applied to the portlet content (the markup fragment)
- and to content a portlet wants to inject into the header. The rewrite is implemented as
- specified in the WSRP (OASIS: Web Services for Remote Portlets; producer write). As a
- result of this, the token to use for rewrite is the WSRP specified "wsrp_rewrite_". If
- the portlet sets the following response property
- <programlisting>res.setProperty("WSRP_REWRITE","true");</programlisting>
- all occurrences
- of the wsrp_rewrite_ token in the portlet fragment will be replaced with a unique token
- (the window id). If the portlet also specifies content to be injected into the header of
- the page, that content is also subject to this rewrite.
- <programlisting><![CDATA[res.setProperty("HEADER_CONTENT", "
- <script>function wsrp_rewrite_OnFocus(){alert('hello button');}</script>
- ");]]>
- </programlisting>
- Note that in order for the header content injection to work, the layout needs to make
- use of the headerContent JSP tag, like:
- <programlisting>
- <![CDATA[<%@ taglib uri="/WEB-INF/theme/portal-layout.tld" prefix="p" %>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title><JBoss Portal 2.2 early</title>
- <meta http-equiv="Content-Type" content="text/html;" />
-
- <p:headerContent />
- </head>
- <body id="body">
- <p>...</p>
- </body>
-</html>]]></programlisting>
- </para>
- </section>
- <section>
- <title>Declarative CSS Style injection</title>
- <para>If a portlet needs a CSS style sheet to be injected via a link tag in the page
- header, it can do so by providing the context relative URI to the file in the
- jboss-portlet.xml descriptor, like:
- <programlisting>
- <![CDATA[<portlet-app>
- <portlet>
- <portlet-name>HeaderContentPortlet</portlet-name>
- <header-content>
- <link rel="stylesheet" type="text/css" href="/portlet-styles/HeaderContent.css"
- title="" media="screen" />
- </header-content>
- </portlet>
-</portlet-app>]]></programlisting>
- </para>
- <para>This functionality, just like the previously described header content injection,
- requires the layout JSP to add the "headerContent" JSP tag (see example above). One thing to note here is
- the order of the tags. If the headerContent tag is placed after the theme tag, it will allow portlet
- injected
- CSS files to overwrite the theme's behavior, making this feature even more powerful!
- </para>
- </section>
- <section>
- <title>Disabling Portlet Decoration</title>
- <para>One possible use of window properties is demonstrated in the divRenderer RenderSet implementation.
- If a window definition (in the portal descriptor) contains a property like:
- <programlisting>
- <![CDATA[<window>
- <window-name>HintPortletWindow</window-name>
- <instance-ref>HintPortletInstance</instance-ref>
- <region>center</region>
- <height>0</height>
- <properties>
- <!-- turn the decoration off for this portlet (i.e. no title and mode/state links) -->
- <property>
- <name>theme.decorationRendererId</name>
- <value>emptyRenderer</value>
- </property>
- </properties>
-</window>]]></programlisting>
- the DivWindowRenderer will use the decoration renderer from the emptyRenderer
- RenderSet to render the decoration for this window (not delegate to the DivDecorationRenderer).
- As a result, the portlet window will be part of the rendered page, but it will not have a title,
- nor will it have any links to change the portlet mode or window state.
- </para>
- </section>
- </section>
- <section>
- <title>Theme Style Guide (based on the Industrial theme)</title>
- <section>
- <title>Overview</title>
- <note><title>Note</title><para>This section to be updated soon with new CSS selectors found in JBoss Portal 2.6. The current
- definitions remain, but the newer additions with regards to dashboards/drag-n-drop have not been
- documented as of yet.</para>
- </note>
- <para>This document outlines the different selectors used to handle the layout and
- look/feel of the Industrial theme included in the JBoss portal.
- </para>
- <para>A couple of things to know about the theming approach discussed below:</para>
-
- <itemizedlist>
-
- <listitem><para>Main premise behind this approach was to provide a clean separation between
- the business and presentation layer of the portal. As we go through each selector
- and explain the relation to the visual presentation on the page, this will become
- more apparent.</para>
- </listitem>
- <listitem><para>The flexibility of the selectors used in the theme stylesheet allow a
- designer to very easily customize the visual aspects of the portal, thereby taking
- the responsibility off of the developers hands through allowing the designer to
- quickly achieve the desired effect w/out the need to dive down into code and/or
- having to deploy changes to the portal. This saves time and allows both developers
- and designers to focus on what they do best.</para>
- </listitem>
- <listitem><para>This theme incorporates a liquid layout approach which allows elements on a
- page to expand/contract based on screen resolution and provides a consistent look
- across varying display settings. However, the stylesheet is adaptable to
- facilitate a fixed layout and/or combination approach where elements are pixel
- based and completely independent of viewport.</para>
- </listitem>
- <listitem><para>The pieces that make up the portal theme consist of at least one stylesheet
- and any associated images. Having a consolidated set of files to control the
- portal look and feel allows administrators to effortlessly swap themes on the fly.
- In addition, this clean separation of the pieces that make up a specific theme
- will enable sharing and collaboration of different themes by those looking to get
- involved or contribute to the open source initiative.</para>
- </listitem>
- </itemizedlist>
-
- </section>
- <section>
- <title>Main Screen Shot</title>
- <para>Screen shot using color outline of main ID selectors used to control presentation
- and layout:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/selector-outline.gif" scalefit="1"/>
- </imageobject>
- </mediaobject>
- </para>
-
- <itemizedlist>
- <listitem><para>Red Border - portal-container</para></listitem>
- <listitem><para>Yellow Border - header-container</para></listitem>
- <listitem><para>Orange Border - content-container</para></listitem>
- <listitem><para>Blue Border - regionA/regionB</para></listitem>
- <listitem><para>Green Border - portlet-container</para></listitem>
- </itemizedlist>
-
- </section>
- <section>
- <title>List of CSS Selectors</title>
-
- <para>The following is a list of the selectors used in the theme stylesheet,
- including a brief explanation of how each selector is used in the portal:
- </para>
- <itemizedlist>
-
- <listitem>
- <para>Portal Body Selector
- <programlisting>#body {
- background-color: #FFFFFF;
- background-image: url( images/header_bg.gif );
- background-repeat: repeat-x;
- margin: 0px;
- padding: 0px;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- background-repeat: repeat-x;
- font-size: 11px;
- color: #656565;
-}</programlisting>
- Usage: This selector controls the background of the page, and can be modified
- to set a base font-family, layout margin, etc. that will be inherited by all
- child elements that do not have their own individual style applied. By default,
- the selector pulls an image background for the page.
- </para>
- </listitem>
- <listitem>
- <para>Portal Header Selectors
- <programlisting>#spacer {
- width: 770px;
- line-height: 0px;
- font-size: 0px;
- height: 0px;
-}</programlisting>
- Usage: Spacer div used to keep header at certain width regardless of display
- size. This is done to avoid overlapping of tab navigation in header. To account
- for different display sizes, this selector can be modified to force a
- horizontal scroll in the browser which eliminates any issue with overlapping
- elements in the header.
- <programlisting>#header-container {
- background-repeat: repeat-y;
- height: 100%;
- min-width: 1000px;
- width: 100%;
- position: absolute;
- bottom: 5px;*/
- }</programlisting>
- Usage: Wrapper selector used to control the position of the header on the page.
- This selector is applied as an ID on the
- table used to structure the header. You can adjust the attributes to reposition
- the header location on the page and/or create margin space on the top, right,
- bottom and left sides of the header.
- Screenshot:
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/portal-header.gif" scalefit="1"/>
- </imageobject>
- </mediaobject>
-
- <programlisting>#header {
- height: 65px;
- width: 100%;
- padding: 0px;
- margin: 0px;
- z-index: 1;
-}</programlisting>
- Usage: This selector applies the header background image in the portal. It can
- be adjusted to accommodate a header background of a certain width/height or, as
- it currently does, repeat the header graphic so that it tiles across the header
- portion of the page.
- <programlisting>#logoName {
- background-image: url( images/logo.gif );
- background-repeat: no-repeat;
- float: left;
- width: 250px;
- height: 25px;
- z-index: 2;
- position: absolute;
- left: 20px;
- top: 10px;
-}</programlisting>
- Usage: Logo selector which is used to brand the header with a specific,
- customized logo. The style is applied as an ID on an absolutely positioned DIV
- element which enables it to be moved to any location on the page, and allows it
- to be adjusted to accommodate a logo of any set width/height.
- </para>
- </listitem>
- <listitem>
- <para>Portal Layout Region Selectors
- <programlisting>#portal-container {
-/* part of below IE hack to preserve min-width for portlet regions */
-/*width: 100%;*/
- margin: 4px 2% 0px 2%;
-
- padding: 0 350px 0 350px;
-}</programlisting>
- Usage: Wrapper for entire portal which starts/ends after/before the BODY tag
- (see red border in screen shot). The padding attribute for this selector is
- used to preserve a minimum width setting for the portlet regions (discussed
- below). Similar to body selector, this style can modified to create margin or
- padding space on the top, right, bottom and left sections of the page. It
- provides the design capability to accommodate most layouts (e.g. a centered
- look such as the phalanx theme where there is some spacing around the content
- of the portal, or a full width look as illustrated in the Industrial theme).
- Screenshot:
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/region-selectors.gif" scalefit="1"/>
- </imageobject>
- </mediaobject>
-
- <programlisting>/* min width for IE */
-#expander {
- position: relative;
- padding: 0 0 0 0;
-
- margin: 0 -350px 0 -350px;
- min-width: 770px;
- padding: 0 0 0 0;
-}
-
-/* min width hack for IE */
-#sizer {
- width: 100%;
-}
-
-/* IE Hack \*/
-* html #portal-container,
- * html #sizer,
- * html #expander {
- height: 0;
-}</programlisting>
- Usage: These selectors are used in conjunction with the above,
- portal-container, selector to preserve a minimum width setting for the portlet
- regions. This was implemented to maintain a consistent look across different
- browsers.
- <programlisting>#content-container {
- height: 100%;
- text-align: left;
- width: 100%;
- min-width: 770px;
- /*
- position: absolute;
- top: 70px;
- left: 0px; / * z-index: 1; * /
- / * part of below IE hack
-padding: 0 350px 0 350px; * /
- padding: 0px 100px 0px 0px;
- */
-}</programlisting>
- Usage: Wrapper that contains all regions in portal with the exception of the
- header (see orange border in screen shot). Its attributes can be adjusted to
- create margin space on page, as well as control positioning of the area of the
- page below the header.
- <programlisting>/* portlet regions within content-container. this includes footer-container. */
-#regionA {
- width: 30%;
- float: left;
- margin: 0px;
- padding: 0px;
- min-width: 250px; /*height: 300px;*/
-}</programlisting>
- Usage: First portlet region located within the content-container (see blue
- border in screen shot). This selector controls the width of the region as well
- as its location on the page. Designers can very easily reposition this region
- in the portal (e.g. swap left regionA with right regionB, etc.) by adjusting
- the attributes of this selector.
- <programlisting>#regionB {
- /* test to swap columns..
-margin: 0 30% 0 0; */
-
- /*two column layout
-margin: 0 0 0 30%;*/
- padding: 0px; /* test to add 3rd region in layout...*/
- width: 67%;
- float: left; /*height: 300px;*/
-}</programlisting>
- Usage: Second portlet region located within the content-container (see blue
- border in screen shot). Similar to regionA, this selector controls the width of
- the region as well as its location on the page.
- <programlisting>#regionC {
-/* inclusion of 3rd region - comment out for 2 region testing */
- padding: 0px;
- margin: 0px;
- width: 28%;
- float: left; /*hide 3rd region*/
- display: none;
-}</programlisting>
- Usage: Third portlet region located within the content-container (please refer
- to blue border in screen shot representing regionA and regionB for an example).
- Used for 3 column layout. Similar to regionA and regionB, this selector
- controls the width of the region as well as its location on the page.
- Screenshot:
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/regions.gif" scalefit="1"/>
- </imageobject>
- </mediaobject>
-
- <programlisting>
-hr.cleaner {
-clear:both;
-height:1px;
-margin: -1px 0 0 0;
-padding:0;
-border:none;
-visibility: hidden;
-}
- </programlisting>
- Usage: Used to clear floats in regionA, regionB and regionC DIVs so that footer
- spans bottom of page.
- <programlisting>#footer-container {
- padding: 10px;
- text-align: center;
- clear: both;
-}</programlisting>
- Usage: Footer region located towards the bottom of the content-container (see
- above screen shot). This region spans the entire width of the page, but can be
- adjusted (just like regionA, regionB and regionC) to take on a certain position
- and width/height in the layout.
- </para>
- </listitem>
- <listitem>
- <para>Portlet Container Window Selectors
- <programlisting>.portlet-container {
- padding: 10px;
-}</programlisting>
- Usage: Wrapper that surrounds the portlet windows (see green border in screen
- shot). Currently, this selector is used to create space (padding) between the
- portlets displayed in each particular region.
- <programlisting>.portlet-titlebar-title {
- color: #656565;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 12px;
- font-weight: bold;
- white-space: nowrap;
- line-height: 100%;
- float: left;
- text-indent: 5px;
- padding-top: 5px;
- padding-bottom: 6px;
-}</programlisting>
- Usage: Class used to style the title of each portlet window. Attributes of this
- selector set font properties, indentation and position of title.
- <programlisting>.portlet-mode-container {
- float: right;
- padding-top: 4px;
- white-space: nowrap;
-}</programlisting>
- Usage: Wrapper that contains the portlet window modes that display in the top
- right section of the portlet windows.
- <programlisting>.portlet-titlebar-left {
- background-image: url( images/portlet-top-left.gif );
- background-repeat: no-repeat;
- width: 9px;
- height: 29px;
- min-width: 9px;
- background-position: bottom;
-}</programlisting>
- Usage: Used to style the top left corner of the portlet window. Each portlet
- window consists of one table that has 3 columns and 3 rows. This selector
- styles the first column (TD) in the first row (TR).
- Screenshot:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/portlet-titlebar-left.gif"/>
- </imageobject>
- </mediaobject>
- <programlisting>.portlet-titlebar-center {
- background-image: url( images/portlet-top-middle.gif );
- background-repeat: repeat-x;
- height: 29px;
- background-position: bottom;
-}</programlisting>
- Usage: Used to style the center section of the portlet title bar. Each portlet
- window consists of one table that has 3 columns and 3 rows. This selector
- styles the second column (TD) in the first row (TR).
- Screenshot:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/portlet-titlebar-center.gif"/>
- </imageobject>
- </mediaobject>
- <programlisting>.portlet-titlebar-right {
- background-image: url( images/portlet-top-right.gif );
- background-repeat: no-repeat;
- width: 10px;
- height: 30px;
- min-width: 10px;
- background-position: bottom left;
-}</programlisting>
- Usage: Used to style the top right corner of the portlet window. Each portlet
- window consists of one table that has 3 columns and 3 rows. This selector
- styles the third column (TD) in the first row (TR).
- Screenshot:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/portlet-titlebar-right.gif"/>
- </imageobject>
- </mediaobject>
- <programlisting>.portlet-content-left {
- background-image: url( images/portlet-left-vertical.gif );
- background-repeat: repeat-y;
- width: 9px;
- min-width: 9px;
- /*
- width:20px;
- background-color:#FFFFFF;
- border-left: 1px solid #dfe8ed;
- */
-}</programlisting>
- Usage: Used to style the left hand vertical lines that make up the portlet
- window. Each portlet window consists of one table that has 3 columns and 3
- rows. This selector styles the first column (TD) in the second row (TR).
-
- Screenshot:
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/portlet-content-left.gif"/>
- </imageobject>
- </mediaobject>
- <programlisting>.portlet-content-center {
- vertical-align: top;
- padding: 0;
- margin: 0;
-}</programlisting>
- Usage: Used to style the center, content area where the portlet content is
- injected into the portlet window (see below screen). Attributes for this
- selector control the positioning of the portlet content as well as the
- background and font properties. Each portlet window consists of one table that
- has 3 columns and 3 rows. This selector styles the second column (TD) in the
- second row (TR).
- Screenshot:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/portlet-content-center.gif"/>
- </imageobject>
- </mediaobject>
- <programlisting>.portlet-body {
- background-color: #FFFFFF;
- padding: 0;
- margin: 0;
-}</programlisting>
- Usage: An extra selector for controlling the content section of the portlet
- windows (see below screen). This was added to better deal with structuring the
- content that gets inserted/rendered in the portlet windows, specifically if the
- content is causing display problems in a portlet.
- Screenshot:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/portlet-body.gif"/>
- </imageobject>
- </mediaobject>
- <programlisting>.portlet-content-right {
- background-image: url( images/portlet-right-vertical.gif );
- height: 100%;
- background-repeat: repeat-y;
- background-position: left;
- width: 5px;
- min-width: 5px;
- padding: 0;
- margin: 0;
- /*
- width:5px;
- background-color:#FFFFFF;
- border-right: 1px solid #dfe8ed;
- */
-}</programlisting>
- Usage: Used to style the right hand vertical lines that make up the portlet
- window. Each portlet window consists of one table that has 3 columns and 3
- rows. This selector styles the third column (TD) in the second row (TR).
-
- Screenshot:
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/portlet-content-right.gif"/>
- </imageobject>
- </mediaobject>
- <programlisting>.portlet-footer-left {
- background-image: url( images/portlet-bottom-left.gif );
- width: 9px;
- height: 4px;
- background-repeat: no-repeat;
- background-position: top right;
- min-width: 9px;
- padding: 0;
- margin: 0;
- /*
- background-color:#FFFFFF;
- border-bottom: 1px solid #98b7c6;
- border-left: 1px solid #dfe8ed;
- height:5px;
- */
-}</programlisting>
- Usage: Used to style the bottom left corner of the portlet window. Each portlet
- window consists of one table that has 3 columns and 3 rows. This selector
- styles the first column (TD) in the third row (TR).
- Screenshot:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/portlet-footer-left.gif"/>
- </imageobject>
- </mediaobject>
- <programlisting>.portlet-footer-center {
- background-image: url( images/portlet-bottom-middle.gif );
- height: 4px;
- background-repeat: repeat-x;
- /* background-color:#FFFFFF;
- border-bottom: 1px solid #98b7c6;
- height:5px;
- */
-}</programlisting>
- Usage: Used to style the bottom, center of the portlet window (i.e. the bottom
- horizontal line in the Industrial theme). Each portlet window consists of one
- table that has 3 columns and 3 rows. This selector styles the second column
- (TD) in the third row (TR).
- Screenshot:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/portlet-footer-center.gif"/>
- </imageobject>
- </mediaobject>
- <programlisting>.portlet-footer-right {
- background-image: url( images/portlet-bottom-right.gif );
- width: 5px;
- height: 4px;
- background-repeat: no-repeat;
- min-width: 5px;
- /*
- background-color:#FFFFFF;
- border-bottom: 1px solid #98b7c6;
- border-right: 1px solid #dfe8ed;
- height:5px;
- */
-}</programlisting>
- Usage: Used to style the bottom right corner of the portlet window. Each
- portlet window consists of one table that has 3 columns and 3 rows. This
- selector styles the third column (TD) in the third row (TR).
- Screenshot:
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/themeguide/portlet-footer-right.gif"/>
- </imageobject>
- </mediaobject>
- </para>
- </listitem>
- <listitem>
- <para>Portlet Window Mode Selectors
- <programlisting>.portlet-mode-maximized {
- background-image: url( images/ico_16_maximize.gif );
- background-repeat: no-repeat;
- width: 16px;
- height: 16px;
- float: left;
- display: inline;
- cursor: pointer;
- padding-left: 3px;
-}</programlisting>
- Usage: Selector used to display the portlet maximize mode. Attributes for this
- selector control the display and dimensions of the maximize icon, including the
- behavior of the mouse pointer when hovering the mode.
- <programlisting>.portlet-mode-minimized {
- background-image: url( images/ico_16_minimize.gif );
- background-repeat: no-repeat;
- width: 16px;
- height: 16px;
- float: left;
- display: inline;
- cursor: pointer;
- padding-left: 3px;
-}</programlisting>
- Usage: Selector used to display the portlet minimize mode. Attributes for this
- selector control the display and dimensions of the minimize icon, including the
- behavior of the mouse pointer when hovering the mode.
- <programlisting>.portlet-mode-normal {
- background-image: url( images/ico_16_normal.gif );
- width: 16px;
- height: 16px;
- background-repeat: no-repeat;
- float: left;
- display: inline;
- cursor: pointer;
- padding-left: 3px;
-}</programlisting>
- Usage: Selector used to display the portlet normal mode (i.e. the icon that
- when clicked, restores the portlet to the original, default view). Attributes
- for this selector control the display and dimensions of the normal icon,
- including the behavior of the mouse pointer when hovering the mode.
- <programlisting>.portlet-mode-help {
- background-image: url( images/ico_16_help.gif );
- width: 16px;
- height: 16px;
- background-repeat: no-repeat;
- float: left;
- display: inline;
- cursor: pointer;
- padding-left: 3px;
-}</programlisting>
- Usage: Selector used to display the portlet help mode. Attributes for this
- selector control the display and dimensions of the help icon, including the
- behavior of the mouse pointer when hovering the mode.
- <programlisting>.portlet-mode-edit {
- background-image: url( images/ico_edit.gif );
- background-repeat: no-repeat;
- width: 28px;
- height: 16px;
- float: left;
- display: inline;
- cursor: pointer;
- padding-left: 3px;
-}</programlisting>
- Usage: Selector used to display the portlet edit mode. Attributes for this
- selector control the display and dimensions of the edit icon, including the
- behavior of the mouse pointer when hovering the mode.
- <programlisting>.portlet-mode-remove {
- background-image: url( images/ico_16_remove.gif );
- background-repeat: no-repeat;
- width: 16px;
- height: 16px;
- float: left;
- display: inline;
- cursor: pointer;
- padding-left: 3px;
-}</programlisting>
- Usage: Currently not available. But here is the intended use: Selector used to
- display the portlet remove mode. Attributes for this selector control the
- display and dimensions of the remove icon, including the behavior of the mouse
- pointer when hovering the mode.
- <programlisting>.portlet-mode-view {
- background-image: url( images/ico_cancel.gif );
- background-repeat: no-repeat;
- width: 28px;
- height: 16px;
- float: left;
- display: inline;
- cursor: pointer;
- padding-left: 3px;
- padding-right: 20px;
-}</programlisting>
- Usage: Selector used to display the portlet view mode. Attributes for this
- selector control the display and dimensions of the view icon, including the
- behavior of the mouse pointer when hovering the mode.
- <programlisting>.portlet-mode-reload {
- background-image: url( images/ico_16_reload.gif );
- background-repeat: no-repeat;
- width: 16px;
- height: 16px;
- float: left;
- display: inline;
- cursor: pointer;
- padding-left: 3px;
-}</programlisting>
- Usage: Currently not available. But here is the intended use: Selector used to
- display the portlet reload mode. Attributes for this selector control the
- display and dimensions of the reload icon, including the behavior of the mouse
- pointer when hovering the mode.
- </para>
- </listitem>
- <listitem>
- <para>Copyright Selectors
- <programlisting>.portal-copyright {
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 10px;
- color: #5E6D7A;
-}
-
-a.portal-copyright {
- color: #768591;
- text-decoration: none;
-}
-
-a.portal-copyright:hover {
- color: #bcbcbc;
- text-decoration: underline;
-}</programlisting>
- Usage: The above three selectors are used to style copyright content in the
- portal. The portal-copyright selector sets the font properties (color, etc.),
- and the a.portal-copyright/a.portal-copyright:hover selectors style any links
- that are part of the copyright information.
- </para>
- </listitem>
- <listitem>
- <para>Table Selectors
- <programlisting>.portlet-table-header {
- background-color: #eef;
- padding: 0 5px 5px 5px;
- font-weight: bold;
- color: #656565;
- font-size: 12px;
- border-bottom: 1px solid #d5d5d5;
-}</programlisting>
- Usage: Intended for styling tables (specifically, the TH
- or table header elements) that get rendered within a portlet window.
- <programlisting>.portlet-table-body {
-
-}</programlisting>
- Usage: Intended for styling the table body element used
- to group rows in a table.
- <programlisting>.portlet-table-alternate {
- background-color: #E6E8E5;
- border-bottom: 1px solid #d5d5d5;
-}</programlisting>
- Usage: Used to style the background color (and possibly
- other attributes) for every other row within a table.
- <programlisting>.portlet-table-selected {
- color: #000;
- font-size: 12px;
- background-color: #CBD4E6;
-}</programlisting>
- Usage: Used to style text, color, etc. in a selected cell
- range.
- <programlisting>.portlet-table-subheader {
- font-weight: bold;
- color: #000;
- font-size: 12px;
-}</programlisting>
- Usage: Used to style a subheading within a table that
- gets rendered in a portlet.
- <programlisting>.portlet-table-footer {
- padding: 5px 5px 0 5px;
- font-weight: bold;
- color: #656565;
- font-size: 12px;
- border: none;
- border-top: 1px solid #d5d5d5;
-}</programlisting>
- Usage: Similar to portlet-table-header and
- portlet-table-body, this selector is used to style the table footer element
- which is used to group the footer row in a table.
- <programlisting>.portlet-table-text {
- padding: 3px 5px;
- border-bottom: 1px solid #d5d5d5;
-}</programlisting>
- Usage: Text that belongs to the table but does not fall in one of the other
- categories (e.g. explanatory or help text that is associated with the table).
- This selector can also be modified to provide styled text that can be used in
- all tables that are rendered within a portlet.
- </para>
- </listitem>
- <listitem>
- <para>FONT Selectors
- <programlisting>.portlet-font {
- color: #000000;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 11px;
-}</programlisting>
- Usage: Used to style the font properties on text used in a portlet. Typically
- this class is used for the display of non-accentuated information.
- <programlisting>.portlet-font-dim {
- color: #777777;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 11px;
-}</programlisting>
- Usage: A lighter version (color-wise) of the portlet-font selector.
- </para>
- </listitem>
- <listitem>
- <para>FORM Selectors
- <programlisting>.portlet-form-label {
- font-size: 10px;
- color: #656565;
-}</programlisting>
- Usage: Text used for the descriptive label of an entire form (not the label for
- each actual form field).
- <programlisting>.portlet-form-button {
- font-size: 10px;
- font-weight: bold;
- color: #FFFFFF;
- background-color: #5078aa;
- border-top: 1px solid #97B7C6;
- border-left: 1px solid #97B7C6;
- border-bottom: 1px solid #254869;
- border-right: 1px solid #254869;
-}</programlisting>
- Usage: Used to style portlet form buttons (e.g. Submit).
- <programlisting>.portlet-icon-label {
-
-}</programlisting>
- Usage: Text that appears beside a context dependent
- action icon.
- <programlisting>.portlet-dlg-icon-label {
-
-}</programlisting>
- Usage: Text that appears beside a "standard" icon (e.g
- Ok, or Cancel).
- <programlisting>.portlet-form-field-label {
- font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
- font-size: 10px;
- color: #000;
- vertical-align: bottom;
- white-space: nowrap
-}</programlisting>
- Usage: Selector used to style portlet form field labels.
- <programlisting>.portlet-form-field {
- font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
- font-size: 10px;
- color: #000; /*margin-top: 10px;*/
-}</programlisting>
- Usage: Selector used to style portlet form fields (i.e. INPUT controls, SELECT
- elements, etc.).
- </para>
- </listitem>
- <listitem>
- <para>LINK Selectors
- <programlisting>.portal-links:link {
- font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
- font-size: 11px;
- font-weight: bold;
- color: #242424;
- text-decoration: none;
-}
-
-.portal-links:hover {
- font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
- font-size: 11px;
- font-weight: bold;
- color: #5699B7;
- text-decoration: none;
-}
-
-.portal-links:active {
- font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
- font-size: 11px;
- font-weight: bold;
- color: #242424;
- text-decoration: none;
-}
-
-.portal-links:visited {
- font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
- font-size: 11px;
- font-weight: bold;
- color: #242424;
- text-decoration: none;
-}</programlisting>
- Usage: The above four selectors are used to style links in the portal. Each
- pseudo class (i.e. hover, active, etc.) provides a different link style.
- </para>
- </listitem>
- <listitem>
- <para>MESSAGE Selectors
- <programlisting>.portlet-msg-status {
- font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
- font-size: 12px;
- font-style: normal;
- color: #336699;
-}</programlisting>
- Usage: Selector used to signify the status of a current operation that takes
- place in the portlet (e.g. "saving results", "step 1 of 4").
- <programlisting>.portlet-msg-info {
- font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
- font-size: 12px;
- font-style: italic;
- color: #000;
-}</programlisting>
- Usage: Selector used to signify general information in a portlet (e.g. help
- messages).
- <programlisting>.portlet-msg-error {
- color: red;
- font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
- font-size: 12px;
- font-weight: bold;
-}</programlisting>
- Usage: Selector used to signify an error message in the portlet (e.g. form
- validation error).
- <programlisting>.portlet-msg-alert {
- font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
- font-size: 12px;
- font-weight: bold;
- color: #821717;
-}</programlisting>
- Usage: Selector used to style an alert that is displayed to the user.
- <programlisting>.portlet-msg-success {
- font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
- font-size: 12px;
- font-weight: bold;
- color: #359630;
-}</programlisting>
- Usage: Selector used to indicate successful completion of an action in a
- portlet (e.g. "save successful").
- </para>
- </listitem>
- <listitem>
- <para>SECTION Selectors
- <programlisting>.portlet-section-header {
- font-weight: bold;
- color: #656565;
- font-size: 12px;
-}
-</programlisting>
- Usage: Table or section header.
- <programlisting>.portlet-section-body {
- color: #656565;
-}</programlisting>
- Usage: Normal text in a table cell.
- <programlisting>.portlet-section-alternate {
- background-color: #F2F2F2;
-}</programlisting>
- Usage: Used to style background color and text in every other table row.
- <programlisting>.portlet-section-selected {
- background-color: #CBD4E6;
-}</programlisting>
- Usage: Used to style background and font properties in a selected cell range.
- <programlisting>.portlet-section-subheader {
- font-weight: bold;
- font-size: 10px;
-}</programlisting>
- Usage: Used to style a subheading within a table/section that gets rendered in
- a portlet.
- <programlisting>.portlet-section-footer {
- font-size: 11px;
-}</programlisting>
- Usage: Used to style footer area of a section/table that gets rendered in a
- portlet.
- <programlisting>.portlet-section-text {
- font-size: 12px;
- font-style: italic;
-}</programlisting>
- Usage: Text that belongs to a section but does not fall in
- one of the other categories. This selector can also be modified to provide
- styled text that can be used in all sections that are rendered within a
- portlet.
- </para>
- </listitem>
- <listitem>
- <para>MENU Selectors
- <programlisting>
-.portlet-menu {}
- </programlisting>
- Usage: General menu settings such as background color,
- margins, etc.
- <programlisting>.portlet-menu-item {
- color: #242424;
- text-decoration: none;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 12px;
-}</programlisting>
- Usage: Normal, unselected menu item.
- <programlisting>.portlet-menu-item:hover {
- color: #5699B7;
- text-decoration: none;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 12px;
-}</programlisting>
- Usage: Used to style hover effect on a normal, unselected
- menu item.
- <programlisting>
-.portlet-menu-item-selected {}
- </programlisting>
- Usage: Applies to selected menu items.
- <programlisting>
-.portlet-menu-item-selected:hover {}
- </programlisting>
- Usage: Selector styles the hover effect on a selected menu
- item.
- <programlisting>
-.portlet-menu-cascade-item {}
- </programlisting>
- Usage: Normal, unselected menu item that has sub-menus.
- <programlisting>
-.portlet-menu-cascade-item-selected {}
- </programlisting>
- Usage: Selected sub-menu item.
- <programlisting>
-.portlet-menu-description {}
- </programlisting>
- Usage: Descriptive text for the menu (e.g. in a help
- context below the menu).
- <programlisting>
-.portlet-menu-caption {}
- </programlisting>
- Usage: Selector used to style menu captions.
- </para>
- </listitem>
- <listitem>
- <para>WSRP Selectors
- <programlisting>
-.portlet-horizontal-separator {}
- </programlisting>
- Usage: A separator bar similar to a horizontal rule, but
- with styling matching the page.
- <programlisting>
-.portlet-nestedTitle-bar {}
- </programlisting>
- Usage: Allows portlets to mimic the title bar when nesting
- something.
- <programlisting>
-.portlet-nestedTitle {}
- </programlisting>
- Usage: Allows portlets to match the textual character of
- the title on the title bar.
- <programlisting>
-.portlet-tab {}
- </programlisting>
- Usage: Support portlets having tabs in the same style as
- the page or other portlets.
- <programlisting>
-.portlet-tab-active {}
- </programlisting>
- Usage: Highlight the tab currently being shown.
- <programlisting>
-.portlet-tab-selected {}
- </programlisting>
- Usage: Highlight the selected tab (not yet active).
- <programlisting>
-.portlet-tab-disabled {}
- </programlisting>
- Usage: A tab which can not be currently activated.
- <programlisting>
-.portlet-tab-area {}
- </programlisting>
- Usage: Top level style for the content of a tab.
- </para>
- </listitem>
- </itemizedlist>
-
- </section>
- </section>
- <section>
- <title>Additional Ajax selectors</title>
- <para>Since 2.6 JBoss Portal has ajax features. Those features introduce a couple of
- CSS selectors that enables further customization of the visual look and feel. Indeed by default
- those CSS styles are provided by ajaxified layouts but it may not fit with some themes. It is possible
- to redefine them in the stylesheet of the themes.</para>
- <itemizedlist>
- <listitem><para>
- <programlisting>
-.dyna-region {}
- </programlisting>
-
- Usage:
- Denotes a dynamic region which can be subject to ajax capabilities.</para>
- </listitem>
- <listitem><para>
- <programlisting>
-.dyna-window {}
- </programlisting>
-
- Usage:
- Denotes a dynamic window which can be subject to ajax capabilities.</para>
- </listitem>
- <listitem><para>
- <programlisting>
-.dyna-decoration {}
- </programlisting>
-
- Usage:
- Denotes a dynamic decorator which can be subject to ajax capabilities.</para>
- </listitem>
- <listitem><para>
- <programlisting>
-.dyna-portlet {}
- </programlisting>
-
- Usage:
- Denotes a dynamic content which can be subject to ajax capabilities.</para>
- </listitem>
- <listitem><para>
- <programlisting>
-.dnd-handle {
- cursor: move;
-}
- </programlisting>
-
- Usage:
- Denotes the handle offered by draggable windows. By default it changes the mouse shape to indicate
- to the user that his mouse is hovering a draggable window.</para>
- </listitem>
- <listitem><para>
- <programlisting>
-.dnd-droppable {
- border: red 1px dashed;
- background-color: Transparent;
-}
- </programlisting>
-
- Usage:
- Denotes a zone where a user can drop a window during drag and drop operations. This selector is added
- and removed dynamically at runtime by the ajax framework and is not present in the generated markup.</para>
- </listitem>
- </itemizedlist>
- </section>
-</chapter>
- <chapter id="ajax">
-<!-- <chapterinfo>
- <author>
- <firstname>Julien</firstname>
- <surname>Viet</surname>
- </author>
- </chapterinfo>-->
- <title>Ajax</title>
- <para>This section covers the ajax features provided by the portal.</para>
- <section>
- <title>Introduction</title>
- <para>Todo</para>
- </section>
- <section>
- <title>Ajaxified markup</title>
- <section>
- <title>Ajaxified layouts</title>
- <para>Part of the Ajax capabilities are implemented in the layout framework which provide the structure for
- generating portal pages. The good news is that the existing layout only requires a few modifications in
- order to be ajaxified.</para>
- <para>We will use as example an simplified version of the layout JSP provided in JBoss Portal 2.6 and outline
- what are the required changes that makes it an ajaxified layout:
- <programlisting><![CDATA[
-<%@ taglib uri="/WEB-INF/theme/portal-layout.tld" prefix="p" %>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <meta http-equiv="Content-Type" content="text/html;"/>
- <!-- inject the theme, default to the Renaissance theme if
- nothing is selected for the portal or the page -->
- <p:theme themeName="renaissance"/>
- <!-- insert header content that was possibly set by portlets on the page -->
- <p:headerContent/>
-</head>
-
-<body id="body">
-<p:region regionName='AJAXScripts' regionID='AJAXScripts'/>
-<div id="portal-container">
- <div id="sizer">
- <div id="expander">
- <div id="logoName"></div>
- <table border="0" cellpadding="0" cellspacing="0" id="header-container">
- <tr>
- <td align="center" valign="top" id="header">
-
- <!-- Utility controls -->
- <p:region regionName='dashboardnav' regionID='dashboardnav'/>
-
- <!-- navigation tabs and such -->
- <p:region regionName='navigation' regionID='navigation'/>
- <div id="spacer"></div>
- </td>
- </tr>
- </table>
- <div id="content-container">
- <!-- insert the content of the 'left' region of the page,
- and assign the css selector id 'regionA' -->
- <p:region regionName='left' regionID='regionA'/>
- <!-- insert the content of the 'center' region of the page,
- and assign the css selector id 'regionB' -->
- <p:region regionName='center' regionID='regionB'/>
- <hr class="cleaner"/>
- </div>
- </div>
- </div>
-</div>
-
-<p:region regionName='AJAXFooter' regionID='AJAXFooter'/>
-
-</body>
-</html>
-]]></programlisting>
- <itemizedlist>
- <listitem><para><![CDATA[<p:theme themeName="renaissance"/>]]> should be already present as it exists since 2.4 but is even more
- necessary as it will inject in the page the reference to the ajax stylesheet.</para></listitem>
- <listitem><para><![CDATA[<p:region regionName='AJAXScripts' regionID='AJAXScripts'/>]]> should be added before any other region
- in the markup of the layout.</para></listitem>
- <listitem><para><![CDATA[<p:region regionName='AJAXFooter' regionID='AJAXFooter'/>]]> should be added after any other region
- in the markup of the layout.</para></listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>Ajaxified renderers</title>
- <para>At runtime the portal combines the layout and the renderers in order create the markup returned to the
- web browser. The most used render set is the divRenderer. Renderers only need a modification in the deployment
- descriptor to indicate that they support ajax. Here is the declaration of the default divRenderer now in 2.6:</para>
- <programlisting role="XML"><![CDATA[
-<renderSet name="divRenderer">
- <set content-type="text/html">
- <ajax-enabled>true</ajax-enabled>
- <region-renderer>org.jboss.portal.theme.impl.render.div.DivRegionRenderer
- </region-renderer>
- <window-renderer>org.jboss.portal.theme.impl.render.div.DivWindowRenderer
- </window-renderer>
- <portlet-renderer>org.jboss.portal.theme.impl.render.div.DivPortletRenderer
- </portlet-renderer>
- <decoration-renderer>org.jboss.portal.theme.impl.render.div.DivDecorationRenderer
- </decoration-renderer>
- </set>
-</renderSet>
-]]></programlisting>
- <para>You should notice the <![CDATA[<ajax-enabled>true</ajax-enabled>]]> which indicates that the render set
- supports ajaxification.</para>
- </section>
- </section>
- <section>
- <title>Ajaxified pages</title>
- <para>The ajaxification of the portal pages can be configured in a fine grained manner. Thanks to the portal
- object properties it is possible to control which pages support ajax and which page do not support ajax. The
- administrator must pay attention to the fact that property values are inherited in the object hierarchy.</para>
- <section>
- <title>Drag and Drop</title>
- <para>That feature is only effective in dashboards as it requires the offer personalization of the page
- layout per user. By default the feature is enabled thanks to a property set on the dashboard object.
- It is possible to turn off that property if the administrator does not want to expose that feature
- to its user.</para>
- <para>In the file <emphasis>jboss-portal.sar/conf/data/default-object.xml</emphasis> is declared and configured the
- creation of the dashboard portal:</para>
- <programlisting role="XML"><![CDATA[
-<deployment>
- <parent-ref/>
- <if-exists>keep</if-exists>
- <context>
- <context-name>dashboard</context-name>
- <properties>
- ...
- <property>
- <name>theme.dyna.dnd_enabled</name>
- <value>true</value>
- </property>
- ...
- </properties>
- ...
- </context>
-</deployment>
-]]></programlisting>
- <para>The property <emphasis>theme.dyna.dnd_enabled</emphasis> is set to the value <emphasis>true</emphasis>
- which means that the dashboard object will provide the drag and drop feature.
- </para>
- </section>
- <section>
- <title>Partial refresh</title>
- <para>Partial refresh is a very powerful feature which allows the portal to optimize the refreshing
- of portlets on a page. When one portlet is invoked, instead of redrawing the full page, the portal is able
- to detect which portlets needs to be refreshed and will update only these portlets.</para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/ajax/partial-refresh.png" format="PNG" scalefit="1"/>
- </imageobject>
- </mediaobject>
- <para>The portal providing partial refresh.</para>
-
- <section>
- <title>Portal objects configuration</title>
- <para>Like with the drag and drop feature, partial page refresh is controlled via properties on portal objects.
- The name of the property is <emphasis>theme.dyna.partial_refresh_enabled</emphasis> and its values can
- be <emphasis>true</emphasis> or <emphasis>false</emphasis>. When this property is set on an object
- it is automatically inherited by the sub hierarchy located under that object. By default the drag
- and drop feature is positioned on the dashboard object and not on the rest of the portal objects.
- </para>
- <programlisting role="XML"><![CDATA[
-<deployment>
- <parent-ref/>
- <if-exists>keep</if-exists>
- <context>
- <context-name>dashboard</context-name>
- <properties>
- ...
- <property>
- <name>theme.dyna.partial_refresh_enabled</name>
- <value>true</value>
- </property>
- ...
- </properties>
- ...
- </context>
-</deployment>
-]]></programlisting>
- <note>
- <para>The partial page refresh feature is compatible with the Portal API. The Portal API allows programmatic
- update of the state of portlets at runtime. For instance it is possible to modify the window state or
- the mode of several portlets on a given page. When such event occurs, the portal detects the changes
- which occurred and will update the portlet fragments in the page.</para>
- </note>
- <para>It is possible to change that behavior at runtime using the property editor of the management portlet.
- If you want to enable partial refreshing on the default portal you should set the property to true
- directly on the portal and all the pages in that portal will automatically inherit those properties.</para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/ajax/partial-refresh-admin.png" format="PNG" scalefit="1"/>
- </imageobject>
- </mediaobject>
- <para>The default portal configured for partial page refresh</para>
-
- </section>
- <section>
- <title>Portlet configuration</title>
- <para>
- By default any portlet will support partial refreshing. When does the portal performs partial page
- refreshing ? By default it is enabled for action and render links with the following exceptions. In those
- situations, the portal will prefer to perform a full page refresh:
- <itemizedlist>
- <listitem>
- <para>Form GET are not handled, however it should not be an issue as this situation is discouraged
- by the Portlet specification. It however taken in account, just in case of. Here is an example
- of a JavaServer Page that would do one:</para>
- <programlisting><![CDATA[
-<form action="<%= renderResponse.createActionURL() %>" method="get">
- ...
-</form>
-]]></programlisting>
- </listitem>
- <listitem>
- <para>Form uploads are not handled.</para>
- </listitem>
- <listitem><para>Having an interaction that deals with the <emphasis>MAXIMIZED</emphasis> window state.
- When a window is entering a maximized state or leaving a maximized window state, the portal will
- perform a full page refresh.</para></listitem>
- </itemizedlist>
- </para>
- <para>It can happen that a portlet does not want to support partial refreshing, in those situations
- the <emphasis>jboss-portlet.xml</emphasis> can be used to control that behavior. Since 2.6 an ajax
- section has been added in order to configure ajax features related to the portlet.</para>
- <programlisting role="XML"><![CDATA[
-<portlet>
- <portlet-name>MyPortletNoAjax</portlet-name>
- <ajax>
- <partial-refresh>false</partial-refresh>
- </ajax>
-</portlet>
-]]></programlisting>
- <para>The usage of the <emphasis>partial-refresh</emphasis> set to the value false means that
- the portlet will not be subject of a partial page refresh when it is invoked. However the portlet
- markup can still be subject to a partial rendering.</para>
- </section>
- <section>
- <title>Limitations</title>
- <para>Partial refreshing of portlets has limitations both on the server side (portal) and on the client side (browser).</para>
- <section>
- <title>Application scoped session attributes</title>
- <para>When partial refresh is activated, the state of a page can potentially become inconsistent. for
- example, if some objects are shared in the application scope of the session between portlets. When one
- portlet update a session object, the other portlet won't be refreshed and will still display content based
- on the previous value of the object in the session. To avoid that, partial refresh can be deactivated
- for certain portlets by adding <portlet-refresh>false<portlet-refresh> in the jboss-portlet.xml file.</para>
- </section>
- <section>
- <title>Non ajax interactions</title>
- <para>The solution developed by JBoss Portal on the client side is built on top of DOM events emitted
- by the web browser when the user interacts with the page. If an interaction is done without an
- emission of an event then JBoss Portal will not be able to transform it into a partial refresh and
- it will result instead of a full refresh. This can happen with programmatic submission of forms.
- </para>
- <programlisting role="XHTML"><![CDATA[
-<form id="<%= formId %>" action="<%= renderResponse.createActionURL() %>" method="post">
- ...
- <select onclick="document.getElementById('<%= formId %>').submit()">
- ...
- </select>
- ...
-</form>
-]]></programlisting>
- </section>
- </section>
- </section>
- </section>
-</chapter>
- <chapter id="troubleshooting">
- <!-- <chapterinfo>
- <author>
- <firstname>Roy</firstname>
- <surname>Russo</surname>
- </author>
- </chapterinfo>-->
- <title>Troubleshooting and FAQ</title>
- <section id="troubleshooting-faq">
- <title>Troubleshooting and FAQ</title>
- <para>
- <emphasis role="bold">Installation / Configuration</emphasis>
- <itemizedlist>
- <listitem><para>
- <xref linkend="conf1"/> I am seeing "ERROR [JDBCExceptionReporter] Table not found in statement" in the
- logfile
- on first boot. What is this?</para>
- </listitem>
- <listitem><para>
- <xref linkend="conf2"/> I want to do a clean install/upgrade over my existing one. What are the
- steps?</para>
- </listitem>
- <listitem><para>
- <xref linkend="conf3"/> Is my database vendor/version combination supported?</para>
- </listitem>
- <listitem>
- <para><xref linkend="conf4"/> How do I force the Hibernate Dialect used for my database?</para>
- </listitem>
- <listitem>
- <para> <xref linkend="conf5"/> How do I change the context-root of the portal to http://localhost:8080/?</para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- <emphasis role="bold">CMS</emphasis>
- <itemizedlist>
- <listitem>
- <para> <xref linkend="cms1"/>. How do I change the CMS repository configuration?</para>
- </listitem>
- <listitem>
- <para> <xref linkend="cms2"/>.On reboot, the CMS is complaining about a locked repository.</para>
- </listitem>
- <listitem>
- <para> <xref linkend="cms3"/>. I created a file in the CMSAdmin. How do I view it?</para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- <emphasis role="bold">Errors</emphasis>
- <itemizedlist>
- <listitem>
- <para> <xref linkend="error1"/>. When I access a specific portal-instance or page, I keep seeing "401 - not
- authorized" error in my browser.</para>
- </listitem>
- <listitem>
- <para> <xref linkend="error2"/>. How do I disable development-mode errors on the presentation layer?</para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- <emphasis role="bold">Miscellaneous</emphasis>
- <itemizedlist>
- <listitem>
- <para> <xref linkend="misc1"/>Is there a sample portlet I can look at to learn about portlet development and
- JBoss
- Portal deployments?</para>
- </listitem>
- </itemizedlist>
- </para>
-
-
- <section id="conf1"><title>"Error [JDBCExceptionReporter] Table not found in statement"</title>
- <para>
- <emphasis role="bold">I am seeing "ERROR [JDBCExceptionReporter] Table not found in statement" in the logfile
- on first
- boot. What is
- this?</emphasis>
- Ignore this error. It is used by the portal to create the initial database tables. On second boot, you should
- not see them at all.
- </para>
-</section>
-
- <section id="conf2"><title>install/upgrade</title>
- <para>
- <emphasis role="bold">I want to do a clean install/upgrade over my existing one. What are the steps?</emphasis>
- <itemizedlist>
- <listitem><para>Shut down JBoss AS</para></listitem>
- <listitem><para>Delete JBOSS_HOME/server/default/data/portal</para></listitem>
- <listitem><para>Delete all JBoss Portal tables from your database</para></listitem>
- <listitem><para>Start JBoss AS.</para></listitem>
- </itemizedlist>
- </para>
-</section>
-
- <section id="conf3"><title>database support</title>
- <para>
- <emphasis role="bold">Is my database vendor/version combination supported?</emphasis>
- See
- <xref linkend="supportedversions-db"/>
- </para>
-</section>
-
- <section id="conf4"><title>Hibernate Dialect</title>
- <para>
- <emphasis role="bold">How do I force the Hibernate Dialect used for my database?</emphasis>
- See
- <xref linkend="configuration-hibdialect"/>
- </para>
-</section>
-
- <section id="conf5"><title>context-root</title>
- <para>
- <emphasis role="bold">How do I change the context-root of the portal to http://localhost:8080/?</emphasis>
- See
- <xref linkend="configuration-contextroot"/>
- </para>
-</section>
-
- <section id="cms1"><title>CMS repository configuration</title>
- <para>
- <emphasis role="bold">How do I change the CMS repository configuration?</emphasis>
-
- There are 3 supported modes: 100% DB (default), 100% Filsystem, and Mixed (Blobs on the Filesystem and metadata
- in the DB). You can see configuration options here:
- <xref linkend="configuration-cms"/>
- </para>
-</section>
- <section id="cms2"><title>Locked repository</title>
- <para>
- <emphasis role="bold">On reboot, the CMS is complaining about a locked repository.</emphasis>
-
- This occurs when JBoss AS is improperly shutdown or the CMS Service errors on startup. To remove the lock,
- shutdown JBoss, and then remove the file under JBOSS_HOME/server/default/data/portal/cms/conf/.lock.
- </para>
-</section>
-
- <section id="cms3"><title>CMSAdmin</title>
- <para>
- <emphasis role="bold">I created a file in the CMSAdmin. How do I view it?</emphasis>
-
- Using the default configuration, the path to the file in the browser would be:
- http://localhost:8080/portal/content/path/to/file.ext.
- Note that all requests for cms content must be prepended with /content and then followed by the
- path/to/the/file.gif as it is in your directory structure.
- </para>
-</section>
-
- <section id="error1"><title>"401 - not authorised"</title>
- <para>
- <emphasis role="bold">When I access a specific portal-instance or page, I keep seeing "401 - not
- authorized" error in my browser.</emphasis>
- You are likely not authorized to view the page or portal instance. You can either modify the security using the
- Management Portlet under the Admin Tab, or secure your portlets via the object descriptor,
- <xref linkend="securing_objects"/>
- </para>
-</section>
-
- <section id="error2"><title>Development errors</title>
- <para>
- <emphasis role="bold">How do I disable development-mode errors on the presentation layer?</emphasis>
- See:
- <xref linkend="descriptor_debug"/>
- </para>
-</section>
- <section id="misc1"><title>Portlet Deployment</title>
- <para>
- <emphasis role="bold">Is there a sample portlet I can look at to learn about portlet development and JBoss
- Portal deployments?</emphasis>
-</para>
-
- <itemizedlist>
- <listitem><para>Sample portlets with tutorials can be found here,
- <xref linkend="tutorials_tutorials"/></para>
- </listitem>
- <listitem><para>Additional Portlets can be found at
- <ulink url="http://www.portletswap.com">PortletSwap.com</ulink>
- .</para>
- </listitem>
- </itemizedlist>
- </section>
-
- </section>
-</chapter>
- <!-- DO NOT EDIT ME DIRECTLY, I AM GENERATED FROM THE DTD USING THE dtd2docbook ANT TASK --><appendix id="portalObjectsDTD">
- <title>*-object.xml DTD</title>
- <para>
-<programlisting><![CDATA[
-
- <?xml version="1.0" encoding="UTF-8" ?>
-
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
- ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<!--
-<!DOCTYPE deployments PUBLIC
- "-//JBoss Portal//DTD Portal Object 2.6//EN"
- "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
--->
-
-<!--
-The deployements element is a generic container for deployment elements.
--->
-<!ELEMENT deployments (deployment*)>
-
-<!--
-The deployment is a generic container for portal object elements. The parent-ref
-child gives the name of the parent object that the current object will use as parent.
-The optional if-exists element define the behavior when a portal object which
-an identical name is already child of the parent element. The default behavior of
-the if-exist tag is to keep the existing object and not create a new object. The
-last element is the portal object itself.
-
-Example:
-
-<deployment>
- <parent-ref>default</parent-ref>
- <page>
- ...
- </page>
-</deployment>
-
-All portal objects have a common configuration which can be :
-
-1/ a listener : specifies the id of a listener is the listener registry. A listener
-object is able to listen portal events which apply to the portal node hierarchy.
-
-2/ properties : a set of generic properties owned by the portal object. Some
-properties can drive the behavior of the object.
-
-3/ security-constraint : defines security configuration of the portal object.
-
--->
-<!ELEMENT deployment (parent-ref?,if-exists?,(context|portal|page|window))>
-
-<!--
-Contains a reference to the parent object. The naming convention for naming object
-is to concatenate the names of the path to the object and separate the names by a dot.
-If the path is empty then the empty string must be used.
-
-Example:
-
-<parent-ref/> the root having an empty path
-
-<parent-ref>default</parent-ref> the object with the name default under the root
-having the path (default)
-
-<parent-ref>default.default</parent-ref> the object with the path (default,default)
-
--->
-<!ELEMENT parent-ref (#PCDATA)>
-
-<!--
-The authorized values are overwrite and keep. Overwrite means that the existing
-object will be destroyed and the current declaration will be used. Keep means that
-the existing object will not be destroyed and no creation hence will be done.
--->
-<!ELEMENT if-exists (#PCDATA)>
-
-<!--
-A portal object of type context. A context type represent a node in the tree which
-does not have a visual representation. It can exist only under the root. A context can
-only have children with the portal type.
--->
-<!ELEMENT context (context-name,properties?,listener?,security-constraint?,portal*,
- (display-name* | (resource-bundle, supported-locale+)))>
-
-<!--
-The context name value.
--->
-<!ELEMENT context-name (#PCDATA)>
-
-<!--
-A portal object of type portal. A portal type represents a virtual portal and can
-have children of type page. In addition of the common portal object elements it support
-also the declaration of the modes and the window states it supports. If no declaration
-of modes or window states is done then the default value will be respectively
-(view,edit,help) and (normal,minimized,maximized).
--->
-<!ELEMENT portal (portal-name,supported-modes,supported-window-states?,properties?,
- listener?,security-constraint?,page*,
- (display-name* | (resource-bundle, supported-locale+)))>
-
-<!--
-The portal name value.
--->
-<!ELEMENT portal-name (#PCDATA)>
-
-
-<!--
-The supported modes of a portal.
-
-Example:
-
-<supported-mode>
- <mode>view</mode>
- <mode>edit</mode>
- <mode>help</mode>
-</supported-mode>
--->
-<!ELEMENT supported-modes (mode*)>
-
-<!--
-A portlet mode value.
--->
-<!ELEMENT mode (#PCDATA)>
-
-<!--
-The supported window states of a portal.
-
-Example:
-
-<supported-window-states>
- <window-state>normal</window-state>
- <window-state>minimized</window-state>
- <window-state>maximized</window-state>
-</supported-window-states>
-
--->
-<!ELEMENT supported-window-states (window-state*)>
-
-<!--
-A window state value.
--->
-<!ELEMENT window-state (#PCDATA)>
-
-<!--
-A portal object of type page. A page type represents a page which can have children of
-type page and window. The children windows are the windows of the page and the children
-pages are the subpages of this page.
--->
-<!ELEMENT page (page-name,properties?,listener?,security-constraint?,(page|window)*,
- (display-name* | (resource-bundle, supported-locale+)))>
-
-<!ELEMENT display-name (#PCDATA)>
-<!ATTLIST display-name
- xml:lang NMTOKEN #IMPLIED
->
-
-<!ELEMENT resource-bundle (#PCDATA)>
-
-<!ELEMENT supported-locale (#PCDATA)>
-
-<!--
-The page name value.
--->
-<!ELEMENT page-name (#PCDATA)>
-
-<!--
-A portal object of type window. A window type represents a window. Beside the common
-properties a window has a content and belong to a region on the page.
-
-The instance-ref or content tags are used to define the content of the window. The
-usage of the content tag is generic and can be used to describe any kind of content.
-The instance-ref is a shortcut to define a content type of portlet which points to a
-portlet instance.
-
-The region and height defines how the window is placed in the page.
--->
-<!ELEMENT window (window-name,(instance-ref|content),region,height,
- initial-window-state?,initial-mode?,properties?,listener?,
- (display-name* | (resource-bundle, supported-locale+)))>
-
-<!--
-The window name value.
--->
-<!ELEMENT window-name (#PCDATA)>
-
-<!--
-Define the content of the window as a reference to a portlet instance. The value
-is the id of the instance.
-
-Example:
-
-<instance-ref>MyPortletInstance</instance-ref>
-
--->
-<!ELEMENT instance-ref (#PCDATA)>
-
-<!--
-Define the content of the window in a generic manner. The content is define by
-the type of the content and an URI which acts as an identificator for the content.
-
-Example:
-
-<content>
- <content-type>portlet</content-type>
- <content-uri>MyPortletInstance</content-uri>
-</content>
-
-<content>
- <content-type>cms</content-type>
- <content-uri>/default/index.html</content-uri>
-</content>
-
--->
-<!ELEMENT content (content-type,content-uri)>
-
-<!--
-The content type of the window.
--->
-<!ELEMENT content-type (#PCDATA)>
-
-<!--
-The content URI of the window.
--->
-<!ELEMENT content-uri (#PCDATA)>
-
-<!--
-The region the window belongs to.
--->
-<!ELEMENT region (#PCDATA)>
-
-<!--
-The window state to use when the window is first accessed
--->
-<!ELEMENT initial-window-state (#PCDATA)>
-
-<!--
-The mode to use when the window is first accessed
--->
-<!ELEMENT initial-mode (#PCDATA)>
-
-<!--
-The height of the window in the particular region.
--->
-<!ELEMENT height (#PCDATA)>
-
-<!--
-Define a listener for a portal object. The value is the id of the listener.
--->
-<!ELEMENT listener (#PCDATA)>
-
-<!--
-A set of generic properties for the portal object.
--->
-<!ELEMENT properties (property*)>
-
-<!--
-A generic string property.
--->
-<!ELEMENT property (name,value)>
-
-<!--
-A name value.
--->
-<!ELEMENT name (#PCDATA)>
-
-<!--
-A value.
--->
-<!ELEMENT value (#PCDATA)>
-
-<!--
-The security-constraint element is a container for policy-permission elements
-
-Examples:
-
-<security-constraint>
- <policy-permission>
- <role-name>User</role-name>
- <action-name>view</action-name>
- </policy-permission>
-</security-constraint>
-
-<security-constraint>
- <policy-permission>
- <unchecked/>
- <action-name>view</action-name>
- </policy-permission>
-</security-constraint>
--->
-<!ELEMENT security-constraint (policy-permission*)>
-
-<!--
-The policy-permission element is used to secure a specific portal page based on a
-user's role.
--->
-<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>
-
-<!--
-The role-name element is used to define a role that this security constraint will apply to
-
- * <role-name>SOMEROLE</role-name> Access to this portal page is limited to the defined role.
--->
-<!ELEMENT action-name (#PCDATA)>
-
-<!--
-The unchecked element is used to define (if present) that anyone can view this portal page
--->
-<!ELEMENT unchecked EMPTY>
-
-<!--
-The action-name element is used to define the access rights given to the role defined.
-Possible values are:
-
- * view - Users can view the page.
--->
-<!ELEMENT role-name (#PCDATA)>
-
-
-]]></programlisting>
- </para>
-</appendix>
- <!-- DO NOT EDIT ME DIRECTLY, I AM GENERATED FROM THE DTD USING THE dtd2docbook ANT TASK --><appendix id="portletInstancesDTD">
- <title>portlet-instances.xml DTD</title>
- <para>
-<programlisting><![CDATA[
-
- <?xml version="1.0" encoding="UTF-8" ?>
-
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
- ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<!--
-<!DOCTYPE deployments PUBLIC
- "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
- "http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
--->
-
-<!--
-The deployements element is a container for deployment elements.
--->
-<!ELEMENT deployments (deployment*)>
-
-<!--
-The deployment is a container for an instance element.
--->
-<!ELEMENT deployment (if-exists?,instance)>
-
-<!--
-The if-exists element is used to define action to take if instance with such name is
-already present. Possible values are overwrite or keep . Overwrite will destroy the
-existing object in the database and create a new one, based on the content of the
-deployment. Keep will maintain the existing object deployment or create a new one if
-it does not yet exist.
--->
-<!ELEMENT if-exists (#PCDATA)>
-
-<!--
-The instance element is used to create an instance of a portlet from the portlet
-application of the same war file containing the portlet-instances.xml file. The portlet
-will be created and configured only if the portlet is present and an instance with
-such a name does not already exist.
-
-Example :
-
-<instance>
- <instance-id>MyPortletInstance</instance-id>
- <portlet-ref>MyPortlet</portlet-ref>
- <preferences>
- <preference>
- <name>abc</name>
- <value>def</value>
- </preference>
- </preferences>
- <security-constraint>
- <policy-permission>
- <role-name>User</role-name>
- <action-name>view</action-name>
- </policy-permission>
- </security-constraint>
-</instance>
-
--->
-<!ELEMENT instance (instance-id,portlet-ref,display-name*,preferences?,
- security-constraint?, (display-name* | (resource-bundle, supported-locale+)))>
-
-<!ELEMENT display-name (#PCDATA)>
-<!ATTLIST display-name
- xml:lang NMTOKEN #IMPLIED
->
-
-<!ELEMENT resource-bundle (#PCDATA)>
-
-<!ELEMENT supported-locale (#PCDATA)>
-
-
-<!--
-The identifier of the instance.
--->
-<!ELEMENT instance-id (#PCDATA)>
-
-<!--
-The reference to the portlet which is its portlet name.
--->
-<!ELEMENT portlet-ref (#PCDATA)>
-
-<!--
-Display name is the string used to represent this instance
--->
-<!ELEMENT display-name (#PCDATA)>
-<!ATTLIST display-name
- xml:lang NMTOKEN #IMPLIED
->
-
-<!--
-The preferences element configures the instance with a specific set of preferences.
--->
-<!ELEMENT preferences (preference+)>
-
-<!--
-The preference configure one preference of a set of preferences.
--->
-<!ELEMENT preference (name,value)>
-
-<!--
-A name.
--->
-<!ELEMENT name (#PCDATA)>
-
-<!--
-A string value.
--->
-<!ELEMENT value (#PCDATA)>
-
-<!--
-The security-constraint element is a container for policy-permission elements
-
-Examples:
-
-<security-constraint>
- <policy-permission>
- <role-name>User</role-name>
- <action-name>view</action-name>
- </policy-permission>
-</security-constraint>
-
-<security-constraint>
- <policy-permission>
- <unchecked/>
- <action-name>view</action-name>
- </policy-permission>
-</security-constraint>
--->
-<!ELEMENT security-constraint (policy-permission*)>
-
-<!--
-The policy-permission element is used to secure a specific portlet instance based on a
-user's role.
--->
-<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>
-
-<!--
-The action-name element is used to define the access rights given to the role defined.
-Possible values are:
-
- * view - Users can view the page.
- * viewrecursive - Users can view the page and child pages.
- * personalize - Users are able to view AND personalize the page.
- * personalizerecursive - Users are able to view AND personalize the page AND its child
- pages.
--->
-<!ELEMENT action-name (#PCDATA)>
-
-<!--
-The unchecked element is used to define (if present) that anyone can view this instance
--->
-<!ELEMENT unchecked EMPTY>
-
-<!--
-The role-name element is used to define a role that this security constraint will apply to
-
- * <role-name>SOMEROLE</role-name> Access to this instance is limited to the defined role.
--->
-<!ELEMENT role-name (#PCDATA)>
-
-
-]]></programlisting>
- </para>
-</appendix>
- <!-- DO NOT EDIT ME DIRECTLY, I AM GENERATED FROM THE DTD USING THE dtd2docbook ANT TASK --><appendix id="jbossPortletDTD">
- <title>jboss-portlet.xml DTD</title>
- <para>
-<programlisting><![CDATA[
-
- <?xml version="1.0" encoding="UTF-8" ?>
-
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
- ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<!-- The additional configuration elements of the JBoss portlet container.
-
-<!DOCTYPE portlet-app PUBLIC
- "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
--->
-
-<!--
-The remotable element is used to configure the default behavior of the portlets with
-respect to WSRP exposure.
-
-For each portlet defined in portlet.xml, it is possible to configure specific
-settings of the portlet container.
-
-It is also possible to inject services in the portlet context of the application
-using the service elements.
--->
-<!ELEMENT portlet-app (remotable?,portlet*,service*)>
-
-<!--
-Additional configuration for a portlet.
-
-The portlet-name defines the name of the portlet. It must match a portlet defined already
-in portlet.xml of the same web application.
-
-The remotable element configures the portlet exposure to WSRP. If no value is present
-then the value considered is either the value defined globally at the portlet
-application level or false.
-
-The trans-attribute value specifies the behavior of the portlet when it is invoked at
-runtime with respect to the transactionnal context. According to how the portlet is
-invoked a transaction may exist or not before the portlet is invoked. Usually in the
-local context the portal transaction could be present. By default the value considered is
- NotSupported which means that the portal transaction will be suspended for the duration
- of the portlet invocation.
-
-Example:
-
-<portlet>
- <portlet-name>MyPortlet</portlet-name>
- <remotable>true</remotable>
- <trans-attribute>Required</trans-attribute>
-</portlet>
-
--->
-<!ELEMENT portlet (portlet-name,remotable?,ajax?,session-config?,transaction?,
- header-content?,portlet-info?)>
-
-<!--
-The portlet name.
--->
-<!ELEMENT portlet-name (#PCDATA)>
-
-<!--
-The remotable value is used for WSRP exposure. The accepted values are the
-litterals true of false.
--->
-<!ELEMENT remotable (#PCDATA)>
-
-<!--
-The ajax tag allows to configure the ajax capabilities of the portlet. If
-the portlet is tagged as partial-refresh then the portal may use partial page
-refreshing and render only that portlet. If the portlet partial-refresh value
-is false, then the portal will perform a full page refresh when the portlet is refreshed.
--->
-<!ELEMENT ajax (partial-refresh)>
-
-<!--
-The authorized values for the partial-refresh element are true or false.
--->
-<!ELEMENT partial-refresh (#PCDATA)>
-
-<!--
-Additional portlet information
--->
-<!ELEMENT portlet-info (icon?)>
-
-<!--
-Defines icons for the portlet, they can be used by the administration portlet
-to represent a particular portlet.
--->
-<!ELEMENT icon (small-icon?, large-icon?)>
-
-<!--
-A small icon image, usually 16x16, gif, jpg and png are usually supported.
-An absolute URL or a URL starting with a '/' in the context of the webapp are accepted:
-eg. http://www.example.com/images/smallIcon.png
-eg. /images/smallIcon.png
--->
-<!ELEMENT small-icon (#PCDATA)>
-
-<!--
-A large icon image, usually 32x32, gif, jpg and png are usually supported.
-An absolute URL or a URL starting with a '/' in the context of the webapp are accepted:
-eg. http://www.example.com/images/smallIcon.png
-eg. /images/smallIcon.png
--->
-<!ELEMENT large-icon (#PCDATA)>
-
-<!--
-This element configure the portlet session of the portlet.
-
-The distributed element instructs the container to distribute the session attributes
-using the portal session replication. It applies only to local portlets are not to
-remote portlets. The default value is false.
-
-Example:
-
-<session-config>
- <distributed>true</distributed>
-</session-config>
-
--->
-<!ELEMENT session-config (distributed)>
-
-<!--
-The authorized values for the distributed element are true or false.
--->
-<!ELEMENT distributed (#PCDATA)>
-
-<!--
-Defines how the portlet behaves with the transactionnal context. The default value
-is Never.
-
-Example:
-
-<transaction>
- <trans-attribute>Required</transaction>
-<transaction>
--->
-<!ELEMENT transaction (trans-attribute)>
-
-<!--
-The trans-attribute value defines the transactionnal behavior. The accepted values
-are Required, Mandatory, Never, Supports, NotSupported and RequiresNew.
--->
-<!ELEMENT trans-attribute (#PCDATA)>
-
-<!--
-Specify content which should be included in the portal aggregated page when the portlet
-is present on that page. This setting only applies when the portlet is used in the local mode.
--->
-<!ELEMENT header-content (link|script|meta)*>
-
-<!--
-Creates a header markup element for linked resources,
-see http://www.w3.org/TR/html401/struct/links.html#h-12.3
-
-At runtime the href attribute value will be prefixed with the context path
-of the web application.
-
-Example:
-
-<link rel="stylesheet" type="text/css" href="/style.css" media="screen"/>
-
-will produce at runtime the following markup
-
-<link rel="stylesheet" type="text/css" href="/my-web-application/style.css" media="screen"/>
--->
-<!ATTLIST link
- href CDATA #IMPLIED
- rel CDATA #IMPLIED
- type CDATA #IMPLIED
- media CDATA #IMPLIED
- title CDATA #IMPLIED>
-
-<!--
-No content is allowed inside an link element.
--->
-<!ELEMENT link EMPTY>
-
-<!--
-Creates a header markup for scripting,
-see http://www.w3.org/TR/html401/interact/scripts.html
-
-At runtime the src attribute value will be prefixed with the context path
-of the web application.
-
-Example 1:
-
-<script type="text/javascript" src="/myscript.js"></script>
-
-will produce at runtime the following markup
-
-<script type="text/javascript" src="/my-web-application/myscript.js"></script>
-
-Example 2:
-
-<script type="text/javascript">
- function hello() {
- alert('Hello');
- }
-</script>
--->
-<!ATTLIST script
- src CDATA #IMPLIED
- type CDATA #IMPLIED
- language CDATA #IMPLIED>
-
-<!--
-The script header element can contain inline script definitions.
--->
-<!ELEMENT script (#PCDATA)>
-
-<!--
-Creates a header markup for adding meta data to a page,
-see http://www.w3.org/TR/html401/struct/global.html#h-7.4.4
-
-Example:
-
-<meta name="keywords" content="jboss, portal, redhat"/>
--->
-<!ATTLIST meta
- name CDATA #REQUIRED
- content CDATA #REQUIRED>
-
-<!--
-No content is allowed for meta element.
--->
-<!ELEMENT meta EMPTY>
-
-<!--
-Declare a service that will be injected by the portlet container as an
-attribute of the portlet context.
-
-Example:
-
-<service>
- <service-name>UserModule</service-name>
- <service-class>org.jboss.portal.identity.UserModule</service-class>
- <service-ref>:service=Module,type=User</service-ref>
-</service>
-
-In the portlet it is then possible to use it by doing a lookup on the service
-name, for example in the init() lifecycle method :
-
-public void init()
-{
- UserModule userModule = (UserModule)getPortletContext().getAttribute("UserModule");
-}
-
--->
-<!ELEMENT service (service-name,service-class,service-ref)>
-
-<!--
-The service name that will be used to bind the service as a portlet context attribute.
--->
-<!ELEMENT service-name (#PCDATA)>
-
-<!--
-The full qualified name of the interface that the service implements.
--->
-<!ELEMENT service-class (#PCDATA)>
-
-<!--
-The reference to the service. In the JMX Microkernel environment it consist of the JMX
-name of the service MBean. For an MBean reference if the domain is left out, then the
-current domain of the portal will be used.
--->
-<!ELEMENT service-ref (#PCDATA)>
-
-
-]]></programlisting>
- </para>
-</appendix>
-</book>
15 years, 6 months