Package org.exoplatform.application.registry

Examples of org.exoplatform.application.registry.Application


                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
            for (Application application : appRegService.getApplications(selectedCate)) {
                if (application.getContentId().equals(tmp.getContentId())) {
                    ctx.getUIApplication().addMessage(new ApplicationMessage("UIAddApplicationForm.msg.PortletExist", null));
                    return;
                }
            }

            Application app = cloneApplication(tmp);
            UIApplicationRegistryPortlet.setPermissionToAdminGroup(app);

            if (displayName != null && displayName.trim().length() > 0) {
                app.setDisplayName(displayName);
            }

            appRegService.save(selectedCate, app);
            uiOrganizer.reload();
            uiOrganizer.setSelectedCategory(selectedCate.getName());
            uiOrganizer.selectApplication(app.getApplicationName());
            ctx.addUIComponentToUpdateByAjax(uiOrganizer);
        }
View Full Code Here


            uiOrganizer.selectApplication(app.getApplicationName());
            ctx.addUIComponentToUpdateByAjax(uiOrganizer);
        }

        private Application cloneApplication(Application app) {
            Application newApp = new Application();
            newApp.setApplicationName(app.getApplicationName());
            newApp.setDisplayName(app.getDisplayName());
            newApp.setType(app.getType());
            newApp.setDescription(app.getDescription());
            newApp.setAccessPermissions(app.getAccessPermissions());
            newApp.setContentId(app.getContentId());
            return newApp;
        }
View Full Code Here

        private void removeFromApplicationRegistry(String name) throws Exception {
            ApplicationRegistryService appRegService = org.exoplatform.portal.webui.util.Util.getUIPortalApplication()
                    .getApplicationComponent(ApplicationRegistryService.class);
            List<ApplicationCategory> cates = appRegService.getApplicationCategories();
            for (ApplicationCategory cate : cates) {
                Application app = appRegService.getApplication(cate.getName(), name);
                if (app != null)
                    appRegService.remove(app);
            }
        }
View Full Code Here

            UIApplication uiApp = ctx.getUIApplication();
            uiApp.addMessage(new ApplicationMessage("application.msg.changeNotExist", null));
            return;
        }
        service.update(application_);
        Application selectedApplication = getApplication();
        UIApplicationOrganizer uiApplicationOrganizer = getAncestorOfType(UIApplicationOrganizer.class);
        ApplicationCategory selectedCategory = uiApplicationOrganizer.getSelectedCategory();
        uiApplicationOrganizer.reload();
        uiApplicationOrganizer.setSelectedCategory(selectedCategory);
        uiApplicationOrganizer.setSelectedApplication(selectedApplication);
View Full Code Here

            }

            Gadget gadget = gadgetInfo.getGadget();
            gadgetInfo.removeChild(UICategorySelector.class);
            UICategorySelector selector = gadgetInfo.addChild(UICategorySelector.class, null, CATEGORY_ID);
            Application app = new Application();
            app.setApplicationName(gadget.getName());
            app.setType(ApplicationType.GADGET);
            app.setDisplayName(gadget.getTitle());
            app.setContentId(gadget.getName());
            String description = (gadget.getDescription() == null || gadget.getDescription().length() < 1) ? gadget.getName()
                    : gadget.getDescription();
            app.setDescription(description);
            app.setAccessPermissions(new ArrayList<String>());

            selector.setApplication(app);
            selector.setRendered(true);
            event.getRequestContext().addUIComponentToUpdateByAjax(event.getSource());
        }
