Author: julien_viet
Date: 2009-10-28 09:55:12 -0400 (Wed, 28 Oct 2009)
New Revision: 439
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/Query.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/tasks/SearchTask.java
portal/branches/performance/webui/portal/src/main/java/org/exoplatform/portal/webui/util/PortalDataMapper.java
Log:
- GTNPORTAL-117 : Wrong model portal request
- PortalDataMapper does not map the page storage id
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/Query.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/Query.java 2009-10-28
10:40:05 UTC (rev 438)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/Query.java 2009-10-28
13:55:12 UTC (rev 439)
@@ -114,4 +114,35 @@
this.title_ = title_;
}
+ @Override
+ public String toString()
+ {
+ StringBuilder builder = new StringBuilder("Query[");
+ if (classType_ != null)
+ {
+
builder.append("class=").append(classType_.getSimpleName()).append(",");
+ }
+ if (ownerType_ != null)
+ {
+
builder.append("ownerType=").append(ownerType_).append(",");
+ }
+ if (ownerId_ != null)
+ {
+ builder.append("ownerId=").append(ownerId_).append(",");
+ }
+ if (name_ != null)
+ {
+ builder.append("name=").append(name_).append(",");
+ }
+ if (title_ != null)
+ {
+ builder.append("title=").append(title_).append(",");
+ }
+ if (builder.charAt(builder.length() - 1) == ',')
+ {
+ builder.setLength(builder.length() - 1);
+ }
+ builder.append(']');
+ return builder.toString();
+ }
}
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-28
10:40:05 UTC (rev 438)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java 2009-10-28
13:55:12 UTC (rev 439)
@@ -217,7 +217,7 @@
{
return (LazyPageList<T>)executor.execute(new
SearchTask.FindPortletPreferences((Query<PortletPreferences>)q)).getResult();
}
- else if (PortalData.class.equals(type) &&
"portal".equals(q.getOwnerType()))
+ else if (PortalData.class.equals(type))
{
return (LazyPageList<T>)executor.execute(new
SearchTask.FindSite((Query<PortalData>)q)).getResult();
}
@@ -227,7 +227,7 @@
}
else
{
- throw new UnsupportedOperationException("Type " + type.getName() +
" cannot be searched");
+ throw new UnsupportedOperationException("Could not perform search on query
" + q);
}
}
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-28
10:40:05 UTC (rev 438)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/SearchTask.java 2009-10-28
13:55:12 UTC (rev 439)
@@ -219,7 +219,9 @@
public void run(final POMSession session) throws Exception
{
Workspace workspace = session.getWorkspace();
- final Collection<? extends Site> portals =
workspace.getSites(ObjectType.PORTAL_SITE);
+ String ownerType = q.getOwnerType();
+ ObjectType<Site> siteType = ownerType == null ? ObjectType.PORTAL_SITE :
Mapper.parseSiteType(ownerType);
+ final Collection<? extends Site> portals = workspace.getSites(siteType);
ListAccess<PortalData> la = new ListAccess<PortalData>()
{
public PortalData[] load(int index, int length) throws Exception,
IllegalArgumentException
Modified:
portal/branches/performance/webui/portal/src/main/java/org/exoplatform/portal/webui/util/PortalDataMapper.java
===================================================================
---
portal/branches/performance/webui/portal/src/main/java/org/exoplatform/portal/webui/util/PortalDataMapper.java 2009-10-28
10:40:05 UTC (rev 438)
+++
portal/branches/performance/webui/portal/src/main/java/org/exoplatform/portal/webui/util/PortalDataMapper.java 2009-10-28
13:55:12 UTC (rev 439)
@@ -304,6 +304,7 @@
private static void toUIContainer(UIContainer uiContainer, Container model, boolean
dashboard) throws Exception
{
+ uiContainer.setStorageId(model.getStorageId());
uiContainer.setId(model.getId());
uiContainer.setWidth(model.getWidth());
uiContainer.setHeight(model.getHeight());
@@ -426,7 +427,6 @@
Container container = (Container)model;
UIContainer uiTempContainer =
uiContainer.createUIComponent(context, UIContainer.class,
container.getFactoryId(), null);
- uiTempContainer.setStorageId(container.getStorageId());
toUIContainer(uiTempContainer, (Container)model, dashboard);
uiComponent = uiTempContainer;
}