Author: julien_viet
Date: 2009-10-24 04:22:11 -0400 (Sat, 24 Oct 2009)
New Revision: 413
Added:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/NavigationData.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/NavigationNodeContainerData.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/NavigationNodeData.java
Removed:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/NavigationContainer.java
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNavigation.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNode.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNodeContainer.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/Mapper.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/ModelDataStorage.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageNavigationTask.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/SearchTask.java
Log:
refactored the navigation class names and avoid to use inner classes at this place
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNavigation.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNavigation.java 2009-10-24
07:50:41 UTC (rev 412)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNavigation.java 2009-10-24
08:22:11 UTC (rev 413)
@@ -19,7 +19,8 @@
package org.exoplatform.portal.config.model;
-import org.exoplatform.portal.pom.config.data.NavigationContainer;
+import org.exoplatform.portal.pom.config.data.NavigationData;
+import org.exoplatform.portal.pom.config.data.NavigationNodeData;
import java.util.ArrayList;
import java.util.LinkedHashMap;
@@ -58,12 +59,12 @@
this((String)null);
}
- public PageNavigation(NavigationContainer.Page nav)
+ public PageNavigation(NavigationData nav)
{
super(nav.getStorageId());
- ArrayList<PageNode> children = new
ArrayList<PageNode>(nav.getChildren().size());
- for (NavigationContainer.Node child : nav.getChildren())
+ ArrayList<PageNode> children = new
ArrayList<PageNode>(nav.getNodes().size());
+ for (NavigationNodeData child : nav.getNodes())
{
PageNode node = new PageNode(child);
children.add(node);
@@ -256,10 +257,10 @@
}
@Override
- public NavigationContainer.Page build()
+ public NavigationData build()
{
- List<NavigationContainer.Node> children = buildNavigationChildren();
- return new NavigationContainer.Page(
+ List<NavigationNodeData> children = buildNavigationChildren();
+ return new NavigationData(
storageId,
ownerType,
ownerId,
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNode.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNode.java 2009-10-24
07:50:41 UTC (rev 412)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNode.java 2009-10-24
08:22:11 UTC (rev 413)
@@ -20,7 +20,7 @@
package org.exoplatform.portal.config.model;
import org.exoplatform.commons.utils.ExpressionUtil;
-import org.exoplatform.portal.pom.config.data.NavigationContainer;
+import org.exoplatform.portal.pom.config.data.NavigationNodeData;
import java.util.ArrayList;
import java.util.Date;
@@ -54,13 +54,13 @@
private transient boolean modifiable;
- public PageNode(NavigationContainer.Node nav)
+ public PageNode(NavigationNodeData nav)
{
super(nav.getStorageId());
//
- ArrayList<PageNode> children = new
ArrayList<PageNode>(nav.getChildren().size());
- for (NavigationContainer.Node child : nav.getChildren())
+ ArrayList<PageNode> children = new
ArrayList<PageNode>(nav.getNodes().size());
+ for (NavigationNodeData child : nav.getNodes())
{
PageNode node = new PageNode(child);
children.add(node);
@@ -288,10 +288,10 @@
}
@Override
- public NavigationContainer.Node build()
+ public NavigationNodeData build()
{
- List<NavigationContainer.Node> children = buildNavigationChildren();
- return new NavigationContainer.Node(
+ List<NavigationNodeData> children = buildNavigationChildren();
+ return new NavigationNodeData(
storageId,
uri,
label,
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNodeContainer.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNodeContainer.java 2009-10-24
07:50:41 UTC (rev 412)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNodeContainer.java 2009-10-24
08:22:11 UTC (rev 413)
@@ -20,7 +20,8 @@
package org.exoplatform.portal.config.model;
import org.exoplatform.portal.config.model.ModelObject;
-import org.exoplatform.portal.pom.config.data.NavigationContainer;
+import org.exoplatform.portal.pom.config.data.NavigationNodeContainerData;
+import org.exoplatform.portal.pom.config.data.NavigationNodeData;
import java.util.ArrayList;
import java.util.Collections;
@@ -44,16 +45,16 @@
public abstract List<PageNode> getNodes();
- protected List<NavigationContainer.Node> buildNavigationChildren()
+ protected List<NavigationNodeData> buildNavigationChildren()
{
List<PageNode> nodes = getNodes();
if (nodes != null)
{
- ArrayList<NavigationContainer.Node> children = new
ArrayList<NavigationContainer.Node>();
+ ArrayList<NavigationNodeData> children = new
ArrayList<NavigationNodeData>();
for (int i = 0;i < nodes.size();i++)
{
PageNode node = nodes.get(i);
- NavigationContainer.Node child = node.build();
+ NavigationNodeData child = node.build();
children.add(child);
}
return Collections.unmodifiableList(children);
@@ -64,6 +65,6 @@
}
}
- public abstract NavigationContainer build();
+ public abstract NavigationNodeContainerData build();
}
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java 2009-10-24
07:50:41 UTC (rev 412)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java 2009-10-24
08:22:11 UTC (rev 413)
@@ -30,7 +30,7 @@
import org.exoplatform.portal.config.model.ModelChange;
import org.exoplatform.portal.config.model.ModelObject;
import org.exoplatform.portal.pom.config.data.ModelDataStorage;
-import org.exoplatform.portal.pom.config.data.NavigationContainer;
+import org.exoplatform.portal.pom.config.data.NavigationData;
import org.exoplatform.portal.pom.config.data.NavigationKey;
import org.exoplatform.portal.pom.config.data.PageData;
import org.exoplatform.portal.config.model.PersistentApplicationState;
@@ -149,22 +149,22 @@
return execute(new PageTask.Save(page)).getChanges();
}
- public NavigationContainer.Page getPageNavigation(NavigationKey key) throws Exception
+ public NavigationData getPageNavigation(NavigationKey key) throws Exception
{
return execute(new PageNavigationTask.Load(key)).getPageNavigation();
}
- public void save(NavigationContainer.Page navigation) throws Exception
+ public void save(NavigationData navigation) throws Exception
{
execute(new PageNavigationTask.Save(navigation, true));
}
- public void create(NavigationContainer.Page navigation) throws Exception
+ public void create(NavigationData navigation) throws Exception
{
execute(new PageNavigationTask.Save(navigation, false));
}
- public void remove(NavigationContainer.Page navigation) throws Exception
+ public void remove(NavigationData navigation) throws Exception
{
execute(new PageNavigationTask.Remove(navigation));
}
@@ -221,9 +221,9 @@
{
return (LazyPageList<T>)execute(new
SearchTask.FindPage((Query<PageData>)q)).getResult();
}
- else if (NavigationContainer.Page.class.equals(type))
+ else if (NavigationData.class.equals(type))
{
- return (LazyPageList<T>)execute(new
SearchTask.FindNavigation((Query<NavigationContainer.Page>)q)).getResult();
+ return (LazyPageList<T>)execute(new
SearchTask.FindNavigation((Query<NavigationData>)q)).getResult();
}
else if (PortletPreferences.class.equals(type))
{
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/Mapper.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/Mapper.java 2009-10-24
07:50:41 UTC (rev 412)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/Mapper.java 2009-10-24
08:22:11 UTC (rev 413)
@@ -22,7 +22,6 @@
import org.exoplatform.portal.config.model.ApplicationState;
import org.exoplatform.portal.config.model.ApplicationType;
import org.exoplatform.portal.pom.config.data.BodyType;
-import org.exoplatform.portal.config.model.Dashboard;
import org.exoplatform.portal.config.model.ModelChange;
import org.exoplatform.portal.config.model.PersistentApplicationState;
import org.exoplatform.portal.config.model.PortalConfig;
@@ -41,7 +40,7 @@
import org.exoplatform.portal.pom.config.data.ContainerData;
import org.exoplatform.portal.pom.config.data.DashboardData;
import org.exoplatform.portal.pom.config.data.ModelData;
-import org.exoplatform.portal.pom.config.data.NavigationContainer;
+import org.exoplatform.portal.pom.config.data.NavigationNodeContainerData;
import org.exoplatform.portal.pom.config.data.PageData;
import org.exoplatform.portal.pom.config.data.PortalData;
import org.exoplatform.portal.pom.spi.gadget.Gadget;
@@ -105,31 +104,31 @@
this.session = session;
}
- public NavigationContainer.Page load(Navigation src)
+ public NavigationData load(Navigation src)
{
- return load(src, NavigationContainer.Page.class);
+ return load(src, NavigationData.class);
}
- private <T extends NavigationContainer> T load(Navigation src, Class<T>
type)
+ private <T extends NavigationNodeContainerData> T load(Navigation src,
Class<T> type)
{
//
- ArrayList<NavigationContainer.Node> children = new
ArrayList<NavigationContainer.Node>(src.getChildren().size());
+ ArrayList<NavigationNodeData> children = new
ArrayList<NavigationNodeData>(src.getChildren().size());
for (Navigation srcChild : src.getChildren())
{
- NavigationContainer.Node dstChild = load(srcChild,
NavigationContainer.Node.class);
+ NavigationNodeData dstChild = load(srcChild, NavigationNodeData.class);
children.add(dstChild);
}
//
T dst;
- if (type == NavigationContainer.Page.class)
+ if (type == NavigationData.class)
{
Site site = src.getSite();
String ownerType = getOwnerType(site.getObjectType());
String ownerId = site.getName();
Attributes attrs = src.getAttributes();
- NavigationContainer.Page dstNav = new NavigationContainer.Page(
+ NavigationData dstNav = new NavigationData(
src.getObjectId(),
ownerType,
ownerId,
@@ -140,7 +139,7 @@
children);
dst = (T)dstNav;
}
- else if (type == NavigationContainer.Node.class)
+ else if (type == NavigationNodeData.class)
{
Attributes attrs = src.getAttributes();
String pageReference = null;
@@ -156,7 +155,7 @@
pageReference = getOwnerType(siteType) + "::" + site.getName() +
"::" + target.getName();
}
}
- NavigationContainer.Node dstNode = new NavigationContainer.Node(
+ NavigationNodeData dstNode = new NavigationNodeData(
src.getObjectId(),
attrs.getValue(MappedAttributes.URI),
attrs.getValue(MappedAttributes.LABEL),
@@ -181,16 +180,16 @@
return dst;
}
- public void save(NavigationContainer.Page src, Navigation dst)
+ public void save(NavigationData src, Navigation dst)
{
- save((NavigationContainer)src, dst);
+ save((NavigationNodeContainerData)src, dst);
}
- private void save(NavigationContainer src, Navigation dst)
+ private void save(NavigationNodeContainerData src, Navigation dst)
{
- if (src instanceof NavigationContainer.Node)
+ if (src instanceof NavigationNodeData)
{
- NavigationContainer.Node node = (NavigationContainer.Node)src;
+ NavigationNodeData node = (NavigationNodeData)src;
Workspace workspace = dst.getSite().getWorkspace();
String reference = node.getPageReference();
if (reference != null)
@@ -213,9 +212,9 @@
attrs.setValue(MappedAttributes.SHOW_PUBLICATION_DATE,
node.getShowPublicationDate());
attrs.setValue(MappedAttributes.VISIBLE, node.isVisible());
}
- else if (src instanceof NavigationContainer.Page)
+ else if (src instanceof NavigationData)
{
- NavigationContainer.Page pageNav = (NavigationContainer.Page)src;
+ NavigationData pageNav = (NavigationData)src;
//
Attributes attrs = dst.getAttributes();
@@ -231,7 +230,7 @@
//
Set<String> savedSet = new HashSet<String>();
- for (NavigationContainer.Node node : src.getChildren())
+ for (NavigationNodeData node : src.getNodes())
{
String srcId = node.getStorageId();
Navigation dstChild;
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/ModelDataStorage.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/ModelDataStorage.java 2009-10-24
07:50:41 UTC (rev 412)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/ModelDataStorage.java 2009-10-24
08:22:11 UTC (rev 413)
@@ -25,7 +25,6 @@
import org.exoplatform.portal.config.model.ApplicationState;
import org.exoplatform.portal.config.model.Container;
import org.exoplatform.portal.config.model.ModelChange;
-import org.exoplatform.portal.pom.config.data.NavigationContainer;
import org.exoplatform.portal.pom.config.data.PageData;
import org.exoplatform.portal.pom.config.data.PortalData;
import org.exoplatform.portal.pom.config.POMTask;
@@ -83,13 +82,13 @@
*/
public List<ModelChange> save(PageData page) throws Exception;
- public NavigationContainer.Page getPageNavigation(NavigationKey key) throws
Exception;
+ public NavigationData getPageNavigation(NavigationKey key) throws Exception;
- public void save(NavigationContainer.Page navigation) throws Exception;
+ public void save(NavigationData navigation) throws Exception;
- public void create(NavigationContainer.Page navigation) throws Exception;
+ public void create(NavigationData navigation) throws Exception;
- public void remove(NavigationContainer.Page navigation) throws Exception;
+ public void remove(NavigationData navigation) throws Exception;
public void save(PortletPreferences portletPreferences) throws Exception;
Deleted:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/NavigationContainer.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/NavigationContainer.java 2009-10-24
07:50:41 UTC (rev 412)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/NavigationContainer.java 2009-10-24
08:22:11 UTC (rev 413)
@@ -1,261 +0,0 @@
-/*
- * Copyright (C) 2003-2007 eXo Platform SAS.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not,
see<http://www.gnu.org/licenses/>.
- */
-package org.exoplatform.portal.pom.config.data;
-
-import org.exoplatform.portal.pom.config.data.ModelData;
-
-import java.util.Date;
-import java.util.List;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
- * @version $Revision$
- */
-public class NavigationContainer extends ModelData
-{
-
- /** . */
- private final List<NavigationContainer.Node> children;
-
- public NavigationContainer(String storageId, List<NavigationContainer.Node>
children)
- {
- super(storageId, null);
-
- //
- this.children = children;
- }
-
- public List<NavigationContainer.Node> getChildren()
- {
- return children;
- }
-
- public static class Node extends NavigationContainer
- {
-
- /** . */
- private final String uri;
-
- /** . */
- private final String label;
-
- /** . */
- private final String icon;
-
- /** . */
- private final String name;
-
- /** . */
- private final Date startPublicationDate;
-
- /** . */
- private final Date endPublicationDate;
-
- /** . */
- private final boolean showPublicationDate;
-
- /** . */
- private final boolean visible;
-
- /** . */
- private final String pageReference;
-
- public Node(
- String uri,
- String label,
- String icon,
- String name,
- Date startPublicationDate,
- Date endPublicationDate,
- Boolean showPublicationDate,
- Boolean visible,
- String pageReference,
- List<NavigationContainer.Node> children)
- {
- this(null, uri, label, icon, name, startPublicationDate, endPublicationDate,
showPublicationDate, visible, pageReference, children);
- }
-
- public Node(
- String storageId,
- String uri,
- String label,
- String icon,
- String name,
- Date startPublicationDate,
- Date endPublicationDate,
- Boolean showPublicationDate,
- Boolean visible,
- String pageReference,
- List<NavigationContainer.Node> children)
- {
- super(storageId, children);
-
- //
- this.uri = uri;
- this.label = label;
- this.icon = icon;
- this.name = name;
- this.startPublicationDate = startPublicationDate;
- this.endPublicationDate = endPublicationDate;
- this.showPublicationDate = showPublicationDate != null ? showPublicationDate :
false;
- this.visible = visible != null ? visible : true;
- this.pageReference = pageReference;
- }
- public String getURI()
- {
- return uri;
- }
-
- public String getLabel()
- {
- return label;
- }
-
- public String getIcon()
- {
- return icon;
- }
-
- public String getName()
- {
- return name;
- }
-
- public Date getStartPublicationDate()
- {
- return startPublicationDate;
- }
-
- public Date getEndPublicationDate()
- {
- return endPublicationDate;
- }
-
- public boolean getShowPublicationDate()
- {
- return showPublicationDate;
- }
-
- public boolean isVisible()
- {
- return visible;
- }
-
- public String getPageReference()
- {
- return pageReference;
- }
- }
-
- public static class Page extends NavigationContainer
- {
-
- /** . */
- private final NavigationKey key;
-
- /** . */
- private final String description;
-
- /** . */
- private final String creator;
-
- /** . */
- private final String modifier;
-
- /** . */
- private final int priority;
-
- public Page(
- String ownerType,
- String ownerId,
- String description,
- String creator,
- String modifier,
- Integer priority,
- List<NavigationContainer.Node> children)
- {
- this(null, ownerType, ownerId, description, creator, modifier, priority,
children);
- }
-
- public Page(
- String storageId,
- String ownerType,
- String ownerId,
- String description,
- String creator,
- String modifier,
- Integer priority,
- List<NavigationContainer.Node> children)
- {
- super(storageId, children);
-
- //
- if (ownerType == null)
- {
- throw new NullPointerException("No null owner type");
- }
- if (ownerId == null)
- {
- throw new NullPointerException("No null owner id");
- }
-
- //
- this.key = new NavigationKey(ownerType, ownerId);
- this.description = description;
- this.creator = creator;
- this.modifier = modifier;
- this.priority = priority != null ? priority : 1;
- }
-
- public NavigationKey getKey()
- {
- return key;
- }
-
- public String getOwnerType()
- {
- return key.getOwnerType();
- }
-
- public String getOwnerId()
- {
- return key.getOwnerId();
- }
-
- public String getDescription()
- {
- return description;
- }
-
- public String getCreator()
- {
- return creator;
- }
-
- public String getModifier()
- {
- return modifier;
- }
-
- public int getPriority()
- {
- return priority;
- }
- }
-
-
-}
Added:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/NavigationData.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/NavigationData.java
(rev 0)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/NavigationData.java 2009-10-24
08:22:11 UTC (rev 413)
@@ -0,0 +1,119 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.pom.config.data;
+
+import java.util.List;
+
+/**
+* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+* @version $Revision$
+*/
+public class NavigationData extends NavigationNodeContainerData
+{
+
+ /** . */
+ private final NavigationKey key;
+
+ /** . */
+ private final String description;
+
+ /** . */
+ private final String creator;
+
+ /** . */
+ private final String modifier;
+
+ /** . */
+ private final int priority;
+
+ public NavigationData(
+ String ownerType,
+ String ownerId,
+ String description,
+ String creator,
+ String modifier,
+ Integer priority,
+ List<NavigationNodeData> children)
+ {
+ this(null, ownerType, ownerId, description, creator, modifier, priority,
children);
+ }
+
+ public NavigationData(
+ String storageId,
+ String ownerType,
+ String ownerId,
+ String description,
+ String creator,
+ String modifier,
+ Integer priority,
+ List<NavigationNodeData> children)
+ {
+ super(storageId, children);
+
+ //
+ if (ownerType == null)
+ {
+ throw new NullPointerException("No null owner type");
+ }
+ if (ownerId == null)
+ {
+ throw new NullPointerException("No null owner id");
+ }
+
+ //
+ this.key = new NavigationKey(ownerType, ownerId);
+ this.description = description;
+ this.creator = creator;
+ this.modifier = modifier;
+ this.priority = priority != null ? priority : 1;
+ }
+
+ public NavigationKey getKey()
+ {
+ return key;
+ }
+
+ public String getOwnerType()
+ {
+ return key.getOwnerType();
+ }
+
+ public String getOwnerId()
+ {
+ return key.getOwnerId();
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public String getCreator()
+ {
+ return creator;
+ }
+
+ public String getModifier()
+ {
+ return modifier;
+ }
+
+ public int getPriority()
+ {
+ return priority;
+ }
+}
Copied:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/NavigationNodeContainerData.java
(from rev 412,
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/NavigationContainer.java)
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/NavigationNodeContainerData.java
(rev 0)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/NavigationNodeContainerData.java 2009-10-24
08:22:11 UTC (rev 413)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.pom.config.data;
+
+import org.exoplatform.portal.pom.config.data.ModelData;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public class NavigationNodeContainerData extends ModelData
+{
+
+ /** . */
+ private final List<NavigationNodeData> nodes;
+
+ public NavigationNodeContainerData(String storageId, List<NavigationNodeData>
nodes)
+ {
+ super(storageId, null);
+
+ //
+ this.nodes = nodes;
+ }
+
+ public List<NavigationNodeData> getNodes()
+ {
+ return nodes;
+ }
+}
Added:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/NavigationNodeData.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/NavigationNodeData.java
(rev 0)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/NavigationNodeData.java 2009-10-24
08:22:11 UTC (rev 413)
@@ -0,0 +1,141 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.pom.config.data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+* @version $Revision$
+*/
+public class NavigationNodeData extends NavigationNodeContainerData
+{
+
+ /** . */
+ private final String uri;
+
+ /** . */
+ private final String label;
+
+ /** . */
+ private final String icon;
+
+ /** . */
+ private final String name;
+
+ /** . */
+ private final Date startPublicationDate;
+
+ /** . */
+ private final Date endPublicationDate;
+
+ /** . */
+ private final boolean showPublicationDate;
+
+ /** . */
+ private final boolean visible;
+
+ /** . */
+ private final String pageReference;
+
+ public NavigationNodeData(
+ String uri,
+ String label,
+ String icon,
+ String name,
+ Date startPublicationDate,
+ Date endPublicationDate,
+ Boolean showPublicationDate,
+ Boolean visible,
+ String pageReference,
+ List<NavigationNodeData> children)
+ {
+ this(null, uri, label, icon, name, startPublicationDate, endPublicationDate,
showPublicationDate, visible, pageReference, children);
+ }
+
+ public NavigationNodeData(
+ String storageId,
+ String uri,
+ String label,
+ String icon,
+ String name,
+ Date startPublicationDate,
+ Date endPublicationDate,
+ Boolean showPublicationDate,
+ Boolean visible,
+ String pageReference,
+ List<NavigationNodeData> children)
+ {
+ super(storageId, children);
+
+ //
+ this.uri = uri;
+ this.label = label;
+ this.icon = icon;
+ this.name = name;
+ this.startPublicationDate = startPublicationDate;
+ this.endPublicationDate = endPublicationDate;
+ this.showPublicationDate = showPublicationDate != null ? showPublicationDate :
false;
+ this.visible = visible != null ? visible : true;
+ this.pageReference = pageReference;
+ }
+ public String getURI()
+ {
+ return uri;
+ }
+
+ public String getLabel()
+ {
+ return label;
+ }
+
+ public String getIcon()
+ {
+ return icon;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public Date getStartPublicationDate()
+ {
+ return startPublicationDate;
+ }
+
+ public Date getEndPublicationDate()
+ {
+ return endPublicationDate;
+ }
+
+ public boolean getShowPublicationDate()
+ {
+ return showPublicationDate;
+ }
+
+ public boolean isVisible()
+ {
+ return visible;
+ }
+
+ public String getPageReference()
+ {
+ return pageReference;
+ }
+}
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageNavigationTask.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageNavigationTask.java 2009-10-24
07:50:41 UTC (rev 412)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageNavigationTask.java 2009-10-24
08:22:11 UTC (rev 413)
@@ -20,10 +20,10 @@
package org.exoplatform.portal.pom.config.tasks;
import org.exoplatform.portal.pom.config.data.Mapper;
-import org.exoplatform.portal.pom.config.data.NavigationContainer;
import org.exoplatform.portal.pom.config.AbstractPOMTask;
import org.exoplatform.portal.pom.config.POMSession;
+import org.exoplatform.portal.pom.config.data.NavigationData;
import org.exoplatform.portal.pom.config.data.NavigationKey;
import org.gatein.mop.api.workspace.Navigation;
import org.gatein.mop.api.workspace.ObjectType;
@@ -57,14 +57,14 @@
{
/** . */
- private NavigationContainer.Page pageNav;
+ private NavigationData pageNav;
public Load(NavigationKey key)
{
super(key);
}
- public NavigationContainer.Page getPageNavigation()
+ public NavigationData getPageNavigation()
{
return pageNav;
}
@@ -100,12 +100,12 @@
{
/** . */
- private final NavigationContainer.Page pageNav;
+ private final NavigationData pageNav;
/** . */
private final boolean overwrite;
- public Save(NavigationContainer.Page pageNav, boolean overwrite)
+ public Save(NavigationData pageNav, boolean overwrite)
{
super(pageNav.getKey());
@@ -148,7 +148,7 @@
public static class Remove extends PageNavigationTask
{
- public Remove(NavigationContainer.Page pageNav)
+ public Remove(NavigationData pageNav)
{
super(pageNav.getKey());
}
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/SearchTask.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/SearchTask.java 2009-10-24
07:50:41 UTC (rev 412)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/SearchTask.java 2009-10-24
08:22:11 UTC (rev 413)
@@ -24,7 +24,7 @@
import org.exoplatform.portal.application.PortletPreferences;
import org.exoplatform.portal.config.Query;
import org.exoplatform.portal.pom.config.data.Mapper;
-import org.exoplatform.portal.pom.config.data.NavigationContainer;
+import org.exoplatform.portal.pom.config.data.NavigationData;
import org.exoplatform.portal.pom.config.data.PageData;
import org.exoplatform.portal.pom.config.data.PortalData;
import org.exoplatform.portal.pom.config.data.PortalKey;
@@ -156,10 +156,10 @@
}
}
- public static class FindNavigation extends FindSiteObject<Navigation,
NavigationContainer.Page>
+ public static class FindNavigation extends FindSiteObject<Navigation,
NavigationData>
{
- public FindNavigation(Query<NavigationContainer.Page> pageQuery)
+ public FindNavigation(Query<NavigationData> pageQuery)
{
super(pageQuery);
}
@@ -170,12 +170,12 @@
return session.findObjects(ObjectType.NAVIGATION, siteType, q.getOwnerId(),
q.getTitle());
}
- protected NavigationContainer.Page[] createT(int length)
+ protected NavigationData[] createT(int length)
{
- return new NavigationContainer.Page[length];
+ return new NavigationData[length];
}
- protected NavigationContainer.Page loadT(POMSession session, Navigation w)
+ protected NavigationData loadT(POMSession session, Navigation w)
{
return new Mapper(session).load(w);
}