[gatein-commits] gatein SVN: r2303 - in portal/trunk: component/application-registry/src/main/java/org/exoplatform/application/registry/impl and 2 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Mar 18 13:47:09 EDT 2010


Author: chris.laprun at jboss.com
Date: 2010-03-18 13:47:08 -0400 (Thu, 18 Mar 2010)
New Revision: 2303

Modified:
   portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/ApplicationRegistryService.java
   portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java
   portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/Util.java
   portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIAddApplicationForm.java
Log:
GTNPORTAL-917: Added possibility to browse the WSRP portlets from add portlet to category form.

Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/ApplicationRegistryService.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/ApplicationRegistryService.java	2010-03-18 14:42:38 UTC (rev 2302)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/ApplicationRegistryService.java	2010-03-18 17:47:08 UTC (rev 2303)
@@ -1,16 +1,16 @@
 /**
  * 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
@@ -25,13 +25,10 @@
 import java.util.Comparator;
 import java.util.List;
 
-/**
- * Created y the eXo platform team
- * User: Tuan Nguyen
- * Date: 20 april 2007
- */
+/** Created y the eXo platform team User: Tuan Nguyen Date: 20 april 2007 */
 public interface ApplicationRegistryService
 {
+   String REMOTE_DISPLAY_NAME_SUFFIX = " (remote)";
 
    public List<ApplicationCategory> getApplicationCategories(String accessUser, ApplicationType<?>... appTypes) throws Exception;
 
@@ -51,7 +48,7 @@
    public List<Application> getApplications(ApplicationCategory category, ApplicationType<?>... appTypes) throws Exception;
 
    public List<Application> getApplications(ApplicationCategory category, Comparator<Application> sortComparator,
-      ApplicationType<?>... appTypes) throws Exception;
+                                            ApplicationType<?>... appTypes) throws Exception;
 
    public List<Application> getAllApplications() throws Exception;
 
@@ -68,5 +65,6 @@
    public void importAllPortlets() throws Exception;
 
    //TODO: dang.tung
+
    public void importExoGadgets() throws Exception;
 }
\ No newline at end of file

Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java	2010-03-18 14:42:38 UTC (rev 2302)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java	2010-03-18 17:47:08 UTC (rev 2303)
@@ -84,7 +84,6 @@
 
    /** . */
    final POMSessionManager mopManager;
-   private static final String REMOTE_DISPLAY_NAME_SUFFIX = " (remote)";
 
    /** Should match WSRPPortletInfo.PRODUCER_NAME_META_INFO_KEY */
    private static final String PRODUCER_NAME_META_INFO_KEY = "producer-name";

Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/Util.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/Util.java	2010-03-18 14:42:38 UTC (rev 2302)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/Util.java	2010-03-18 17:47:08 UTC (rev 2303)
@@ -1,16 +1,16 @@
 /**
  * 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
@@ -26,16 +26,11 @@
 
 import java.util.Comparator;
 
-/**
- * Created by The eXo Platform SAS
- * Author : Pham Thanh Tung
- *          thanhtungty at gmail.com
- * Sep 11, 2008  
- */
+/** Created by The eXo Platform SAS Author : Pham Thanh Tung thanhtungty at gmail.com Sep 11, 2008 */
 public class Util
 {
 
-   static final public String getLocalizedStringValue(LocalizedString localizedString, String defaultValue)
+   static public String getLocalizedStringValue(LocalizedString localizedString, String defaultValue)
    {
       if (localizedString == null || localizedString.getDefaultString() == null)
       {

Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIAddApplicationForm.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIAddApplicationForm.java	2010-03-18 14:42:38 UTC (rev 2302)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIAddApplicationForm.java	2010-03-18 17:47:08 UTC (rev 2303)
@@ -25,21 +25,21 @@
 import org.exoplatform.application.registry.ApplicationCategory;
 import org.exoplatform.application.registry.ApplicationRegistryService;
 import org.exoplatform.applicationregistry.webui.Util;
+import org.exoplatform.commons.serialization.api.annotations.Serialized;
 import org.exoplatform.commons.utils.SerializablePageList;
 import org.exoplatform.container.ExoContainer;
 import org.exoplatform.container.ExoContainerContext;
 import org.exoplatform.portal.config.model.ApplicationType;
 import org.exoplatform.web.application.ApplicationMessage;
 import org.exoplatform.webui.application.WebuiRequestContext;
-import org.exoplatform.commons.serialization.api.annotations.Serialized;
 import org.exoplatform.webui.config.annotation.ComponentConfig;
 import org.exoplatform.webui.config.annotation.EventConfig;
 import org.exoplatform.webui.core.UIApplication;
 import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
 import org.exoplatform.webui.core.model.SelectItemOption;
 import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.Event.Phase;
 import org.exoplatform.webui.event.EventListener;
-import org.exoplatform.webui.event.Event.Phase;
 import org.exoplatform.webui.form.UIForm;
 import org.exoplatform.webui.form.UIFormInputInfo;
 import org.exoplatform.webui.form.UIFormInputSet;
@@ -84,9 +84,10 @@
    public UIAddApplicationForm() throws Exception
    {
       addUIFormInput(new UIFormStringInput(FIELD_NAME, null, null).addValidator(StringLengthValidator.class, 3, 30));
-      List<SelectItemOption<String>> types = new ArrayList<SelectItemOption<String>>(2);
+      List<SelectItemOption<String>> types = new ArrayList<SelectItemOption<String>>(3);
       types.add(new SelectItemOption<String>(ApplicationType.PORTLET.getName()));
       types.add(new SelectItemOption<String>(ApplicationType.GADGET.getName()));
+      types.add(new SelectItemOption<String>(ApplicationType.WSRP_PORTLET.getName()));
       UIFormSelectBox uiSelectBox = new UIFormSelectBox(FIELD_TYPE, null, types);
       uiSelectBox.setOnChange("ChangeType");
       addUIFormInput(uiSelectBox);
@@ -200,10 +201,12 @@
          //         app.setApplicationGroup(info.getApplicationName());
          ApplicationType appType;
          String contentId;
+         String displayName = Util.getLocalizedStringValue(displayNameLS, portletName);
          if (remote)
          {
             appType = ApplicationType.WSRP_PORTLET;
             contentId = portlet.getContext().getId();
+            displayName += ApplicationRegistryService.REMOTE_DISPLAY_NAME_SUFFIX;  // add remote to display name to make it more obvious that the portlet is remote
          }
          else
          {
@@ -211,7 +214,7 @@
             contentId = info.getApplicationName() + "/" + info.getName();
          }
          app.setType(appType);
-         app.setDisplayName(Util.getLocalizedStringValue(displayNameLS, portletName));
+         app.setDisplayName(displayName);
          app.setDescription(Util.getLocalizedStringValue(descriptionLS, portletName));
          app.setAccessPermissions(new ArrayList<String>());
          app.setContentId(contentId);



More information about the gatein-commits mailing list