gatein SVN: r6227 - in portal/branches/decoupled-webos: webui/portal/src/main/java/org/exoplatform/portal/webui/page and 2 other directories.
by do-not-reply@jboss.org
Author: phuong_vu
Date: 2011-04-15 03:34:42 -0400 (Fri, 15 Apr 2011)
New Revision: 6227
Modified:
portal/branches/decoupled-webos/component/portal/src/main/java/org/exoplatform/portal/config/model/Page.java
portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPage.java
portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java
portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java
portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/util/Util.java
portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java
Log:
GTNPORTAL-1783 Improve UIPage to make it easier for extending in other extension project
Modified: portal/branches/decoupled-webos/component/portal/src/main/java/org/exoplatform/portal/config/model/Page.java
===================================================================
--- portal/branches/decoupled-webos/component/portal/src/main/java/org/exoplatform/portal/config/model/Page.java 2011-04-15 07:29:10 UTC (rev 6226)
+++ portal/branches/decoupled-webos/component/portal/src/main/java/org/exoplatform/portal/config/model/Page.java 2011-04-15 07:34:42 UTC (rev 6227)
@@ -200,19 +200,5 @@
public String toString()
{
return "Page[ownerType=" + ownerType + ",ownerId=" + ownerId + ",name=" + name + "]";
- }
-
- @Override
- public final String getFactoryId()
- {
- String factoryId = super.getFactoryId();
- if (factoryId != null)
- {
- return factoryId;
- }
- else
- {
- return "org.exoplatform.portal.webui.page.UIPage";
- }
- }
+ }
}
\ No newline at end of file
Modified: portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPage.java
===================================================================
--- portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPage.java 2011-04-15 07:29:10 UTC (rev 6226)
+++ portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPage.java 2011-04-15 07:34:42 UTC (rev 6227)
@@ -36,6 +36,8 @@
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
+import java.util.HashMap;
+import java.util.Map;
/**
* May 19, 2006
@@ -44,7 +46,6 @@
@EventConfig(name = "EditCurrentPage", listeners = UIPage.EditCurrentPageActionListener.class)})
public class UIPage extends UIContainer
{
-
/** . */
private String pageId;
@@ -58,6 +59,28 @@
private UIPortlet maximizedUIPortlet;
+ protected static Map<String, Class<? extends UIPage>> realClass;
+
+ public static String DEFAULT_FACTORY_ID = "Default";
+
+ static
+ {
+ if (realClass == null)
+ {
+ realClass = new HashMap<String, Class<? extends UIPage>>();
+ realClass.put(DEFAULT_FACTORY_ID, UIPage.class);
+ }
+ }
+
+ public static Class<? extends UIPage> getRealClass(String factoryID)
+ {
+ if (factoryID == null || factoryID.trim().equals("") || factoryID.trim().equals(DEFAULT_FACTORY_ID))
+ {
+ return UIPage.class;
+ }
+ return realClass.get(factoryID);
+ }
+
public String getOwnerId()
{
return ownerId;
@@ -160,8 +183,7 @@
uiApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
// We clone the edited UIPage object, that is required for Abort action
- Class<? extends UIPage> clazz = Class.forName(page.getFactoryId())
- .asSubclass(UIPage.class);
+ Class<? extends UIPage> clazz = UIPage.getRealClass(uiPage.getFactoryId());
UIPage newUIPage = uiWorkingWS.createUIComponent(clazz, null, null);
PortalDataMapper.toUIPage(newUIPage, page);
uiToolPanel.setWorkingComponent(newUIPage);
Modified: portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java
===================================================================
--- portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java 2011-04-15 07:29:10 UTC (rev 6226)
+++ portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java 2011-04-15 07:34:42 UTC (rev 6227)
@@ -145,8 +145,8 @@
{
return uiPage;
}
-
- Class<? extends UIPage> clazz = Class.forName(page.getFactoryId()).asSubclass(UIPage.class);
+
+ Class<? extends UIPage> clazz = UIPage.getRealClass(page.getFactoryId());
uiPage = createUIComponent(context, clazz, null, null);
PortalDataMapper.toUIPage(uiPage, page);
Modified: portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java
===================================================================
--- portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java 2011-04-15 07:29:10 UTC (rev 6226)
+++ portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java 2011-04-15 07:34:42 UTC (rev 6227)
@@ -343,7 +343,7 @@
UIPagePreview uiPagePreview = uiWizard.getChild(UIPagePreview.class);
- Class<? extends UIPage> clazz = Class.forName(page.getFactoryId()).asSubclass(UIPage.class);
+ Class<? extends UIPage> clazz = UIPage.getRealClass(page.getFactoryId());
UIPage uiPage = uiWizard.createUIComponent(context, clazz, null, null);
PortalDataMapper.toUIPage(uiPage, page);
Modified: portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/util/Util.java
===================================================================
--- portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/util/Util.java 2011-04-15 07:29:10 UTC (rev 6226)
+++ portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/util/Util.java 2011-04-15 07:34:42 UTC (rev 6227)
@@ -226,7 +226,7 @@
return uiPage;
WebuiRequestContext context = Util.getPortalRequestContext();
- Class<? extends UIPage> clazz = Class.forName(page.getFactoryId()).asSubclass(UIPage.class);
+ Class<? extends UIPage> clazz = UIPage.getRealClass(page.getFactoryId());
uiPage = uiParent.createUIComponent(context, clazz, null, null);
PortalDataMapper.toUIPage(uiPage, page);
Modified: portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java
===================================================================
--- portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java 2011-04-15 07:29:10 UTC (rev 6226)
+++ portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java 2011-04-15 07:34:42 UTC (rev 6227)
@@ -93,7 +93,7 @@
uiApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
// We clone the edited UIPage object, that is required for Abort action
- Class<? extends UIPage> clazz = Class.forName(page.getFactoryId()).asSubclass(UIPage.class);
+ Class<? extends UIPage> clazz = UIPage.getRealClass(page.getFactoryId());
UIPage newUIPage = uiWorkingWS.createUIComponent(clazz, null, null);
PortalDataMapper.toUIPage(newUIPage, page);
uiToolPanel.setWorkingComponent(newUIPage);
13 years, 9 months
gatein SVN: r6226 - in portal/branches/decoupled-webos: portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component and 8 other directories.
by do-not-reply@jboss.org
Author: phuong_vu
Date: 2011-04-15 03:29:10 -0400 (Fri, 15 Apr 2011)
New Revision: 6226
Removed:
portal/branches/decoupled-webos/web/portal/src/main/webapp/groovy/portal/webui/application/UIAddNewApplication.gtmpl
portal/branches/decoupled-webos/web/portal/src/main/webapp/groovy/portal/webui/page/UIDesktopPage.gtmpl
portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIAddNewApplication.java
portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIDesktopPage.java
Modified:
portal/branches/decoupled-webos/component/portal/src/main/java/org/exoplatform/portal/config/model/Page.java
portal/branches/decoupled-webos/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIAdminToolbarPortlet.java
portal/branches/decoupled-webos/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
portal/branches/decoupled-webos/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPage.java
portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java
portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java
portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java
portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java
portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/util/Util.java
portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java
portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalToolPanel.java
portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIWorkingWorkspace.java
Log:
GTNPORTAL-1786 Remove WebOS checking from UIPageCreationWizard, UIPageForm, UIPortalToolPanel (squash a7fbb1e , 705608e, 024de96, ed54678)
Modified: portal/branches/decoupled-webos/component/portal/src/main/java/org/exoplatform/portal/config/model/Page.java
===================================================================
--- portal/branches/decoupled-webos/component/portal/src/main/java/org/exoplatform/portal/config/model/Page.java 2011-04-14 16:21:08 UTC (rev 6225)
+++ portal/branches/decoupled-webos/component/portal/src/main/java/org/exoplatform/portal/config/model/Page.java 2011-04-15 07:29:10 UTC (rev 6226)
@@ -31,9 +31,6 @@
**/
public class Page extends Container
{
-
- final static public String DESKTOP_PAGE = "Desktop";
-
final static public String DEFAULT_PAGE = "Default";
private String ownerType;
@@ -204,4 +201,18 @@
{
return "Page[ownerType=" + ownerType + ",ownerId=" + ownerId + ",name=" + name + "]";
}
+
+ @Override
+ public final String getFactoryId()
+ {
+ String factoryId = super.getFactoryId();
+ if (factoryId != null)
+ {
+ return factoryId;
+ }
+ else
+ {
+ return "org.exoplatform.portal.webui.page.UIPage";
+ }
+ }
}
\ No newline at end of file
Modified: portal/branches/decoupled-webos/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIAdminToolbarPortlet.java
===================================================================
--- portal/branches/decoupled-webos/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIAdminToolbarPortlet.java 2011-04-14 16:21:08 UTC (rev 6225)
+++ portal/branches/decoupled-webos/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIAdminToolbarPortlet.java 2011-04-15 07:29:10 UTC (rev 6226)
@@ -40,9 +40,6 @@
@ComponentConfig(lifecycle = UIApplicationLifecycle.class, template = "app:/groovy/admintoolbar/webui/component/UIAdminToolbarPortlet.gtmpl")
public class UIAdminToolbarPortlet extends UIPortletApplication
{
- // Minh Hoang TO
- // TODO: Add a ThreadLocal cache to avoid double invocation of editPermission
- // check ( one in processRender method, and one in Groovy template )
public UIAdminToolbarPortlet() throws Exception
{
Modified: portal/branches/decoupled-webos/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- portal/branches/decoupled-webos/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml 2011-04-14 16:21:08 UTC (rev 6225)
+++ portal/branches/decoupled-webos/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml 2011-04-15 07:29:10 UTC (rev 6226)
@@ -22,6 +22,12 @@
<portlet-app version="1.0" 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">
+
+ <public-render-parameter>
+ <identifier>navigation_uri</identifier>
+ <qname xmlns:prp='http://www.gatein.org/xml/ns/prp_1_0'>prp:navigation_uri</qname>
+ </public-render-parameter>
+
<portlet>
<description xml:lang="EN">Organization Portlet</description>
<portlet-name>OrganizationPortlet</portlet-name>
@@ -253,6 +259,8 @@
<short-title>Administration Toolbar</short-title>
<keywords>gatein_internal</keywords>
</portlet-info>
+
+ <supported-public-render-parameter>navigation_uri</supported-public-render-parameter>
</portlet>
<portlet>
Modified: portal/branches/decoupled-webos/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
===================================================================
--- portal/branches/decoupled-webos/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2011-04-14 16:21:08 UTC (rev 6225)
+++ portal/branches/decoupled-webos/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2011-04-15 07:29:10 UTC (rev 6226)
@@ -432,6 +432,7 @@
UIPageBrowser.msg.NotViewPage=You have not the rights to view this page.
UIPageBrowser.msg.edit.NotEditPage=You have not the rights to edit this page.
UIPageBrowser.msg.delete.NotDelete=You have not the rights to delete this page.
+UIPageBrowser.msg.delete.DeleteCurrentUserPage=You have to switch to other page to delete this page
UIPageBrowser.selectItem.ownerType=Owner Type
UIPageBrowser.selectItem.ownerId=Owner Id
UIPageBrowser.selectItem.name=Name
Deleted: portal/branches/decoupled-webos/web/portal/src/main/webapp/groovy/portal/webui/application/UIAddNewApplication.gtmpl
===================================================================
--- portal/branches/decoupled-webos/web/portal/src/main/webapp/groovy/portal/webui/application/UIAddNewApplication.gtmpl 2011-04-14 16:21:08 UTC (rev 6225)
+++ portal/branches/decoupled-webos/web/portal/src/main/webapp/groovy/portal/webui/application/UIAddNewApplication.gtmpl 2011-04-15 07:29:10 UTC (rev 6226)
@@ -1,152 +0,0 @@
-<%
- import org.exoplatform.web.application.Parameter;
- List appCategories = uicomponent.getApplicationCategories();
-%>
-<div class="UIAddApplication" id="UIAddNewApplication">
- <div class="UIBarStyle">
- <div class="TitleBar">
- <div class="LeftBar">
- <div class="RightBar">
- <div class="MiddleBar"><%=_ctx.appRes("UIAddNewApplication.label.AddApplication")%></div>
- </div>
- </div>
- </div>
- </div>
-
- <div class="ContentContainerDetail">
- <div class="CategoryContainer">
-
- <div class="UITabContentContainer">
- <div class="UITabContent" style="display: block">
- <div class="UIAddPortlet">
- <div class="UIItemSelector">
- <div class="LeftColumnStyle">
- <div class="ItemListContainer">
-
- <div class="ItemListTitle">
- <div class="TitleIcon ItemListIcon"><span></span></div>
- <div class="Title"><%=_ctx.appRes("UIAddNewApplication.label.Categories")%></div>
- <div class="ClearLeft"><span></span></div>
- </div>
- <div class="ItemList">
- <%
- boolean selected = true;
- for(category in appCategories){
- %>
- <div onmouseout="eXo.webui.UIItemSelector.onOver(this, false);" onmouseover="eXo.webui.UIItemSelector.onOver(this, true);" onclick="eXo.webui.UIItemSelector.onClick(this);" class="<%= selected ? "SelectedItem" : "" %> Item" title="<%=category.getDisplayName()%>">
- <div class="LeftItem">
- <div class="RightItem"><div id="<%=category.getName()%>" class="ItemTitle"><div class="CenterItemTitle"><%=category.getDisplayName()%></div></div></div>
- </div>
- </div>
- <%
- selected = false;
- }
- %>
- </div>
-
- </div>
-
- <div class="ItemDetailList">
- <div class="ItemDetailTitle">
- <div class="TitleIcon ViewListIcon"><span></span></div>
- <div class="Title"><%=_ctx.appRes("UIAddNewApplication.label.Select")%></div>
- <div class="ClearLeft"><span></span></div>
- </div>
- <div class="ApplicationListContainer">
- <% if(appCategories==null || appCategories.isEmpty()){ %>
- <div class="ItemDetail" style="display:block">
- <div class="NoneAppsMessage" style="display:block">
- <%=_ctx.appRes("UIAddNewApplication.label.NoneApp")%>
- </div>
- </div>
- <% } %>
- <%
- selected = true;
- for(category in appCategories) {
- List listApplication = category.getApplications();
- %>
- <div class="ItemDetail" style="display: <%= selected ? "block" : "none" %>">
-
- <%
- for(application in listApplication) {
- String srcBG = application.getApplicationGroup() + "/skin/DefaultSkin/portletIcons/" + application.getApplicationName()+ ".png";
- String srcNormalBG = "/eXoResources/skin/sharedImages/Icon80x80/DefaultPortlet.png";
-
- //Create add Application Ajax request URL
- String callingAction = "AddApplication";
- String addApplicationURL = uicomponent.event(callingAction, application.getId());
- String addToStartup = uicomponent.event("AddToStartup", application.getId());
- %>
- <div class="Application">
- <div class="ApplicationDescription">
- <div onclick="$addApplicationURL" title="<%= application.getDisplayName() %>" class="PortletIcon">
- <span><img src="/$srcBG" alt="" onError="src='$srcNormalBG'" /></span>
- </div>
- <div class="ApplicationContent">
- <div class="TitleBarApplication">
- <div class="Title"><%= application.getDisplayName() %></div>
- <div class="ApplicationButton">
- <% if (org.exoplatform.web.application.Application.EXO_PORTLET_TYPE.equals(application.getApplicationType())) { %>
- <div title="<%=_ctx.appRes("UIAddNewApplication.label.AddToStartup")%>" class="AddToStartUp" onclick="$addToStartup" ><span></span></div>
- <%}%>
- <div title="<%=_ctx.appRes("UIAddNewApplication.label.Add")%>" class="AddButton" onclick="$addApplicationURL" ><span></span></div>
- </div>
- </div>
- <div class="ApplicationContentLabel">
- <div class="ContentLabel">
- <span class="LeftLabel"><%=_ctx.appRes("UIAddNewApplication.label.Type")%></span>
- <span class="RightLabel"><%=application.getApplicationType()%></span>
- </div>
- <div class="ContentLabel">
- <span class="LeftLabel"><%=_ctx.appRes("UIAddNewApplication.label.Created")%></span>
- <span class="RightLabel">eXo Platform SAS.</span>
- </div>
- <div class="ContentLabel">
- <span class="LeftLabel"><%=_ctx.appRes("UIAddNewApplication.label.Description")%></span>
- <span class="RightLabel"><%= application.getDescription() %></span>
- </div>
- </div>
- </div>
- </div>
- <div class="ClearRight"><span ></span></div>
- </div>
- <%
- }
- %>
-
- </div>
- <%
- selected = false;
- }
- %>
- </div>
- </div>
- <div class="ClearLeft"><span></span></div>
- </div>
- </div>
- </div>
- </div>
- </div>
-
- </div>
- </div>
-
- <div class="UIAction">
- <table class="ActionContainer">
- <tr>
- <td>
- <div class="ActionButton LightBlueStyle" onclick="<%= uicomponent.event("Close") %>" >
- <div class="ButtonLeft">
- <div class="ButtonRight">
- <div class="ButtonMiddle">
- <a href="javascript:void(0);"><%=_ctx.appRes("UIAddNewApplication.label.Close")%></a>
- </div>
- </div>
- </div>
- </div>
- </td>
- </tr>
- </table>
- </div>
-
-</div>
\ No newline at end of file
Deleted: portal/branches/decoupled-webos/web/portal/src/main/webapp/groovy/portal/webui/page/UIDesktopPage.gtmpl
===================================================================
--- portal/branches/decoupled-webos/web/portal/src/main/webapp/groovy/portal/webui/page/UIDesktopPage.gtmpl 2011-04-14 16:21:08 UTC (rev 6225)
+++ portal/branches/decoupled-webos/web/portal/src/main/webapp/groovy/portal/webui/page/UIDesktopPage.gtmpl 2011-04-15 07:29:10 UTC (rev 6226)
@@ -1,307 +0,0 @@
-<%
- import org.exoplatform.portal.webui.application.UIPortlet;
- import org.exoplatform.web.application.JavascriptManager;
- import org.exoplatform.portal.config.model.PageNavigation;
- import org.exoplatform.portal.config.model.PageNode;
- def rcontext = _ctx.getRequestContext();
- JavascriptManager jsmanager = rcontext.getJavascriptManager();
-
- jsmanager.importJavascript('eXo.desktop.UIDesktop');
- jsmanager.importJavascript('eXo.webui.UIPopupSelectCategory');
- jsmanager.importJavascript('eXo.desktop.UIWindow');
- jsmanager.importJavascript('eXo.webui.UIRightClickPopupMenu');
- jsmanager.addCustomizedOnLoadScript("eXo.gadget.UIGadget.SaveTitle='" + _ctx.appRes("UIDashboardContainer.label.SaveTitle") + "';");
- jsmanager.addCustomizedOnLoadScript("eXo.gadget.UIGadget.CancelTitle='" + _ctx.appRes("UIDashboardContainer.label.CancelTitle") + "';");
- jsmanager.addCustomizedOnLoadScript("eXo.gadget.UIGadget.Cache='" + _ctx.appRes("UIDashboardContainer.label.Cache") + "';");
- jsmanager.addCustomizedOnLoadScript("eXo.gadget.UIGadget.Debug='" + _ctx.appRes("UIDashboardContainer.label.Debug") + "';");
- jsmanager.addCustomizedOnLoadScript('eXo.desktop.UIDockbar.initNav();');
-
- String docBase = rcontext.getRequestContextPath();
- String comId = uicomponent.getId();
- boolean modifiable = uicomponent.isModifiable();
-
- void renderSinglePageNode(PageNavigation nav, PageNode node) {
- String href = uicomponent.event("ChangePage", nav.getId() + "::" + node.getUri());
- String icon = node.getIcon();
- if(icon == null) icon = "DefaultPageIcon";
- print """
- <div class="MenuItem">
- <div class="LabelItem">
- <div class="Icon $icon" style="padding-left: 18px">
- <div class="LabelText"><a href="#" onclick="$href">$node.resolvedLabel</a></div>
- </div>
- </div>
- </div>
- """;
- }
-
- void renderPageNode(PageNavigation nav, PageNode node) {
- String href = uicomponent.event("ChangePage", nav.getId() + "::" + node.getUri());
- String icon = node.getIcon();
- String scrollUpTitle = _ctx.appRes("UIExoStart.tooltip.scrollUp");
- String scrollDownTitle = _ctx.appRes("UIExoStart.tooltip.scrollDown");
- if(icon == null) icon = "DefaultPageIcon";
- print """
- <div class="MenuItem">
- <div class="LabelItem">
- <div class="Icon $icon" style="padding-left: 18px">
- <div class="BlackArrowIcon">
- <div class="LabelText "><a href="#" onclick="$href">$node.resolvedLabel</a></div>
- </div>
- </div>
- </div>
- <div class="MenuItemContainer">
- <div class="StartMenuDecorator">
- <div class="StartMenuTL">
- <div class="StartMenuTR">
- <div class="StartMenuTC"><span></span></div>
- </div>
- </div>
- <div class="StartMenuML">
- <div class="StartMenuMR">
- <div class="StartMenuBG" style="padding-bottom: 6px">
- <div class="TopNavigator" style="display: none;" title="$scrollUpTitle">
- <div class="UpNavigatorIcon"><span></span></div>
- </div>
- <div class="BlockMenu">
- <div class="MenuContainer">
- """;
- for(child in node.getChildren()) {
- if(child.getChildren() != null && child.getChildren().size() > 0) renderPageNode(nav, child);
- else renderSinglePageNode(nav, child);
- }
- print """
- </div>
- </div>
- <div class="BottomNavigator" style="display: none;" title="$scrollDownTitle">
- <div class="DownNavigatorIcon"><span></span></div>
- </div>
- </div>
- </div>
- </div>
- <div class="StartMenuBL">
- <div class="StartMenuBR">
- <div class="StartMenuBC"><span></span></div>
- </div>
- </div>
- </div>
- </div>
- </div>
- """;
- }
-
- void renderPageNavigation(PageNavigation navigation) {
- nodes = navigation.getNodes();
- if(nodes.size() < 1) return;
- String navTitle = _ctx.appRes("UIPageNavigation.label.titleBar");
- navTitle = navTitle.replace("{0}", navigation.ownerId);
- print """
- <div class="PageNavigationBlock">
- <div class="DecoratorBlock">
- <div class="PageOwnerContainer">
- <div class="TitleBar">$navTitle </div>
- """;
- for(node in nodes) {
- if(node.getChildren() != null && node.getChildren().size() > 0) {
- renderPageNode(navigation, node);
- }
- else renderSinglePageNode(navigation, node);
- }
- print """
- </div>
- </div>
- </div>
- """;
- }
-
- void renderNavigations() {
- String label = _ctx.appRes(uicomponent.getId() + ".item.PageNavigation");
- String scrollUpTitle = _ctx.appRes("UIExoStart.tooltip.scrollUp");
- String scrollDownTitle = _ctx.appRes("UIExoStart.tooltip.scrollDown");
- navigations = uicomponent.getNavigations();
- //if (navigations != null && navigations.size() > 0 && navigations.get(0).getNodes().size() > 0) {
- if (navigations != null && navigations.size() > 0) {
- print """
- <div class="MenuItemContainer NavigationContainer" style="position: absolute; top: -450px;">
- <div class="StartMenuDecorator">
- <div class="StartMenuTL">
- <div class="StartMenuTR">
- <div class="StartMenuTC"><span></span></div>
- </div>
- </div>
- <div class="StartMenuML">
- <div class="StartMenuMR">
- <div class="StartMenuBG" style="padding: 5px 0px;">
- <div class="TopNavigator" style="display: none;" title="$scrollUpTitle">
- <div class="UpNavigatorIcon"><span></span></div>
- </div>
- <div class="BlockMenu">
- <div class="MenuContainer">
- """;
- for(navigation in navigations) {
- renderPageNavigation(navigation);
- }
- print """
- </div>
- </div>
- <div class="BottomNavigator" style="display: none;" title="$scrollDownTitle">
- <div class="DownNavigatorIcon"><span></span></div>
- </div>
- </div>
- </div>
- </div>
- <div class="StartMenuBL">
- <div class="StartMenuBR">
- <div class="StartMenuBC"><span></span></div>
- </div>
- </div>
- </div>
- </div>
- """;
- }
- }
-
-%>
-
-
-<div class="UIPage" id="UIPage-${uicomponent.id}">
- <div class="META-DATA-BLOCK" style="display: none">
- <div class="id">$uicomponent.id</div>
- <div class="title"><%=_ctx.appRes("UIPage.label.title")%></div>
- <div class="description"><%=_ctx.appRes("UIPage.label.description")%></div>
- </div>
- <div class="VIEW-PAGE">
- <div id="UIPage">
- <div class="UIPageDesktop" id="UIPageDesktop">
- <%int x = 15; y = 15 %>
- <%for(uiChild in uicomponent.getChildren()) {
- if(!(uiChild instanceof UIPortlet)) {
- uicomponent.renderUIComponent(uiChild);
- continue;
- }
-
- String popupId = uiChild.getId();
- String title = uiChild.getTitle();
- if(title == null || title.trim().length() < 1) {
- title = popupId;
- uiChild.setTitle(title);
- }
- uiChild.setShowInfoBar(true);
- uiChild.setPortletStyle("Window");
- uicomponent.renderUIComponent(uiChild);
-
- String posX = uiChild.getProperties().get("locationX");
- String posY = uiChild.getProperties().get("locationY");
-
- if(posX == null) posX = (String)x;
- if(posY == null) posY = (String)y;
-
- jsmanager.addJavascript("eXo.desktop.UIWindow.init('UIWindow-${popupId}', true, ${posX}, ${posY});");
- %>
- <% x += 10; y += 20;%>
- <%}%>
-
- <%//String containerMouseOver = "eXo.desktop.UIDockbar.containerMouseOver();";%>
- <div class="UIDockBar" id="UIDockBar" onmouseover="eXo.desktop.UIDockbar.startDockBarEvt(event);">
- <div id="DockNavigation" class="UIExoStart" style="position: absolute; display: none; width: 0px;">
- <div class="StartMenuContainer">
- <% renderNavigations(); %>
- </div>
- </div>
- <div class="UIRightClickPopupMenu" id="DockbarContextMenu" onmousedown="event.cancelBubble = true;">
- <div class="UIContextMenuContainer" >
- <div class="TopLeftRightClickPopupMenu">
- <div class="TopRightRightClickPopupMenu">
- <div class="TopCenterRightClickPopupMenu"><span></span></div>
- </div>
- </div>
- <div class="MiddleLeftRightClickPopupMenu">
- <div class="MiddleRightRightClickPopupMenu">
- <div class="UIRightPopupMenuContainer">
- <div class="MenuItem">
- <a href="javascript:eXo.desktop.UIDesktop.removeApp('<%=uicomponent.url("RemoveChild", "_objectid_")%>')" onclick="return eXo.webui.UIRightClickPopupMenu.prepareObjectId(event, this);"
- class="ItemIcon CloseDockBarIcon"><%=_ctx.appRes("UIPageDesktop.action.Close")%></a>
- </div>
- <div class="MenuItem">
- <a class="ItemIcon QuitDockBarIcon" href="javascript:eXo.desktop.UIDesktop.removeWindowContent('_objectid_')" onclick="return eXo.webui.UIRightClickPopupMenu.prepareObjectId(event, this);" ><%=_ctx.appRes("UIPageDesktop.action.Quit")%></a>
- </div>
- <div class="RightClickCustomItem"><%=_ctx.appRes("UIPageDesktop.action.action.Open")%></div>
- </div>
- </div>
- </div>
- <div class="BottomLeftRightClickPopupMenu">
- <div class="BottomRightRightClickPopupMenu">
- <div class="BottomCenterRightClickPopupMenu">
- <div class="ClickCenterBottom"><span></span></div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="DockbarLeft">
- <div class="DockbarRight">
- <div class="DockbarCenter" id="DockbarCenter">
-
- <div class="IconContainer" id="IconContainer" style="text-align: center;">
- <img id="FixBug" alt="" src="/eXoResources/skin/sharedImages/Debug1x32.gif" />
-
- <%if(rcontext.getRemoteUser() == null) {%>
- <img id="SignInIcon" class="Icon" src="/eXoResources/skin/sharedImages/Icon80x80/Signin.png" alt="" title=""
- onclick="<%=uicomponent.event("ShowLoginForm", null);%>" /><span class="Tooltip" style="display: none;"><%=_ctx.appRes("UIPageDesktop.title.SignIn")%></span>
- <%} else {%>
- <img id="SignOutIcon" class="Icon" src="/eXoResources/skin/sharedImages/Icon80x80/Signout.png" alt="" title=""
- onclick="eXo.portal.logout()" /><span class="Tooltip" style="display: none;"><%=_ctx.appRes("UIPageDesktop.title.SignOut")%></span>
- <%} %>
- <img class="Separator" alt="" src="/webosResources/skin/Defaultskin/portal/webui/component/view/UIPageDesktop/background/Separator2x1.png"/>
-
- <% String changeLanguageAction = "if(document.getElementById('UIMaskWorkspace')) ajaxGet(eXo.env.server.createPortalURL('UIPortal', 'ChangeLanguage', true));"; %>
- <img id="ChangeLanguageIcon" class="Icon" src="/eXoResources/skin/sharedImages/Icon80x80/ChangeLanguage.png" alt="" title=""
- onclick="$changeLanguageAction" /><span class="Tooltip" style="display: none;"><%=_ctx.appRes("UIExoStart.item.ChangeLanguage")%></span>
-
- <img class="Icon" src="/eXoResources/skin/sharedImages/Icon80x80/NavigationIcon.png" alt="" title=""
- id="NavigationIcon"
- onclick="eXo.desktop.UIDockbar.showNavigation(event)"/><span class="Tooltip" style="display: none"><%=_ctx.appRes("UIPageDesktop.title.pageNavigation")%></span>
-
- <%if(modifiable) {%>
- <img class="Icon" src="/eXoResources/skin/sharedImages/Icon80x80/AddPortlet.png" alt="" title=""
- id="UIAddApplicationIcon"
- onclick="<%=uicomponent.event("ShowAddNewApplication")%>"/><span class="Tooltip" style="display: none"><%=_ctx.appRes("UIPageDesktop.title.AddApplication")%></span>
- <%}%>
- <img class="Separator" alt="" src="/webosResources/skin/Defaultskin/portal/webui/component/view/UIPageDesktop/background/Separator2x1.png"/>
- <%
- def res = rcontext.getApplicationResourceBundle();
- String skin = rcontext.getUIApplication().getSkin();
-
- for(uiChild in uicomponent.getChildren()) {
- if(!(uiChild instanceof UIPortlet)) continue;
- String imgLocation = uiChild.getExoWindowID().getPortletApplicationName() + "/skin/DefaultSkin/portletIcons/" + uiChild.getExoWindowID().getPortletName();
- String appStatus = uiChild.getProperties().get("appStatus");
- boolean isVisible = "SHOW".equals(appStatus) || "HIDE".equals(appStatus);
-
- if(rcontext.getRemoteUser() != null) {
- %>
- <img id="DockItem${uiChild.id}" class="Icon <%=isVisible ? "ShowIcon": ""%>" onmousedown="eXo.webui.UIRightClickPopupMenu.clickRightMouse(event, this, 'DockbarContextMenu', '${uiChild.id}', null, 1)" src="/${imgLocation}.png" alt=""
- onerror="this.src='/eXoResources/skin/sharedImages/Icon80x80/DefaultPortlet.png'" onclick="eXo.desktop.UIDesktop.showHideWindow('UIWindow-${uiChild.id}', this);" /><span class="Tooltip" style="display: none"><%=uiChild.getTitle();%></span>
- <%}else{%>
- <img id="DockItem${uiChild.id}" class="Icon <%=isVisible ? "ShowIcon": ""%>" src="/${imgLocation}.png" alt=""
- onerror="this.src='/eXoResources/skin/sharedImages/Icon80x80/DefaultPortlet.png'" onclick="eXo.desktop.UIDesktop.showHideWindow('UIWindow-${uiChild.id}', this);" /><span class="Tooltip" style="display: none"><%=uiChild.getTitle();%></span>
- <%}}%>
-
- <img class="Separator" alt="" src="/webosResources/skin/Defaultskin/portal/webui/component/view/UIPageDesktop/background/Separator2x1.png" />
- <img id="PortletsViewer" class="Icon" src="/eXoResources/skin/sharedImages/Icon80x80/ShowPortletsViewer.png" alt="" title=""/><span class="Tooltip" style="display: none;"><%=_ctx.appRes("UIPageDesktop.title.ShowPortletDesktop")%></span>
- <img id="GadgetsViewer" class="Icon" src="/eXoResources/skin/sharedImages/Icon80x80/HideWidgetsViewer.png" alt="" title=""/><span class="Tooltip" style="display: none;"><%=_ctx.appRes("UIPageDesktop.title.ShowWidgetDesktop")%></span>
- </div>
- </div>
- </div>
- </div>
-
- </div>
- </div>
- </div>
- </div>
-</div>
-
-<%
- jsmanager.addOnLoadJavascript('eXo.desktop.UIDesktop.init');
- jsmanager.addOnResizeJavascript('eXo.desktop.UIDesktop.fixDesktop');
-%>
\ No newline at end of file
Deleted: portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIAddNewApplication.java
===================================================================
--- portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIAddNewApplication.java 2011-04-14 16:21:08 UTC (rev 6225)
+++ portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIAddNewApplication.java 2011-04-15 07:29:10 UTC (rev 6226)
@@ -1,289 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * 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.exoplatform.portal.webui.application;
-
-import org.exoplatform.application.registry.Application;
-import org.exoplatform.application.registry.ApplicationCategory;
-import org.exoplatform.application.registry.ApplicationRegistryService;
-import org.exoplatform.container.ExoContainer;
-import org.exoplatform.container.ExoContainerContext;
-import org.exoplatform.portal.application.PortalRequestContext;
-import org.exoplatform.portal.config.DataStorage;
-import org.exoplatform.portal.config.UserPortalConfigService;
-import org.exoplatform.portal.config.model.ApplicationType;
-import org.exoplatform.portal.config.model.CloneApplicationState;
-import org.exoplatform.portal.config.model.ModelObject;
-import org.exoplatform.portal.config.model.Page;
-import org.exoplatform.portal.config.model.TransientApplicationState;
-import org.exoplatform.portal.pom.spi.gadget.Gadget;
-import org.exoplatform.portal.pom.spi.portlet.Portlet;
-import org.exoplatform.portal.pom.spi.wsrp.WSRPState;
-import org.exoplatform.portal.webui.page.UIPage;
-import org.exoplatform.portal.webui.portal.UIPortal;
-import org.exoplatform.portal.webui.util.PortalDataMapper;
-import org.exoplatform.portal.webui.util.Util;
-import org.exoplatform.portal.webui.workspace.UIMaskWorkspace;
-import org.exoplatform.portal.webui.workspace.UIPortalApplication;
-import org.exoplatform.portal.webui.workspace.UIPortalToolPanel;
-import org.exoplatform.portal.webui.workspace.UIWorkingWorkspace;
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-import org.exoplatform.webui.config.annotation.EventConfig;
-import org.exoplatform.webui.core.UIComponent;
-import org.exoplatform.webui.core.UIContainer;
-import org.exoplatform.webui.event.Event;
-import org.exoplatform.webui.event.EventListener;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/** Created by The eXo Platform SARL Author : Anh Nguyen ntuananh.vn(a)gmail.com Oct 18, 2007 */
-@ComponentConfig(template = "system:/groovy/portal/webui/application/UIAddNewApplication.gtmpl", events = {
- @EventConfig(listeners = UIMaskWorkspace.CloseActionListener.class),
- @EventConfig(listeners = UIAddNewApplication.AddApplicationActionListener.class),
- @EventConfig(listeners = UIAddNewApplication.AddToStartupActionListener.class)})
-public class UIAddNewApplication extends UIContainer
-{
-
- private List<ApplicationCategory> listAppCategories;
-
- private UIComponent uiComponentParent;
-
- private boolean isInPage;
-
- public List<ApplicationCategory> getApplicationCategories() throws Exception
- {
- return listAppCategories;
- }
-
- public List<ApplicationCategory> getApplicationCategories(String remoteUser,
- ApplicationType[] applicationType) throws Exception
- {
- ExoContainer container = ExoContainerContext.getCurrentContainer();
- ApplicationRegistryService prService = (ApplicationRegistryService)container.getComponentInstanceOfType(ApplicationRegistryService.class);
-
- if (applicationType == null)
- {
- applicationType = new ApplicationType[0];
- }
-
- List<ApplicationCategory> appCategories = prService.getApplicationCategories(remoteUser,
- applicationType);
-
- if (appCategories == null)
- {
- appCategories = new ArrayList();
- }
- else
- {
- Iterator<ApplicationCategory> cateItr = appCategories.iterator();
- while (cateItr.hasNext())
- {
- ApplicationCategory cate = cateItr.next();
- List<Application> applications = cate.getApplications();
- if (applications.size() < 1)
- {
- cateItr.remove();
- }
- }
- }
- listAppCategories = appCategories;
-
- return listAppCategories;
-
- }
-
- public UIComponent getUiComponentParent()
- {
- return uiComponentParent;
- }
-
- public void setUiComponentParent(UIComponent uiComponentParent)
- {
- this.uiComponentParent = uiComponentParent;
- }
-
- public boolean isInPage()
- {
- return isInPage;
- }
-
- public void setInPage(boolean isInPage)
- {
- this.isInPage = isInPage;
- }
-
- private Application getApplication(String id) throws Exception
- {
-
- List<ApplicationCategory> pCategories = getApplicationCategories();
-
- for (ApplicationCategory pCategory : pCategories)
- {
- List<Application> applications = pCategory.getApplications();
- for (Application application : applications)
- {
- if (application.getId().equals(id))
- {
- return application;
- }
- }
- }
-
- return null;
- }
-
- /**
- * Add Application to UiPage
- *
- * @param event
- * @throws Exception
- */
- private static void addApplicationToPage(Event<UIAddNewApplication> event, boolean atStartup) throws Exception
- {
- UIPortal uiPortal = Util.getUIPortal();
-
- UIPortalApplication uiPortalApp = uiPortal.getAncestorOfType(UIPortalApplication.class);
- UIPage uiPage;
- if (uiPortal.isRendered())
- {
- uiPage = uiPortal.findFirstComponentOfType(UIPage.class);
- }
- else
- {
- UIPortalToolPanel uiPortalToolPanel = uiPortalApp.findFirstComponentOfType(UIPortalToolPanel.class);
- uiPage = uiPortalToolPanel.findFirstComponentOfType(UIPage.class);
- }
-
- String applicationId = event.getRequestContext().getRequestParameter(UIComponent.OBJECTID);
-
- Application application = event.getSource().getApplication(applicationId);
- ApplicationType appType = application.getType();
- String portletName = application.getApplicationName();
-// String appGroup = application.getApplicationGroup();
-
- // TODO review windowId for eXoWidget and eXoApplication
- UIComponent component = null;
- if (ApplicationType.GADGET.equals(appType))
- {
- UIGadget uiGadget = uiPage.createUIComponent(event.getRequestContext(), UIGadget.class, null, null);
-
- uiGadget.setState(new TransientApplicationState<Gadget>(portletName));
-
- // Set Properties For gadget
- int posX = (int)(Math.random() * 400);
- int posY = (int)(Math.random() * 200);
-
- uiGadget.getProperties().put(UIApplication.locationX, String.valueOf(posX));
- uiGadget.getProperties().put(UIApplication.locationY, String.valueOf(posY));
-
- component = uiGadget;
- }
- else
- {
- boolean remote = ApplicationType.WSRP_PORTLET.equals(appType);
-
- UIPortlet uiPortlet = uiPage.createUIComponent(UIPortlet.class, null, null);
-
- CloneApplicationState appState;
- Object appId;
- if (!remote)
- {
- appState = new CloneApplicationState<Portlet>(application.getId());
- }
- else
- {
- appState = new CloneApplicationState<WSRPState>(application.getId());
- }
-
- ApplicationType applicationType = remote ? ApplicationType.WSRP_PORTLET : ApplicationType.PORTLET;
- PortletState portletState = new PortletState(appState, applicationType);
-
- uiPortlet.setState(portletState);
- uiPortlet.setPortletInPortal(false);
-
- if (atStartup)
- {
- uiPortlet.getProperties().setProperty("appStatus", "HIDE");
- }
-
- if (application != null)
- {
- String displayName = application.getDisplayName();
- if (displayName != null)
- {
- uiPortlet.setTitle(displayName);
- }
- else if (portletName != null)
- {
- uiPortlet.setTitle(portletName);
- }
- uiPortlet.setDescription(application.getDescription());
- List<String> accessPers = application.getAccessPermissions();
- String[] accessPermissions = accessPers.toArray(new String[accessPers.size()]);
- uiPortlet.setAccessPermissions(accessPermissions);
-
- component = uiPortlet;
- }
- }
-
- // Add component to page
- uiPage.addChild(component);
-
- // Save all changes
- if (uiPage.isModifiable())
- {
- Page page = (Page)PortalDataMapper.buildModelObject(uiPage);
- if (page.getChildren() == null)
- {
- page.setChildren(new ArrayList<ModelObject>());
- }
- DataStorage dataService = uiPortalApp.getApplicationComponent(DataStorage.class);
- dataService.save(page);
- }
-
- PortalRequestContext pcontext = Util.getPortalRequestContext();
- UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
- pcontext.addUIComponentToUpdateByAjax(uiWorkingWS);
- pcontext.ignoreAJAXUpdateOnPortlets(true);
- }
-
- static public class AddApplicationActionListener extends EventListener<UIAddNewApplication>
- {
- public void execute(Event<UIAddNewApplication> event) throws Exception
- {
- if (event.getSource().isInPage())
- {
- addApplicationToPage(event, false);
- }
- }
- }
-
- static public class AddToStartupActionListener extends EventListener<UIAddNewApplication>
- {
- public void execute(Event<UIAddNewApplication> event) throws Exception
- {
- if (event.getSource().isInPage())
- {
- addApplicationToPage(event, true);
- }
- }
- }
-}
Deleted: portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIDesktopPage.java
===================================================================
--- portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIDesktopPage.java 2011-04-14 16:21:08 UTC (rev 6225)
+++ portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIDesktopPage.java 2011-04-15 07:29:10 UTC (rev 6226)
@@ -1,237 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * 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.exoplatform.portal.webui.page;
-
-import org.exoplatform.commons.serialization.api.annotations.Serialized;
-import org.exoplatform.portal.config.DataStorage;
-import org.exoplatform.portal.config.model.ModelObject;
-import org.exoplatform.portal.config.model.Page;
-import org.exoplatform.portal.config.model.PageNavigation;
-import org.exoplatform.portal.webui.application.UIAddNewApplication;
-import org.exoplatform.portal.webui.application.UIApplication;
-import org.exoplatform.portal.webui.application.UIGadget;
-import org.exoplatform.portal.webui.application.UIPortlet;
-import org.exoplatform.portal.webui.navigation.PageNavigationUtils;
-import org.exoplatform.portal.webui.page.UIPageActionListener.DeleteGadgetActionListener;
-import org.exoplatform.portal.webui.page.UIPageActionListener.RemoveChildActionListener;
-import org.exoplatform.portal.webui.portal.PageNodeEvent;
-import org.exoplatform.portal.webui.portal.UIPortal;
-import org.exoplatform.portal.webui.portal.UIPortalComponentActionListener.ShowLoginFormActionListener;
-import org.exoplatform.portal.webui.util.PortalDataMapper;
-import org.exoplatform.portal.webui.util.Util;
-import org.exoplatform.portal.webui.workspace.UIMaskWorkspace;
-import org.exoplatform.portal.webui.workspace.UIPortalApplication;
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-import org.exoplatform.webui.config.annotation.EventConfig;
-import org.exoplatform.webui.core.UIComponent;
-import org.exoplatform.webui.event.Event;
-import org.exoplatform.webui.event.EventListener;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import javax.portlet.WindowState;
-
-/**
- * May 19, 2006
- */
-
-@ComponentConfig(lifecycle = UIPageLifecycle.class, template = "system:/groovy/portal/webui/page/UIDesktopPage.gtmpl", events = {
- @EventConfig(listeners = ShowLoginFormActionListener.class),
- @EventConfig(listeners = DeleteGadgetActionListener.class),
- @EventConfig(listeners = RemoveChildActionListener.class),
- @EventConfig(listeners = UIDesktopPage.SaveGadgetPropertiesActionListener.class),
- @EventConfig(listeners = UIDesktopPage.SaveWindowPropertiesActionListener.class),
- @EventConfig(listeners = UIDesktopPage.ShowAddNewApplicationActionListener.class),
- @EventConfig(listeners = UIDesktopPage.ChangePageActionListener.class),
- @EventConfig(listeners = UIDesktopPage.ShowPortletActionListener.class)})
-@Serialized
-public class UIDesktopPage extends UIPage
-{
-
- public UIDesktopPage()
- {
- setChildren((List<UIComponent>)new CopyOnWriteArrayList<UIComponent>());
- }
-
- public boolean isShowMaxWindow()
- {
- return true;
- }
-
- public List<PageNavigation> getNavigations() throws Exception
- {
- List<PageNavigation> allNav = Util.getUIPortal().getNavigations();
- String removeUser = Util.getPortalRequestContext().getRemoteUser();
- List<PageNavigation> result = new ArrayList<PageNavigation>();
- for (PageNavigation nav : allNav)
- {
- result.add(PageNavigationUtils.filter(nav, removeUser));
- }
- return result;
- }
-
- static public class SaveGadgetPropertiesActionListener extends EventListener<UIPage>
- {
- public void execute(Event<UIPage> event) throws Exception
- {
- UIPage uiPage = event.getSource();
- String objectId = event.getRequestContext().getRequestParameter(UIComponent.OBJECTID);
- List<UIGadget> uiGadgets = new ArrayList<UIGadget>();
- uiPage.findComponentOfType(uiGadgets, UIGadget.class);
- UIGadget uiGadget = null;
- for (UIGadget ele : uiGadgets)
- {
- if (ele.getId().equals(objectId))
- {
- uiGadget = ele;
- break;
- }
- }
- if (uiGadget == null)
- return;
- String posX = event.getRequestContext().getRequestParameter("posX");
- String posY = event.getRequestContext().getRequestParameter("posY");
- String zIndex = event.getRequestContext().getRequestParameter(UIApplication.zIndex);
-
- uiGadget.getProperties().put(UIApplication.locationX, posX);
- uiGadget.getProperties().put(UIApplication.locationY, posY);
- uiGadget.getProperties().put(UIApplication.zIndex, zIndex);
-
- if (!uiPage.isModifiable())
- return;
- Page page = (Page)PortalDataMapper.buildModelObject(uiPage);
- if (page.getChildren() == null)
- page.setChildren(new ArrayList<ModelObject>());
- DataStorage dataService = uiPage.getApplicationComponent(DataStorage.class);
- dataService.save(page);
- }
- }
-
- static public class SaveWindowPropertiesActionListener extends EventListener<UIPage>
- {
- public void execute(Event<UIPage> event) throws Exception
- {
- UIPage uiPage = event.getSource();
- String objectId = event.getRequestContext().getRequestParameter(UIComponent.OBJECTID);
-
- UIApplication uiApp = uiPage.getChildById(objectId);
- if (uiApp == null)
- return;
-
- /*########################## Save Position ##########################*/
- String posX = event.getRequestContext().getRequestParameter("posX");
- String posY = event.getRequestContext().getRequestParameter("posY");
-
- if (posX != null)
- uiApp.getProperties().put(UIApplication.locationX, posX);
- if (posY != null)
- uiApp.getProperties().put(UIApplication.locationY, posY);
-
- //System.out.println("\n\n\n\n\n\n\n\n\n\n\n SAVE POSX: "+posX+"\n SAVE POSY: "+posY+"\n\n\n\n\n\n\n\n\n");
- /*########################## Save ZIndex ##########################*/
- String zIndex = event.getRequestContext().getRequestParameter(UIApplication.zIndex);
-
- if (zIndex != null)
- uiApp.getProperties().put(UIApplication.zIndex, zIndex);
-
- /*########################## Save Dimension ##########################*/
- String windowWidth = event.getRequestContext().getRequestParameter("windowWidth");
- String windowHeight = event.getRequestContext().getRequestParameter("windowHeight");
-
- if (windowWidth != null)
- uiApp.getProperties().put("windowWidth", windowWidth);
- if (windowHeight != null)
- uiApp.getProperties().put("windowHeight", windowHeight);
-
- // if(appWidth != null) uiComponent.getProperties().put(UIApplication.appWidth, appWidth);
- // if(appHeight != null) uiComponent.getProperties().put(UIApplication.appHeight, appHeight);
-
- // String applicationHeight = event.getRequestContext().getRequestParameter("applicationHeight");
- // if(applicationHeight != null) uiComponent.getProperties().put("applicationHeight", applicationHeight);
-
- /*########################## Save Window status (SHOW / HIDE) ##########################*/
- String appStatus = event.getRequestContext().getRequestParameter(UIApplication.appStatus);
- if (appStatus != null)
- uiApp.getProperties().put(UIApplication.appStatus, appStatus);
-
- // if(!uiPage.isModifiable()) return;
- // Page page = PortalDataMapper.toPageModel(uiPage);
- // UserPortalConfigService configService = uiPage.getApplicationComponent(UserPortalConfigService.class);
- // if(page.getChildren() == null) page.setChildren(new ArrayList<Object>());
- // configService.update(page);
- }
- }
-
- static public class ShowAddNewApplicationActionListener extends EventListener<UIPage>
- {
- public void execute(Event<UIPage> event) throws Exception
- {
- UIPage uiPage = event.getSource();
- UIPortalApplication uiPortalApp = uiPage.getAncestorOfType(UIPortalApplication.class);
- UIMaskWorkspace uiMaskWorkspace = uiPortalApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
-
- UIAddNewApplication uiAddApplication = uiPage.createUIComponent(UIAddNewApplication.class, null, null);
- uiAddApplication.setInPage(true);
- uiAddApplication.setUiComponentParent(uiPage);
- uiAddApplication.getApplicationCategories(event.getRequestContext().getRemoteUser(), null);
-
- uiMaskWorkspace.setWindowSize(700, 375);
- uiMaskWorkspace.setUIComponent(uiAddApplication);
- uiMaskWorkspace.setShow(true);
- event.getRequestContext().addUIComponentToUpdateByAjax(uiMaskWorkspace);
- }
- }
-
- static public class ChangePageActionListener extends EventListener<UIPage>
- {
- public void execute(Event<UIPage> event) throws Exception
- {
- String uri = event.getRequestContext().getRequestParameter(OBJECTID);
- UIPortal uiPortal = Util.getUIPortal();
- UIPageBody uiPageBody = uiPortal.findFirstComponentOfType(UIPageBody.class);
- if (uiPageBody != null)
- {
- if (uiPageBody.getMaximizedUIComponent() != null)
- {
- UIPortlet currentPortlet = (UIPortlet)uiPageBody.getMaximizedUIComponent();
- currentPortlet.setCurrentWindowState(WindowState.NORMAL);
- uiPageBody.setMaximizedUIComponent(null);
- }
- }
- PageNodeEvent<UIPortal> pnevent = new PageNodeEvent<UIPortal>(uiPortal, PageNodeEvent.CHANGE_PAGE_NODE, uri);
- uiPortal.broadcast(pnevent, Event.Phase.PROCESS);
- }
- }
-
- static public class ShowPortletActionListener extends EventListener<UIPage>
- {
- public void execute(Event<UIPage> event) throws Exception
- {
- UIPage uiPage = event.getSource();
- String portletId = event.getRequestContext().getRequestParameter(UIComponent.OBJECTID);
- UIPortlet uiPortlet = uiPage.getChildById(portletId);
- uiPortlet.getProperties().setProperty("appStatus", "SHOW");
- event.getRequestContext().addUIComponentToUpdateByAjax(uiPortlet);
- }
- }
-
-}
\ No newline at end of file
Modified: portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPage.java
===================================================================
--- portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPage.java 2011-04-14 16:21:08 UTC (rev 6225)
+++ portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPage.java 2011-04-15 07:29:10 UTC (rev 6226)
@@ -19,16 +19,29 @@
package org.exoplatform.portal.webui.page;
+import org.exoplatform.portal.config.UserACL;
+import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.webui.application.UIPortlet;
import org.exoplatform.portal.webui.container.UIContainer;
+import org.exoplatform.portal.webui.portal.UIPortalComposer;
import org.exoplatform.portal.webui.portal.UIPortalComponentActionListener.MoveChildActionListener;
+import org.exoplatform.portal.webui.util.PortalDataMapper;
+import org.exoplatform.portal.webui.util.Util;
+import org.exoplatform.portal.webui.workspace.UIEditInlineWorkspace;
+import org.exoplatform.portal.webui.workspace.UIPortalApplication;
+import org.exoplatform.portal.webui.workspace.UIPortalToolPanel;
+import org.exoplatform.portal.webui.workspace.UIWorkingWorkspace;
+import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
+import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.EventListener;
/**
* May 19, 2006
*/
-@ComponentConfig(lifecycle = UIPageLifecycle.class, template = "system:/groovy/portal/webui/page/UIPage.gtmpl", events = {@EventConfig(listeners = MoveChildActionListener.class)})
+@ComponentConfig(lifecycle = UIPageLifecycle.class, template = "system:/groovy/portal/webui/page/UIPage.gtmpl", events = {@EventConfig(listeners = MoveChildActionListener.class),
+ @EventConfig(name = "EditCurrentPage", listeners = UIPage.EditCurrentPageActionListener.class)})
public class UIPage extends UIContainer
{
@@ -104,4 +117,61 @@
{
this.maximizedUIPortlet = maximizedUIPortlet;
}
+
+ public static class EditCurrentPageActionListener extends EventListener<UIPage>
+ {
+ @Override
+ public void execute(Event<UIPage> event) throws Exception {
+ UIPortalApplication uiApp = Util.getUIPortalApplication();
+ UIWorkingWorkspace uiWorkingWS = uiApp
+ .getChildById(UIPortalApplication.UI_WORKING_WS_ID);
+
+ // check edit permission for page
+ UIPageBody pageBody = uiWorkingWS
+ .findFirstComponentOfType(UIPageBody.class);
+ UIPage uiPage = (UIPage) pageBody.getUIComponent();
+ if (uiPage == null) {
+ uiApp.addMessage(new ApplicationMessage(
+ "UIPageBrowser.msg.PageNotExist", null));
+ return;
+ }
+ Page page = PortalDataMapper.toPageModel(uiPage);
+
+ UserACL userACL = uiApp.getApplicationComponent(UserACL.class);
+ if (!userACL.hasEditPermission(page)) {
+ uiApp.addMessage(new ApplicationMessage(
+ "UIPortalManagement.msg.Invalid-EditPage-Permission", null));
+ return;
+ }
+
+ uiWorkingWS.setRenderedChild(UIEditInlineWorkspace.class);
+
+ UIPortalComposer portalComposer = uiWorkingWS.findFirstComponentOfType(
+ UIPortalComposer.class).setRendered(true);
+ portalComposer.setComponentConfig(UIPortalComposer.class, "UIPageEditor");
+ portalComposer.setId("UIPageEditor");
+ portalComposer.setShowControl(true);
+ portalComposer.setEditted(false);
+ portalComposer.setCollapse(false);
+
+ UIPortalToolPanel uiToolPanel = uiWorkingWS
+ .findFirstComponentOfType(UIPortalToolPanel.class);
+ uiToolPanel.setShowMaskLayer(false);
+ uiApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
+
+ // We clone the edited UIPage object, that is required for Abort action
+ Class<? extends UIPage> clazz = Class.forName(page.getFactoryId())
+ .asSubclass(UIPage.class);
+ UIPage newUIPage = uiWorkingWS.createUIComponent(clazz, null, null);
+ PortalDataMapper.toUIPage(newUIPage, page);
+ uiToolPanel.setWorkingComponent(newUIPage);
+
+ // Remove current UIPage from UIPageBody
+ pageBody.setUIComponent(null);
+
+ event.getRequestContext().addUIComponentToUpdateByAjax(uiWorkingWS);
+ Util.getPortalRequestContext().setFullRender(true);
+
+ }
+ }
}
\ No newline at end of file
Modified: portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java
===================================================================
--- portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java 2011-04-14 16:21:08 UTC (rev 6225)
+++ portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java 2011-04-15 07:29:10 UTC (rev 6226)
@@ -146,14 +146,9 @@
return uiPage;
}
- if (Page.DESKTOP_PAGE.equals(page.getFactoryId()))
- {
- uiPage = createUIComponent(context, UIDesktopPage.class, null, null);
- }
- else
- {
- uiPage = createUIComponent(context, UIPage.class, null, null);
- }
+ Class<? extends UIPage> clazz = Class.forName(page.getFactoryId()).asSubclass(UIPage.class);
+ uiPage = createUIComponent(context, clazz, null, null);
+
PortalDataMapper.toUIPage(uiPage, page);
uiPortal.setUIPage(page.getId(), uiPage);
Modified: portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java
===================================================================
--- portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java 2011-04-14 16:21:08 UTC (rev 6225)
+++ portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java 2011-04-15 07:29:10 UTC (rev 6226)
@@ -19,6 +19,10 @@
package org.exoplatform.portal.webui.page;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.ResourceBundle;
+
import org.exoplatform.commons.serialization.api.annotations.Serialized;
import org.exoplatform.commons.utils.PageList;
import org.exoplatform.commons.utils.PageListAccess;
@@ -57,8 +61,8 @@
import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
import org.exoplatform.webui.core.model.SelectItemOption;
import org.exoplatform.webui.event.Event;
-import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.event.Event.Phase;
+import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.form.UIForm;
import org.exoplatform.webui.form.UIFormInputItemSelector;
import org.exoplatform.webui.form.UIFormInputSet;
@@ -66,10 +70,6 @@
import org.exoplatform.webui.form.UIFormStringInput;
import org.exoplatform.webui.form.UISearchForm;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ResourceBundle;
-
@ComponentConfigs({
@ComponentConfig(template = "system:/groovy/portal/webui/page/UIPageBrowser.gtmpl", events = {
@EventConfig(listeners = UIPageBrowser.DeleteActionListener.class, confirm = "UIPageBrowse.deletePage"),
@@ -266,13 +266,23 @@
return;
}
Page page = service.getPage(id, pcontext.getRemoteUser());
+
if (page == null || !page.isModifiable())
{
uiPortalApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.delete.NotDelete", new String[]{id}, 1));
pcontext.addUIComponentToUpdateByAjax(uiPortalApp.getUIPopupMessages());
return;
}
-
+
+ UIPortal uiPortal = Util.getUIPortal();
+ boolean isDeleteCurrentPage = uiPortal.getSelectedNode().getPageReference().equals(page.getPageId());
+ if (isDeleteCurrentPage && page.getOwnerType().equals(PortalConfig.USER_TYPE))
+ {
+ ApplicationMessage msg = new ApplicationMessage("UIPageBrowser.msg.delete.DeleteCurrentUserPage", null, ApplicationMessage.WARNING);
+ event.getRequestContext().getUIApplication().addMessage(msg);
+ return;
+ }
+
UIVirtualList virtualList = uiPageBrowser.getChild(UIVirtualList.class);
UIRepeater repeater = (UIRepeater)virtualList.getDataFeed();
PageListAccess datasource = (PageListAccess)repeater.getDataSource();
@@ -283,9 +293,8 @@
//As we have multiple UIPortal, which means multiple caches of UIPage. It 's unwise to garbage
// all UIPage caches at once. Better solution is to clear UIPage on browsing to PageNode having Page
//removed
-
- UIPortal uiPortal = Util.getUIPortal();
- if (uiPortal.getSelectedNode().getPageReference().equals(page.getPageId()))
+
+ if (isDeleteCurrentPage)
{
PageNodeEvent<UIPortal> pnevent =
new PageNodeEvent<UIPortal>(uiPortal, PageNodeEvent.CHANGE_PAGE_NODE, uiPortal.getSelectedNode()
@@ -404,6 +413,13 @@
pcontext.addUIComponentToUpdateByAjax(uiPortalApp.getUIPopupMessages());
return;
}
+
+ if (page.getName().equals("webos"))
+ {
+ uiPortalApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.edit.NotEditDesktopPage", new String[]{id}, 1));
+ pcontext.addUIComponentToUpdateByAjax(uiPortalApp.getUIPopupMessages());
+ return;
+ }
//Check current user 's permissions on the page
UserACL userACL = uiPageBrowser.getApplicationComponent(UserACL.class);
@@ -413,7 +429,7 @@
pcontext.addUIComponentToUpdateByAjax(uiPortalApp.getUIPopupMessages());
return;
}
-
+
//Switch portal application to edit mode
uiPortalApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
UIWorkingWorkspace uiWorkingWS = uiPortalApp.findFirstComponentOfType(UIWorkingWorkspace.class);
@@ -427,17 +443,6 @@
if (uiPageBody.getUIComponent() != null)
uiPageBody.setUIComponent(null);
- if (Page.DESKTOP_PAGE.equals(page.getFactoryId()))
- {
- UIMaskWorkspace uiMaskWS = uiPortalApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
- UIPageForm uiPageForm = uiMaskWS.createUIComponent(UIPageForm.class, "UIBrowserPageForm", "UIPageForm");
- uiPageForm.setValues(uiPage);
- uiMaskWS.setUIComponent(uiPageForm);
- uiMaskWS.setShow(true);
- pcontext.addUIComponentToUpdateByAjax(uiMaskWS);
- return;
- }
-
editInlineWS.setRendered(true);
editInlineWS.setUIComponent(uiPage);
@@ -533,21 +538,6 @@
applications.add(PortalDataMapper.buildModelObject(uiPortlet));
}
- if (Page.DESKTOP_PAGE.equals(uiPage.getFactoryId()) && !Page.DESKTOP_PAGE.equals(page.getFactoryId()))
- {
- page.setShowMaxWindow(false);
- uiPage.getChildren().clear();
- page.setChildren(applications);
- PortalDataMapper.toUIPage(uiPage, page);
- // if (page.getTemplate() == null)
- // page.setTemplate(uiPage.getTemplate());
- if (page.getChildren() == null)
- page.setChildren(new ArrayList<ModelObject>());
- dataService.save(page);
- postSave(uiPortalApp, pcontext);
- return;
- }
-
List<UIComponent> uiChildren = uiPage.getChildren();
if (uiChildren == null)
return;
@@ -565,11 +555,6 @@
// if (page.getTemplate() == null) page.setTemplate(uiPage.getTemplate());
if (page.getChildren() == null)
page.setChildren(new ArrayList<ModelObject>());
- if (Page.DESKTOP_PAGE.equals(uiPage.getFactoryId()))
- {
- dataService.save(page);
- postSave(uiPortalApp, pcontext);
- }
}
private void postSave(UIPortalApplication uiPortalApp, WebuiRequestContext context) throws Exception
Modified: portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java
===================================================================
--- portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java 2011-04-14 16:21:08 UTC (rev 6225)
+++ portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java 2011-04-15 07:29:10 UTC (rev 6226)
@@ -19,6 +19,11 @@
package org.exoplatform.portal.webui.page;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.UserACL;
@@ -27,7 +32,6 @@
import org.exoplatform.portal.config.model.PageNode;
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.webui.navigation.UIPageNodeSelector;
-import org.exoplatform.portal.webui.portal.PageNodeEvent;
import org.exoplatform.portal.webui.portal.UIPortal;
import org.exoplatform.portal.webui.portal.UIPortalComposer;
import org.exoplatform.portal.webui.util.PortalDataMapper;
@@ -36,7 +40,6 @@
import org.exoplatform.portal.webui.workspace.UIPortalToolPanel;
import org.exoplatform.portal.webui.workspace.UIWorkingWorkspace;
import org.exoplatform.web.application.ApplicationMessage;
-import org.exoplatform.web.application.JavascriptManager;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.ComponentConfigs;
@@ -44,11 +47,6 @@
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
-
/** Created by The eXo Platform SARL Author : Dang Van Minh minhdv81(a)yahoo.com Jun 23, 2006 */
@ComponentConfigs(@ComponentConfig(template = "system:/groovy/webui/core/UIWizard.gtmpl", events = {
@EventConfig(listeners = UIPageCreationWizard.ViewStep1ActionListener.class),
@@ -343,37 +341,14 @@
page.setTitle(pageNode.getName());
}
- boolean isDesktopPage = Page.DESKTOP_PAGE.equals(page.getFactoryId());
- if (isDesktopPage)
- {
- page.setShowMaxWindow(true);
- }
-
UIPagePreview uiPagePreview = uiWizard.getChild(UIPagePreview.class);
- UIPage uiPage;
- if (Page.DESKTOP_PAGE.equals(page.getFactoryId()))
- {
- uiPage = uiWizard.createUIComponent(context, UIDesktopPage.class, null, null);
- }
- else
- {
- uiPage = uiWizard.createUIComponent(context, UIPage.class, null, null);
- }
-
+
+ Class<? extends UIPage> clazz = Class.forName(page.getFactoryId()).asSubclass(UIPage.class);
+ UIPage uiPage = uiWizard.createUIComponent(context, clazz, null, null);
+
PortalDataMapper.toUIPage(uiPage, page);
uiPagePreview.setUIComponent(uiPage);
- if (isDesktopPage)
- {
- uiWizard.saveData();
- PageNode selectedNode = uiNodeSelector.getSelectedPageNode();
- UIPortal uiPortal = Util.getUIPortal();
- PageNodeEvent<UIPortal> pnevent = new PageNodeEvent<UIPortal>(uiPortal, PageNodeEvent.CHANGE_PAGE_NODE, selectedNode.getUri());
- uiPortal.broadcast(pnevent, Event.Phase.PROCESS);
- uiWizard.updateUIPortal(event);
- return;
- }
-
uiWizard.updateWizardComponent();
uiPageTemplateOptions.setSelectedOption(null);
}
Modified: portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java
===================================================================
--- portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java 2011-04-14 16:21:08 UTC (rev 6225)
+++ portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java 2011-04-15 07:29:10 UTC (rev 6226)
@@ -19,10 +19,13 @@
package org.exoplatform.portal.webui.page;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.portal.application.PortalRequestContext;
-import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.NoSuchDataException;
import org.exoplatform.portal.config.UserACL;
import org.exoplatform.portal.config.UserPortalConfig;
@@ -33,29 +36,23 @@
import org.exoplatform.portal.webui.application.UIPortlet;
import org.exoplatform.portal.webui.container.UIContainer;
import org.exoplatform.portal.webui.portal.UIPortal;
-import org.exoplatform.portal.webui.portal.UIPortalComponent;
import org.exoplatform.portal.webui.portal.UIPortalComposer;
import org.exoplatform.portal.webui.util.PortalDataMapper;
import org.exoplatform.portal.webui.util.Util;
import org.exoplatform.portal.webui.workspace.UIMaskWorkspace;
import org.exoplatform.portal.webui.workspace.UIPortalApplication;
-import org.exoplatform.portal.webui.workspace.UIPortalToolPanel;
-import org.exoplatform.portal.webui.workspace.UIWorkingWorkspace;
import org.exoplatform.web.application.ApplicationMessage;
-import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.InitParams;
-import org.exoplatform.webui.config.Param;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.ComponentConfigs;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.config.annotation.ParamConfig;
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
-import org.exoplatform.webui.core.model.SelectItemCategory;
import org.exoplatform.webui.core.model.SelectItemOption;
import org.exoplatform.webui.event.Event;
-import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.event.Event.Phase;
+import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.form.UIFormCheckBoxInput;
import org.exoplatform.webui.form.UIFormInputItemSelector;
import org.exoplatform.webui.form.UIFormInputSet;
@@ -68,13 +65,9 @@
import org.exoplatform.webui.form.validator.StringLengthValidator;
import org.exoplatform.webui.organization.UIGroupMembershipSelector;
import org.exoplatform.webui.organization.UIListPermissionSelector;
-import org.exoplatform.webui.organization.UIPermissionSelector;
import org.exoplatform.webui.organization.UIListPermissionSelector.EmptyIteratorValidator;
+import org.exoplatform.webui.organization.UIPermissionSelector;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
@ComponentConfigs({
@ComponentConfig(lifecycle = UIFormLifecycle.class, template = "system:/groovy/webui/form/UIFormTabPane.gtmpl", events = {
@EventConfig(listeners = UIPageForm.SaveActionListener.class),
@@ -266,8 +259,6 @@
{
page.setFactoryId(itemOption.getIcon());
// page.setTemplate((String)itemOption.getValue());
- if (page.getFactoryId().equals(Page.DESKTOP_PAGE))
- page.setShowMaxWindow(true);
}
}
UIPageTemplateOptions uiConfigOptions = getChild(UIPageTemplateOptions.class);
@@ -278,9 +269,6 @@
return;
page.setChildren(selectedPage.getChildren());
page.setFactoryId(selectedPage.getFactoryId());
- if (Page.DESKTOP_PAGE.equals(page.getFactoryId()))
- page.setShowMaxWindow(true);
-
}
static public class SaveActionListener extends EventListener<UIPageForm>
@@ -311,43 +299,6 @@
applications.add(PortalDataMapper.buildModelObject(uiPortlet));
}
- if (Page.DESKTOP_PAGE.equals(uiPage.getFactoryId()) && !Page.DESKTOP_PAGE.equals(page.getFactoryId()))
- {
- page.setShowMaxWindow(false);
- uiPage.getChildren().clear();
- page.setChildren(applications);
-
- PortalDataMapper.toUIPage(uiPage, page);
- if (page.getChildren() == null)
- page.setChildren(new ArrayList<ModelObject>());
-
- pcontext.ignoreAJAXUpdateOnPortlets(true);
- UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
- pcontext.addUIComponentToUpdateByAjax(uiWorkingWS);
- pcontext.getJavascriptManager().addJavascript("eXo.portal.UIPortal.changeComposerSaveButton();");
- return;
- }
-
- if (Page.DESKTOP_PAGE.equals(page.getFactoryId()))
- {
- uiPage.getChildren().clear();
- page.setChildren(applications);
-
- PortalDataMapper.toUIPage(uiPage, page);
- if (page.getChildren() == null)
- page.setChildren(new ArrayList<ModelObject>());
-
- UIPortalToolPanel toolPanel = Util.getUIPortalToolPanel();
- toolPanel.setShowMaskLayer(true);
- pcontext.ignoreAJAXUpdateOnPortlets(true);
- UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
- pcontext.addUIComponentToUpdateByAjax(uiWorkingWS);
- pcontext.getJavascriptManager().addJavascript("eXo.portal.UIPortal.changeComposerSaveButton();");
- DataStorage dataService = uiPageForm.getApplicationComponent(DataStorage.class);
- dataService.save(page);
- return;
- }
-
List<UIComponent> uiChildren = uiPage.getChildren();
if (uiChildren == null)
{
Modified: portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/util/Util.java
===================================================================
--- portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/util/Util.java 2011-04-14 16:21:08 UTC (rev 6225)
+++ portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/util/Util.java 2011-04-15 07:29:10 UTC (rev 6226)
@@ -19,13 +19,14 @@
package org.exoplatform.portal.webui.util;
+import java.util.List;
+
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PageNode;
import org.exoplatform.portal.webui.application.UIPortlet;
import org.exoplatform.portal.webui.container.UIContainer;
-import org.exoplatform.portal.webui.page.UIDesktopPage;
import org.exoplatform.portal.webui.page.UIPage;
import org.exoplatform.portal.webui.portal.UIPortal;
import org.exoplatform.portal.webui.portal.UIPortalComponent;
@@ -38,8 +39,6 @@
import org.exoplatform.webui.core.UIComponentDecorator;
import org.exoplatform.webui.event.Event;
-import java.util.List;
-
/**
* Jun 5, 2006
*/
@@ -226,14 +225,10 @@
if (uiPage != null && uiPage.getId().equals(page.getId()))
return uiPage;
WebuiRequestContext context = Util.getPortalRequestContext();
- if (Page.DESKTOP_PAGE.equals(page.getFactoryId()))
- {
- uiPage = uiParent.createUIComponent(context, UIDesktopPage.class, null, null);
- }
- else
- {
- uiPage = uiParent.createUIComponent(context, UIPage.class, null, null);
- }
+
+ Class<? extends UIPage> clazz = Class.forName(page.getFactoryId()).asSubclass(UIPage.class);
+ uiPage = uiParent.createUIComponent(context, clazz, null, null);
+
PortalDataMapper.toUIPage(uiPage, page);
return uiPage;
}
Modified: portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java
===================================================================
--- portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java 2011-04-14 16:21:08 UTC (rev 6225)
+++ portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java 2011-04-15 07:29:10 UTC (rev 6226)
@@ -19,6 +19,8 @@
package org.exoplatform.portal.webui.workspace;
+import java.lang.reflect.Method;
+
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.config.UserACL;
import org.exoplatform.portal.config.UserPortalConfig;
@@ -36,7 +38,10 @@
import org.exoplatform.portal.webui.portal.UIPortalForm;
import org.exoplatform.portal.webui.util.PortalDataMapper;
import org.exoplatform.portal.webui.util.Util;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import org.exoplatform.web.application.ApplicationMessage;
+import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
@@ -88,8 +93,8 @@
uiApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
// We clone the edited UIPage object, that is required for Abort action
- //UIPage newUIPage = new UIPage();
- UIPage newUIPage = uiWorkingWS.createUIComponent(UIPage.class, null, null);
+ Class<? extends UIPage> clazz = Class.forName(page.getFactoryId()).asSubclass(UIPage.class);
+ UIPage newUIPage = uiWorkingWS.createUIComponent(clazz, null, null);
PortalDataMapper.toUIPage(newUIPage, page);
uiToolPanel.setWorkingComponent(newUIPage);
@@ -224,5 +229,36 @@
prContext.addUIComponentToUpdateByAjax(uiMaskWS);
}
}
+
+ public static class EditBackgroundActionListener extends EventListener<UIWorkingWorkspace>
+ {
+ private Log log = ExoLogger.getExoLogger(this.getClass());
+
+ @Override
+ public void execute(Event<UIWorkingWorkspace> event) throws Exception
+ {
+
+ UIWorkingWorkspace workingWorkspace = event.getSource();
+ UIPage uiPage = workingWorkspace.findFirstComponentOfType(UIPage.class);
+
+ Method showEditBackgroundPopupMethod = null;
+ try
+ {
+ if (uiPage == null)
+ {
+ return;
+ }
+ showEditBackgroundPopupMethod = uiPage.getClass().getDeclaredMethod("showEditBackgroundPopup", WebuiRequestContext.class);
+ }
+ catch (NoSuchMethodException ex)
+ {
+ log.warn(ex.getMessage(), ex);
+ }
+ if(showEditBackgroundPopupMethod != null)
+ {
+ showEditBackgroundPopupMethod.invoke(uiPage, event.getRequestContext());
+ }
+ }
+ }
}
Modified: portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalToolPanel.java
===================================================================
--- portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalToolPanel.java 2011-04-14 16:21:08 UTC (rev 6225)
+++ portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalToolPanel.java 2011-04-15 07:29:10 UTC (rev 6226)
@@ -19,8 +19,6 @@
package org.exoplatform.portal.webui.workspace;
-import org.exoplatform.portal.config.model.Page;
-import org.exoplatform.portal.webui.page.UIPage;
import org.exoplatform.web.application.JavascriptManager;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
@@ -56,22 +54,6 @@
public void processRender(WebuiRequestContext context) throws Exception
{
JavascriptManager jsmanager = context.getJavascriptManager();
- UIComponent uiComponent = getUIComponent();
- if (uiComponent instanceof UIPage)
- {
- UIPage uiPage = (UIPage)uiComponent;
- //if(uiPage.isShowMaxWindow()){
- if (Page.DESKTOP_PAGE.equals(uiPage.getFactoryId()))
- {
- uiComponent.processRender(context);
- if (showMaskLayer)
- {
- jsmanager.importJavascript("eXo.core.UIMaskLayer");
- jsmanager.addCustomizedOnLoadScript("eXo.core.UIMaskLayer.createMask('UIPage', null, 10) ;");
- }
- return;
- }
- }
super.processRender(context);
if (showMaskLayer)
Modified: portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIWorkingWorkspace.java
===================================================================
--- portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIWorkingWorkspace.java 2011-04-14 16:21:08 UTC (rev 6225)
+++ portal/branches/decoupled-webos/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIWorkingWorkspace.java 2011-04-15 07:29:10 UTC (rev 6226)
@@ -42,6 +42,7 @@
@EventConfig(listeners = UIMainActionListener.CreatePortalActionListener.class),
@EventConfig(listeners = UIMainActionListener.EditCurrentPageActionListener.class),
@EventConfig(listeners = UIMainActionListener.PageCreationWizardActionListener.class),
+ @EventConfig(listeners = UIMainActionListener.EditBackgroundActionListener.class),
@EventConfig(listeners = UIMainActionListener.EditInlineActionListener.class)})
public class UIWorkingWorkspace extends UIContainer
{
13 years, 9 months
gatein SVN: r6225 - portal/trunk.
by do-not-reply@jboss.org
Author: bdaw
Date: 2011-04-14 12:21:08 -0400 (Thu, 14 Apr 2011)
New Revision: 6225
Modified:
portal/trunk/pom.xml
Log:
GTNPORTAL-1861 - Upgrade to PicketLink IDM 1.1.8.GA
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2011-04-14 15:58:32 UTC (rev 6224)
+++ portal/trunk/pom.xml 2011-04-14 16:21:08 UTC (rev 6225)
@@ -47,7 +47,7 @@
<org.gatein.common.version>2.0.4-Beta02</org.gatein.common.version>
<org.gatein.wci.version>2.1.0-Beta02</org.gatein.wci.version>
<org.gatein.pc.version>2.3.0-Beta01</org.gatein.pc.version>
- <org.picketlink.idm>1.1.8.CR01</org.picketlink.idm>
+ <org.picketlink.idm>1.1.8.GA</org.picketlink.idm>
<org.gatein.wsrp.version>2.1.0-Beta01</org.gatein.wsrp.version>
<org.gatein.mop.version>1.0.6-Beta01</org.gatein.mop.version>
<org.slf4j.version>1.5.6</org.slf4j.version>
13 years, 9 months
gatein SVN: r6224 - components/pc/trunk/samples.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-04-14 11:58:32 -0400 (Thu, 14 Apr 2011)
New Revision: 6224
Modified:
components/pc/trunk/samples/pom.xml
Log:
- GTNPC-57: Missing dependency.
Modified: components/pc/trunk/samples/pom.xml
===================================================================
--- components/pc/trunk/samples/pom.xml 2011-04-14 15:30:06 UTC (rev 6223)
+++ components/pc/trunk/samples/pom.xml 2011-04-14 15:58:32 UTC (rev 6224)
@@ -1,4 +1,28 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+ ~ JBoss, a division of Red Hat
+ ~ Copyright 2011, 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.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
@@ -22,6 +46,10 @@
<groupId>sun-jaxb</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
</dependencies>
<build>
13 years, 9 months
gatein SVN: r6223 - in portal/trunk/component/portal/src: main/resources and 2 other directories.
by do-not-reply@jboss.org
Author: nscavell
Date: 2011-04-14 11:30:06 -0400 (Thu, 14 Apr 2011)
New Revision: 6223
Added:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/GadgetApplication.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/GadgetApplicationHandler.java
portal/trunk/component/portal/src/test/resources/jibx/gadget-application.xml
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/AbstractApplicationHandler.java
portal/trunk/component/portal/src/main/resources/binding.xml
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestJIBXXmlMapping.java
Log:
Initial support for gadget applications in xml descriptor.
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/AbstractApplicationHandler.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/AbstractApplicationHandler.java 2011-04-14 15:02:05 UTC (rev 6222)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/AbstractApplicationHandler.java 2011-04-14 15:30:06 UTC (rev 6223)
@@ -26,6 +26,7 @@
import org.exoplatform.portal.config.model.Application;
import org.exoplatform.portal.config.model.Properties;
import org.exoplatform.portal.config.model.TransientApplicationState;
+import org.exoplatform.portal.pom.spi.gadget.Gadget;
import org.exoplatform.portal.pom.spi.portlet.Portlet;
import org.exoplatform.portal.pom.spi.portlet.PortletBuilder;
import org.jibx.runtime.IAliasable;
@@ -100,7 +101,7 @@
ctx.parsePastStartTag(m_uri, m_name);
//
- Application<Portlet> app;
+ Application<?> app;
if ("application".equals(m_name))
{
String instanceId = ctx.parseElementText(m_uri, "instance-id");
@@ -130,9 +131,25 @@
ownerId,
persistenceChunks[2]);
}
- app = Application.createPortletApplication();
- app.setState(state);
+ Application<Portlet> application = Application.createPortletApplication();
+ application.setState(state);
+ app = application;
}
+ // Since we don't support dashboard's here, this only works for gadgets using the gadget wrapper portlet.
+ else if ("gadget-application".equals(m_name))
+ {
+ ctx.parsePastStartTag(m_uri, "gadget");
+ String gadgetName = ctx.parseElementText(m_uri, "gadget-ref");
+ Gadget gadget = null;
+ // Once the gadget portlet wrapper is able to use gadget userPref's, include parsing logic here.
+ // Gadget gadget = new Gadget();
+ // gadget.setUserPref();
+ TransientApplicationState<Gadget> state = new TransientApplicationState<Gadget>(gadgetName, gadget);
+ Application<Gadget> application = Application.createGadgetApplication();
+ application.setState(state);
+ app = application;
+ ctx.parsePastEndTag(m_uri, "gadget");
+ }
else
{
ctx.parsePastStartTag(m_uri, "portlet");
@@ -155,8 +172,9 @@
{
state = new TransientApplicationState<Portlet>(applicationName + "/" + portletName, null);
}
- app = Application.createPortletApplication();
- app.setState(state);
+ Application<Portlet> application = Application.createPortletApplication();
+ application.setState(state);
+ app = application;
ctx.parsePastEndTag(m_uri, "portlet");
}
Added: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/GadgetApplication.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/GadgetApplication.java (rev 0)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/GadgetApplication.java 2011-04-14 15:30:06 UTC (rev 6223)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.exoplatform.portal.config.serialize;
+
+import org.exoplatform.portal.config.model.Application;
+import org.exoplatform.portal.config.model.ApplicationType;
+import org.exoplatform.portal.pom.data.ApplicationData;
+import org.exoplatform.portal.pom.spi.gadget.Gadget;
+
+/**
+ * @author <a href="mailto:nscavell@redhat.com">Nick Scavelli</a>
+ * @version $Revision$
+ */
+public class GadgetApplication extends Application<Gadget>
+{
+ public GadgetApplication(ApplicationData<Gadget> gadgetApplicationData)
+ {
+ super(gadgetApplicationData);
+ }
+
+ public GadgetApplication(ApplicationType<Gadget> gadgetApplicationType, String storageId)
+ {
+ super(gadgetApplicationType, storageId);
+ }
+
+ public GadgetApplication(ApplicationType<Gadget> gadgetApplicationType)
+ {
+ super(gadgetApplicationType);
+ }
+}
Added: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/GadgetApplicationHandler.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/GadgetApplicationHandler.java (rev 0)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/GadgetApplicationHandler.java 2011-04-14 15:30:06 UTC (rev 6223)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.exoplatform.portal.config.serialize;
+
+/**
+ * @author <a href="mailto:nscavell@redhat.com">Nick Scavelli</a>
+ * @version $Revision$
+ */
+public class GadgetApplicationHandler extends AbstractApplicationHandler
+{
+ public GadgetApplicationHandler()
+ {
+ }
+
+ public GadgetApplicationHandler(String m_uri, int m_index, String m_name)
+ {
+ super(m_uri, m_index, m_name);
+ }
+}
Modified: portal/trunk/component/portal/src/main/resources/binding.xml
===================================================================
--- portal/trunk/component/portal/src/main/resources/binding.xml 2011-04-14 15:02:05 UTC (rev 6222)
+++ portal/trunk/component/portal/src/main/resources/binding.xml 2011-04-14 15:30:06 UTC (rev 6223)
@@ -44,9 +44,16 @@
unmarshaller="org.exoplatform.portal.config.serialize.PortletApplicationHandler">
</mapping>
+ <mapping name="gadget-application"
+ label="gadget-application"
+ class="org.exoplatform.portal.config.serialize.GadgetApplication"
+ marshaller="org.exoplatform.portal.config.serialize.GadgetApplicationHandler"
+ unmarshaller="org.exoplatform.portal.config.serialize.GadgetApplicationHandler">
+ </mapping>
+
<mapping name="page-body" label="pageBody" class="org.exoplatform.portal.config.model.PageBody">
</mapping>
-
+
<mapping name="site-body" label="siteBody" class="org.exoplatform.portal.config.model.SiteBody">
</mapping>
@@ -66,8 +73,9 @@
<structure map-as="org.exoplatform.portal.config.model.Container" usage="optional"/>
<structure map-as="org.exoplatform.portal.config.model.Application" usage="optional"/>
<structure map-as="org.exoplatform.portal.config.model.PageBody" usage="optional"/>
- <structure map-as="org.exoplatform.portal.config.model.SiteBody" usage="optional"/>
+ <structure map-as="org.exoplatform.portal.config.model.SiteBody" usage="optional"/>
<structure map-as="org.exoplatform.portal.config.serialize.PortletApplication" usage="optional"/>
+ <structure map-as="org.exoplatform.portal.config.serialize.GadgetApplication" usage="optional"/>
</collection>
</mapping>
@@ -86,6 +94,7 @@
<structure map-as="org.exoplatform.portal.config.model.Application" usage="optional"/>
<structure map-as="org.exoplatform.portal.config.model.PageBody" usage="optional"/>
<structure map-as="org.exoplatform.portal.config.serialize.PortletApplication" usage="optional"/>
+ <structure map-as="org.exoplatform.portal.config.serialize.GadgetApplication" usage="optional"/>
</collection>
</mapping>
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestJIBXXmlMapping.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestJIBXXmlMapping.java 2011-04-14 15:02:05 UTC (rev 6222)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestJIBXXmlMapping.java 2011-04-14 15:30:06 UTC (rev 6223)
@@ -22,11 +22,13 @@
import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.portal.application.PortletPreferences.PortletPreferencesSet;
import org.exoplatform.portal.config.model.Application;
+import org.exoplatform.portal.config.model.ApplicationType;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.config.model.TransientApplicationState;
import org.exoplatform.portal.config.model.Page.PageSet;
+import org.exoplatform.portal.pom.spi.gadget.Gadget;
import org.exoplatform.portal.pom.spi.portlet.Portlet;
import org.exoplatform.portal.pom.spi.portlet.PortletBuilder;
import org.jibx.runtime.BindingDirectory;
@@ -124,4 +126,21 @@
Portlet preferences = (Portlet)portletState.getContentState();
assertEquals(new PortletBuilder().add("template", "template_value").build(), preferences);
}
+
+ public void testGadgetApplicationMapping() throws Exception
+ {
+ IBindingFactory bfact = BindingDirectory.getFactory(PortalConfig.class);
+ IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
+ @SuppressWarnings("unchecked")
+ Application<Gadget> app =
+ (Application<Gadget>)uctx.unmarshalDocument(new FileInputStream(
+ "src/test/resources/jibx/gadget-application.xml"), null);
+
+ assertEquals(ApplicationType.GADGET, app.getType());
+ TransientApplicationState gadgetState = (TransientApplicationState) app.getState();
+ assertNotNull(gadgetState);
+ assertEquals("Calendar", gadgetState.getContentId());
+ assertNull(gadgetState.getContentState());
+ // Add test for user-prefs when supported...
+ }
}
Copied: portal/trunk/component/portal/src/test/resources/jibx/gadget-application.xml (from rev 6160, portal/trunk/component/portal/src/test/resources/jibx/portlet-application.xml)
===================================================================
--- portal/trunk/component/portal/src/test/resources/jibx/gadget-application.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/jibx/gadget-application.xml 2011-04-14 15:30:06 UTC (rev 6223)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2011, Red Hat, Inc., and individual contributors
+ ~ as indicated by the @author tags. See the copyright.txt file 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.
+ -->
+
+<gadget-application>
+ <gadget>
+ <gadget-ref>Calendar</gadget-ref>
+ </gadget>
+</gadget-application>
13 years, 9 months
gatein SVN: r6222 - in epp/portal/branches/EPP_5_1_0_GA_JBEPP-860/webui: portal/src/main/java/org/exoplatform/portal/webui/application and 1 other directory.
by do-not-reply@jboss.org
Author: ghjboss
Date: 2011-04-14 11:02:05 -0400 (Thu, 14 Apr 2011)
New Revision: 6222
Modified:
epp/portal/branches/EPP_5_1_0_GA_JBEPP-860/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputSet.java
epp/portal/branches/EPP_5_1_0_GA_JBEPP-860/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java
Log:
[JBEPP-860] solved.
Modified: epp/portal/branches/EPP_5_1_0_GA_JBEPP-860/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputSet.java
===================================================================
--- epp/portal/branches/EPP_5_1_0_GA_JBEPP-860/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputSet.java 2011-04-14 14:18:27 UTC (rev 6221)
+++ epp/portal/branches/EPP_5_1_0_GA_JBEPP-860/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputSet.java 2011-04-14 15:02:05 UTC (rev 6222)
@@ -167,36 +167,36 @@
UIForm uiForm = getAncestorOfType(UIForm.class);
for (UIComponent inputEntry : getChildren())
{
- if (inputEntry.isRendered())
- {
- String label;
- try
- {
- label = uiForm.getLabel(res, inputEntry.getId());
- if (inputEntry instanceof UIFormInputBase)
- ((UIFormInputBase)inputEntry).setLabel(label);
- }
- catch (MissingResourceException ex)
- {
- //label = " " ;
- label = inputEntry.getName();
- System.err.println("\n " + uiForm.getId() + ".label." + inputEntry.getId() + " not found value");
- }
- w.write("<tr>");
- w.write("<td class=\"FieldLabel\">");
-
- // if missing resource, don't print out the label.
- if(!label.equals(inputEntry.getName()))
- {
- w.write(label);
- }
- w.write("</td>");
- w.write("<td class=\"FieldComponent\">");
- renderUIComponent(inputEntry);
- w.write("</td>");
- w.write("</tr>");
- }
- }
+ if (inputEntry instanceof UIFormInputBase)
+ {
+ if (inputEntry.isRendered())
+ {
+ UIFormInputBase formInputBase = (UIFormInputBase) inputEntry;
+ String label;
+ if (formInputBase.getLabel() != null)
+ {
+ label = uiForm.getLabel(res, formInputBase.getLabel());
+ }
+ else
+ {
+ label = uiForm.getLabel(res, formInputBase.getId());
+ }
+ w.write("<tr>");
+ w.write("<td class=\"FieldLabel\">");
+
+ // if missing resource and the label hasn't been set before, don't print out the label.
+ if (formInputBase.getLabel() != null || (label != formInputBase.getId()))
+ {
+ w.write(label);
+ }
+ w.write("</td>");
+ w.write("<td class=\"FieldComponent\">");
+ renderUIComponent(formInputBase);
+ w.write("</td>");
+ w.write("</tr>");
+ }
+ }
+ }
w.write("</table>");
w.write("</div>");
}
Modified: epp/portal/branches/EPP_5_1_0_GA_JBEPP-860/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java
===================================================================
--- epp/portal/branches/EPP_5_1_0_GA_JBEPP-860/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java 2011-04-14 14:18:27 UTC (rev 6221)
+++ epp/portal/branches/EPP_5_1_0_GA_JBEPP-860/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java 2011-04-14 15:02:05 UTC (rev 6222)
@@ -45,21 +45,14 @@
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.Event.Phase;
import org.exoplatform.webui.event.EventListener;
-import org.exoplatform.webui.form.UIFormCheckBoxInput;
-import org.exoplatform.webui.form.UIFormInputIconSelector;
-import org.exoplatform.webui.form.UIFormInputInfo;
-import org.exoplatform.webui.form.UIFormInputSet;
-import org.exoplatform.webui.form.UIFormStringInput;
-import org.exoplatform.webui.form.UIFormTabPane;
-import org.exoplatform.webui.form.UIFormTextAreaInput;
+import org.exoplatform.webui.form.*;
import org.exoplatform.webui.form.validator.ExpressionValidator;
import org.exoplatform.webui.form.validator.MandatoryValidator;
import org.exoplatform.webui.form.validator.StringLengthValidator;
import org.exoplatform.webui.organization.UIListPermissionSelector;
import org.exoplatform.webui.organization.UIListPermissionSelector.EmptyIteratorValidator;
import org.gatein.pc.api.Mode;
-import org.gatein.pc.api.PortletContext;
-import org.gatein.pc.api.PortletInvoker;
+import org.gatein.pc.api.info.PreferenceInfo;
import org.gatein.pc.api.StatefulPortletContext;
import org.gatein.pc.api.invocation.RenderInvocation;
import org.gatein.pc.api.invocation.response.ErrorResponse;
@@ -68,23 +61,12 @@
import org.gatein.pc.api.spi.InstanceContext;
import org.gatein.pc.api.state.AccessMode;
import org.gatein.pc.api.state.PropertyChange;
-import org.gatein.pc.portlet.impl.spi.AbstractClientContext;
-import org.gatein.pc.portlet.impl.spi.AbstractPortalContext;
-import org.gatein.pc.portlet.impl.spi.AbstractSecurityContext;
-import org.gatein.pc.portlet.impl.spi.AbstractServerContext;
-import org.gatein.pc.portlet.impl.spi.AbstractUserContext;
-import org.gatein.pc.portlet.impl.spi.AbstractWindowContext;
+import org.gatein.pc.portlet.impl.spi.*;
import javax.portlet.PortletMode;
import javax.servlet.http.Cookie;
+import java.util.*;
-import java.nio.charset.Charset;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.ResourceBundle;
-
/** Author : Nhu Dinh Thuan nhudinhthuan(a)yahoo.com Jun 8, 2006 */
@ComponentConfigs({
@ComponentConfig(lifecycle = UIFormLifecycle.class, template = "system:/groovy/portal/webui/portal/UIPortletForm.gtmpl", events = {
@@ -288,39 +270,57 @@
getChild(UIFormInputIconSelector.class).setSelectedIcon(icon);
getChild(UIFormInputThemeSelector.class).getChild(UIItemThemeSelector.class).setSelectedTheme(
uiPortlet.getSuitedTheme(null));
- WebuiRequestContext contextres = WebuiRequestContext.getCurrentInstance();
- ResourceBundle res = contextres.getApplicationResourceBundle();
if (hasEditMode())
{
uiPortlet.setCurrentPortletMode(PortletMode.EDIT);
}
else
{
+ Map<String, String> portletPreferenceMaps = new HashMap<String, String>();
+ org.gatein.pc.api.Portlet portlet = uiPortlet.getProducedOfferedPortlet();
+ Set<String> keySet = portlet.getInfo().getPreferences().getKeys();
- //
+ for (String key : keySet)
+ {
+ PreferenceInfo preferenceInfo = portlet.getInfo().getPreferences().getPreference(key);
+ if (!preferenceInfo.isReadOnly())
+ {
+ String ppValue = (preferenceInfo.getDefaultValue().size() > 0) ? preferenceInfo.getDefaultValue().get
+ (0) : "";
+ portletPreferenceMaps.put(key, ppValue);
+ }
+ }
+
Portlet pp = uiPortlet.getPreferences();
if (pp != null)
{
- UIFormInputSet uiPortletPrefSet = getChildById(FIELD_PORTLET_PREF);
- uiPortletPrefSet.getChildren().clear();
for (Preference pref : pp)
{
if (!pref.isReadOnly())
{
- UIFormStringInput templateStringInput =
- new UIFormStringInput(pref.getName(), null, pref.getValues().get(0));
- templateStringInput.setLabel(res.getString("UIPortletForm.tab.label.Template"));
- templateStringInput.addValidator(MandatoryValidator.class);
- uiPortletPrefSet.addUIFormInput(templateStringInput);
+ portletPreferenceMaps.put(pref.getName(), (pref.getValues().size() > 0) ? pref.getValues().get(0) :
+ "");
}
-
}
- if (uiPortletPrefSet.getChildren().size() > 0)
+ }
+
+ if (portletPreferenceMaps.size() > 0)
+ {
+ Set<String> ppKeySet = portletPreferenceMaps.keySet();
+ UIFormInputSet uiPortletPrefSet = getChildById(FIELD_PORTLET_PREF);
+ uiPortletPrefSet.getChildren().clear();
+ for (String ppKey : ppKeySet)
{
- uiPortletPrefSet.setRendered(true);
- setSelectedTab(FIELD_PORTLET_PREF);
- return;
+ String ppValue = portletPreferenceMaps.get(ppKey);
+ UIFormStringInput preferenceStringInput = new UIFormStringInput(ppKey, null, ppValue);
+ preferenceStringInput.setLabel(ppKey);
+ preferenceStringInput.addValidator(MandatoryValidator.class);
+ uiPortletPrefSet.addUIFormInput(preferenceStringInput);
}
+
+ uiPortletPrefSet.setRendered(true);
+ setSelectedTab(FIELD_PORTLET_PREF);
+ return;
}
setSelectedTab("PortletSetting");
}
@@ -336,12 +336,6 @@
return;
}
- //
- PortletInvoker portletInvoker = getApplicationComponent(PortletInvoker.class);
- PortletContext portletContext = uiPortlet_.getPortletContext();
-
- //
-
PropertyChange[] propertyChanges = new PropertyChange[uiFormInputs.size()];
for (int i = 0; i < uiFormInputs.size(); i++)
13 years, 9 months
gatein SVN: r6221 - in components/pc/trunk: api and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-04-14 10:18:27 -0400 (Thu, 14 Apr 2011)
New Revision: 6221
Modified:
components/pc/trunk/api/pom.xml
components/pc/trunk/pom.xml
Log:
- GTNPC-57: Updated to common 2.0.4-Beta02 and added missing dependencies.
Modified: components/pc/trunk/api/pom.xml
===================================================================
--- components/pc/trunk/api/pom.xml 2011-04-14 14:11:57 UTC (rev 6220)
+++ components/pc/trunk/api/pom.xml 2011-04-14 14:18:27 UTC (rev 6221)
@@ -1,3 +1,26 @@
+<!--
+ ~ JBoss, a division of Red Hat
+ ~ Copyright 2011, 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.
+ -->
+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
@@ -20,6 +43,14 @@
<groupId>org.gatein.wci</groupId>
<artifactId>wci-wci</artifactId>
</dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
</dependencies>
<build>
Modified: components/pc/trunk/pom.xml
===================================================================
--- components/pc/trunk/pom.xml 2011-04-14 14:11:57 UTC (rev 6220)
+++ components/pc/trunk/pom.xml 2011-04-14 14:18:27 UTC (rev 6221)
@@ -1,6 +1,6 @@
<!--
~ JBoss, a division of Red Hat
- ~ Copyright 2010, Red Hat Middleware, LLC, and individual
+ ~ Copyright 2011, 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.
@@ -21,7 +21,8 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -45,12 +46,14 @@
</scm>
<properties>
- <version.gatein.common>2.0.4-Beta01</version.gatein.common>
+ <version.gatein.common>2.0.4-Beta02</version.gatein.common>
<version.gatein.wci>2.1.0-Beta01</version.gatein.wci>
<version.apache.portals.bridges>1.0.4</version.apache.portals.bridges>
<version.apache.taglibs>1.1.2</version.apache.taglibs>
<version.apache.log4j>1.2.14</version.apache.log4j>
<version.discovery>0.4</version.discovery>
+ <version.servlet>2.5</version.servlet>
+ <version.junit>4.6</version.junit>
<!-- used in test module by maven-antrun-extended-plugin -->
<version.jboss.unit>1.2.3</version.jboss.unit>
@@ -164,6 +167,16 @@
<version>${version.apache.taglibs}</version>
</dependency>
<dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>${version.servlet}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${version.junit}</version>
+ </dependency>
+ <dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>${version.apache.taglibs}</version>
@@ -171,9 +184,9 @@
<dependency>
<groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-jetty-deployer</artifactId>
- <type>war</type>
- <version>${version.cargo.jetty.deployer}</version>
+ <artifactId>cargo-jetty-deployer</artifactId>
+ <type>war</type>
+ <version>${version.cargo.jetty.deployer}</version>
</dependency>
<dependency>
<groupId>org.jboss.integration</groupId>
13 years, 9 months
gatein SVN: r6220 - epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/jbosscache/local.
by do-not-reply@jboss.org
Author: hfnukal
Date: 2011-04-14 10:11:57 -0400 (Thu, 14 Apr 2011)
New Revision: 6220
Added:
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/jbosscache/local/config.xml
Log:
JBEPP-735 Move jgroups stack configuration out of exo.portal.component.common-<version>.jar
Added: epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/jbosscache/local/config.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/jbosscache/local/config.xml (rev 0)
+++ epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/jbosscache/local/config.xml 2011-04-14 14:11:57 UTC (rev 6220)
@@ -0,0 +1,22 @@
+<!--
+ ~ Copyright (C) 2009 eXo Platform SAS.
+ ~
+ ~ 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.
+ -->
+
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
+
+</jbosscache>
\ No newline at end of file
13 years, 9 months
gatein SVN: r6219 - in epp/portal/branches/EPP_5_1_Branch: web/portal/src/main/webapp/WEB-INF/conf and 3 other directories.
by do-not-reply@jboss.org
Author: hfnukal
Date: 2011-04-14 10:01:29 -0400 (Thu, 14 Apr 2011)
New Revision: 6219
Added:
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/jbosscache/
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/jbosscache/cluster/
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/jbosscache/cluster/config.xml
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/jbosscache/local/
Removed:
epp/portal/branches/EPP_5_1_Branch/component/common/src/main/java/conf/jbosscache/
Modified:
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/common/common-configuration.xml
Log:
JBEPP-735 Move jgroups stack configuration out of exo.portal.component.common-<version>.jar
JBEPP-779 Call RuntimeConfig.setMuxChannelFactory for the MOPSessionManager JBoss Cache instance
Modified: epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/common/common-configuration.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/common/common-configuration.xml 2011-04-14 13:52:46 UTC (rev 6218)
+++ epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/common/common-configuration.xml 2011-04-14 14:01:29 UTC (rev 6219)
@@ -127,11 +127,11 @@
<init-params>
<value-param>
<name>cache.config.template</name>
- <value>classpath:/conf/jbosscache/local/config.xml</value>
+ <value>war:/conf/jbosscache/local/config.xml</value>
</value-param>
<value-param profiles="cluster">
<name>cache.config.template</name>
- <value>classpath:/conf/jbosscache/cluster/config.xml</value>
+ <value>war:/conf/jbosscache/cluster/config.xml</value>
</value-param>
</init-params>
</component>
Added: epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/jbosscache/cluster/config.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/jbosscache/cluster/config.xml (rev 0)
+++ epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/jbosscache/cluster/config.xml 2011-04-14 14:01:29 UTC (rev 6219)
@@ -0,0 +1,27 @@
+<!--
+ ~ Copyright (C) 2009 eXo Platform SAS.
+ ~
+ ~ 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.
+ -->
+
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
+
+<!-- The cluster name should be changed by the kernel cache configuration -->
+<clustering mode="replication" clusterName="${jboss.partition.name:DefaultPartition}-gatein">
+<jgroupsConfig configFile="${jboss.default.jgroups.stack:udp}.xml" />
+</clustering>
+
+</jbosscache>
13 years, 9 months
gatein SVN: r6218 - in epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF: conf/organization and 1 other directory.
by do-not-reply@jboss.org
Author: hfnukal
Date: 2011-04-14 09:52:46 -0400 (Thu, 14 Apr 2011)
New Revision: 6218
Added:
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/idm-local-cache-config.xml
Modified:
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml
Log:
JBEPP-772 Use JndiMultiplexedJBossCacheRegionFactory for IDM second level cache to make switching to TCP easier
Added: epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/idm-local-cache-config.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/idm-local-cache-config.xml (rev 0)
+++ epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/idm-local-cache-config.xml 2011-04-14 13:52:46 UTC (rev 6218)
@@ -0,0 +1,187 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ Hibernate, Relational Persistence for Idiomatic Java
+ ~
+ ~ Copyright (c) 2007, Red Hat Middleware LLC or third-party contributors as
+ ~ indicated by the @author tags or express copyright attribution
+ ~ statements applied by the authors. All third-party contributions are
+ ~ distributed under license by Red Hat Middleware LLC.
+ ~
+ ~ This copyrighted material is made available to anyone wishing to use, modify,
+ ~ copy, or redistribute it subject to the terms and conditions of the GNU
+ ~ Lesser General Public License, as published by the Free Software Foundation.
+ ~
+ ~ This program 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 distribution; if not, write to:
+ ~ Free Software Foundation, Inc.
+ ~ 51 Franklin Street, Fifth Floor
+ ~ Boston, MA 02110-1301 USA
+ -->
+<cache-configs>
+
+ <!--
+ Various JBoss Cache configurations, suitable for different caching
+ uses (e.g. entities vs. queries).
+
+ In all cases, TransactionManager configuration not required.
+ Hibernate will plug in its own transaction manager integration.
+ -->
+
+
+ <!-- A config appropriate for entity/collection caching. -->
+ <cache-config name="local-optimistic-entity">
+
+ <!-- Node locking scheme -->
+ <attribute name="NodeLockingScheme">OPTIMISTIC</attribute>
+
+ <!-- Mode of communication with peer caches.
+
+ LOCAL
+ -->
+ <attribute name="CacheMode">LOCAL</attribute>
+
+ <!-- Name of cluster. Needs to be the same for all members, in order
+ to find each other -->
+ <attribute name="ClusterName">local-optimistic-entity</attribute>
+
+ <!-- Use a UDP (multicast) based stack. A udp-sync stack might be
+ slightly better (no JGroups FC) but we stick with udp to
+ help ensure this cache and others like timestamps-cache
+ that require FC can use the same underlying JGroups resources. -->
+ <attribute name="MultiplexerStack"></attribute>
+
+ <!-- Whether or not to fetch state on joining a cluster. -->
+ <attribute name="FetchInMemoryState">false</attribute>
+
+ <!--
+ The max amount of time (in milliseconds) we wait until the
+ state (ie. the contents of the cache) are retrieved from
+ existing members at startup. Ignored if FetchInMemoryState=false.
+ -->
+ <attribute name="StateRetrievalTimeout">20000</attribute>
+
+ <!--
+ Number of milliseconds to wait until all responses for a
+ synchronous call have been received.
+ -->
+ <attribute name="SyncReplTimeout">20000</attribute>
+
+ <!-- Max number of milliseconds to wait for a lock acquisition -->
+ <attribute name="LockAcquisitionTimeout">15000</attribute>
+
+ <!--
+ Indicate whether to use marshalling or not. Set this to true if you
+ are running under a scoped class loader, e.g., inside an application
+ server.
+ -->
+ <attribute name="UseRegionBasedMarshalling">true</attribute>
+ <!-- Must match the value of "useRegionBasedMarshalling" -->
+ <attribute name="InactiveOnStartup">true</attribute>
+
+ <!-- Eviction policy configurations. -->
+ <attribute name="EvictionPolicyConfig">
+ <config>
+ <attribute name="wakeUpIntervalSeconds">5</attribute>
+ <!-- Name of the DEFAULT eviction policy class. -->
+ <attribute name="policyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
+ <!-- Cache wide default -->
+ <region name="/_default_">
+ <!-- Evict LRU node once we have more than this number of nodes -->
+ <attribute name="maxNodes">10000</attribute>
+ <!-- And, evict any node that hasn't been accessed in this many seconds -->
+ <attribute name="timeToLiveSeconds">1000</attribute>
+ <!-- Don't evict a node that's been accessed within this many seconds.
+ Set this to a value greater than your max expected transaction length. -->
+ <attribute name="minTimeToLiveSeconds">120</attribute>
+ </region>
+ <!-- Don't ever evict modification timestamps -->
+ <region name="/TS" policyClass="org.jboss.cache.eviction.NullEvictionPolicy"/>
+ </config>
+ </attribute>
+
+ </cache-config>
+
+
+
+ <!-- Optimized for timestamp caching. A clustered timestamp cache
+ is required if query caching is used, even if the query cache
+ itself is configured with CacheMode=LOCAL.
+ -->
+ <cache-config name="local-timestamps-cache">
+
+ <!-- Node locking scheme -->
+ <attribute name="NodeLockingScheme">PESSIMISTIC</attribute>
+
+ <!--
+ READ_COMMITTED is as strong as necessary.
+ -->
+ <attribute name="IsolationLevel">READ_COMMITTED</attribute>
+
+ <!-- Cannot be INVALIDATION. ASYNC for improved performance. -->
+ <attribute name="CacheMode">LOCAL</attribute>
+
+ <!-- Name of cluster. Needs to be the same for all members, in order
+ to find each other -->
+ <attribute name="ClusterName">local-timestamp-cache</attribute>
+
+ <!-- Use a UDP (multicast) based stack -->
+ <attribute name="MultiplexerStack"></attribute>
+
+ <!-- Used for timestamps, so must fetch state. -->
+ <attribute name="FetchInMemoryState">true</attribute>
+
+ <!--
+ The max amount of time (in milliseconds) we wait until the
+ state (ie. the contents of the cache) are retrieved from
+ existing members at startup. Ignored if FetchInMemoryState=false.
+ -->
+ <attribute name="StateRetrievalTimeout">20000</attribute>
+
+ <!--
+ Number of milliseconds to wait until all responses for a
+ synchronous call have been received.
+ -->
+ <attribute name="SyncReplTimeout">20000</attribute>
+
+ <!-- Max number of milliseconds to wait for a lock acquisition -->
+ <attribute name="LockAcquisitionTimeout">15000</attribute>
+
+ <!--
+ Indicate whether to use marshalling or not. Set this to true if you
+ are running under a scoped class loader, e.g., inside an application
+ server. Default is "false".
+ -->
+ <attribute name="UseRegionBasedMarshalling">true</attribute>
+ <!-- Must match the value of "useRegionBasedMarshalling" -->
+ <attribute name="InactiveOnStartup">true</attribute>
+
+ <!-- Eviction policy configurations. -->
+ <attribute name="EvictionPolicyConfig">
+ <config>
+ <attribute name="wakeUpIntervalSeconds">5</attribute>
+ <!-- Name of the DEFAULT eviction policy class. -->
+ <attribute name="policyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
+ <!-- Cache wide default -->
+ <region name="/_default_">
+ <!-- Evict LRU node once we have more than this number of nodes -->
+ <attribute name="maxNodes">10000</attribute>
+ <!-- And, evict any node that hasn't been accessed in this many seconds -->
+ <attribute name="timeToLiveSeconds">1000</attribute>
+ <!-- Don't evict a node that's been accessed within this many seconds.
+ Set this to a value greater than your max expected transaction length. -->
+ <attribute name="minTimeToLiveSeconds">120</attribute>
+ </region>
+ <!-- Don't ever evict modification timestamps -->
+ <region name="/TS" policyClass="org.jboss.cache.eviction.NullEvictionPolicy"/>
+ </config>
+ </attribute>
+
+ </cache-config>
+</cache-configs>
+
Modified: epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml 2011-04-14 12:14:56 UTC (rev 6217)
+++ epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml 2011-04-14 13:52:46 UTC (rev 6218)
@@ -1,277 +1,319 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- 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.
-
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
- xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
-
-
- <component>
- <key>org.exoplatform.services.organization.idm.PicketLinkIDMCacheService</key>
- <type>org.exoplatform.services.organization.idm.PicketLinkIDMCacheService</type>
- </component>
-
- <component>
- <key>org.exoplatform.services.database.HibernateService</key>
- <jmx-name>database:type=HibernateService</jmx-name>
- <type>org.exoplatform.services.database.impl.HibernateServiceImpl</type>
- <init-params>
- <properties-param>
- <name>hibernate.properties</name>
- <description>Default Hibernate Service</description>
- <property name="hibernate.cache.region.jbc2.query.localonly" value="true" />
- <property name="hibernate.cache.region.jbc2.cachefactory" value="java:CacheManager"/>
- <property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.jbc2.JndiMultiplexedJBossCacheRegionFactory" />
- <!--<property name="hibernate.cache.region.jbc2.query.localonly" value="true" />-->
- <!--<property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.jbc2.MultiplexedJBossCacheRegionFactory" />-->
- <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
- <property name="hibernate.show_sql" value="false"/>
- <property name="hibernate.current_session_context_class" value="thread"/>
- <property name="hibernate.cache.use_second_level_cache" value="true"/>
- <property name="hibernate.cache.use_query_cache" value="true"/>
- <property name="hibernate.connection.datasource" value="${gatein.idm.datasource.name}${container.name.suffix}"/>
- <property name="hibernate.connection.autocommit" value="true"/>
- <!--
- Should be automatically detected. Force otherwise
- <property name="hibernate.dialect" value="org.hibernate.dialect.XXXDialect"/>
- -->
- </properties-param>
- </init-params>
- </component>
-
- <component>
- <key>org.exoplatform.services.organization.idm.PicketLinkIDMService</key>
- <type>org.exoplatform.services.organization.idm.PicketLinkIDMServiceImpl</type>
- <init-params>
- <value-param>
- <name>config</name>
- <value>war:/conf/organization/picketlink-idm/picketlink-idm-config.xml</value>
-
- <!--Sample LDAP config-->
- <!--<value>war:/conf/organization/picketlink-idm/examples/picketlink-idm-ldap-config.xml</value>-->
-
- <!--Read Only "ACME" LDAP Example-->
- <!--<value>war:/conf/organization/picketlink-idm/examples/picketlink-idm-ldap-acme-config.xml</value>-->
-
- <!--OpenLDAP LDAP config-->
- <!--<value>war:/conf/organization/picketlink-idm/examples/picketlink-idm-openldap-config.xml</value>-->
-
- <!--OpenLDAP ReadOnly "ACME" LDAP Example-->
- <!--<value>war:/conf/organization/picketlink-idm/examples/picketlink-idm-openldap-acme-config.xml</value>-->
-
- <!--MSAD LDAP Example-->
- <!--<value>war:/conf/organization/picketlink-idm/examples/picketlink-idm-msad-config.xml</value>-->
-
- <!--MSAD Read Only "ACME" LDAP Example-->
- <!--<value>war:/conf/organization/picketlink-idm/examples/picketlink-idm-msad-readonly-config.xml</value>-->
-
- </value-param>
-
- <!-- In default PicketLink IDM configuration hibernate store will namespace identity objects using this realm name
- if you want to share DB between portal and also share the same identity data remove the "${container.name.suffix}" part-->
- <value-param>
- <name>portalRealm</name>
- <value>idm_realm${container.name.suffix}</value>
- </value-param>
-
- <value-param>
- <name>apiCacheConfig</name>
- <value>war:/conf/organization/picketlink-idm/jboss-cache.xml</value>
- </value-param>
-
- <value-param profiles="cluster">
- <name>apiCacheConfig</name>
- <value>war:/conf/organization/picketlink-idm/jboss-cache-cluster.xml</value>
- </value-param>
-
- <value-param>
- <name>storeCacheConfig</name>
- <value>war:/conf/organization/picketlink-idm/jboss-cache.xml</value>
- </value-param>
-
- <value-param profiles="cluster">
- <name>storeCacheConfig</name>
- <value>war:/conf/organization/picketlink-idm/jboss-cache-cluster.xml</value>
- </value-param>
-
- </init-params>
- </component>
-
-
- <component>
- <key>org.exoplatform.services.organization.OrganizationService</key>
- <type>org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</type>
- <init-params>
- <object-param>
- <name>configuration</name>
- <object type="org.exoplatform.services.organization.idm.Config">
- <!-- For all ids not mapped with type in 'groupTypeMappings' use parent id path
- as a group type to store group in PicketLink IDM. The effect of setting
- this option to false and not providing any mappings under 'groupTypeMappings' option
- is that there can be only one group with a given name in all GateIn group tree-->
- <field name="useParentIdAsGroupType">
- <boolean>true</boolean>
- </field>
- <!-- Group stored in PicketLink IDM with a type mapped in 'groupTypeMappings' will
- automatically be member under mapped parent. Normally groups are linked by
- PicketLink IDM group association - such relationship won't be needed then. It can
- be set to false if all groups are added via GateIn APIs
- This option may be useful with LDAP config as it will make (if set to true) every entry
- added to LDAP (not via GateIn management UI) appear in GateIn-->
- <field name="forceMembershipOfMappedTypes">
- <boolean>true</boolean>
- </field>
- <!-- When 'userParentIdAsGroupType is set to true this value will be used to
- replace all "/" chars in id. This is because "/" is not allowed to be
- used in group type name in PicketLink IDM-->
- <field name="pathSeparator">
- <string>.</string>
- </field>
- <!-- Name of a group stored in PicketLink IDM that acts as root group in GateIn - "/" -->
- <field name="rootGroupName">
- <string>GTN_ROOT_GROUP</string>
- </field>
- <!-- Map groups added with GateIn API as a childs of a given group ID to be stored with a given
- group type name in PicketLink IDM. If parent ID ends with "/*" then all child groups will
- have the mapped group type. Otherwise only direct (first level) children will use this type.
-
- This can be leveraged by LDAP setup. Given LDAP DN configured in PicketLink IDM to
- store specific group type will then store one given branch in GateIn group tree while
- all other groups will remain in DB. -->
- <field name="groupTypeMappings">
- <map type="java.util.HashMap">
- <entry>
- <key><string>/</string></key>
- <value><string>root_type</string></value>
- </entry>
-
- <!-- Uncomment for sample LDAP configuration -->
- <!--
- <entry>
- <key><string>/platform/*</string></key>
- <value><string>platform_type</string></value>
- </entry>
- <entry>
- <key><string>/organization/*</string></key>
- <value><string>organization_type</string></value>
- </entry>
- -->
-
-
- <!-- Uncomment for ACME LDAP example -->
- <!--
- <entry>
- <key><string>/acme/roles/*</string></key>
- <value><string>acme_roles_type</string></value>
- </entry>
- <entry>
- <key><string>/acme/organization_units/*</string></key>
- <value><string>acme_ou_type</string></value>
- </entry>
- -->
-
- <!-- Uncomment for MSAD ReadOnly LDAP example -->
- <!--
- <entry>
- <key><string>/acme/roles/*</string></key>
- <value><string>msad_roles_type</string></value>
- </entry>
- -->
- </map>
- </field>
- <!-- If this option is used then each Membership created with MembrshipType that is
- equal to value specified here will be stored in PicketLink IDM as simple
- Group-User association-->
- <field name="associationMembershipType">
- <string>member</string>
- </field>
- <!-- if "associationMembershipType" option is used and this option is set to true
- then Membership with MembershipType configured to be stored as PicketLink IDM association
- will not be stored as PicketLink IDM Role -->
- <field name="ignoreMappedMembershipType">
- <boolean>false</boolean>
- </field>
- <!-- If 'true' will use JTA UserTransaction. If 'false' will use IDM transaction API -->
- <field name="useJTA">
- <boolean>false</boolean>
- </field>
-
- <!-- If PLIDM group will have name containing slash "/" char than it will be replace with following string.
- Slashes are used in group paths and if present in names may cause unpredictable behaviour -->
- <field name="slashReplacement">
- <string>@_@_@</string>
- </field>
-
- <!-- If groups should be displayed in a sorted order in the management UI-->
- <field name="sortGroups">
- <boolean>true</boolean>
- </field>
-
- <!-- If memberships should be displayed in a sorted order in the management UI-->
- <field name="sortMemberships">
- <boolean>true</boolean>
- </field>
- </object>
- </object-param>
- </init-params>
- </component>
-
- <external-component-plugins>
- <target-component>org.exoplatform.services.database.HibernateService</target-component>
- <component-plugin>
- <name>add.hibernate.mapping</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.database.impl.AddHibernateMappingPlugin</type>
- <init-params>
- <values-param>
- <name>hibernate.mapping</name>
- <value>picketlink-idm/mappings/HibernateRealm.hbm.xml</value>
- <value>picketlink-idm/mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml</value>
- <value>picketlink-idm/mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml</value>
- <value>picketlink-idm/mappings/HibernateIdentityObject.hbm.xml</value>
- <value>picketlink-idm/mappings/HibernateIdentityObjectCredential.hbm.xml</value>
- <value>picketlink-idm/mappings/HibernateIdentityObjectCredentialType.hbm.xml</value>
- <value>picketlink-idm/mappings/HibernateIdentityObjectAttribute.hbm.xml</value>
- <value>picketlink-idm/mappings/HibernateIdentityObjectType.hbm.xml</value>
- <value>picketlink-idm/mappings/HibernateIdentityObjectRelationship.hbm.xml</value>
- <value>picketlink-idm/mappings/HibernateIdentityObjectRelationshipType.hbm.xml</value>
- <value>picketlink-idm/mappings/HibernateIdentityObjectRelationshipName.hbm.xml</value>
- </values-param>
- <values-param profiles="sybase">
- <name>hibernate.mapping</name>
- <value>picketlink-idm/sybase-mappings/HibernateRealm.hbm.xml</value>
- <value>picketlink-idm/sybase-mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml</value>
- <value>picketlink-idm/sybase-mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml</value>
- <value>picketlink-idm/sybase-mappings/HibernateIdentityObject.hbm.xml</value>
- <value>picketlink-idm/sybase-mappings/HibernateIdentityObjectCredential.hbm.xml</value>
- <value>picketlink-idm/sybase-mappings/HibernateIdentityObjectCredentialType.hbm.xml</value>
- <value>picketlink-idm/sybase-mappings/HibernateIdentityObjectAttribute.hbm.xml</value>
- <value>picketlink-idm/sybase-mappings/HibernateIdentityObjectType.hbm.xml</value>
- <value>picketlink-idm/sybase-mappings/HibernateIdentityObjectRelationship.hbm.xml</value>
- <value>picketlink-idm/sybase-mappings/HibernateIdentityObjectRelationshipType.hbm.xml</value>
- <value>picketlink-idm/sybase-mappings/HibernateIdentityObjectRelationshipName.hbm.xml</value>
- </values-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
-
-</configuration>
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+
+
+ <component>
+ <key>org.exoplatform.services.organization.idm.PicketLinkIDMCacheService</key>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMCacheService</type>
+ </component>
+
+
+ <!-- non-clustered profile -->
+ <component>
+ <key>org.exoplatform.services.database.HibernateService</key>
+ <jmx-name>database:type=HibernateService</jmx-name>
+ <type>org.exoplatform.services.database.impl.HibernateServiceImpl</type>
+ <init-params>
+ <properties-param>
+ <name>hibernate.properties</name>
+ <description>Default Hibernate Service</description>
+ <property name="hibernate.cache.region.jbc2.query.localonly" value="true" />
+ <property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.jbc2.MultiplexedJBossCacheRegionFactory" />
+ <!-- force usage of LOCAL cache configurations -->
+ <property name="hibernate.cache.region.jbc2.configs" value="picketlink-idm/idm-local-cache-config.xml" />
+ <property name="hibernate.cache.region.jbc2.cfg.entity" value="local-optimistic-entity" />
+ <property name="hibernate.cache.region.jbc2.cfg.ts" value="local-timestamps-cache" />
+
+ <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
+ <property name="hibernate.show_sql" value="false"/>
+ <property name="hibernate.current_session_context_class" value="thread"/>
+ <property name="hibernate.cache.use_second_level_cache" value="true"/>
+ <property name="hibernate.cache.use_query_cache" value="true"/>
+ <property name="hibernate.connection.datasource" value="${gatein.idm.datasource.name}${container.name.suffix}"/>
+ <property name="hibernate.connection.autocommit" value="true"/>
+ <!--
+ Should be automatically detected. Force otherwise
+ <property name="hibernate.dialect" value="org.hibernate.dialect.XXXDialect"/>
+ -->
+ </properties-param>
+ </init-params>
+ </component>
+
+ <!-- clustered profile -->
+ <component profiles="cluster">
+ <key>org.exoplatform.services.database.HibernateService</key>
+ <jmx-name>database:type=HibernateService</jmx-name>
+ <type>org.exoplatform.services.database.impl.HibernateServiceImpl</type>
+ <init-params>
+ <properties-param>
+ <name>hibernate.properties</name>
+ <description>Default Hibernate Service</description>
+ <property name="hibernate.cache.region.jbc2.query.localonly" value="true" />
+ <property name="hibernate.cache.region.jbc2.cachefactory" value="java:CacheManager"/>
+ <property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.jbc2.JndiMultiplexedJBossCacheRegionFactory" />
+ <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
+ <property name="hibernate.show_sql" value="false"/>
+ <property name="hibernate.current_session_context_class" value="thread"/>
+ <property name="hibernate.cache.use_second_level_cache" value="true"/>
+ <property name="hibernate.cache.use_query_cache" value="true"/>
+ <property name="hibernate.connection.datasource" value="${gatein.idm.datasource.name}${container.name.suffix}"/>
+ <property name="hibernate.connection.autocommit" value="true"/>
+ <!--
+ Should be automatically detected. Force otherwise
+ <property name="hibernate.dialect" value="org.hibernate.dialect.XXXDialect"/>
+ -->
+ </properties-param>
+ </init-params>
+ </component>
+
+
+ <component>
+ <key>org.exoplatform.services.organization.idm.PicketLinkIDMService</key>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMServiceImpl</type>
+ <init-params>
+ <value-param>
+ <name>config</name>
+ <value>war:/conf/organization/picketlink-idm/picketlink-idm-config.xml</value>
+
+ <!--Sample LDAP config-->
+ <!--<value>war:/conf/organization/picketlink-idm/examples/picketlink-idm-ldap-config.xml</value>-->
+
+ <!--Read Only "ACME" LDAP Example-->
+ <!--<value>war:/conf/organization/picketlink-idm/examples/picketlink-idm-ldap-acme-config.xml</value>-->
+
+ <!--OpenLDAP LDAP config-->
+ <!--<value>war:/conf/organization/picketlink-idm/examples/picketlink-idm-openldap-config.xml</value>-->
+
+ <!--OpenLDAP ReadOnly "ACME" LDAP Example-->
+ <!--<value>war:/conf/organization/picketlink-idm/examples/picketlink-idm-openldap-acme-config.xml</value>-->
+
+ <!--MSAD LDAP Example-->
+ <!--<value>war:/conf/organization/picketlink-idm/examples/picketlink-idm-msad-config.xml</value>-->
+
+ <!--MSAD Read Only "ACME" LDAP Example-->
+ <!--<value>war:/conf/organization/picketlink-idm/examples/picketlink-idm-msad-readonly-config.xml</value>-->
+
+ </value-param>
+
+ <!-- In default PicketLink IDM configuration hibernate store will namespace identity objects using this realm name
+ if you want to share DB between portal and also share the same identity data remove the "${container.name.suffix}" part-->
+ <value-param>
+ <name>portalRealm</name>
+ <value>idm_realm${container.name.suffix}</value>
+ </value-param>
+
+ <value-param>
+ <name>apiCacheConfig</name>
+ <value>war:/conf/organization/picketlink-idm/jboss-cache.xml</value>
+ </value-param>
+
+ <value-param profiles="cluster">
+ <name>apiCacheConfig</name>
+ <value>war:/conf/organization/picketlink-idm/jboss-cache-api-cluster.xml</value>
+ </value-param>
+
+ <value-param>
+ <name>storeCacheConfig</name>
+ <value>war:/conf/organization/picketlink-idm/jboss-cache.xml</value>
+ </value-param>
+
+ <value-param profiles="cluster">
+ <name>storeCacheConfig</name>
+ <value>war:/conf/organization/picketlink-idm/jboss-cache-store-cluster.xml</value>
+ </value-param>
+
+ <value-param profiles="cluster">
+ <name>jgroups-configuration</name>
+ <value>${gatein.jcr.jgroups.config}</value>
+ </value-param>
+
+ <value-param profiles="cluster">
+ <name>jgroups-multiplexer-stack</name>
+ <value>true</value>
+ </value-param>
+
+ </init-params>
+ </component>
+
+
+ <component>
+ <key>org.exoplatform.services.organization.OrganizationService</key>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</type>
+ <init-params>
+ <object-param>
+ <name>configuration</name>
+ <object type="org.exoplatform.services.organization.idm.Config">
+ <!-- For all ids not mapped with type in 'groupTypeMappings' use parent id path
+ as a group type to store group in PicketLink IDM. The effect of setting
+ this option to false and not providing any mappings under 'groupTypeMappings' option
+ is that there can be only one group with a given name in all GateIn group tree-->
+ <field name="useParentIdAsGroupType">
+ <boolean>true</boolean>
+ </field>
+ <!-- Group stored in PicketLink IDM with a type mapped in 'groupTypeMappings' will
+ automatically be member under mapped parent. Normally groups are linked by
+ PicketLink IDM group association - such relationship won't be needed then. It can
+ be set to false if all groups are added via GateIn APIs
+ This option may be useful with LDAP config as it will make (if set to true) every entry
+ added to LDAP (not via GateIn management UI) appear in GateIn-->
+ <field name="forceMembershipOfMappedTypes">
+ <boolean>true</boolean>
+ </field>
+ <!-- When 'userParentIdAsGroupType is set to true this value will be used to
+ replace all "/" chars in id. This is because "/" is not allowed to be
+ used in group type name in PicketLink IDM-->
+ <field name="pathSeparator">
+ <string>.</string>
+ </field>
+ <!-- Name of a group stored in PicketLink IDM that acts as root group in GateIn - "/" -->
+ <field name="rootGroupName">
+ <string>GTN_ROOT_GROUP</string>
+ </field>
+ <!-- Map groups added with GateIn API as a childs of a given group ID to be stored with a given
+ group type name in PicketLink IDM. If parent ID ends with "/*" then all child groups will
+ have the mapped group type. Otherwise only direct (first level) children will use this type.
+
+ This can be leveraged by LDAP setup. Given LDAP DN configured in PicketLink IDM to
+ store specific group type will then store one given branch in GateIn group tree while
+ all other groups will remain in DB. -->
+ <field name="groupTypeMappings">
+ <map type="java.util.HashMap">
+ <entry>
+ <key><string>/</string></key>
+ <value><string>root_type</string></value>
+ </entry>
+
+ <!-- Uncomment for sample LDAP configuration -->
+ <!--
+ <entry>
+ <key><string>/platform/*</string></key>
+ <value><string>platform_type</string></value>
+ </entry>
+ <entry>
+ <key><string>/organization/*</string></key>
+ <value><string>organization_type</string></value>
+ </entry>
+ -->
+
+
+ <!-- Uncomment for ACME LDAP example -->
+ <!--
+ <entry>
+ <key><string>/acme/roles/*</string></key>
+ <value><string>acme_roles_type</string></value>
+ </entry>
+ <entry>
+ <key><string>/acme/organization_units/*</string></key>
+ <value><string>acme_ou_type</string></value>
+ </entry>
+ -->
+
+ <!-- Uncomment for MSAD ReadOnly LDAP example -->
+ <!--
+ <entry>
+ <key><string>/acme/roles/*</string></key>
+ <value><string>msad_roles_type</string></value>
+ </entry>
+ -->
+ </map>
+ </field>
+ <!-- If this option is used then each Membership created with MembrshipType that is
+ equal to value specified here will be stored in PicketLink IDM as simple
+ Group-User association-->
+ <field name="associationMembershipType">
+ <string>member</string>
+ </field>
+ <!-- if "associationMembershipType" option is used and this option is set to true
+ then Membership with MembershipType configured to be stored as PicketLink IDM association
+ will not be stored as PicketLink IDM Role -->
+ <field name="ignoreMappedMembershipType">
+ <boolean>false</boolean>
+ </field>
+ <!-- If 'true' will use JTA UserTransaction. If 'false' will use IDM transaction API -->
+ <field name="useJTA">
+ <boolean>false</boolean>
+ </field>
+
+ <!-- If PLIDM group will have name containing slash "/" char than it will be replace with following string.
+ Slashes are used in group paths and if present in names may cause unpredictable behaviour -->
+ <field name="slashReplacement">
+ <string>@_@_@</string>
+ </field>
+
+ <!-- If groups should be displayed in a sorted order in the management UI-->
+ <field name="sortGroups">
+ <boolean>true</boolean>
+ </field>
+
+ <!-- If memberships should be displayed in a sorted order in the management UI-->
+ <field name="sortMemberships">
+ <boolean>true</boolean>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.database.HibernateService</target-component>
+ <component-plugin>
+ <name>add.hibernate.mapping</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.database.impl.AddHibernateMappingPlugin</type>
+ <init-params>
+ <values-param>
+ <name>hibernate.mapping</name>
+ <value>picketlink-idm/mappings/HibernateRealm.hbm.xml</value>
+ <value>picketlink-idm/mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml</value>
+ <value>picketlink-idm/mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml</value>
+ <value>picketlink-idm/mappings/HibernateIdentityObject.hbm.xml</value>
+ <value>picketlink-idm/mappings/HibernateIdentityObjectCredential.hbm.xml</value>
+ <value>picketlink-idm/mappings/HibernateIdentityObjectCredentialType.hbm.xml</value>
+ <value>picketlink-idm/mappings/HibernateIdentityObjectAttribute.hbm.xml</value>
+ <value>picketlink-idm/mappings/HibernateIdentityObjectType.hbm.xml</value>
+ <value>picketlink-idm/mappings/HibernateIdentityObjectRelationship.hbm.xml</value>
+ <value>picketlink-idm/mappings/HibernateIdentityObjectRelationshipType.hbm.xml</value>
+ <value>picketlink-idm/mappings/HibernateIdentityObjectRelationshipName.hbm.xml</value>
+ </values-param>
+ <values-param profiles="sybase">
+ <name>hibernate.mapping</name>
+ <value>picketlink-idm/sybase-mappings/HibernateRealm.hbm.xml</value>
+ <value>picketlink-idm/sybase-mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml</value>
+ <value>picketlink-idm/sybase-mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml</value>
+ <value>picketlink-idm/sybase-mappings/HibernateIdentityObject.hbm.xml</value>
+ <value>picketlink-idm/sybase-mappings/HibernateIdentityObjectCredential.hbm.xml</value>
+ <value>picketlink-idm/sybase-mappings/HibernateIdentityObjectCredentialType.hbm.xml</value>
+ <value>picketlink-idm/sybase-mappings/HibernateIdentityObjectAttribute.hbm.xml</value>
+ <value>picketlink-idm/sybase-mappings/HibernateIdentityObjectType.hbm.xml</value>
+ <value>picketlink-idm/sybase-mappings/HibernateIdentityObjectRelationship.hbm.xml</value>
+ <value>picketlink-idm/sybase-mappings/HibernateIdentityObjectRelationshipType.hbm.xml</value>
+ <value>picketlink-idm/sybase-mappings/HibernateIdentityObjectRelationshipName.hbm.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+</configuration>
13 years, 9 months