gatein SVN: r7643 - in epp/portal/branches/EPP_5_2_Branch/web: portal/src/main/webapp/groovy/portal/webui/container and 1 other directory.
by do-not-reply@jboss.org
Author: theute
Date: 2011-10-04 03:19:25 -0400 (Tue, 04 Oct 2011)
New Revision: 7643
Modified:
epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/container/UIColumnContainer.gtmpl
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl
Log:
JBEPP-1252: Can't DnD UIColumnContainer when language is Arabic
Modified: epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js 2011-10-04 07:16:45 UTC (rev 7642)
+++ epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js 2011-10-04 07:19:25 UTC (rev 7643)
@@ -404,29 +404,31 @@
* @param layout {string} the layout type which is "row" or "column"
*/
PortalDragDrop.prototype.findInsertPosition = function(components, layout, mouseEvent) {
- var Browser = eXo.core.Browser;
- if (layout == "row") {
- for (var i = 0; i < components.length; i++) {
- var componentTop = Browser.findPosY(components[i]);
- var mouseYInPage = Browser.findMouseYInPage(mouseEvent);
- var componentMIddle = componentTop + Math.round(components[i].offsetHeight / 2);
- if (mouseYInPage > componentMIddle) continue;
- else return i;
- }
-
- return -1;
- } else {
- for (var i = 0; i < components.length; i++) {
- var mouseXInPage = Browser.findMouseXInPage(mouseEvent);
- var componentInTD = eXo.core.DOMUtil.getChildrenByTagName(components[i], "div")[0];
- var componentX = Browser.findPosX(components[i]);
- if (mouseXInPage > componentX) continue;
- else return i
- }
-
- return -1
- }
-};
+ var Browser = eXo.core.Browser;
+ if (layout == "row") {
+ for (var i = 0; i < components.length; i++) {
+ var componentTop = Browser.findPosY(components[i]);
+ var mouseYInPage = Browser.findMouseYInPage(mouseEvent);
+ var componentMIddle = componentTop + Math.round(components[i].offsetHeight / 2);
+ if (mouseYInPage > componentMIddle) continue;
+ else return i;
+ }
+
+ return -1;
+ } else {
+ for (var i = 0; i < components.length; i++) {
+ var mouseXInPage = Browser.findMouseXInPage(mouseEvent);
+ var componentX = Browser.findPosX(components[i], eXo.core.I18n.isRT());
+ if (eXo.core.I18n.isRT()) {
+ if (mouseXInPage < componentX) continue;
+ } else if (mouseXInPage > componentX ) continue;
+
+ return i;
+ }
+
+ return -1;
+ }
+ };
/**
* Create a div block which show the preview block
Modified: epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/container/UIColumnContainer.gtmpl
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/container/UIColumnContainer.gtmpl 2011-10-04 07:16:45 UTC (rev 7642)
+++ epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/container/UIColumnContainer.gtmpl 2011-10-04 07:19:25 UTC (rev 7643)
@@ -40,11 +40,11 @@
<div class="VIEW-CONTAINER VIEW-BLOCK">
<%} %>
<%if(hasPermission) {%>
+ <div>
<div class="UIRowContainer <%=(portalMode != UIPortalApplication.NORMAL_MODE && uicomponent.getChildren().size() == 0) ? "EmptyContainer" : ""%>">
- <div>
<%uicomponent.renderChildren();%>
- </div>
</div>
+ </div>
<%} else out.print("<div class='ProtectedContent'>"+_ctx.appRes("UIPortlet.label.protectedContent")+"</div>");%>
</div>
Modified: epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl 2011-10-04 07:16:45 UTC (rev 7642)
+++ epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl 2011-10-04 07:19:25 UTC (rev 7643)
@@ -29,26 +29,25 @@
id="${uicomponent.id}" ${cssStyle}
onmouseover="eXo.portal.UIPortal.blockOnMouseOver(event, this, true);"
onmouseout="eXo.portal.UIPortal.blockOnMouseOver(event, this, false);">
- <div class="NormalContainerBlock UIComponentBlock">
-
- <%
- int portalMode = uiPortalApp.getModeState();
- if(portalMode == uiPortalApp.CONTAINER_BLOCK_EDIT_MODE || portalMode == uiPortalApp.APP_BLOCK_EDIT_MODE){
- %>
- <div class="LAYOUT-CONTAINER LAYOUT-BLOCK">
- <%} else {%>
- <div class="VIEW-CONTAINER VIEW-BLOCK">
- <%} %>
- <%if(hasPermission) {%>
- <div class="UIRowContainer <%=(portalMode != UIPortalApplication.NORMAL_MODE && uicomponent.getChildren().size() == 0) ? "EmptyContainer" : ""%>">
- <div>
- <%uicomponent.renderChildren();%>
- </div>
- </div>
- <%} else out.print("<div class='ProtectedContent'>"+_ctx.appRes("UIPortlet.label.protectedContent")+"</div>");%>
- </div>
-
- <%if(portalMode != UIPortalApplication.NORMAL_MODE){%>
+ <div class="NormalContainerBlock UIComponentBlock">
+ <%
+ int portalMode = uiPortalApp.getModeState();
+ if(portalMode == uiPortalApp.CONTAINER_BLOCK_EDIT_MODE || portalMode == uiPortalApp.APP_BLOCK_EDIT_MODE){
+ %>
+ <div class="LAYOUT-CONTAINER LAYOUT-BLOCK">
+ <%} else {%>
+ <div class="VIEW-CONTAINER VIEW-BLOCK">
+ <%} %>
+ <%if(hasPermission) {%>
+ <div>
+ <div class="UIRowContainer <%=(portalMode != UIPortalApplication.NORMAL_MODE && uicomponent.getChildren().size() == 0) ? "EmptyContainer" : ""%>">
+ <%uicomponent.renderChildren();%>
+ </div>
+ </div>
+ <%} else out.print("<div class='ProtectedContent'>"+_ctx.appRes("UIPortlet.label.protectedContent")+"</div>");%>
+ </div>
+
+ <%if(portalMode != UIPortalApplication.NORMAL_MODE){%>
<div class="EDITION-BLOCK EDITION-CONTAINER" style="display: none;position: relative;">
<div style="position: absolute; top: -86px;">
<div class="NewLayer" style="display: none; visibility: hidden;"><span></span></div>
@@ -74,4 +73,4 @@
</div>
<%} %>
</div>
-</div>
\ No newline at end of file
+</div>
13 years, 3 months
gatein SVN: r7642 - in epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo: portal and 1 other directory.
by do-not-reply@jboss.org
Author: theute
Date: 2011-10-04 03:16:45 -0400 (Tue, 04 Oct 2011)
New Revision: 7642
Modified:
epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/core/DragDrop.js
epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js
Log:
JBEPP-1254: Fix some DnD problems when editing layout
Modified: epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/core/DragDrop.js
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/core/DragDrop.js 2011-10-04 07:09:30 UTC (rev 7641)
+++ epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/core/DragDrop.js 2011-10-04 07:16:45 UTC (rev 7642)
@@ -101,19 +101,20 @@
} ;
DragDrop.prototype.onDrop = function(evt) {
- /* should not remove this or move this line to destroy since the onMouseMove method keep calling */
- if(eXo.core.DragDrop.dropCallback != null) {
- var dndEvent = eXo.core.DragDrop.dndEvent ;
- dndEvent.backupMouseEvent = evt ;
- var dragObject = dndEvent.dragObject ;
+ if(!evt) evt = window.event ;
+ /* should not remove this or move this line to destroy since the onMouseMove method keep calling */
+ if(eXo.core.DragDrop.dropCallback != null) {
+ var dndEvent = eXo.core.DragDrop.dndEvent ;
+ dndEvent.backupMouseEvent = evt ;
+ var dragObject = dndEvent.dragObject ;
- var foundTarget = eXo.core.DragDrop.findDropableTarget(dndEvent, eXo.core.DragDrop.dropableTargets, evt) ;
- var junkMove = eXo.core.DragDrop.isJunkMove(dragObject, foundTarget) ;
+ var foundTarget = eXo.core.DragDrop.findDropableTarget(dndEvent, eXo.core.DragDrop.dropableTargets, evt) ;
+ var junkMove = eXo.core.DragDrop.isJunkMove(dragObject, foundTarget) ;
- dndEvent.update(foundTarget, junkMove) ;
- eXo.core.DragDrop.dropCallback (dndEvent) ;
- }
- eXo.core.DragDrop.destroy() ;
+ dndEvent.update(foundTarget, junkMove) ;
+ eXo.core.DragDrop.dropCallback (dndEvent) ;
+ }
+ eXo.core.DragDrop.destroy() ;
} ;
DragDrop.prototype.onCancel = function(evt) {
Modified: epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js 2011-10-04 07:09:30 UTC (rev 7641)
+++ epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js 2011-10-04 07:16:45 UTC (rev 7642)
@@ -86,9 +86,12 @@
dndEvent.dragObject = cloneObject ;
dndEvent.dragObject.isAddingNewly = isAddingNewly;
} else {
+ var componentBlockWidth = 300;
+
previewBlock = PortalDragDrop.createPreview();
+ previewBlock.style.height = dragObject.offsetHeight + "px";
dragObject.parentNode.insertBefore(previewBlock, dragObject);
- dragObject.style.width = "300px";
+ dragObject.style.width = componentBlockWidth + "px";
var componentBlock = eXo.core.DOMUtil.findFirstDescendantByClass(dragObject, "div", "UIComponentBlock") ;
var editBlock = eXo.core.DOMUtil.findFirstChildByClass(componentBlock, "div", "EDITION-BLOCK");
if(editBlock) {
@@ -99,10 +102,20 @@
dragObject.isAddingNewly = isAddingNewly;
dragObject = dndEvent.dragObject;
dragObject.style.position = "absolute" ;
- if(eXo.core.I18n.isLT()) dragObject.style.left = originalDragObjectLeft + "px" ;
- else dragObject.style.right = (PortalDragDrop.positionRootObj.offsetWidth - originalDragObjectLeft - dragObject.offsetWidth) + "px" ;
dragObject.style.top = originalDragObjectTop + "px" ;
+ var dragObjectLeft = originalDragObjectLeft;
+ if (PortalDragDrop.deltaXDragObjectAndMouse > componentBlockWidth/2) {
+ if ((PortalDragDrop.backupDragObjectWidth - PortalDragDrop.deltaXDragObjectAndMouse) > componentBlockWidth/2) {
+ dragObjectLeft = originalDragObjectLeft + PortalDragDrop.deltaXDragObjectAndMouse - componentBlockWidth/2;
+ } else {
+ dragObjectLeft = originalDragObjectLeft + PortalDragDrop.backupDragObjectWidth - componentBlockWidth;
+ }
+ }
+
+ if (eXo.core.I18n.isLT()) dragObject.style.left = dragObjectLeft + "px";
+ else dragObject.style.right = PortalDragDrop.positionRootObj.offsetWidth - dragObject.offsetWidth - dragObjectLeft + "px";
+
eXo.portal.isInDragging = true;
}
@@ -110,7 +123,14 @@
var dragObject = dndEvent.dragObject ;
/* Control Scroll */
eXo.portal.PortalDragDrop.scrollOnDrag(dndEvent) ;
- if(!dndEvent.foundTargetObject) return;
+ if(!dndEvent.foundTargetObject) {
+ if (!dndEvent.lastFoundTargetObject) {
+ return;
+ } else {
+ dndEvent.foundTargetObject = dndEvent.lastFoundTargetObject;
+ }
+ }
+
var uiComponentLayout ;
if(dndEvent.foundTargetObject.className == "UIPage") {
uiComponentLayout = DOMUtil.findFirstDescendantByClass(dndEvent.foundTargetObject, "div", "VIEW-PAGE");
@@ -149,7 +169,7 @@
}
dndEvent.foundTargetObject.listComponentInTarget = listComponent ;
- var insertPosition = eXo.portal.PortalDragDrop.findInsertPosition(listComponent, dragObject, "row") ;
+ var insertPosition = eXo.portal.PortalDragDrop.findInsertPosition(listComponent, "row", dndEvent.backupMouseEvent) ;
dndEvent.foundTargetObject.foundIndex = insertPosition ;
/* Insert preview block */
@@ -179,7 +199,7 @@
}
dndEvent.foundTargetObject.listComponentInTarget = listComponent ;
- var insertPosition = eXo.portal.PortalDragDrop.findInsertPosition(listComponent, dragObject, "column") ;
+ var insertPosition = eXo.portal.PortalDragDrop.findInsertPosition(listComponent, "column", dndEvent.backupMouseEvent) ;
dndEvent.foundTargetObject.foundIndex = insertPosition ;
/* Insert preview block */
@@ -203,11 +223,15 @@
hasChanged = false;
}
//When dragObject is outside
- var targetElement = dndEvent.foundTargetObject;
- if(!targetElement || targetElement.foundIndex == null) {
- hasChanged = false;
- }
- //When dragobject is next to preview object (position is not changed)
+ if (!dndEvent.foundTargetObject) {
+ dndEvent.foundTargetObject = dndEvent.lastFoundTargetObject;
+ }
+
+ var targetElement = dndEvent.foundTargetObject;
+ if(!targetElement || targetElement.foundIndex == null) {
+ hasChanged = false;
+ }
+ //When dragobject is next to preview object (position is not changed)
if(!dndEvent.dragObject.isAddingNewly) {
var DOMUtil = eXo.core.DOMUtil;
var previewClass = "DragAndDropPreview";
@@ -229,7 +253,7 @@
}
}
- if(dndEvent.foundTargetObject != null || (dndEvent.backupMouseEvent && dndEvent.backupMouseEvent.keyCode != 27)) {
+ if(dndEvent.backupMouseEvent && dndEvent.backupMouseEvent.keyCode != 27) {
eXo.portal.PortalDragDrop.doDropCallback(dndEvent) ;
} else {
if(dndEvent.dragObject.parentNode.nodeName.toLowerCase() == "td") {
@@ -359,13 +383,18 @@
var mouseY = eXo.core.Browser.findMouseYInClient(dndEvent.backupMouseEvent) ;
var deltaTop = mouseY - (Math.round(browserHeight * 5/6)) ;
var deltaBottom = mouseY - (Math.round(browserHeight/6)) ;
+ var currentDragObjPos = parseInt(dndEvent.dragObject.style.top);
if(deltaTop > 0) {
- document.documentElement.scrollTop += deltaTop - 5 ;
+ document.documentElement.scrollTop += deltaTop - 5;
+ currentDragObjPos += deltaTop - 5;
}
if(deltaBottom < 0 && document.documentElement.scrollTop > 0) {
document.documentElement.scrollTop += deltaBottom ;
+ currentDragObjPos += deltaBottom;
}
+
+ dndEvent.dragObject.style.top = currentDragObjPos + "px";
};
/**
@@ -374,29 +403,29 @@
*
* @param layout {string} the layout type which is "row" or "column"
*/
-PortalDragDrop.prototype.findInsertPosition = function(components, dragObject, layout) {
- if(layout == "row") {
- for(var i = 0; i < components.length; i++) {
- var componentTop = eXo.core.Browser.findPosY(components[i]) ;
- var dragObjectTop = eXo.core.Browser.findPosY(dragObject) ;
- var componentMiddle = componentTop + Math.round(components[i].offsetHeight / 2) ;
-
- if(dragObjectTop > componentMiddle) continue ;
- else return i;
- }
- return -1 ;
-
- } else {
- var dragObjectX = eXo.core.Browser.findPosX(dragObject) ;
- for(var i = 0; i < components.length; i++) {
- var componentInTD = eXo.core.DOMUtil.getChildrenByTagName(components[i] ,"div")[0] ;
- var componentX = eXo.core.Browser.findPosX(components[i]) ;
+PortalDragDrop.prototype.findInsertPosition = function(components, layout, mouseEvent) {
+ var Browser = eXo.core.Browser;
+ if (layout == "row") {
+ for (var i = 0; i < components.length; i++) {
+ var componentTop = Browser.findPosY(components[i]);
+ var mouseYInPage = Browser.findMouseYInPage(mouseEvent);
+ var componentMIddle = componentTop + Math.round(components[i].offsetHeight / 2);
+ if (mouseYInPage > componentMIddle) continue;
+ else return i;
+ }
- if(dragObjectX > componentX) continue ;
- else return i ;
- }
- return -1 ;
- }
+ return -1;
+ } else {
+ for (var i = 0; i < components.length; i++) {
+ var mouseXInPage = Browser.findMouseXInPage(mouseEvent);
+ var componentInTD = eXo.core.DOMUtil.getChildrenByTagName(components[i], "div")[0];
+ var componentX = Browser.findPosX(components[i]);
+ if (mouseXInPage > componentX) continue;
+ else return i
+ }
+
+ return -1
+ }
};
/**
13 years, 3 months
gatein SVN: r7641 - epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/management/operations.
by do-not-reply@jboss.org
Author: theute
Date: 2011-10-04 03:09:30 -0400 (Tue, 04 Oct 2011)
New Revision: 7641
Modified:
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/management/operations/MopImportResource.java
Log:
JBEPP-1253: Show correct import mode in logger during MOP import
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/management/operations/MopImportResource.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/management/operations/MopImportResource.java 2011-10-04 07:06:26 UTC (rev 7640)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/management/operations/MopImportResource.java 2011-10-04 07:09:30 UTC (rev 7641)
@@ -96,19 +96,18 @@
DescriptionService descriptionService = operationContext.getRuntimeContext().getRuntimeComponent(DescriptionService.class);
if (descriptionService == null) throw new OperationException(operationName, "Description service was null");
- ImportMode importMode = ImportMode.MERGE;
String mode = operationContext.getAttributes().getValue("importMode");
- if (mode != null)
+ if (mode == null || "".equals(mode)) mode = "merge";
+
+ ImportMode importMode;
+ try
{
- try
- {
- importMode = ImportMode.valueOf(mode.trim().toUpperCase());
- }
- catch (Exception e)
- {
- throw new OperationException(operationName, "Unknown importMode " + mode);
- }
+ importMode = ImportMode.valueOf(mode.trim().toUpperCase());
}
+ catch (Exception e)
+ {
+ throw new OperationException(operationName, "Unknown importMode " + mode);
+ }
Map<SiteKey, MopImport> importMap = new HashMap<SiteKey, MopImport>();
final NonCloseableZipInputStream zis = new NonCloseableZipInputStream(inputStream);
13 years, 3 months
gatein SVN: r7640 - epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp.
by do-not-reply@jboss.org
Author: theute
Date: 2011-10-04 03:06:26 -0400 (Tue, 04 Oct 2011)
New Revision: 7640
Modified:
epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml
Log:
- Removed now unneeded importMode.
Modified: epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml 2011-10-04 07:02:13 UTC (rev 7639)
+++ epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml 2011-10-04 07:06:26 UTC (rev 7640)
@@ -164,9 +164,6 @@
<name>group.configuration</name>
<description>description</description>
<object type="org.exoplatform.portal.config.NewPortalConfig">
- <field name="importMode">
- <string>merge</string>
- </field>
<field name="predefinedOwner">
<collection type="java.util.HashSet">
<value>
13 years, 3 months
gatein SVN: r7639 - epp/portal/branches/EPP_5_2_Branch/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator.
by do-not-reply@jboss.org
Author: theute
Date: 2011-10-04 03:02:13 -0400 (Tue, 04 Oct 2011)
New Revision: 7639
Modified:
epp/portal/branches/EPP_5_2_Branch/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/rssAggregator.xml
epp/portal/branches/EPP_5_2_Branch/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/script.js
Log:
JBEPP-1251: Small issues in RSS gadget
Modified: epp/portal/branches/EPP_5_2_Branch/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/rssAggregator.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/rssAggregator.xml 2011-10-04 06:49:53 UTC (rev 7638)
+++ epp/portal/branches/EPP_5_2_Branch/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/rssAggregator.xml 2011-10-04 07:02:13 UTC (rev 7639)
@@ -23,7 +23,8 @@
<Module>
<ModulePrefs title="RSS Reader" title_url="http://www.exoplatform.com" directory_title="RSS Reader"
description="RSS Reader"
- thumbnail="images/rssAggregator.png">
+ thumbnail="images/rssAggregator.png"
+ height="229">
<Require feature="dynamic-height" />
<Require feature="setprefs"/>
<Require feature="settitle"/>
@@ -35,7 +36,7 @@
<link rel="stylesheet" type="text/css" href="style.css"></link>
<script type="text/javascript" src="script.js"></script>
-<div id="feedContainer" style="height:229px;overflow:auto;"></div>
+<div id="feedContainer" style="height:auto;overflow:auto;"></div>
<script type="text/javascript">
// Get userprefs
Modified: epp/portal/branches/EPP_5_2_Branch/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/script.js
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/script.js 2011-10-04 06:49:53 UTC (rev 7638)
+++ epp/portal/branches/EPP_5_2_Branch/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/script.js 2011-10-04 07:02:13 UTC (rev 7639)
@@ -44,43 +44,7 @@
return "an indeterminate amount of time ago"
}
time = (new Date().getTime()*1000 - B) / 1000;
- if (time < 60) {
- return "less than a minute ago"
- } else {
- if (time < 120) {
- return "about a minute ago"
- } else {
- if (time < 3600) {
- var A = Math.round(time / 60);
- return "about " + A + " minutes ago"
- } else {
- if (time < 7200) {
- return "about an hour ago"
- } else {
- if (time < 86400) {
- var A = Math.round(time / 3600);
- return "about " + A + " hours ago"
- } else {
- if (time < 172800) {
- return "about a day ago"
- } else {
- if (time < 2592000) {
- var A = Math.round(time / 86400);
- return "about " + A + " days ago"
- } else {
- if (time < 5184000) {
- return "about a month ago"
- } else {
- var A = Math.round(time / 2592000);
- return "about " + A + " months ago"
- }
- }
- }
- }
- }
- }
- }
- }
+ return (new Date(B).toLocaleString());
}
RssAggregator.prototype.renderFeed = function(feedObj) {
13 years, 3 months
gatein SVN: r7638 - in epp/portal/branches/EPP_5_2_Branch/component/portal: src/main/java/org/exoplatform/portal/config and 10 other directories.
by do-not-reply@jboss.org
Author: theute
Date: 2011-10-04 02:49:53 -0400 (Tue, 04 Oct 2011)
New Revision: 7638
Added:
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/group/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/group/platform/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/group/platform/administrators/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/group/platform/administrators/group.xml
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/group/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/group/platform/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/group/platform/administrators/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/group/platform/administrators/pages.xml
Removed:
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/group/platform/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/group/platform/administrators/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/group/platform/administrators/group.xml
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/group/platform/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/group/platform/administrators/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/group/platform/administrators/pages.xml
Modified:
epp/portal/branches/EPP_5_2_Branch/component/portal/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/AbstractSiteDataImportTest.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport1-configuration.xml
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport2-configuration.xml
Log:
JBEPP-1203 [Data Import] It does not work properly with PortalConfig in extension
Property changes on: epp/portal/branches/EPP_5_2_Branch/component/portal
___________________________________________________________________
Modified: svn:mergeinfo
- /portal/trunk:7451
/portal/trunk/component/portal:7451
+ /portal/trunk:7451
/portal/trunk/component/portal:7451,7500
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2011-10-04 03:03:58 UTC (rev 7637)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2011-10-04 06:49:53 UTC (rev 7638)
@@ -495,16 +495,25 @@
String type = config.getOwnerType();
UnmarshalledObject<PortalConfig> obj = getConfig(config, owner, type, PortalConfig.class);
- ImportMode importMode = getRightMode(config.getImportMode());
-
- PortalConfig pConfig = (obj != null) ? obj.getObject() : null;
- if (pConfig == null)
+ PortalConfig pConfig;
+ if (obj == null)
{
- pConfig = new PortalConfig(type);
- pConfig.setPortalLayout(new Container());
- pConfig.setName(owner);
+ if (dataStorage_.getPortalConfig(type, owner) != null)
+ {
+ return true;
+ }
+ else
+ {
+ pConfig = new PortalConfig(type, owner);
+ }
}
+ else
+ {
+ pConfig = obj.getObject();
+ }
+ ImportMode importMode = getRightMode(config.getImportMode());
+
PortalConfigImporter portalImporter = new PortalConfigImporter(importMode, pConfig, dataStorage_);
try
{
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/AbstractSiteDataImportTest.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/AbstractSiteDataImportTest.java 2011-10-04 03:03:58 UTC (rev 7637)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/AbstractSiteDataImportTest.java 2011-10-04 06:49:53 UTC (rev 7638)
@@ -6,6 +6,7 @@
import org.exoplatform.portal.config.model.Container;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.portal.mop.SiteType;
import org.exoplatform.portal.mop.importer.Imported;
import org.exoplatform.portal.pom.config.POMSessionManager;
import org.exoplatform.portal.pom.spi.portlet.Portlet;
@@ -39,7 +40,7 @@
Workspace workspace = mgr.getSession().getWorkspace();
assertTrue(workspace.isAdapted(Imported.class));
- //
+ // Test portal
DataStorage dataStorage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
PortalConfig portal = dataStorage.getPortalConfig("classic");
Container layout = portal.getPortalLayout();
@@ -47,19 +48,30 @@
Application<Portlet> layoutPortlet = (Application<Portlet>)layout.getChildren().get(0);
assertEquals("site2/layout", dataStorage.getId(layoutPortlet.getState()));
- //
- Page home = dataStorage.getPage("portal::classic::home");
- assertNotNull(home);
- assertEquals("site 1", home.getTitle());
+ Page page = dataStorage.getPage("portal::classic::home");
+ assertNotNull(page);
+ assertEquals("site 1", page.getTitle());
+
+ page = dataStorage.getPage("portal::classic::page1");
+ assertNotNull(page);
+ assertEquals("site 2", page.getTitle());
+
+ page = dataStorage.getPage("portal::classic::page2");
+ assertNotNull(page);
+ assertEquals("site 2", page.getTitle());
- Page page1 = dataStorage.getPage("portal::classic::page1");
- assertNotNull(page1);
- assertEquals("site 2", page1.getTitle());
+ // Test group
+ portal = dataStorage.getPortalConfig(SiteType.GROUP.getName(), "/platform/administrators");
+ layout = portal.getPortalLayout();
+ assertEquals(1, layout.getChildren().size());
+ layoutPortlet = (Application<Portlet>)layout.getChildren().get(0);
+ assertEquals("site1/layout", dataStorage.getId(layoutPortlet.getState()));
- Page page2 = dataStorage.getPage("portal::classic::page2");
- assertNotNull(page2);
- assertEquals("site 2", page2.getTitle());
+ page = dataStorage.getPage("group::/platform/administrators::page1");
+ assertNotNull(page);
+ assertEquals("site 2", page.getTitle());
+ // Test user
Page dashboard1 = dataStorage.getPage("user::root::dashboard1");
assertNotNull(dashboard1);
assertEquals("site 2", dashboard1.getTitle());
@@ -76,7 +88,7 @@
Workspace workspace = mgr.getSession().getWorkspace();
assertTrue(workspace.isAdapted(Imported.class));
- //
+ // Test portal
DataStorage dataStorage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
PortalConfig portal = dataStorage.getPortalConfig("classic");
Container layout = portal.getPortalLayout();
@@ -84,18 +96,28 @@
Application<Portlet> layoutPortlet = (Application<Portlet>)layout.getChildren().get(0);
assertEquals("site1/layout", dataStorage.getId(layoutPortlet.getState()));
- //
- Page home = dataStorage.getPage("portal::classic::home");
- assertNotNull(home);
- assertEquals("site 1", home.getTitle());
+ Page page = dataStorage.getPage("portal::classic::home");
+ assertNotNull(page);
+ assertEquals("site 1", page.getTitle());
+
+ page = dataStorage.getPage("portal::classic::page1");
+ assertNotNull(page);
+ assertEquals("site 1", page.getTitle());
+
+ page = dataStorage.getPage("portal::classic::page2");
+ assertNull(page);
- Page page1 = dataStorage.getPage("portal::classic::page1");
- assertNotNull(page1);
- assertEquals("site 1", page1.getTitle());
+ // Test group
+ portal = dataStorage.getPortalConfig(SiteType.GROUP.getName(), "/platform/administrators");
+ layout = portal.getPortalLayout();
+ assertEquals(1, layout.getChildren().size());
+ layoutPortlet = (Application<Portlet>)layout.getChildren().get(0);
+ assertEquals("site1/layout", dataStorage.getId(layoutPortlet.getState()));
- Page page2 = dataStorage.getPage("portal::classic::page2");
- assertNull(page2);
+ page = dataStorage.getPage("group::/platform/administrators::page1");
+ assertNull(page);
+ // Test user
Page dashboard1 = dataStorage.getPage("user::root::dashboard1");
assertNull(dashboard1);
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport1-configuration.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport1-configuration.xml 2011-10-04 03:03:58 UTC (rev 7637)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport1-configuration.xml 2011-10-04 06:49:53 UTC (rev 7638)
@@ -59,6 +59,28 @@
</object>
</object-param>
<object-param>
+ <name>group.configuration</name>
+ <description>description</description>
+ <object type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+ <value>
+ <string>/platform/administrators</string>
+ </value>
+ </collection>
+ </field>
+ <field name="ownerType">
+ <string>group</string>
+ </field>
+ <field name="templateLocation">
+ <string>classpath:/org/exoplatform/portal/config/${import.portal.1}-conf</string>
+ </field>
+ <field name="importMode">
+ <string>${import.mode.1}</string>
+ </field>
+ </object>
+ </object-param>
+ <object-param>
<name>user.configuration</name>
<description>description</description>
<object type="org.exoplatform.portal.config.NewPortalConfig">
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport2-configuration.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport2-configuration.xml 2011-10-04 03:03:58 UTC (rev 7637)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport2-configuration.xml 2011-10-04 06:49:53 UTC (rev 7638)
@@ -18,9 +18,8 @@
~ 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_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
- xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
<external-component-plugins>
<target-component>org.exoplatform.portal.config.UserPortalConfigService</target-component>
@@ -60,6 +59,28 @@
</object>
</object-param>
<object-param>
+ <name>group.configuration</name>
+ <description>description</description>
+ <object type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+ <value>
+ <string>/platform/administrators</string>
+ </value>
+ </collection>
+ </field>
+ <field name="ownerType">
+ <string>group</string>
+ </field>
+ <field name="templateLocation">
+ <string>classpath:/org/exoplatform/portal/config/${import.portal_2}-conf</string>
+ </field>
+ <field name="importMode">
+ <string>${import.mode_2}</string>
+ </field>
+ </object>
+ </object-param>
+ <object-param>
<name>user.configuration</name>
<description>description</description>
<object type="org.exoplatform.portal.config.NewPortalConfig">
Deleted: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/group/platform/administrators/group.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/group/platform/administrators/group.xml 2011-09-23 11:44:57 UTC (rev 7500)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/group/platform/administrators/group.xml 2011-10-04 06:49:53 UTC (rev 7638)
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- Copyright (C) 2011 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.
-
--->
-
-<portal-config
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
- xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
- <portal-name>exo</portal-name>
- <locale>en</locale>
- <access-permissions>Everyone</access-permissions>
- <edit-permission>*:/exo</edit-permission>
- <portal-layout>
- <portlet-application>
- <portlet>
- <application-ref>site1</application-ref>
- <portlet-ref>layout</portlet-ref>
- </portlet>
- <access-permissions>Everyone</access-permissions>
- <show-info-bar>true</show-info-bar>
- </portlet-application>
- </portal-layout>
-</portal-config>
Copied: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/group/platform/administrators/group.xml (from rev 7500, portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/group/platform/administrators/group.xml)
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/group/platform/administrators/group.xml (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/group/platform/administrators/group.xml 2011-10-04 06:49:53 UTC (rev 7638)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2011 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.
+
+-->
+
+<portal-config
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
+ <portal-name>exo</portal-name>
+ <locale>en</locale>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/exo</edit-permission>
+ <portal-layout>
+ <portlet-application>
+ <portlet>
+ <application-ref>site1</application-ref>
+ <portlet-ref>layout</portlet-ref>
+ </portlet>
+ <access-permissions>Everyone</access-permissions>
+ <show-info-bar>true</show-info-bar>
+ </portlet-application>
+ </portal-layout>
+</portal-config>
Deleted: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/group/platform/administrators/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/group/platform/administrators/pages.xml 2011-09-23 11:44:57 UTC (rev 7500)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/group/platform/administrators/pages.xml 2011-10-04 06:49:53 UTC (rev 7638)
@@ -1,40 +0,0 @@
-<?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.
-
--->
-
-<page-set
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
- xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
-
- <page>
- <name>page1</name>
- <title>site 2</title>
- <portlet-application>
- <portlet>
- <application-ref>site2</application-ref>
- <portlet-ref>page1</portlet-ref>
- </portlet>
- <access-permissions>Everyone</access-permissions>
- <show-info-bar>true</show-info-bar>
- </portlet-application>
- </page>
-</page-set>
Copied: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/group/platform/administrators/pages.xml (from rev 7500, portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/group/platform/administrators/pages.xml)
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/group/platform/administrators/pages.xml (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/group/platform/administrators/pages.xml 2011-10-04 06:49:53 UTC (rev 7638)
@@ -0,0 +1,40 @@
+<?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.
+
+-->
+
+<page-set
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
+
+ <page>
+ <name>page1</name>
+ <title>site 2</title>
+ <portlet-application>
+ <portlet>
+ <application-ref>site2</application-ref>
+ <portlet-ref>page1</portlet-ref>
+ </portlet>
+ <access-permissions>Everyone</access-permissions>
+ <show-info-bar>true</show-info-bar>
+ </portlet-application>
+ </page>
+</page-set>
13 years, 3 months
gatein SVN: r7637 - portal/trunk/web/portal/src/main/webapp/groovy/portal/webui.
by do-not-reply@jboss.org
Author: mwringe
Date: 2011-10-03 23:03:58 -0400 (Mon, 03 Oct 2011)
New Revision: 7637
Modified:
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/UILoginForm.gtmpl
Log:
JBEPP-1104: revert patch until it can be fixed properly in the case where the login link is used.
Modified: portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/UILoginForm.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/UILoginForm.gtmpl 2011-10-03 23:16:27 UTC (rev 7636)
+++ portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/UILoginForm.gtmpl 2011-10-04 03:03:58 UTC (rev 7637)
@@ -6,7 +6,8 @@
jsmanager.importJavascript('eXo.portal.UIPortalControl');
jsmanager.addCustomizedOnLoadScript('document.getElementById("UIPortalComponentLogin").username.focus();');
HttpSession session = rcontext.getRequest().getSession();
- String initialURI = rcontext.getRequestParameter("initialURI");
+ String requestPath = rcontext.getInitialURI();
+ //session.setAttribute("initialURI", requestPath);
%>
<div class="UILoginForm">
<div class="LoginDecorator">
@@ -22,7 +23,7 @@
<div class="LoginDecoratorBackground">
<div class="LoginDetailBox">
<form class="UIForm" id="$uicomponent.id" name="loginForm" action="<%= rcontext.getRequestContextPath() + "/login"%>" method="post" style="margin: 0px;">
- <input type="hidden" name="initialURI" value="<%=initialURI %>"/>
+ <input type="hidden" name="initialURI" value="<%=requestPath %>"/>
<div class="VerticalLayout">
<table class="UIFormGrid">
<tr class="UserNameField">
13 years, 3 months
gatein SVN: r7636 - in epp/portal/branches/EPP_5_2_Branch: component/portal/src/main/java/conf and 14 other directories.
by do-not-reply@jboss.org
Author: theute
Date: 2011-10-03 19:16:27 -0400 (Mon, 03 Oct 2011)
New Revision: 7636
Added:
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/AbstractDataImportTest.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/AbstractSiteDataImportTest.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestSiteDataImportConserve.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestSiteDataImportInsert.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestSiteDataImportMerge.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestSiteDataImportOverwrite.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/user/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/user/root/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/user/root/navigation.xml
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/user/root/pages.xml
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/user/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/user/root/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/user/root/navigation.xml
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/user/root/pages.xml
Removed:
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImport.java
Modified:
epp/portal/branches/EPP_5_2_Branch/component/portal/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/conf/gatein-nodetypes.xml
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfig.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/importer/Imported.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/importer/NavigationImporter.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/AbstractImportFragmentTest.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/AbstractImportNavigationTest.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/AbstractImportTest.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportFragmentConserve.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportFragmentInsert.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportFragmentOverwrite.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationConserve.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationInsert.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationMerge.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationOverwrite.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport0-configuration.xml
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport1-configuration.xml
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport2-configuration.xml
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/pages.xml
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/pages.xml
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml
Log:
JBEPP-1250: Import Mode for Portal Config and Page data import
Property changes on: epp/portal/branches/EPP_5_2_Branch/component/portal
___________________________________________________________________
Added: svn:mergeinfo
+ /portal/trunk:7451
/portal/trunk/component/portal:7451
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/conf/gatein-nodetypes.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/conf/gatein-nodetypes.xml 2011-10-03 22:45:45 UTC (rev 7635)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/conf/gatein-nodetypes.xml 2011-10-03 23:16:27 UTC (rev 7636)
@@ -22,6 +22,9 @@
<supertypes>
</supertypes>
<propertyDefinitions>
+ <propertyDefinition name="gtn:status" requiredType="int" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
<propertyDefinition name="gtn:creationdate" requiredType="Date" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
<valueConstraints/>
</propertyDefinition>
Property changes on: epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org
___________________________________________________________________
Modified: svn:mergeinfo
- /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/component/portal/src/main/java/org:5868
/portal/branches/branch-GTNPORTAL-1592/component/portal/src/main/java/org:4894
/portal/branches/branch-GTNPORTAL-1643/component/portal/src/main/java/org:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/component/portal/src/main/java/org:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/component/portal/src/main/java/org:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/component/portal/src/main/java/org:5765
/portal/branches/branch-GTNPORTAL-1790/component/portal/src/main/java/org:5871
/portal/branches/branch-GTNPORTAL-1822/component/portal/src/main/java/org:5943,5952
/portal/branches/branch-GTNPORTAL-1832/component/portal/src/main/java/org:6030,6063
/portal/branches/branch-GTNPORTAL-1872/component/portal/src/main/java/org:6400,6551
/portal/branches/branch-GTNPORTAL-1921/component/portal/src/main/java/org:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/component/portal/src/main/java/org:6904,6915-6916
/portal/trunk/component/portal/src/main/java/org:4876,4891,5269,5744,5822,5943,6031,6033,6168,6196,6201-6203,6205-6206,6223,6292,6323,6437,6440,6449,6452,6573,6741,6783-6784,6912-6913,6960,7042,7061,7095,7117,7120,7125,7132-7134,7186,7198,7239,7262,7308,7326,7330-7334,7359,7367,7433,7450,7452,7454,7478,7497,7500,7552,7554-7555,7598
+ /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/component/portal/src/main/java/org:5868
/portal/branches/branch-GTNPORTAL-1592/component/portal/src/main/java/org:4894
/portal/branches/branch-GTNPORTAL-1643/component/portal/src/main/java/org:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/component/portal/src/main/java/org:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/component/portal/src/main/java/org:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/component/portal/src/main/java/org:5765
/portal/branches/branch-GTNPORTAL-1790/component/portal/src/main/java/org:5871
/portal/branches/branch-GTNPORTAL-1822/component/portal/src/main/java/org:5943,5952
/portal/branches/branch-GTNPORTAL-1832/component/portal/src/main/java/org:6030,6063
/portal/branches/branch-GTNPORTAL-1872/component/portal/src/main/java/org:6400,6551
/portal/branches/branch-GTNPORTAL-1921/component/portal/src/main/java/org:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/component/portal/src/main/java/org:6904,6915-6916
/portal/trunk/component/portal/src/main/java/org:4876,4891,5269,5744,5822,5943,6031,6033,6168,6196,6201-6203,6205-6206,6223,6292,6323,6437,6440,6449,6452,6573,6741,6783-6784,6912-6913,6960,7042,7061,7095,7117,7120,7125,7132-7134,7186,7198,7239,7262,7308,7326,7330-7334,7359,7367,7433,7450-7452,7454,7478,7497,7500,7552,7554-7555,7598
/portal/trunk/src/main/java/org:7451
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfig.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfig.java 2011-10-03 22:45:45 UTC (rev 7635)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfig.java 2011-10-03 23:16:27 UTC (rev 7636)
@@ -45,8 +45,6 @@
private String importMode;
- final Set<String> createdOwners = new HashSet<String>();
-
/**
* @deprecated use the location instead
*/
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2011-10-03 22:45:45 UTC (rev 7635)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2011-10-03 23:16:27 UTC (rev 7636)
@@ -31,7 +31,10 @@
import org.exoplatform.portal.config.model.NavigationFragment;
import org.exoplatform.portal.mop.importer.ImportMode;
import org.exoplatform.portal.mop.importer.Imported;
+import org.exoplatform.portal.mop.importer.Imported.Status;
import org.exoplatform.portal.mop.importer.NavigationImporter;
+import org.exoplatform.portal.mop.importer.PageImporter;
+import org.exoplatform.portal.mop.importer.PortalConfigImporter;
import org.exoplatform.portal.config.model.Container;
import org.exoplatform.portal.config.model.ModelUnmarshaller;
import org.exoplatform.portal.config.model.Page;
@@ -49,7 +52,6 @@
import org.gatein.mop.api.workspace.Workspace;
import org.jibx.runtime.*;
-import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
@@ -116,6 +118,10 @@
/** . */
private DescriptionService descriptionService_;
+ final Set<String> createdOwners = new HashSet<String>();
+
+ private boolean isFirstStartup = false;
+
public NewPortalConfigListener(
UserPortalConfigService owner,
POMSessionManager pomMgr,
@@ -189,6 +195,7 @@
Workspace workspace = session.getWorkspace();
Imported imported = workspace.adapt(Imported.class);
imported.setLastModificationDate(new Date());
+ imported.setStatus(Status.DONE.status());
session.save();
}
finally
@@ -197,34 +204,50 @@
}
}
- private boolean performImport()
+ private boolean performImport() throws Exception
{
RequestLifeCycle.begin(PortalContainer.getInstance());
try
{
+
+ POMSession session = pomMgr.getSession();
+
+ // Obtain the status
+ Workspace workspace = session.getWorkspace();
+ boolean perform = !workspace.isAdapted(Imported.class);
+
+
+ // We mark it
+ if (perform)
+ {
+ Imported imported = workspace.adapt(Imported.class);
+ imported.setCreationDate(new Date());
+ session.save();
+
+ // for legacy checking
+ if (dataStorage_.getPortalConfig(defaultPortal) != null)
+ {
+ perform = false;
+ }
+ else
+ {
+ isFirstStartup = true;
+ }
+ }
+ else
+ {
+ Imported imported = workspace.adapt(Imported.class);
+ Status status = Status.getStatus(imported.getStatus());
+ perform = (Status.WANT_REIMPORT == status);
+ }
+
if (overrideExistingData)
{
return true;
}
- else
- {
- POMSession session = pomMgr.getSession();
- // Obtain the status
- Workspace workspace = session.getWorkspace();
- boolean perform = !workspace.isAdapted(Imported.class);
-
- // We mark it
- if (perform)
- {
- Imported imported = workspace.adapt(Imported.class);
- imported.setCreationDate(new Date());
- session.save();
- }
-
- //
- return perform;
- }
+ //
+ return perform;
}
finally
{
@@ -249,7 +272,7 @@
{
try
{
- initPortletPreferencesDB(ele);
+ initPortalConfigDB(ele);
}
catch (Exception e)
{
@@ -260,7 +283,7 @@
{
try
{
- initPortalConfigDB(ele);
+ initPortletPreferencesDB(ele);
}
catch (Exception e)
{
@@ -313,9 +336,6 @@
log.error("NewPortalConfig error: " + e.getMessage(), e);
}
}
-
- //
- touchImport();
}
else
{
@@ -324,11 +344,11 @@
{
for (NewPortalConfig ele : configs)
{
- initPortletPreferencesDB(ele);
+ initPortalConfigDB(ele);
}
for (NewPortalConfig ele : configs)
{
- initPortalConfigDB(ele);
+ initPortletPreferencesDB(ele);
}
}
finally
@@ -355,10 +375,10 @@
{
ele.getPredefinedOwner().clear();
}
-
- //
- touchImport();
}
+
+ //
+ touchImport();
}
String getDefaultPortal()
@@ -435,7 +455,7 @@
{
if (createPortalConfig(config, owner))
{
- config.createdOwners.add(owner);
+ this.createdOwners.add(owner);
}
}
}
@@ -444,7 +464,7 @@
{
for (String owner : config.getPredefinedOwner())
{
- if (config.createdOwners.contains(owner))
+ if (this.createdOwners.contains(owner))
{
createPage(config, owner);
}
@@ -473,45 +493,28 @@
public boolean createPortalConfig(NewPortalConfig config, String owner) throws Exception
{
String type = config.getOwnerType();
- PortalConfig currentPortalConfig = dataStorage_.getPortalConfig(type, owner);
- if (currentPortalConfig == null)
+ UnmarshalledObject<PortalConfig> obj = getConfig(config, owner, type, PortalConfig.class);
+
+ ImportMode importMode = getRightMode(config.getImportMode());
+
+ PortalConfig pConfig = (obj != null) ? obj.getObject() : null;
+ if (pConfig == null)
{
- try
- {
- UnmarshalledObject<PortalConfig> obj = getConfig(config, owner, type, PortalConfig.class);
-
- if (obj == null)
- {
- // Ensure that the PortalConfig has been defined
- // The PortalConfig could be empty if the related PortalConfigListener
- // has been launched after starting this service
- PortalConfig cfg = dataStorage_.getPortalConfig(type, owner);
- if (cfg == null)
- {
- cfg = new PortalConfig(type);
- cfg.setPortalLayout(new Container());
- cfg.setName(owner);
- dataStorage_.create(cfg);
- return true;
- }
- }
- else
- {
- PortalConfig pconfig = obj.getObject();
- // We use that owner value because it may have been fixed for group names
- owner = pconfig.getName();
- dataStorage_.create(pconfig);
- return true;
- }
- }
- catch (IOException e)
- {
- log.error("Could not load portal configuration", e);
- }
+ pConfig = new PortalConfig(type);
+ pConfig.setPortalLayout(new Container());
+ pConfig.setName(owner);
}
-
- //
- return false;
+
+ PortalConfigImporter portalImporter = new PortalConfigImporter(importMode, pConfig, dataStorage_);
+ try
+ {
+ portalImporter.perform();
+ return true;
+ }
+ catch (Exception ex)
+ {
+ return false;
+ }
}
public void createPage(NewPortalConfig config, String owner) throws Exception
@@ -526,8 +529,11 @@
{
RequestLifeCycle.begin(PortalContainer.getInstance());
try
- {
- dataStorage_.create(page);
+ { //
+ ImportMode importMode = getRightMode(config.getImportMode());
+
+ PageImporter importer = new PageImporter(importMode, page, dataStorage_);
+ importer.perform();
}
finally
{
@@ -548,15 +554,7 @@
PageNavigation navigation = obj.getObject();
//
- ImportMode importMode;
- if (config.getImportMode() != null)
- {
- importMode = ImportMode.valueOf(config.getImportMode().trim().toUpperCase());
- }
- else
- {
- importMode = owner_.getDefaultImportMode();
- }
+ ImportMode importMode = getRightMode(config.getImportMode());
//
Locale locale;
@@ -885,4 +883,24 @@
page.setOwnerId(fixOwnerName(page.getOwnerType(), page.getOwnerId()));
fixOwnerName((Container)page);
}
+
+ private ImportMode getRightMode(String mode)
+ {
+ ImportMode importMode;
+ if (mode != null)
+ {
+ importMode = ImportMode.valueOf(mode.trim().toUpperCase());
+ }
+ else
+ {
+ importMode = owner_.getDefaultImportMode();
+ }
+
+ if (isFirstStartup && (importMode == ImportMode.CONSERVE || importMode == ImportMode.INSERT))
+ {
+ return ImportMode.MERGE;
+ }
+
+ return importMode;
+ }
}
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/importer/Imported.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/importer/Imported.java 2011-10-03 22:45:45 UTC (rev 7635)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/importer/Imported.java 2011-10-03 23:16:27 UTC (rev 7636)
@@ -32,7 +32,47 @@
@MixinType(name = "gtn:imported")
public abstract class Imported
{
+ public enum Status {
+ UNKNOWN(-1),
+
+ FAILED(0),
+
+ DONE(1),
+
+ WANT_REIMPORT(2);
+
+ private final int status;
+
+ Status(int status)
+ {
+ this.status = status;
+ }
+
+ public int status()
+ {
+ return this.status;
+ }
+
+ public static Status getStatus(int status)
+ {
+ for (Status type : Status.values())
+ {
+ if (type.status() == status)
+ {
+ return type;
+ }
+ }
+
+ return UNKNOWN;
+ }
+ }
+
+ @Property(name = "gtn:status")
+ public abstract int getStatus();
+
+ public abstract void setStatus(int status);
+
@Property(name = "gtn:creationdate")
public abstract Date getCreationDate();
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/importer/NavigationImporter.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/importer/NavigationImporter.java 2011-10-03 22:45:45 UTC (rev 7635)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/importer/NavigationImporter.java 2011-10-03 23:16:27 UTC (rev 7636)
@@ -53,7 +53,7 @@
/** . */
private final DescriptionService descriptionService;
-
+
public NavigationImporter(
Locale portalLocale,
ImportMode mode,
Added: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/AbstractDataImportTest.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/AbstractDataImportTest.java (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/AbstractDataImportTest.java 2011-10-03 23:16:27 UTC (rev 7636)
@@ -0,0 +1,273 @@
+/*
+ * Copyright (C) 2011 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.config;
+
+import org.exoplatform.component.test.AbstractGateInTest;
+import org.exoplatform.component.test.ContainerScope;
+import org.exoplatform.component.test.KernelBootstrap;
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.container.component.RequestLifeCycle;
+import org.exoplatform.portal.mop.importer.ImportMode;
+import org.exoplatform.portal.mop.importer.Imported;
+import org.exoplatform.portal.mop.importer.Imported.Status;
+import org.exoplatform.portal.pom.config.POMSessionManager;
+import org.gatein.mop.api.workspace.Workspace;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author <a href="trongtt(a)gmail.com">Trong Tran</a>
+ * @version $Revision$
+ */
+public abstract class AbstractDataImportTest extends AbstractGateInTest
+{
+ private Set<String> clearProperties = new HashSet<String>();
+
+ protected abstract ImportMode getMode();
+
+ protected abstract String getConfig2();
+
+ protected abstract String getConfig1();
+
+ protected abstract void afterOneBootWithExtention(PortalContainer container) throws Exception;
+
+ protected abstract void afterFirstBoot(PortalContainer container) throws Exception;
+
+ protected abstract void afterSecondBoot(PortalContainer container) throws Exception;
+
+ protected abstract void afterSecondBootWithOverride(PortalContainer container) throws Exception;
+
+ protected abstract void afterSecondBootWithWantReimport(PortalContainer container) throws Exception;
+
+ protected abstract void afterSecondBootWithNoMixin(PortalContainer container) throws Exception;
+
+ protected void setSystemProperty(String key, String value)
+ {
+ clearProperties.add(key);
+ System.setProperty(key, value);
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+ for (String key : clearProperties)
+ {
+ System.clearProperty(key);
+ }
+ clearProperties.clear();
+ }
+
+ public void testOneBootWithExtension() throws Exception
+ {
+ KernelBootstrap bootstrap = new KernelBootstrap();
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.test.jcr-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.identity-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.portal-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "org/exoplatform/portal/config/TestImport1-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "org/exoplatform/portal/config/TestImport2-configuration.xml");
+
+ //
+ setSystemProperty("override.1", "false");
+ setSystemProperty("import.mode.1", getMode().toString());
+ setSystemProperty("import.portal.1", getConfig1());
+ setSystemProperty("override_2", "false");
+ setSystemProperty("import.mode_2", getMode().toString());
+ setSystemProperty("import.portal_2", getConfig2());
+
+ //
+ bootstrap.boot();
+ PortalContainer container = bootstrap.getContainer();
+ afterOneBootWithExtention(container);
+ bootstrap.dispose();
+ }
+
+ public void testOneBoot() throws Exception
+ {
+ KernelBootstrap bootstrap = new KernelBootstrap();
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.test.jcr-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.identity-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.portal-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "org/exoplatform/portal/config/TestImport1-configuration.xml");
+
+ //
+ setSystemProperty("override.1", "false");
+ setSystemProperty("import.mode.1", getMode().toString());
+ setSystemProperty("import.portal.1", getConfig1());
+
+ //
+ bootstrap.boot();
+ PortalContainer container = bootstrap.getContainer();
+ afterFirstBoot(container);
+ bootstrap.dispose();
+ }
+
+ public void testTwoBoots() throws Exception
+ {
+ KernelBootstrap bootstrap = new KernelBootstrap();
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.test.jcr-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.identity-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.portal-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "org/exoplatform/portal/config/TestImport1-configuration.xml");
+
+ //
+ setSystemProperty("override.1", "false");
+ setSystemProperty("import.mode.1", getMode().toString());
+ setSystemProperty("import.portal.1", getConfig1());
+
+ bootstrap.boot();
+ PortalContainer container = bootstrap.getContainer();
+ afterFirstBoot(container);
+ bootstrap.dispose();
+
+ //
+ setSystemProperty("import.portal.1", getConfig2());
+
+ bootstrap.boot();
+ container = bootstrap.getContainer();
+ afterSecondBoot(container);
+ bootstrap.dispose();
+ }
+
+ public void testTwoBootsWithOverride() throws Exception
+ {
+ KernelBootstrap bootstrap = new KernelBootstrap();
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.test.jcr-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.identity-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.portal-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "org/exoplatform/portal/config/TestImport1-configuration.xml");
+
+ //
+ setSystemProperty("override.1", "true");
+ setSystemProperty("import.mode.1", getMode().toString());
+ setSystemProperty("import.portal.1", getConfig1());
+
+ bootstrap.boot();
+ PortalContainer container = bootstrap.getContainer();
+ afterFirstBoot(container);
+ bootstrap.dispose();
+
+ //
+ setSystemProperty("import.portal.1", getConfig2());
+
+ bootstrap.boot();
+ container = bootstrap.getContainer();
+ afterSecondBootWithOverride(container);
+ bootstrap.dispose();
+ }
+
+ public void testTwoBootsWithWantReimport() throws Exception
+ {
+ KernelBootstrap bootstrap = new KernelBootstrap();
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.test.jcr-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.identity-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.portal-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "org/exoplatform/portal/config/TestImport1-configuration.xml");
+
+ //
+ setSystemProperty("override.1", "false");
+ setSystemProperty("import.mode.1", getMode().toString());
+ setSystemProperty("import.portal.1", getConfig1());
+
+ bootstrap.boot();
+ PortalContainer container = bootstrap.getContainer();
+ afterFirstBoot(container);
+
+ RequestLifeCycle.begin(container);
+ POMSessionManager mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
+ Workspace workspace = mgr.getSession().getWorkspace();
+ assertTrue(workspace.isAdapted(Imported.class));
+ workspace.adapt(Imported.class).setStatus(Status.WANT_REIMPORT.status());
+ long creationTime1 = workspace.adapt(Imported.class).getCreationDate().getTime();
+ long lastModificationTime1 = workspace.adapt(Imported.class).getLastModificationDate().getTime();
+ mgr.getSession().save();
+ RequestLifeCycle.end();
+
+ bootstrap.dispose();
+
+ //
+ setSystemProperty("import.portal.1", getConfig2());
+
+ bootstrap.boot();
+ container = bootstrap.getContainer();
+ afterSecondBootWithWantReimport(container);
+
+ RequestLifeCycle.begin(container);
+ mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
+ workspace = mgr.getSession().getWorkspace();
+ assertTrue(workspace.isAdapted(Imported.class));
+ long creationTime2 = workspace.adapt(Imported.class).getCreationDate().getTime();
+ assertEquals(creationTime1, creationTime2);
+ long lastModificationTime2 = workspace.adapt(Imported.class).getLastModificationDate().getTime();
+ assertTrue(lastModificationTime2 > lastModificationTime1);
+ mgr.getSession().save();
+ RequestLifeCycle.end();
+ bootstrap.dispose();
+ }
+
+ public void testTwoBootsWithNoMixin() throws Exception
+ {
+ KernelBootstrap bootstrap = new KernelBootstrap();
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.test.jcr-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.identity-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.portal-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "org/exoplatform/portal/config/TestImport1-configuration.xml");
+
+ //
+ setSystemProperty("override.1", "false");
+ setSystemProperty("import.mode.1", getMode().toString());
+ setSystemProperty("import.portal.1", getConfig1());
+
+ bootstrap.boot();
+ PortalContainer container = bootstrap.getContainer();
+ afterFirstBoot(container);
+
+ RequestLifeCycle.begin(container);
+ POMSessionManager mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
+ Workspace workspace = mgr.getSession().getWorkspace();
+ assertTrue(workspace.isAdapted(Imported.class));
+ Imported imported = workspace.adapt(Imported.class);
+ long creationTime1 = imported.getCreationDate().getTime();
+ workspace.removeAdapter(Imported.class);
+ mgr.getSession().save();
+ RequestLifeCycle.end();
+
+ bootstrap.dispose();
+
+ //
+ setSystemProperty("import.portal.1", getConfig2());
+
+ bootstrap.boot();
+ container = bootstrap.getContainer();
+ afterSecondBootWithNoMixin(container);
+
+ RequestLifeCycle.begin(container);
+ mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
+ workspace = mgr.getSession().getWorkspace();
+ assertTrue(workspace.isAdapted(Imported.class));
+ imported = workspace.adapt(Imported.class);
+ long creationTime2 = imported.getCreationDate().getTime();
+ assertTrue(creationTime2 > creationTime1);
+ mgr.getSession().save();
+ RequestLifeCycle.end();
+ bootstrap.dispose();
+ }
+}
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/AbstractImportFragmentTest.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/AbstractImportFragmentTest.java 2011-10-03 22:45:45 UTC (rev 7635)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/AbstractImportFragmentTest.java 2011-10-03 23:16:27 UTC (rev 7636)
@@ -62,12 +62,6 @@
}
@Override
- protected final void afterOnePhaseBoot(NodeContext<?> root)
- {
- assertState(root);
- }
-
- @Override
protected final void afterTwoPhaseOverrideReboot(NodeContext<?> root)
{
assertState(root);
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/AbstractImportNavigationTest.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/AbstractImportNavigationTest.java 2011-10-03 22:45:45 UTC (rev 7635)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/AbstractImportNavigationTest.java 2011-10-03 23:16:27 UTC (rev 7636)
@@ -39,39 +39,11 @@
return "navigation2";
}
- protected abstract void assertState(NodeContext<?> root);
-
@Override
- protected final void afterTwoPhasesBoot(NodeContext<?> root)
- {
- assertEquals(2, root.getNodeCount());
- assertNotNull(root.get("foo"));
- assertNotNull(root.get("daa"));
- }
-
- @Override
protected final void afterTwoPhaseNoOverrideReboot(NodeContext<?> root)
{
assertEquals(2, root.getNodeCount());
assertNotNull(root.get("foo"));
assertNotNull(root.get("daa"));
}
-
- @Override
- protected final void afterOnePhaseBoot(NodeContext<?> root)
- {
- assertState(root);
- }
-
- @Override
- protected final void afterTwoPhaseOverrideReboot(NodeContext<?> root)
- {
- assertState(root);
- }
-
- @Override
- protected final void afterTwoPhaseNoOverrideReconfigure(NodeContext<?> root)
- {
- assertState(root);
- }
}
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/AbstractImportTest.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/AbstractImportTest.java 2011-10-03 22:45:45 UTC (rev 7635)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/AbstractImportTest.java 2011-10-03 23:16:27 UTC (rev 7636)
@@ -27,6 +27,7 @@
import org.exoplatform.portal.mop.SiteKey;
import org.exoplatform.portal.mop.importer.ImportMode;
import org.exoplatform.portal.mop.importer.Imported;
+import org.exoplatform.portal.mop.importer.Imported.Status;
import org.exoplatform.portal.mop.navigation.NavigationContext;
import org.exoplatform.portal.mop.navigation.NavigationService;
import org.exoplatform.portal.mop.navigation.Node;
@@ -160,8 +161,7 @@
afterTwoPhaseNoOverrideReboot(root);
Workspace workspace = mgr.getSession().getWorkspace();
assertTrue(workspace.isAdapted(Imported.class));
- workspace.removeAdapter(Imported.class);
- assertFalse(workspace.isAdapted(Imported.class));
+ workspace.adapt(Imported.class).setStatus(Status.WANT_REIMPORT.status());
mgr.getSession().save();
RequestLifeCycle.end();
bootstrap.dispose();
Added: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/AbstractSiteDataImportTest.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/AbstractSiteDataImportTest.java (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/AbstractSiteDataImportTest.java 2011-10-03 23:16:27 UTC (rev 7636)
@@ -0,0 +1,122 @@
+package org.exoplatform.portal.config;
+
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.container.component.RequestLifeCycle;
+import org.exoplatform.portal.config.model.Application;
+import org.exoplatform.portal.config.model.Container;
+import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.portal.mop.importer.Imported;
+import org.exoplatform.portal.pom.config.POMSessionManager;
+import org.exoplatform.portal.pom.spi.portlet.Portlet;
+import org.gatein.mop.api.workspace.Workspace;
+
+/**
+ * @author <a href="trongtt(a)gmail.com">Trong Tran</a>
+ * @version $Revision$
+ */
+public abstract class AbstractSiteDataImportTest extends AbstractDataImportTest
+{
+
+ @Override
+ protected final String getConfig1()
+ {
+ return "site1";
+ }
+
+ @Override
+ protected final String getConfig2()
+ {
+ return "site2";
+ }
+
+ @Override
+ protected final void afterOneBootWithExtention(PortalContainer container) throws Exception
+ {
+ RequestLifeCycle.begin(container);
+
+ POMSessionManager mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
+ Workspace workspace = mgr.getSession().getWorkspace();
+ assertTrue(workspace.isAdapted(Imported.class));
+
+ //
+ DataStorage dataStorage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
+ PortalConfig portal = dataStorage.getPortalConfig("classic");
+ Container layout = portal.getPortalLayout();
+ assertEquals(1, layout.getChildren().size());
+ Application<Portlet> layoutPortlet = (Application<Portlet>)layout.getChildren().get(0);
+ assertEquals("site2/layout", dataStorage.getId(layoutPortlet.getState()));
+
+ //
+ Page home = dataStorage.getPage("portal::classic::home");
+ assertNotNull(home);
+ assertEquals("site 1", home.getTitle());
+
+ Page page1 = dataStorage.getPage("portal::classic::page1");
+ assertNotNull(page1);
+ assertEquals("site 2", page1.getTitle());
+
+ Page page2 = dataStorage.getPage("portal::classic::page2");
+ assertNotNull(page2);
+ assertEquals("site 2", page2.getTitle());
+
+ Page dashboard1 = dataStorage.getPage("user::root::dashboard1");
+ assertNotNull(dashboard1);
+ assertEquals("site 2", dashboard1.getTitle());
+
+ RequestLifeCycle.end();
+ }
+
+ @Override
+ protected final void afterFirstBoot(PortalContainer container) throws Exception
+ {
+ RequestLifeCycle.begin(container);
+
+ POMSessionManager mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
+ Workspace workspace = mgr.getSession().getWorkspace();
+ assertTrue(workspace.isAdapted(Imported.class));
+
+ //
+ DataStorage dataStorage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
+ PortalConfig portal = dataStorage.getPortalConfig("classic");
+ Container layout = portal.getPortalLayout();
+ assertEquals(1, layout.getChildren().size());
+ Application<Portlet> layoutPortlet = (Application<Portlet>)layout.getChildren().get(0);
+ assertEquals("site1/layout", dataStorage.getId(layoutPortlet.getState()));
+
+ //
+ Page home = dataStorage.getPage("portal::classic::home");
+ assertNotNull(home);
+ assertEquals("site 1", home.getTitle());
+
+ Page page1 = dataStorage.getPage("portal::classic::page1");
+ assertNotNull(page1);
+ assertEquals("site 1", page1.getTitle());
+
+ Page page2 = dataStorage.getPage("portal::classic::page2");
+ assertNull(page2);
+
+ Page dashboard1 = dataStorage.getPage("user::root::dashboard1");
+ assertNull(dashboard1);
+
+ RequestLifeCycle.end();
+ }
+
+ @Override
+ protected final void afterSecondBoot(PortalContainer container) throws Exception
+ {
+ afterFirstBoot(container);
+ }
+
+ @Override
+ protected void afterSecondBootWithWantReimport(PortalContainer container) throws Exception
+ {
+ afterSecondBootWithOverride(container);
+ }
+
+ @Override
+ protected final void afterSecondBootWithNoMixin(PortalContainer container) throws Exception
+ {
+ afterSecondBoot(container);
+ }
+}
Deleted: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImport.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImport.java 2011-10-03 22:45:45 UTC (rev 7635)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImport.java 2011-10-03 23:16:27 UTC (rev 7636)
@@ -1,174 +0,0 @@
-/*
- * Copyright (C) 2011 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.config;
-
-import org.exoplatform.component.test.AbstractGateInTest;
-import org.exoplatform.component.test.ContainerScope;
-import org.exoplatform.component.test.KernelBootstrap;
-import org.exoplatform.container.PortalContainer;
-import org.exoplatform.container.component.RequestLifeCycle;
-import org.exoplatform.portal.config.model.Application;
-import org.exoplatform.portal.config.model.ApplicationState;
-import org.exoplatform.portal.config.model.Container;
-import org.exoplatform.portal.config.model.Page;
-import org.exoplatform.portal.config.model.PortalConfig;
-import org.exoplatform.portal.mop.SiteKey;
-import org.exoplatform.portal.mop.importer.Imported;
-import org.exoplatform.portal.mop.navigation.NavigationContext;
-import org.exoplatform.portal.mop.navigation.NavigationService;
-import org.exoplatform.portal.mop.navigation.Node;
-import org.exoplatform.portal.mop.navigation.NodeContext;
-import org.exoplatform.portal.mop.navigation.Scope;
-import org.exoplatform.portal.pom.config.POMSessionManager;
-import org.exoplatform.portal.pom.spi.portlet.Portlet;
-import org.gatein.mop.api.workspace.Workspace;
-
-import java.io.File;
-import java.util.Collection;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- */
-public class TestImport extends AbstractGateInTest
-{
-
- public void testMixin() throws Exception
- {
- KernelBootstrap bootstrap = new KernelBootstrap();
- bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.test.jcr-configuration.xml");
- bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.identity-configuration.xml");
- bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.portal-configuration.xml");
- bootstrap.addConfiguration(ContainerScope.PORTAL, "org/exoplatform/portal/config/TestImport1-configuration.xml");
-
- //
- System.setProperty("override.1", "false");
- System.setProperty("import.mode.1", "conserve");
- System.setProperty("import.portal.1", "navigation1");
-
- //
- bootstrap.boot();
- PortalContainer container = bootstrap.getContainer();
- POMSessionManager mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
-
- //
- RequestLifeCycle.begin(container);
- Workspace workspace = mgr.getSession().getWorkspace();
- assertTrue(workspace.isAdapted(Imported.class));
- RequestLifeCycle.end();
- bootstrap.dispose();
- }
-
- public void testDefaultMode() throws Exception
- {
- KernelBootstrap bootstrap = new KernelBootstrap();
- bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.test.jcr-configuration.xml");
- bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.identity-configuration.xml");
- bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.portal-configuration.xml");
- bootstrap.addConfiguration(ContainerScope.PORTAL, "org/exoplatform/portal/config/TestImport0-configuration.xml");
- bootstrap.addConfiguration(ContainerScope.PORTAL, "org/exoplatform/portal/config/TestImport1-configuration.xml");
- System.setProperty("import.portal.0", "navigation2");
- System.setProperty("override.1", "false");
- System.setProperty("import.mode.1", "merge");
- System.setProperty("import.portal.1", "navigation1");
-
- //
- bootstrap.boot();
-
- //
- PortalContainer container = bootstrap.getContainer();
- NavigationService service = (NavigationService)container.getComponentInstanceOfType(NavigationService.class);
- RequestLifeCycle.begin(container);
- NavigationContext nav = service.loadNavigation(SiteKey.portal("classic"));
- NodeContext<Node> root = service.loadNode(Node.MODEL, nav, Scope.ALL, null);
- Collection<Node> c = root.getNodes();
- assertEquals(3, c.size());
- assertNotNull(root.get("foo"));
- assertNotNull(root.get("daa"));
- assertNotNull(root.get("bar"));
- RequestLifeCycle.end();
- bootstrap.dispose();
- }
-
- public void testNoMixin() throws Exception
- {
- KernelBootstrap bootstrap = new KernelBootstrap();
- bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.test.jcr-configuration.xml");
- bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.identity-configuration.xml");
- bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.portal-configuration.xml");
- bootstrap.addConfiguration(ContainerScope.PORTAL, "org/exoplatform/portal/config/TestImport1-configuration.xml");
-
- //
- System.setProperty("override.1", "false");
- System.setProperty("import.mode.1", "conserve");
- System.setProperty("import.portal.1", "site1");
-
- //
- bootstrap.boot();
- PortalContainer container = bootstrap.getContainer();
- DataStorage service = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
- RequestLifeCycle.begin(container);
- POMSessionManager mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
- Workspace workspace = mgr.getSession().getWorkspace();
- assertTrue(workspace.isAdapted(Imported.class));
- long when1 = workspace.adapt(Imported.class).getCreationDate().getTime();
- PortalConfig portal = service.getPortalConfig("classic");
- Container layout = portal.getPortalLayout();
- assertEquals(1, layout.getChildren().size());
- Application<Portlet> layoutPortlet = (Application<Portlet>)layout.getChildren().get(0);
- assertEquals("site1/layout", service.getId(layoutPortlet.getState()));
- Page page1 = service.getPage("portal::classic::page1");
- assertEquals(1, page1.getChildren().size());
- Application<Portlet> page1Portlet = (Application<Portlet>)page1.getChildren().get(0);
- assertEquals("site1/page1", service.getId(page1Portlet.getState()));
- workspace.removeAdapter(Imported.class);
- mgr.getSession().save();
- RequestLifeCycle.end();
- bootstrap.dispose();
-
- //
- System.setProperty("override.1", "false");
- System.setProperty("import.mode.1", "conserve");
- System.setProperty("import.portal.1", "site2");
-
- //
- bootstrap.boot();
- container = bootstrap.getContainer();
- service = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
- RequestLifeCycle.begin(container);
- mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
- workspace = mgr.getSession().getWorkspace();
- assertTrue(workspace.isAdapted(Imported.class));
- long when2 = workspace.adapt(Imported.class).getCreationDate().getTime();
- assertTrue(when2 > when1);
- portal = service.getPortalConfig("classic");
- layout = portal.getPortalLayout();
- assertEquals(1, layout.getChildren().size());
- layoutPortlet = (Application<Portlet>)layout.getChildren().get(0);
- assertEquals("site1/layout", service.getId(layoutPortlet.getState()));
- page1 = service.getPage("portal::classic::page1");
- assertEquals(1, page1.getChildren().size());
- page1Portlet = (Application<Portlet>)page1.getChildren().get(0);
- assertEquals("site1/page1", service.getId(page1Portlet.getState()));
- Page page2 = service.getPage("portal::classic::page2");
- assertNull(page2);
- RequestLifeCycle.end();
- bootstrap.dispose();
- }
-}
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportFragmentConserve.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportFragmentConserve.java 2011-10-03 22:45:45 UTC (rev 7635)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportFragmentConserve.java 2011-10-03 23:16:27 UTC (rev 7636)
@@ -35,6 +35,16 @@
}
@Override
+ protected final void afterOnePhaseBoot(NodeContext<?> root)
+ {
+ assertEquals(1, root.getNodeSize());
+ NodeContext<?> foo = root.get("foo");
+ assertNotNull(foo);
+ assertEquals("foo_icon", foo.getState().getIcon());
+ assertEquals(1, foo.getNodeSize());
+ }
+
+ @Override
protected void assertState(NodeContext<?> root)
{
assertEquals(1, root.getNodeSize());
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportFragmentInsert.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportFragmentInsert.java 2011-10-03 22:45:45 UTC (rev 7635)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportFragmentInsert.java 2011-10-03 23:16:27 UTC (rev 7636)
@@ -35,6 +35,12 @@
}
@Override
+ protected final void afterOnePhaseBoot(NodeContext<?> root)
+ {
+ assertState(root);
+ }
+
+ @Override
protected void assertState(NodeContext<?> root)
{
assertEquals(1, root.getNodeSize());
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportFragmentOverwrite.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportFragmentOverwrite.java 2011-10-03 22:45:45 UTC (rev 7635)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportFragmentOverwrite.java 2011-10-03 23:16:27 UTC (rev 7636)
@@ -35,6 +35,12 @@
}
@Override
+ protected final void afterOnePhaseBoot(NodeContext<?> root)
+ {
+ assertState(root);
+ }
+
+ @Override
protected void assertState(NodeContext<?> root)
{
assertEquals(1, root.getNodeSize());
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationConserve.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationConserve.java 2011-10-03 22:45:45 UTC (rev 7635)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationConserve.java 2011-10-03 23:16:27 UTC (rev 7636)
@@ -33,8 +33,49 @@
{
return ImportMode.CONSERVE;
}
+
+ @Override
+ protected final void afterOnePhaseBoot(NodeContext<?> root)
+ {
+ assertEquals(3, root.getNodeCount());
+ NodeContext<?> foo = root.get("foo");
+ assertNotNull(foo);
+ assertEquals("foo_icon_2", foo.getState().getIcon());
+ assertEquals(1, foo.getNodeCount());
+ NodeContext<?> juu = foo.get("juu");
+ assertNotNull(juu);
+ assertEquals("juu_icon", juu.getState().getIcon());
+ assertEquals(0, juu.getNodeCount());
+ NodeContext<?> bar = root.get("bar");
+ assertNotNull(bar);
+ assertEquals("bar_icon", bar.getState().getIcon());
+ assertEquals(0, bar.getNodeCount());
+ NodeContext<?> daa = root.get("daa");
+ assertNotNull(daa);
+ assertEquals("daa_icon", daa.getState().getIcon());
+ assertEquals(0, daa.getNodeCount());
+ }
@Override
+ protected final void afterTwoPhasesBoot(NodeContext<?> root)
+ {
+ assertEquals(2, root.getNodeCount());
+ assertNotNull(root.get("foo"));
+ assertNotNull(root.get("daa"));
+ }
+
+ @Override
+ protected final void afterTwoPhaseOverrideReboot(NodeContext<?> root)
+ {
+ assertState(root);
+ }
+
+ @Override
+ protected final void afterTwoPhaseNoOverrideReconfigure(NodeContext<?> root)
+ {
+ assertState(root);
+ }
+
protected void assertState(NodeContext<?> root)
{
assertEquals(2, root.getNodeCount());
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationInsert.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationInsert.java 2011-10-03 22:45:45 UTC (rev 7635)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationInsert.java 2011-10-03 23:16:27 UTC (rev 7636)
@@ -33,8 +33,49 @@
{
return ImportMode.INSERT;
}
+
+ @Override
+ protected final void afterOnePhaseBoot(NodeContext<?> root)
+ {
+ assertEquals(3, root.getNodeCount());
+ NodeContext<?> foo = root.get("foo");
+ assertNotNull(foo);
+ assertEquals("foo_icon_2", foo.getState().getIcon());
+ assertEquals(1, foo.getNodeCount());
+ NodeContext<?> juu = foo.get("juu");
+ assertNotNull(juu);
+ assertEquals("juu_icon", juu.getState().getIcon());
+ assertEquals(0, juu.getNodeCount());
+ NodeContext<?> bar = root.get("bar");
+ assertNotNull(bar);
+ assertEquals("bar_icon", bar.getState().getIcon());
+ assertEquals(0, bar.getNodeCount());
+ NodeContext<?> daa = root.get("daa");
+ assertNotNull(daa);
+ assertEquals("daa_icon", daa.getState().getIcon());
+ assertEquals(0, daa.getNodeCount());
+ }
@Override
+ protected final void afterTwoPhasesBoot(NodeContext<?> root)
+ {
+ assertEquals(2, root.getNodeCount());
+ assertNotNull(root.get("foo"));
+ assertNotNull(root.get("daa"));
+ }
+
+ @Override
+ protected final void afterTwoPhaseOverrideReboot(NodeContext<?> root)
+ {
+ assertState(root);
+ }
+
+ @Override
+ protected final void afterTwoPhaseNoOverrideReconfigure(NodeContext<?> root)
+ {
+ assertState(root);
+ }
+
protected void assertState(NodeContext<?> root)
{
assertEquals(3, root.getNodeCount());
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationMerge.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationMerge.java 2011-10-03 22:45:45 UTC (rev 7635)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationMerge.java 2011-10-03 23:16:27 UTC (rev 7636)
@@ -33,8 +33,33 @@
{
return ImportMode.MERGE;
}
+
+ @Override
+ protected final void afterOnePhaseBoot(NodeContext<?> root)
+ {
+ assertState(root);
+ }
@Override
+ protected final void afterTwoPhasesBoot(NodeContext<?> root)
+ {
+ assertEquals(2, root.getNodeCount());
+ assertNotNull(root.get("foo"));
+ assertNotNull(root.get("daa"));
+ }
+
+ @Override
+ protected final void afterTwoPhaseOverrideReboot(NodeContext<?> root)
+ {
+ assertState(root);
+ }
+
+ @Override
+ protected final void afterTwoPhaseNoOverrideReconfigure(NodeContext<?> root)
+ {
+ assertState(root);
+ }
+
protected void assertState(NodeContext<?> root)
{
assertEquals(3, root.getNodeCount());
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationOverwrite.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationOverwrite.java 2011-10-03 22:45:45 UTC (rev 7635)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationOverwrite.java 2011-10-03 23:16:27 UTC (rev 7636)
@@ -33,8 +33,39 @@
{
return ImportMode.OVERWRITE;
}
+
+ @Override
+ protected final void afterOnePhaseBoot(NodeContext<?> root)
+ {
+ assertState(root);
+ }
@Override
+ protected final void afterTwoPhasesBoot(NodeContext<?> root)
+ {
+ assertEquals(2, root.getNodeCount());
+ NodeContext<?> foo = root.get("foo");
+ assertNotNull(foo);
+ assertEquals("foo_icon_1", foo.getState().getIcon());
+ assertEquals(1, foo.getNodeCount());
+ NodeContext<?> bar = root.get("daa");
+ assertNotNull(bar);
+ assertEquals("daa_icon", bar.getState().getIcon());
+ assertEquals(0, bar.getNodeCount());
+ }
+
+ @Override
+ protected final void afterTwoPhaseOverrideReboot(NodeContext<?> root)
+ {
+ assertState(root);
+ }
+
+ @Override
+ protected final void afterTwoPhaseNoOverrideReconfigure(NodeContext<?> root)
+ {
+ assertState(root);
+ }
+
protected void assertState(NodeContext<?> root)
{
assertEquals(2, root.getNodeCount());
Added: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestSiteDataImportConserve.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestSiteDataImportConserve.java (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestSiteDataImportConserve.java 2011-10-03 23:16:27 UTC (rev 7636)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2011 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.config;
+
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.portal.mop.importer.ImportMode;
+
+/**
+ * @author <a href="trongtt(a)gmail.com">Trong Tran</a>
+ * @version $Revision$
+ */
+public class TestSiteDataImportConserve extends AbstractSiteDataImportTest
+{
+
+ @Override
+ protected ImportMode getMode()
+ {
+ return ImportMode.CONSERVE;
+ }
+
+ @Override
+ protected void afterSecondBootWithOverride(PortalContainer container) throws Exception
+ {
+ afterSecondBoot(container);
+ }
+}
Added: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestSiteDataImportInsert.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestSiteDataImportInsert.java (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestSiteDataImportInsert.java 2011-10-03 23:16:27 UTC (rev 7636)
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2011 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.config;
+
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.container.component.RequestLifeCycle;
+import org.exoplatform.portal.config.model.Application;
+import org.exoplatform.portal.config.model.Container;
+import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.portal.mop.importer.ImportMode;
+import org.exoplatform.portal.pom.spi.portlet.Portlet;
+
+/**
+ * @author <a href="trongtt(a)gmail.com">Trong Tran</a>
+ * @version $Revision$
+ */
+public class TestSiteDataImportInsert extends AbstractSiteDataImportTest
+{
+
+ @Override
+ protected ImportMode getMode()
+ {
+ return ImportMode.INSERT;
+ }
+
+ @Override
+ protected void afterSecondBootWithOverride(PortalContainer container) throws Exception
+ {
+ //
+ RequestLifeCycle.begin(container);
+
+ DataStorage dataStorage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
+ PortalConfig portal = dataStorage.getPortalConfig("classic");
+ Container layout = portal.getPortalLayout();
+ assertEquals(1, layout.getChildren().size());
+ Application<Portlet> layoutPortlet = (Application<Portlet>)layout.getChildren().get(0);
+ assertEquals("site1/layout", dataStorage.getId(layoutPortlet.getState()));
+
+ //
+ Page home = dataStorage.getPage("portal::classic::home");
+ assertNotNull(home);
+ assertEquals("site 1", home.getTitle());
+
+ Page page1 = dataStorage.getPage("portal::classic::page1");
+ assertNotNull(page1);
+ assertEquals("site 1", page1.getTitle());
+
+ Page page2 = dataStorage.getPage("portal::classic::page2");
+ assertNotNull(page2);
+ assertEquals("site 2", page2.getTitle());
+
+ Page dashboard1 = dataStorage.getPage("user::root::dashboard1");
+ assertNotNull(dashboard1);
+ assertEquals("site 2", dashboard1.getTitle());
+
+ RequestLifeCycle.end();
+ }
+}
Added: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestSiteDataImportMerge.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestSiteDataImportMerge.java (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestSiteDataImportMerge.java 2011-10-03 23:16:27 UTC (rev 7636)
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2011 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.config;
+
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.container.component.RequestLifeCycle;
+import org.exoplatform.portal.config.model.Application;
+import org.exoplatform.portal.config.model.Container;
+import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.portal.mop.importer.ImportMode;
+import org.exoplatform.portal.pom.spi.portlet.Portlet;
+
+/**
+ * @author <a href="trongtt(a)gmail.com">Trong Tran</a>
+ * @version $Revision$
+ */
+public class TestSiteDataImportMerge extends AbstractSiteDataImportTest
+{
+
+ @Override
+ protected ImportMode getMode()
+ {
+ return ImportMode.MERGE;
+ }
+
+ @Override
+ protected void afterSecondBootWithOverride(PortalContainer container) throws Exception
+ {
+ RequestLifeCycle.begin(container);
+
+ DataStorage dataStorage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
+
+ PortalConfig portal = dataStorage.getPortalConfig("classic");
+ Container layout = portal.getPortalLayout();
+ assertEquals(1, layout.getChildren().size());
+ Application<Portlet> layoutPortlet = (Application<Portlet>)layout.getChildren().get(0);
+ assertEquals("site2/layout", dataStorage.getId(layoutPortlet.getState()));
+
+ //
+ Page home = dataStorage.getPage("portal::classic::home");
+ assertNotNull(home);
+ assertEquals("site 1", home.getTitle());
+
+ Page page1 = dataStorage.getPage("portal::classic::page1");
+ assertNotNull(page1);
+ assertEquals("site 2", page1.getTitle());
+
+ Page page2 = dataStorage.getPage("portal::classic::page2");
+ assertNotNull(page2);
+ assertEquals("site 2", page2.getTitle());
+
+ Page dashboard1 = dataStorage.getPage("user::root::dashboard1");
+ assertNotNull(dashboard1);
+ assertEquals("site 2", dashboard1.getTitle());
+
+ RequestLifeCycle.end();
+ }
+}
Added: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestSiteDataImportOverwrite.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestSiteDataImportOverwrite.java (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestSiteDataImportOverwrite.java 2011-10-03 23:16:27 UTC (rev 7636)
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2011 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.config;
+
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.container.component.RequestLifeCycle;
+import org.exoplatform.portal.config.model.Application;
+import org.exoplatform.portal.config.model.Container;
+import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.portal.mop.importer.ImportMode;
+import org.exoplatform.portal.pom.spi.portlet.Portlet;
+
+/**
+ * @author <a href="trongtt(a)gmail.com">Trong Tran</a>
+ * @version $Revision$
+ */
+public class TestSiteDataImportOverwrite extends AbstractSiteDataImportTest
+{
+
+ @Override
+ protected ImportMode getMode()
+ {
+ return ImportMode.OVERWRITE;
+ }
+
+ @Override
+ protected void afterSecondBootWithOverride(PortalContainer container) throws Exception
+ {
+ RequestLifeCycle.begin(container);
+
+ DataStorage dataStorage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
+
+ PortalConfig portal = dataStorage.getPortalConfig("classic");
+ Container layout = portal.getPortalLayout();
+ assertEquals(1, layout.getChildren().size());
+ Application<Portlet> layoutPortlet = (Application<Portlet>)layout.getChildren().get(0);
+ assertEquals("site2/layout", dataStorage.getId(layoutPortlet.getState()));
+
+ //
+ Page home = dataStorage.getPage("portal::classic::home");
+ assertNotNull(home);
+ assertEquals("site 1", home.getTitle());
+
+ Page page1 = dataStorage.getPage("portal::classic::page1");
+ assertNotNull(page1);
+ assertEquals("site 2", page1.getTitle());
+
+ Page page2 = dataStorage.getPage("portal::classic::page2");
+ assertNotNull(page2);
+ assertEquals("site 2", page2.getTitle());
+
+ Page dashboard1 = dataStorage.getPage("user::root::dashboard1");
+ assertNotNull(dashboard1);
+ assertEquals("site 2", dashboard1.getTitle());
+
+ RequestLifeCycle.end();
+ }
+}
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport0-configuration.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport0-configuration.xml 2011-10-03 22:45:45 UTC (rev 7635)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport0-configuration.xml 2011-10-03 23:16:27 UTC (rev 7636)
@@ -28,7 +28,6 @@
<name>new.portal.config.user.listener</name>
<set-method>initListener</set-method>
<type>org.exoplatform.portal.config.NewPortalConfigListener</type>
- <priority>1</priority>
<init-params>
<value-param>
<name>default.portal</name>
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport1-configuration.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport1-configuration.xml 2011-10-03 22:45:45 UTC (rev 7635)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport1-configuration.xml 2011-10-03 23:16:27 UTC (rev 7636)
@@ -18,48 +18,70 @@
~ 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_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
- xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
- <external-component-plugins>
- <target-component>org.exoplatform.portal.config.UserPortalConfigService</target-component>
- <component-plugin>
- <name>new.portal.config.user.listener</name>
- <set-method>initListener</set-method>
- <type>org.exoplatform.portal.config.NewPortalConfigListener</type>
- <init-params>
- <value-param>
- <name>default.portal</name>
- <value>classic</value>
- </value-param>
- <value-param>
- <name>override</name>
- <value>${override.1}</value>
- </value-param>
- <object-param>
- <name>portal.configuration</name>
- <object type="org.exoplatform.portal.config.NewPortalConfig">
- <field name="predefinedOwner">
- <collection type="java.util.HashSet">
- <value>
- <string>classic</string>
- </value>
- </collection>
- </field>
- <field name="ownerType">
- <string>portal</string>
- </field>
- <field name="templateLocation">
- <string>classpath:/org/exoplatform/portal/config/${import.portal.1}-conf</string>
- </field>
- <field name="importMode">
- <string>${import.mode.1}</string>
- </field>
- </object>
- </object-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
+ <external-component-plugins>
+ <target-component>org.exoplatform.portal.config.UserPortalConfigService</target-component>
+ <component-plugin>
+ <name>new.portal.config.user.listener</name>
+ <set-method>initListener</set-method>
+ <type>org.exoplatform.portal.config.NewPortalConfigListener</type>
+ <priority>1</priority>
+ <init-params>
+ <value-param>
+ <name>default.portal</name>
+ <value>classic</value>
+ </value-param>
+ <value-param>
+ <name>override</name>
+ <value>${override.1}</value>
+ </value-param>
+ <object-param>
+ <name>portal.configuration</name>
+ <object type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+ <value>
+ <string>classic</string>
+ </value>
+ </collection>
+ </field>
+ <field name="ownerType">
+ <string>portal</string>
+ </field>
+ <field name="templateLocation">
+ <string>classpath:/org/exoplatform/portal/config/${import.portal.1}-conf</string>
+ </field>
+ <field name="importMode">
+ <string>${import.mode.1}</string>
+ </field>
+ </object>
+ </object-param>
+ <object-param>
+ <name>user.configuration</name>
+ <description>description</description>
+ <object type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+ <value>
+ <string>root</string>
+ </value>
+ </collection>
+ </field>
+ <field name="ownerType">
+ <string>user</string>
+ </field>
+ <field name="templateLocation">
+ <string>classpath:/org/exoplatform/portal/config/${import.portal.1}-conf</string>
+ </field>
+ <field name="importMode">
+ <string>${import.mode.1}</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
</configuration>
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport2-configuration.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport2-configuration.xml 2011-10-03 22:45:45 UTC (rev 7635)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport2-configuration.xml 2011-10-03 23:16:27 UTC (rev 7636)
@@ -22,45 +22,67 @@
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
- <external-component-plugins>
- <target-component>org.exoplatform.portal.config.UserPortalConfigService</target-component>
- <component-plugin>
- <name>new.portal.config.user.listener</name>
- <set-method>initListener</set-method>
- <type>org.exoplatform.portal.config.NewPortalConfigListener</type>
- <priority>1</priority>
- <init-params>
- <value-param>
- <name>default.portal</name>
- <value>classic</value>
- </value-param>
- <value-param>
- <name>override</name>
- <value>${override_2}</value>
- </value-param>
- <object-param>
- <name>portal.configuration</name>
- <object type="org.exoplatform.portal.config.NewPortalConfig">
- <field name="predefinedOwner">
- <collection type="java.util.HashSet">
- <value>
- <string>classic</string>
- </value>
- </collection>
- </field>
- <field name="ownerType">
- <string>portal</string>
- </field>
- <field name="templateLocation">
- <string>classpath:/org/exoplatform/portal/config/${import.portal_2}-conf</string>
- </field>
- <field name="importMode">
- <string>${import.mode_2}</string>
- </field>
- </object>
- </object-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
+ <external-component-plugins>
+ <target-component>org.exoplatform.portal.config.UserPortalConfigService</target-component>
+ <component-plugin>
+ <name>new.portal.config.user.listener</name>
+ <set-method>initListener</set-method>
+ <type>org.exoplatform.portal.config.NewPortalConfigListener</type>
+ <priority>2</priority>
+ <init-params>
+ <value-param>
+ <name>default.portal</name>
+ <value>classic</value>
+ </value-param>
+ <value-param>
+ <name>override</name>
+ <value>${override_2}</value>
+ </value-param>
+ <object-param>
+ <name>portal.configuration</name>
+ <object type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+ <value>
+ <string>classic</string>
+ </value>
+ </collection>
+ </field>
+ <field name="ownerType">
+ <string>portal</string>
+ </field>
+ <field name="templateLocation">
+ <string>classpath:/org/exoplatform/portal/config/${import.portal_2}-conf</string>
+ </field>
+ <field name="importMode">
+ <string>${import.mode_2}</string>
+ </field>
+ </object>
+ </object-param>
+ <object-param>
+ <name>user.configuration</name>
+ <description>description</description>
+ <object type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+ <value>
+ <string>root</string>
+ </value>
+ </collection>
+ </field>
+ <field name="ownerType">
+ <string>user</string>
+ </field>
+ <field name="templateLocation">
+ <string>classpath:/org/exoplatform/portal/config/${import.portal_2}-conf</string>
+ </field>
+ <field name="importMode">
+ <string>${import.mode_2}</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
</configuration>
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/pages.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/pages.xml 2011-10-03 22:45:45 UTC (rev 7635)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/pages.xml 2011-10-03 23:16:27 UTC (rev 7636)
@@ -25,16 +25,30 @@
xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
- <page>
- <name>page1</name>
- <portlet-application>
- <portlet>
- <application-ref>site1</application-ref>
- <portlet-ref>page1</portlet-ref>
- </portlet>
- <access-permissions>Everyone</access-permissions>
- <show-info-bar>true</show-info-bar>
- </portlet-application>
- </page>
+ <page>
+ <name>home</name>
+ <title>site 1</title>
+ <portlet-application>
+ <portlet>
+ <application-ref>site1</application-ref>
+ <portlet-ref>home</portlet-ref>
+ </portlet>
+ <access-permissions>Everyone</access-permissions>
+ <show-info-bar>true</show-info-bar>
+ </portlet-application>
+ </page>
+
+ <page>
+ <name>page1</name>
+ <title>site 1</title>
+ <portlet-application>
+ <portlet>
+ <application-ref>site1</application-ref>
+ <portlet-ref>page1</portlet-ref>
+ </portlet>
+ <access-permissions>Everyone</access-permissions>
+ <show-info-bar>true</show-info-bar>
+ </portlet-application>
+ </page>
</page-set>
Added: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/user/root/navigation.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/user/root/navigation.xml (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/user/root/navigation.xml 2011-10-03 23:16:27 UTC (rev 7636)
@@ -0,0 +1,28 @@
+<?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.
+
+-->
+
+<node-navigation
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
+ <priority>3</priority>
+</node-navigation>
Added: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/user/root/pages.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/user/root/pages.xml (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/user/root/pages.xml 2011-10-03 23:16:27 UTC (rev 7636)
@@ -0,0 +1,28 @@
+<?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.
+
+-->
+
+<page-set
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_0 http://www.gatein.org/xml/ns/gatein_objects_1_0"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_0">
+ </page-set>
+
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/pages.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/pages.xml 2011-10-03 22:45:45 UTC (rev 7635)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/pages.xml 2011-10-03 23:16:27 UTC (rev 7636)
@@ -25,28 +25,30 @@
xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
- <page>
- <name>page1</name>
- <portlet-application>
- <portlet>
- <application-ref>site2</application-ref>
- <portlet-ref>page1</portlet-ref>
- </portlet>
- <access-permissions>Everyone</access-permissions>
- <show-info-bar>true</show-info-bar>
- </portlet-application>
- </page>
-
<page>
- <name>page2</name>
- <portlet-application>
- <portlet>
- <application-ref>site2</application-ref>
- <portlet-ref>page2</portlet-ref>
- </portlet>
- <access-permissions>Everyone</access-permissions>
- <show-info-bar>true</show-info-bar>
+ <name>page1</name>
+ <title>site 2</title>
+ <portlet-application>
+ <portlet>
+ <application-ref>site2</application-ref>
+ <portlet-ref>page1</portlet-ref>
+ </portlet>
+ <access-permissions>Everyone</access-permissions>
+ <show-info-bar>true</show-info-bar>
</portlet-application>
</page>
+ <page>
+ <name>page2</name>
+ <title>site 2</title>
+ <portlet-application>
+ <portlet>
+ <application-ref>site2</application-ref>
+ <portlet-ref>page2</portlet-ref>
+ </portlet>
+ <access-permissions>Everyone</access-permissions>
+ <show-info-bar>true</show-info-bar>
+ </portlet-application>
+ </page>
+
</page-set>
Added: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/user/root/navigation.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/user/root/navigation.xml (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/user/root/navigation.xml 2011-10-03 23:16:27 UTC (rev 7636)
@@ -0,0 +1,35 @@
+<?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.
+
+-->
+
+<node-navigation
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
+ <priority>3</priority>
+
+ <page-nodes>
+ <node>
+ <name>Default_Tab</name>
+ <icon>Default_Tab_icon</icon>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/user/root/pages.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/user/root/pages.xml (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/user/root/pages.xml 2011-10-03 23:16:27 UTC (rev 7636)
@@ -0,0 +1,39 @@
+<?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.
+
+-->
+
+<page-set xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_0 http://www.gatein.org/xml/ns/gatein_objects_1_0"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_0">
+
+ <page>
+ <name>dashboard1</name>
+ <title>site 2</title>
+ <portlet-application>
+ <portlet>
+ <application-ref>site2</application-ref>
+ <portlet-ref>dashboard1</portlet-ref>
+ </portlet>
+ <access-permissions>Everyone</access-permissions>
+ <show-info-bar>true</show-info-bar>
+ </portlet-application>
+ </page>
+</page-set>
+
Modified: epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml 2011-10-03 22:45:45 UTC (rev 7635)
+++ epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml 2011-10-03 23:16:27 UTC (rev 7636)
@@ -180,7 +180,6 @@
</field>
<field name="ownerType"><string>portal</string></field>
<field name="templateLocation"><string>war:/conf/portal/</string></field>
- <field name="importMode"><string>conserve</string></field>
</object>
</object-param>
<object-param>
@@ -197,7 +196,6 @@
</field>
<field name="ownerType"><string>group</string></field>
<field name="templateLocation"><string>war:/conf/portal</string></field>
- <field name="importMode"><string>conserve</string></field>
</object>
</object-param>
<object-param>
@@ -211,7 +209,6 @@
</field>
<field name="ownerType"><string>user</string></field>
<field name="templateLocation"><string>war:/conf/portal</string></field>
- <field name="importMode"><string>conserve</string></field>
</object>
</object-param>
</init-params>
13 years, 3 months
gatein SVN: r7635 - in epp/portal/branches/EPP_5_2_Branch/component/portal/src: main/java/org/exoplatform/portal/config and 10 other directories.
by do-not-reply@jboss.org
Author: theute
Date: 2011-10-03 18:45:45 -0400 (Mon, 03 Oct 2011)
New Revision: 7635
Added:
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/importer/PageImporter.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/importer/PortalConfigImporter.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/pages.xml
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/portal.xml
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/pages.xml
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/portal.xml
Removed:
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/pages.xml
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/portal.xml
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/pages.xml
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/portal.xml
Modified:
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfig.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImport.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/conf/configuration.xml
Log:
JBEPP-1249: A site should not be overwritten when the workspace import marker is not present
Property changes on: epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org
___________________________________________________________________
Modified: svn:mergeinfo
- /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/component/portal/src/main/java/org:5868
/portal/branches/branch-GTNPORTAL-1592/component/portal/src/main/java/org:4894
/portal/branches/branch-GTNPORTAL-1643/component/portal/src/main/java/org:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/component/portal/src/main/java/org:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/component/portal/src/main/java/org:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/component/portal/src/main/java/org:5765
/portal/branches/branch-GTNPORTAL-1790/component/portal/src/main/java/org:5871
/portal/branches/branch-GTNPORTAL-1822/component/portal/src/main/java/org:5943,5952
/portal/branches/branch-GTNPORTAL-1832/component/portal/src/main/java/org:6030,6063
/portal/branches/branch-GTNPORTAL-1872/component/portal/src/main/java/org:6400,6551
/portal/branches/branch-GTNPORTAL-1921/component/portal/src/main/java/org:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/component/portal/src/main/java/org:6904,6915-6916
/portal/trunk/component/portal/src/main/java/org:4876,4891,5269,5744,5822,5943,6031,6033,6168,6196,6201-6203,6205-6206,6223,6292,6323,6437,6440,6449,6452,6573,6741,6783-6784,6912-6913,6960,7042,7061,7095,7117,7120,7125,7132-7134,7186,7198,7239,7262,7308,7326,7331-7334,7359,7367,7433,7452,7454,7478,7497,7552,7554-7555,7598
+ /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/component/portal/src/main/java/org:5868
/portal/branches/branch-GTNPORTAL-1592/component/portal/src/main/java/org:4894
/portal/branches/branch-GTNPORTAL-1643/component/portal/src/main/java/org:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/component/portal/src/main/java/org:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/component/portal/src/main/java/org:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/component/portal/src/main/java/org:5765
/portal/branches/branch-GTNPORTAL-1790/component/portal/src/main/java/org:5871
/portal/branches/branch-GTNPORTAL-1822/component/portal/src/main/java/org:5943,5952
/portal/branches/branch-GTNPORTAL-1832/component/portal/src/main/java/org:6030,6063
/portal/branches/branch-GTNPORTAL-1872/component/portal/src/main/java/org:6400,6551
/portal/branches/branch-GTNPORTAL-1921/component/portal/src/main/java/org:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/component/portal/src/main/java/org:6904,6915-6916
/portal/trunk/component/portal/src/main/java/org:4876,4891,5269,5744,5822,5943,6031,6033,6168,6196,6201-6203,6205-6206,6223,6292,6323,6437,6440,6449,6452,6573,6741,6783-6784,6912-6913,6960,7042,7061,7095,7117,7120,7125,7132-7134,7186,7198,7239,7262,7308,7326,7330-7334,7359,7367,7433,7450,7452,7454,7478,7497,7500,7552,7554-7555,7598
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfig.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfig.java 2011-10-03 21:53:54 UTC (rev 7634)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfig.java 2011-10-03 22:45:45 UTC (rev 7635)
@@ -20,6 +20,8 @@
package org.exoplatform.portal.config;
import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
/**
* Author : Nhu Dinh Thuan
@@ -43,6 +45,8 @@
private String importMode;
+ final Set<String> createdOwners = new HashSet<String>();
+
/**
* @deprecated use the location instead
*/
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2011-10-03 21:53:54 UTC (rev 7634)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2011-10-03 22:45:45 UTC (rev 7635)
@@ -433,7 +433,10 @@
{
for (String owner : config.getPredefinedOwner())
{
- createPortalConfig(config, owner);
+ if (createPortalConfig(config, owner))
+ {
+ config.createdOwners.add(owner);
+ }
}
}
@@ -441,7 +444,10 @@
{
for (String owner : config.getPredefinedOwner())
{
- createPage(config, owner);
+ if (config.createdOwners.contains(owner))
+ {
+ createPage(config, owner);
+ }
}
}
@@ -464,50 +470,48 @@
}
}
- public void createPortalConfig(NewPortalConfig config, String owner) throws Exception
+ public boolean createPortalConfig(NewPortalConfig config, String owner) throws Exception
{
- try
+ String type = config.getOwnerType();
+ PortalConfig currentPortalConfig = dataStorage_.getPortalConfig(type, owner);
+ if (currentPortalConfig == null)
{
- String type = config.getOwnerType();
- UnmarshalledObject<PortalConfig> obj = getConfig(config, owner, type, PortalConfig.class);
+ try
+ {
+ UnmarshalledObject<PortalConfig> obj = getConfig(config, owner, type, PortalConfig.class);
- if (obj == null)
- {
- // Ensure that the PortalConfig has been defined
- // The PortalConfig could be empty if the related PortalConfigListener
- // has been launched after starting this service
- PortalConfig cfg = dataStorage_.getPortalConfig(type, owner);
- if (cfg == null)
+ if (obj == null)
{
- cfg = new PortalConfig(type);
- cfg.setPortalLayout(new Container());
- cfg.setName(owner);
- dataStorage_.create(cfg);
+ // Ensure that the PortalConfig has been defined
+ // The PortalConfig could be empty if the related PortalConfigListener
+ // has been launched after starting this service
+ PortalConfig cfg = dataStorage_.getPortalConfig(type, owner);
+ if (cfg == null)
+ {
+ cfg = new PortalConfig(type);
+ cfg.setPortalLayout(new Container());
+ cfg.setName(owner);
+ dataStorage_.create(cfg);
+ return true;
+ }
}
- return;
+ else
+ {
+ PortalConfig pconfig = obj.getObject();
+ // We use that owner value because it may have been fixed for group names
+ owner = pconfig.getName();
+ dataStorage_.create(pconfig);
+ return true;
+ }
}
-
- //
- PortalConfig pconfig = obj.getObject();
-
- // We use that owner value because it may have been fixed for group names
- owner = pconfig.getName();
-
- //
- PortalConfig currentPortalConfig = dataStorage_.getPortalConfig(type, owner);
- if (currentPortalConfig == null)
+ catch (IOException e)
{
- dataStorage_.create(pconfig);
+ log.error("Could not load portal configuration", e);
}
- else
- {
- dataStorage_.save(pconfig);
- }
}
- catch (IOException e)
- {
- log.error("Could not load portal configuration", e);
- }
+
+ //
+ return false;
}
public void createPage(NewPortalConfig config, String owner) throws Exception
Copied: epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/importer/PageImporter.java (from rev 7450, portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/importer/PageImporter.java)
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/importer/PageImporter.java (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/importer/PageImporter.java 2011-10-03 22:45:45 UTC (rev 7635)
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2011 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.mop.importer;
+
+import org.exoplatform.portal.config.DataStorage;
+import org.exoplatform.portal.config.model.Page;
+
+/**
+ * @author <a href="trongtt(a)gmail.com">Trong Tran</a>
+ * @version $Revision$
+ */
+public class PageImporter
+{
+ /** . */
+ private final Page src;
+
+ /** . */
+ private final DataStorage service;
+
+ /** . */
+ private final ImportMode mode;
+
+ public PageImporter(ImportMode importMode, Page page, DataStorage dataStorage_)
+ {
+ this.mode = importMode;
+ this.src = page;
+ this.service = dataStorage_;
+ }
+
+ public void perform() throws Exception
+ {
+ Page existingPage = service.getPage(src.getPageId());
+ Page dst;
+
+ //
+ switch (mode)
+ {
+ case CONSERVE:
+ dst = null;
+ break;
+ case INSERT:
+ if (existingPage == null)
+ {
+ dst = src;
+ }
+ else
+ {
+ dst = null;
+ }
+ break;
+ case MERGE:
+ case OVERWRITE:
+ dst = src;
+ break;
+ default:
+ throw new AssertionError();
+ }
+
+ if (dst != null)
+ {
+ service.create(dst);
+ }
+ }
+}
Copied: epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/importer/PortalConfigImporter.java (from rev 7450, portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/importer/PortalConfigImporter.java)
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/importer/PortalConfigImporter.java (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/importer/PortalConfigImporter.java 2011-10-03 22:45:45 UTC (rev 7635)
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2011 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.mop.importer;
+
+import org.exoplatform.portal.config.DataStorage;
+import org.exoplatform.portal.config.model.PortalConfig;
+
+/**
+ * @author <a href="trongtt(a)gmail.com">Trong Tran</a>
+ * @version $Revision$
+ */
+public class PortalConfigImporter
+{
+ /** . */
+ private final PortalConfig src;
+
+ /** . */
+ private final DataStorage service;
+
+ /** . */
+ private final ImportMode mode;
+
+ public PortalConfigImporter(ImportMode importMode, PortalConfig portal, DataStorage dataStorage_)
+ {
+ this.mode = importMode;
+ this.src = portal;
+ this.service = dataStorage_;
+ }
+
+ public void perform() throws Exception
+ {
+ PortalConfig existingPortalConfig = service.getPortalConfig(src.getType(), src.getName());
+ PortalConfig dst = null;
+
+ //
+ switch (mode)
+ {
+ case CONSERVE:
+ dst = null;
+ break;
+ case INSERT:
+ if (existingPortalConfig == null)
+ {
+ dst = src;
+ }
+ else
+ {
+ dst = null;
+ }
+ break;
+ case MERGE:
+ case OVERWRITE:
+ dst = src;
+ break;
+ default:
+ throw new AssertionError();
+ }
+
+ if (dst != null)
+ {
+ if (existingPortalConfig == null)
+ {
+ service.create(dst);
+ }
+ else
+ {
+ service.save(dst);
+ }
+ }
+ }
+}
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImport.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImport.java 2011-10-03 21:53:54 UTC (rev 7634)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestImport.java 2011-10-03 22:45:45 UTC (rev 7635)
@@ -24,6 +24,11 @@
import org.exoplatform.component.test.KernelBootstrap;
import org.exoplatform.container.PortalContainer;
import org.exoplatform.container.component.RequestLifeCycle;
+import org.exoplatform.portal.config.model.Application;
+import org.exoplatform.portal.config.model.ApplicationState;
+import org.exoplatform.portal.config.model.Container;
+import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.mop.SiteKey;
import org.exoplatform.portal.mop.importer.Imported;
import org.exoplatform.portal.mop.navigation.NavigationContext;
@@ -32,6 +37,7 @@
import org.exoplatform.portal.mop.navigation.NodeContext;
import org.exoplatform.portal.mop.navigation.Scope;
import org.exoplatform.portal.pom.config.POMSessionManager;
+import org.exoplatform.portal.pom.spi.portlet.Portlet;
import org.gatein.mop.api.workspace.Workspace;
import java.io.File;
@@ -99,4 +105,70 @@
RequestLifeCycle.end();
bootstrap.dispose();
}
+
+ public void testNoMixin() throws Exception
+ {
+ KernelBootstrap bootstrap = new KernelBootstrap();
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.test.jcr-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.identity-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.portal-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "org/exoplatform/portal/config/TestImport1-configuration.xml");
+
+ //
+ System.setProperty("override.1", "false");
+ System.setProperty("import.mode.1", "conserve");
+ System.setProperty("import.portal.1", "site1");
+
+ //
+ bootstrap.boot();
+ PortalContainer container = bootstrap.getContainer();
+ DataStorage service = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
+ RequestLifeCycle.begin(container);
+ POMSessionManager mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
+ Workspace workspace = mgr.getSession().getWorkspace();
+ assertTrue(workspace.isAdapted(Imported.class));
+ long when1 = workspace.adapt(Imported.class).getCreationDate().getTime();
+ PortalConfig portal = service.getPortalConfig("classic");
+ Container layout = portal.getPortalLayout();
+ assertEquals(1, layout.getChildren().size());
+ Application<Portlet> layoutPortlet = (Application<Portlet>)layout.getChildren().get(0);
+ assertEquals("site1/layout", service.getId(layoutPortlet.getState()));
+ Page page1 = service.getPage("portal::classic::page1");
+ assertEquals(1, page1.getChildren().size());
+ Application<Portlet> page1Portlet = (Application<Portlet>)page1.getChildren().get(0);
+ assertEquals("site1/page1", service.getId(page1Portlet.getState()));
+ workspace.removeAdapter(Imported.class);
+ mgr.getSession().save();
+ RequestLifeCycle.end();
+ bootstrap.dispose();
+
+ //
+ System.setProperty("override.1", "false");
+ System.setProperty("import.mode.1", "conserve");
+ System.setProperty("import.portal.1", "site2");
+
+ //
+ bootstrap.boot();
+ container = bootstrap.getContainer();
+ service = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
+ RequestLifeCycle.begin(container);
+ mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
+ workspace = mgr.getSession().getWorkspace();
+ assertTrue(workspace.isAdapted(Imported.class));
+ long when2 = workspace.adapt(Imported.class).getCreationDate().getTime();
+ assertTrue(when2 > when1);
+ portal = service.getPortalConfig("classic");
+ layout = portal.getPortalLayout();
+ assertEquals(1, layout.getChildren().size());
+ layoutPortlet = (Application<Portlet>)layout.getChildren().get(0);
+ assertEquals("site1/layout", service.getId(layoutPortlet.getState()));
+ page1 = service.getPage("portal::classic::page1");
+ assertEquals(1, page1.getChildren().size());
+ page1Portlet = (Application<Portlet>)page1.getChildren().get(0);
+ assertEquals("site1/page1", service.getId(page1Portlet.getState()));
+ Page page2 = service.getPage("portal::classic::page2");
+ assertNull(page2);
+ RequestLifeCycle.end();
+ bootstrap.dispose();
+ }
}
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/conf/configuration.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/conf/configuration.xml 2011-10-03 21:53:54 UTC (rev 7634)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/conf/configuration.xml 2011-10-03 22:45:45 UTC (rev 7635)
@@ -130,6 +130,7 @@
</field>
</object>
</object-param>
+<!--
<object-param>
<name>user.configuration</name>
<object type="org.exoplatform.portal.config.NewPortalConfig">
@@ -148,6 +149,7 @@
</field>
</object>
</object-param>
+-->
</init-params>
</component-plugin>
</external-component-plugins>
@@ -298,6 +300,18 @@
</field>
</object>
</value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field name="userName"><string>overwritelayout</string></field>
+ <field name="password"><string>gtn</string></field>
+ <field name="firstName"><string>Overwrite</string></field>
+ <field name="lastName"><string>Layout</string></field>
+ <field name="email"><string>overwrite@localhost</string></field>
+ <field name="groups">
+ <string>member:/platform/users</string>
+ </field>
+ </object>
+ </value>
</collection>
</field>
</object>
Deleted: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/pages.xml 2011-09-07 13:54:58 UTC (rev 7330)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/pages.xml 2011-10-03 22:45:45 UTC (rev 7635)
@@ -1,40 +0,0 @@
-<?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.
-
--->
-
-<page-set
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
- xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
-
- <page>
- <name>page1</name>
- <portlet-application>
- <portlet>
- <application-ref>site1</application-ref>
- <portlet-ref>page1</portlet-ref>
- </portlet>
- <access-permissions>Everyone</access-permissions>
- <show-info-bar>true</show-info-bar>
- </portlet-application>
- </page>
-
-</page-set>
Copied: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/pages.xml (from rev 7330, portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/pages.xml)
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/pages.xml (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/pages.xml 2011-10-03 22:45:45 UTC (rev 7635)
@@ -0,0 +1,40 @@
+<?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.
+
+-->
+
+<page-set
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
+
+ <page>
+ <name>page1</name>
+ <portlet-application>
+ <portlet>
+ <application-ref>site1</application-ref>
+ <portlet-ref>page1</portlet-ref>
+ </portlet>
+ <access-permissions>Everyone</access-permissions>
+ <show-info-bar>true</show-info-bar>
+ </portlet-application>
+ </page>
+
+</page-set>
Deleted: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/portal.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/portal.xml 2011-09-07 13:54:58 UTC (rev 7330)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/portal.xml 2011-10-03 22:45:45 UTC (rev 7635)
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- Copyright (C) 2011 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.
-
--->
-
-<portal-config
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
- xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
- <portal-name>classic</portal-name>
- <locale>en</locale>
- <access-permissions>Everyone</access-permissions>
- <edit-permission>*:/platform/administrators</edit-permission>
- <portal-layout>
- <portlet-application>
- <portlet>
- <application-ref>site1</application-ref>
- <portlet-ref>layout</portlet-ref>
- </portlet>
- <access-permissions>Everyone</access-permissions>
- <show-info-bar>true</show-info-bar>
- </portlet-application>
- </portal-layout>
-</portal-config>
Copied: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/portal.xml (from rev 7330, portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/portal.xml)
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/portal.xml (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site1-conf/portal/classic/portal.xml 2011-10-03 22:45:45 UTC (rev 7635)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2011 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.
+
+-->
+
+<portal-config
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
+ <portal-name>classic</portal-name>
+ <locale>en</locale>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <portal-layout>
+ <portlet-application>
+ <portlet>
+ <application-ref>site1</application-ref>
+ <portlet-ref>layout</portlet-ref>
+ </portlet>
+ <access-permissions>Everyone</access-permissions>
+ <show-info-bar>true</show-info-bar>
+ </portlet-application>
+ </portal-layout>
+</portal-config>
Deleted: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/pages.xml 2011-09-07 13:54:58 UTC (rev 7330)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/pages.xml 2011-10-03 22:45:45 UTC (rev 7635)
@@ -1,52 +0,0 @@
-<?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.
-
--->
-
-<page-set
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
- xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
-
- <page>
- <name>page1</name>
- <portlet-application>
- <portlet>
- <application-ref>site2</application-ref>
- <portlet-ref>page1</portlet-ref>
- </portlet>
- <access-permissions>Everyone</access-permissions>
- <show-info-bar>true</show-info-bar>
- </portlet-application>
- </page>
-
- <page>
- <name>page2</name>
- <portlet-application>
- <portlet>
- <application-ref>site2</application-ref>
- <portlet-ref>page2</portlet-ref>
- </portlet>
- <access-permissions>Everyone</access-permissions>
- <show-info-bar>true</show-info-bar>
- </portlet-application>
- </page>
-
-</page-set>
Copied: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/pages.xml (from rev 7330, portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/pages.xml)
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/pages.xml (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/pages.xml 2011-10-03 22:45:45 UTC (rev 7635)
@@ -0,0 +1,52 @@
+<?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.
+
+-->
+
+<page-set
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
+
+ <page>
+ <name>page1</name>
+ <portlet-application>
+ <portlet>
+ <application-ref>site2</application-ref>
+ <portlet-ref>page1</portlet-ref>
+ </portlet>
+ <access-permissions>Everyone</access-permissions>
+ <show-info-bar>true</show-info-bar>
+ </portlet-application>
+ </page>
+
+ <page>
+ <name>page2</name>
+ <portlet-application>
+ <portlet>
+ <application-ref>site2</application-ref>
+ <portlet-ref>page2</portlet-ref>
+ </portlet>
+ <access-permissions>Everyone</access-permissions>
+ <show-info-bar>true</show-info-bar>
+ </portlet-application>
+ </page>
+
+</page-set>
Deleted: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/portal.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/portal.xml 2011-09-07 13:54:58 UTC (rev 7330)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/portal.xml 2011-10-03 22:45:45 UTC (rev 7635)
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- Copyright (C) 2011 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.
-
--->
-
-<portal-config
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
- xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
- <portal-name>classic</portal-name>
- <locale>en</locale>
- <access-permissions>Everyone</access-permissions>
- <edit-permission>*:/platform/administrators</edit-permission>
- <portal-layout>
- <portlet-application>
- <portlet>
- <application-ref>site2</application-ref>
- <portlet-ref>layout</portlet-ref>
- </portlet>
- <access-permissions>Everyone</access-permissions>
- <show-info-bar>true</show-info-bar>
- </portlet-application>
- </portal-layout>
-</portal-config>
Copied: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/portal.xml (from rev 7330, portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/portal.xml)
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/portal.xml (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/resources/org/exoplatform/portal/config/site2-conf/portal/classic/portal.xml 2011-10-03 22:45:45 UTC (rev 7635)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2011 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.
+
+-->
+
+<portal-config
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
+ <portal-name>classic</portal-name>
+ <locale>en</locale>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <portal-layout>
+ <portlet-application>
+ <portlet>
+ <application-ref>site2</application-ref>
+ <portlet-ref>layout</portlet-ref>
+ </portlet>
+ <access-permissions>Everyone</access-permissions>
+ <show-info-bar>true</show-info-bar>
+ </portlet-application>
+ </portal-layout>
+</portal-config>
13 years, 3 months
gatein SVN: r7634 - epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/application.
by do-not-reply@jboss.org
Author: theute
Date: 2011-10-03 17:53:54 -0400 (Mon, 03 Oct 2011)
New Revision: 7634
Modified:
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/application/UIApplicationList.gtmpl
Log:
Fixing failed merge
Modified: epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/application/UIApplicationList.gtmpl
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/application/UIApplicationList.gtmpl 2011-10-03 21:47:01 UTC (rev 7633)
+++ epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/application/UIApplicationList.gtmpl 2011-10-03 21:53:54 UTC (rev 7634)
@@ -41,17 +41,8 @@
for (application in uicomponent.getApplications()) {
String applicationName = encoder.encode(application.getDisplayName());
String applicationDescription = encoder.encode(application.getDescription());
- String applicationLabelFull = applicationLabel;
- if(applicationLabel.length() > 30) applicationLabel = applicationLabel.substring(0, 27) + "...";
- applicationLabel = encoder.encode(applicationLabel==null?"":applicationLabel);
- applicationLabelFull = encoder.encode(applicationLabelFull==null?"":applicationLabelFull);
String srcBG = application.getIconURL();
String srcBGError = "/eXoResources/skin/sharedImages/Icon80x80/DefaultPortlet.png";
-
- description = application.getDescription();
- if(description == null) displayName = "";
- description = encoder.encode(description);
-
%>
<div class="UIVTab VTabStyle3" id="<%=application.getId();%>" onmousedown="eXo.portal.PortalDragDrop.init.call(this, event);">
<div class="VTabContentBG">
13 years, 3 months