Author: ndkhoiits
Date: 2011-02-11 23:43:14 -0500 (Fri, 11 Feb 2011)
New Revision: 5870
Modified:
portal/branches/branch-GTNPORTAL-1790/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIAddApplicationForm.java
portal/branches/branch-GTNPORTAL-1790/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPortletInfo.java
Log:
GTNPORTAL-1798 Some portlets are duplicated in category after add an application
Modified:
portal/branches/branch-GTNPORTAL-1790/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIAddApplicationForm.java
===================================================================
---
portal/branches/branch-GTNPORTAL-1790/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIAddApplicationForm.java 2011-02-11
11:33:14 UTC (rev 5869)
+++
portal/branches/branch-GTNPORTAL-1790/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIAddApplicationForm.java 2011-02-12
04:43:14 UTC (rev 5870)
@@ -265,23 +265,24 @@
return;
}
- UIFormRadioBoxInput uiRadio = uiForm.getUIInput("application");
- String displayName = uiForm.getUIStringInput(FIELD_NAME).getValue();
if (uiForm.getApplications().size() == 0)
{
ctx.getUIApplication().addMessage(new
ApplicationMessage("UIAddApplicationForm.msg.appNotExists", null));
ctx.addUIComponentToUpdateByAjax(uiOrganizer);
return;
}
+ UIFormRadioBoxInput uiRadio = uiForm.getUIInput("application");
+ String displayName = uiForm.getUIStringInput(FIELD_NAME).getValue();
Application tmp =
uiForm.getApplications().get(Integer.parseInt(uiRadio.getValue()));
-
+
// check portet name is exist
- if (appRegService.getApplication(selectedCate.getName(),
tmp.getApplicationName()) != null)
+ for (Application application : appRegService.getApplications(selectedCate))
{
- WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
- UIApplication uiApp = context.getUIApplication();
- uiApp.addMessage(new
ApplicationMessage("UIAddApplicationForm.msg.PortletExist", null));
- return;
+ if (application.getContentId().equals(tmp.getContentId()))
+ {
+ ctx.getUIApplication().addMessage(new
ApplicationMessage("UIAddApplicationForm.msg.PortletExist", null));
+ return;
+ }
}
Application app = cloneApplication(tmp);
Modified:
portal/branches/branch-GTNPORTAL-1790/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPortletInfo.java
===================================================================
---
portal/branches/branch-GTNPORTAL-1790/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPortletInfo.java 2011-02-11
11:33:14 UTC (rev 5869)
+++
portal/branches/branch-GTNPORTAL-1790/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPortletInfo.java 2011-02-12
04:43:14 UTC (rev 5870)
@@ -93,9 +93,12 @@
for (ApplicationCategory category : allCategories)
{
- if (appRegService.getApplication(category.getName(), portlet_.getName()) !=
null)
+ for (Application application : appRegService.getApplications(category))
{
- nameList.add(category.getDisplayName());
+ if (application.getContentId().equals(portlet_.getId()))
+ {
+ nameList.add(category.getDisplayName());
+ }
}
}
StringBuffer names = new StringBuffer("");
Show replies by date