View Full Code Here

        public void execute(Event<UIApplicationForm> event) throws Exception {
            UIApplicationForm uiForm = event.getSource();
            WebuiRequestContext ctx = event.getRequestContext();
            UIApplicationOrganizer uiOrganizer = uiForm.getParent();
            ApplicationRegistryService service = uiForm.getApplicationComponent(ApplicationRegistryService.class);
            Application application = uiForm.getApplication();
            if (service.getApplication(application.getId()) == null) {
                UIApplication uiApp = ctx.getUIApplication();
                uiApp.addMessage(new ApplicationMessage("application.msg.changeNotExist", null));
                uiOrganizer.reload();
                uiOrganizer.setSelectedCategory(application.getCategoryName());
                ctx.addUIComponentToUpdateByAjax(uiOrganizer);
                return;
            }
            uiForm.invokeSetBindingBean(application);
            application.setModifiedDate(Calendar.getInstance().getTime());
            String displayName = application.getDisplayName();
            if (displayName == null || displayName.trim().length() < 1) {
                application.setDisplayName(application.getApplicationName());
            }
            service.update(application);
            ApplicationCategory selectedCat = uiOrganizer.getSelectedCategory();
            uiOrganizer.reload();
            uiOrganizer.setSelectedCategory(selectedCat);
View Full Code Here

               uiContainer.setAccessPermissions(accessPers);
               uiSource = uiContainer;
            }
            else
            {
               Application app = null;
               UIApplicationList appList = uiApp.findFirstComponentOfType(UIApplicationList.class);
               app = appList.getApplication(sourceId);
               ApplicationType applicationType = app.getType();

               //
               UIPortlet uiPortlet = uiTarget.createUIComponent(UIPortlet.class, null, null);
               if (app.getDisplayName() != null)
               {
                  uiPortlet.setTitle(app.getDisplayName());
               }
               else if (app.getApplicationName() != null)
               {
                  uiPortlet.setTitle(app.getApplicationName());
               }
               uiPortlet.setDescription(app.getDescription());
               List<String> accessPersList = app.getAccessPermissions();
               String[] accessPers = accessPersList.toArray(new String[accessPersList.size()]);
               for (String accessPer : accessPers)
               {
                  if (accessPer.equals(""))
                     accessPers = null;
               }
               if (accessPers == null || accessPers.length == 0)
                  accessPers = new String[]{UserACL.EVERYONE};
               uiPortlet.setAccessPermissions(accessPers);
               UIPage uiPage = uiTarget.getAncestorOfType(UIPage.class);

               // Hardcode on state to fix error while drag/drop Dashboard
               if ("dashboard/DashboardPortlet".equals(app.getContentId()))
               {
                  TransientApplicationState state = new TransientApplicationState<Object>(app.getContentId());
                  uiPortlet.setState(new PortletState(state, applicationType));
               }
               else
               {
                  ApplicationState state;
                  // if we have a new portlet added to the page we need for it to have its own state.
                  // otherwise all new portlets added to a page will have the same state.
                  if (newComponent)
                  {
                     state = new TransientApplicationState<Object>(app.getContentId());
                  }
                  // if the portlet is not new, then we should clone it from the original portlet
                  else
                  {
                     state = new CloneApplicationState<Object>(app.getStorageId());
                  }
                  uiPortlet.setState(new PortletState(state, applicationType));
               }
               uiPortlet.setPortletInPortal(uiTarget instanceof UIPortal);
               uiPortlet.setShowEditControl(true);
View Full Code Here

      {
         UIPortletInfo uiPortletInfo = event.getSource();
         PortletExtra portlet = uiPortletInfo.getPortlet();
         uiPortletInfo.removeChild(UICategorySelector.class);
         UICategorySelector selector = uiPortletInfo.addChild(UICategorySelector.class, null, CATEGORY_ID);
         Application app = new Application();
         app.setApplicationName(portlet.getName());
         app.setType(ApplicationType.PORTLET);
         app.setDisplayName(portlet.getDisplayName());
         app.setContentId(portlet.getId());
         app.setAccessPermissions(new ArrayList<String>());
        
         selector.setApplication(app);
         selector.setRendered(true);
      }
View Full Code Here

         }
        
         Gadget gadget = gadgetInfo.getGadget();
         gadgetInfo.removeChild(UICategorySelector.class);
         UICategorySelector selector = gadgetInfo.addChild(UICategorySelector.class, null, CATEGORY_ID);
         Application app = new Application();
         app.setApplicationName(gadget.getName());
         app.setType(ApplicationType.GADGET);
         app.setDisplayName(gadget.getTitle());
         app.setContentId(gadget.getName());
         String description =
            (gadget.getDescription() == null || gadget.getDescription().length() < 1) ? gadget.getName() : gadget
               .getDescription();
         app.setDescription(description);
         app.setAccessPermissions(new ArrayList<String>());
        
         selector.setApplication(app);
         selector.setRendered(true);
         event.getRequestContext().addUIComponentToUpdateByAjax(event.getSource());
      }
View Full Code Here

      {
         UIApplicationForm uiForm = event.getSource();
         WebuiRequestContext ctx = event.getRequestContext();
         UIApplicationOrganizer uiOrganizer = uiForm.getParent();
         ApplicationRegistryService service = uiForm.getApplicationComponent(ApplicationRegistryService.class);
         Application application = uiForm.getApplication();
         if (service.getApplication(application.getId()) == null)
         {
            UIApplication uiApp = ctx.getUIApplication();
            uiApp.addMessage(new ApplicationMessage("application.msg.changeNotExist", null));
            uiOrganizer.reload();
            uiOrganizer.setSelectedCategory(application.getCategoryName());
            ctx.addUIComponentToUpdateByAjax(uiOrganizer);
            ctx.addUIComponentToUpdateByAjax(uiApp.getUIPopupMessages());
            return;
         }
         uiForm.invokeSetBindingBean(application);
         application.setModifiedDate(Calendar.getInstance().getTime());
         String displayName = application.getDisplayName();
         if (displayName == null || displayName.trim().length() < 1)
         {
            application.setDisplayName(application.getApplicationName());
         }
         service.update(application);
         //uiOrganizer.setSelectedApplication(uiOrganizer.getSelectedApplication());
         uiOrganizer.reload();
         uiOrganizer.setSelectedApplication(application);
View Full Code Here

TOP

Related Classes of org.exoplatform.application.registry.Application

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.