Package org.exoplatform.application.registry

Examples of org.exoplatform.application.registry.Application


      category.setModifiedDate(categoryDef.getLastModificationDate());

      //
      for (ContentDefinition contentDef : categoryDef.getContentList())
      {
         Application application = load(contentDef);
         if (isApplicationType(application, appTypes))
         {
            category.getApplications().add(application);
         }
      }
View Full Code Here


      //
      ContentType<?> contentType = customization.getType();
      ApplicationType<?> applicationType = ApplicationType.getType(contentType);

      //
      Application application = new Application();
      application.setId(contentDef.getCategory().getName() + "/" + contentDef.getName());
      application.setCategoryName(contentDef.getCategory().getName());
      application.setType(applicationType);
      application.setApplicationName(contentDef.getName());
      application.setIconURL(getApplicationIconURL(contentDef));
      application.setDisplayName(contentDef.getDisplayName());
      application.setDescription(contentDef.getDescription());
      application.setAccessPermissions(new ArrayList<String>(contentDef.getAccessPermissions()));
      application.setCreatedDate(contentDef.getCreationDate());
      application.setModifiedDate(contentDef.getLastModificationDate());
      application.setStorageId(customization.getId());
      application.setContentId(customization.getContentId());
      return application;
   }
View Full Code Here

         GadgetRegistryService gadgetService = getApplicationComponent(GadgetRegistryService.class);
         List<Gadget> gadgets = gadgetService.getAllGadgets();
         List<Application> applications = new ArrayList<Application>(gadgets.size());
         for (Gadget gadget : gadgets)
         {
            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>());
            applications.add(app);
         }
         return applications;
      }
View Full Code Here

         LocalizedString descriptionLS = info.getMeta().getMetaValue(MetaInfo.DESCRIPTION);
         LocalizedString displayNameLS = info.getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);

         String portletName = info.getName();
         Application app = new Application();
         app.setApplicationName(portletName);
         //         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
         {
            appType = ApplicationType.PORTLET;
            contentId = info.getApplicationName() + "/" + info.getName();
         }
         app.setType(appType);
         app.setDisplayName(displayName);
         app.setDescription(Util.getLocalizedStringValue(descriptionLS, portletName));
         app.setAccessPermissions(new ArrayList<String>());
         app.setContentId(contentId);
         applications.add(app);
      }

      return applications;
   }
View Full Code Here

         {
            ctx.getUIApplication().addMessage(new ApplicationMessage("UIAddApplicationForm.msg.appNotExists", null));
            ctx.addUIComponentToUpdateByAjax(uiOrganizer);
            return;
         }
         Application tmp = uiForm.getApplications().get(Integer.parseInt(uiRadio.getValue()));

         // check portet name is exist
         if (appRegService.getApplication(selectedCate.getName(), tmp.getApplicationName()) != null)
         {
            WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
            UIApplication uiApp = context.getUIApplication();
            uiApp.addMessage(new ApplicationMessage("UIAddApplicationForm.msg.PortletExist", null));
            return;
         }

         Application app = cloneApplication(tmp);
         UIApplicationRegistryPortlet.setPermissionToEveryone(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

         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

            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);
      uiApplicationOrganizer.reload();
      uiApplicationOrganizer.setSelectedApplication(selectedApplication);
   }
View Full Code Here

                    if (accessPers == null || accessPers.length == 0)
                        accessPers = new String[] { UserACL.EVERYONE };
                    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);
                    // Only setting title for Gadgets as it's using Portlet wrapper for displaying
                    if (app.getType().equals(ApplicationType.GADGET)) {
                        uiPortlet.setTitle(app.getDisplayName());
                    }
                    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);
View Full Code Here

        category.setCreatedDate(categoryDef.getCreationDate());
        category.setModifiedDate(categoryDef.getLastModificationDate());

        //
        for (ContentDefinition contentDef : categoryDef.getContentList()) {
            Application application = load(contentDef);
            if (isApplicationType(application, appTypes)) {
                category.getApplications().add(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.