Package org.exoplatform.application.registry

Examples of org.exoplatform.application.registry.ApplicationRegistryService


   private ApplicationCategory selectedCategory;

   public UIApplicationList() throws Exception
   {
      ApplicationRegistryService service = getApplicationComponent(ApplicationRegistryService.class);
      String remoteUser = Util.getPortalRequestContext().getRemoteUser();
      if (remoteUser == null || remoteUser.equals(""))
         return;
      UserACL userACL = Util.getUIPortalApplication().getApplicationComponent(UserACL.class);

      PortletComparator portletComparator = new PortletComparator();
      categories = service.getApplicationCategories(remoteUser);

      Iterator<ApplicationCategory> cateItr = categories.iterator();
      while (cateItr.hasNext())
      {
         ApplicationCategory cate = cateItr.next();
View Full Code Here


      public void execute(Event<UIAddApplicationForm> event) throws Exception
      {
         UIAddApplicationForm uiForm = event.getSource();
         UIApplicationOrganizer uiOrganizer = uiForm.getParent();
         WebuiRequestContext ctx = event.getRequestContext();
         ApplicationRegistryService appRegService = uiForm.getApplicationComponent(ApplicationRegistryService.class);
         ApplicationCategory selectedCate = uiOrganizer.getSelectedCategory();
         if (appRegService.getApplicationCategory(selectedCate.getName()) == null)
         {
            uiOrganizer.reload();
            UIApplication uiApp = ctx.getUIApplication();
            uiApp.addMessage(new ApplicationMessage("category.msg.changeNotExist", null));
            ctx.addUIComponentToUpdateByAjax(uiOrganizer);
            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;
         }
         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(uiManagement);
      }

      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

      ArrayList<String> pers = new ArrayList<String>();
      if (uiListPermissionSelector.getValue() != null)
         for (String per : uiListPermissionSelector.getValue())
            pers.add(per);
      application_.setAccessPermissions(pers);
      ApplicationRegistryService service = getApplicationComponent(ApplicationRegistryService.class);
      application_.setModifiedDate(Calendar.getInstance().getTime());
      WebuiRequestContext ctx = WebuiRequestContext.getCurrentInstance();
      if (service.getApplication(application_.getId()) == null)
      {
         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

      return null;
   }

   public String getCategorieNames() throws Exception
   {
      ApplicationRegistryService appRegService = getApplicationComponent(ApplicationRegistryService.class);
      List<ApplicationCategory> allCategories = appRegService.getApplicationCategories();
      List<String> nameList = new ArrayList<String>();

      for (ApplicationCategory category : allCategories)
      {
         if (appRegService.getApplication(category.getName(), gadget_.getName()) != null)
         {
            nameList.add(category.getDisplayName());
         }
      }
      StringBuffer names = new StringBuffer("");
View Full Code Here

      return selectedCategory;
   }

   public final List<ApplicationCategory> getCategories() throws Exception
   {
      ApplicationRegistryService service = getApplicationComponent(ApplicationRegistryService.class);

      String remoteUser = ((WebuiRequestContext)WebuiRequestContext.getCurrentInstance()).getRemoteUser();
      List<ApplicationCategory> listCategories =
         service.getApplicationCategories(remoteUser, ApplicationType.GADGET);

      Iterator<ApplicationCategory> appCateIte = listCategories.iterator();
      while (appCateIte.hasNext())
      {
         ApplicationCategory cate = appCateIte.next();
View Full Code Here

        String remoteUser = Util.getPortalRequestContext().getRemoteUser();
        if (remoteUser == null || remoteUser.equals("")) {
            return;
        }

        ApplicationRegistryService service = getApplicationComponent(ApplicationRegistryService.class);
        UserACL userACL = getApplicationComponent(UserACL.class);

        final Comparator<Application> appComparator = new Comparator<Application>() {
            public int compare(Application p_1, Application p_2) {
                return p_1.getDisplayName().compareToIgnoreCase(p_2.getDisplayName());
            }
        };
        final Comparator<ApplicationCategory> cateComparator = new Comparator<ApplicationCategory>() {
            public int compare(ApplicationCategory p_1, ApplicationCategory p_2) {
                return p_1.getDisplayName(true).compareToIgnoreCase(p_2.getDisplayName(true));
            }
        };

        List<ApplicationCategory> allCategories = service.getApplicationCategories(remoteUser);
        categories = new ArrayList<ApplicationCategory>();

        for (ApplicationCategory category : allCategories) {
            List<Application> apps = category.getApplications();
            List<String> accessPermission = category.getAccessPermissions();
View Full Code Here

                    UIApplication uiApp = event.getRequestContext().getUIApplication();
                    uiApp.addMessage(new ApplicationMessage("UIOrganizer.msg.deleteCategoryInUse", null));
                    return;
                }
            }
            ApplicationRegistryService service = uiOrganizer.getApplicationComponent(ApplicationRegistryService.class);
            if (service.getApplicationCategory(name) != null) {
                service.remove(uiOrganizer.getCategory(name));
            }
            uiOrganizer.reload();
            event.getRequestContext().addUIComponentToUpdateByAjax(uiOrganizer);
        }
View Full Code Here

                    UIApplication uiApp = event.getRequestContext().getUIApplication();
                    uiApp.addMessage(new ApplicationMessage("UIOrganizer.msg.deleteApplicationInUse", null));
                    return;
                }
            }
            ApplicationRegistryService service = uiOrganizer.getApplicationComponent(ApplicationRegistryService.class);
            Application app = uiOrganizer.getApplication(appName);
            if (service.getApplication(app.getId()) != null) {
                service.remove(app);
            }
            String cateName = uiOrganizer.getSelectedCategory().getName();
            uiOrganizer.reload();
            uiOrganizer.setSelectedCategory(cateName);
            event.getRequestContext().addUIComponentToUpdateByAjax(uiOrganizer);
View Full Code Here

        init();
    }

    public List<ApplicationCategory> getAllCategories() {
        try {
            ApplicationRegistryService appRegService = getApplicationComponent(ApplicationRegistryService.class);
            List<ApplicationCategory> categories = appRegService.getApplicationCategories(new Util.CategoryComparator());
            categories = categories != null ? categories : new ArrayList<ApplicationCategory>();
            return categories;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
View Full Code Here

TOP

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

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.