Package org.exoplatform.application.registry

Examples of org.exoplatform.application.registry.ApplicationCategory


      ContentRegistry registry = getContentRegistry();

      //
      for (CategoryDefinition categoryDef : registry.getCategoryList())
      {
         ApplicationCategory category = load(categoryDef, appTypes);
         categories.add(category);
      }

      //
      if (sortComparator != null)
View Full Code Here


      //
      CategoryDefinition categoryDef = registry.getCategory(name);
      if (categoryDef != null)
      {
         ApplicationCategory applicationCategory = load(categoryDef);
         return applicationCategory;
      }

      //
      return null;
View Full Code Here

      categoryDef.setLastModificationDate(category.getModifiedDate());
   }

   private ApplicationCategory load(CategoryDefinition categoryDef, ApplicationType<?>... appTypes)
   {
      ApplicationCategory category = new ApplicationCategory();

      //
      category.setName(categoryDef.getName());
      category.setDisplayName(categoryDef.getDisplayName());
      category.setDescription(categoryDef.getDescription());
      category.setAccessPermissions(new ArrayList<String>(categoryDef.getAccessPermissions()));
      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);
         }
      }

      //
      return category;
View Full Code Here

      categories = service.getApplicationCategories(remoteUser);

      Iterator<ApplicationCategory> cateItr = categories.iterator();
      while (cateItr.hasNext())
      {
         ApplicationCategory cate = cateItr.next();
         List<Application> applications = cate.getApplications();
         boolean hasPermission = false;
         List<String> accessPermission = cate.getAccessPermissions();
         if (accessPermission == null)
         {
            accessPermission = new ArrayList<String>();
         }
         if (accessPermission.size() == 0)
View Full Code Here

      {
         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

         // update to ApplicationOrganizer
         removeFromApplicationRegistry(name);
         UIApplicationOrganizer uiOrganizer =
            uiManagement.getParent().findFirstComponentOfType(UIApplicationOrganizer.class);
         ApplicationCategory selectedCate = uiOrganizer.getSelectedCategory();
         uiOrganizer.reload();
         uiOrganizer.setSelectedCategory(selectedCate);

         ctx.addUIComponentToUpdateByAjax(uiManagement);
      }
View Full Code Here

         service.getApplicationCategories(remoteUser, ApplicationType.GADGET);

      Iterator<ApplicationCategory> appCateIte = listCategories.iterator();
      while (appCateIte.hasNext())
      {
         ApplicationCategory cate = appCateIte.next();
         List<Application> listGadgets = cate.getApplications();
         if (listGadgets == null || listGadgets.size() == 0)
         {
            appCateIte.remove();
            continue;
         }
View Full Code Here

        //
        ContentRegistry registry = getContentRegistry();

        //
        for (CategoryDefinition categoryDef : registry.getCategoryList()) {
            ApplicationCategory category = load(categoryDef, appTypes);
            categories.add(category);
        }

        //
        if (sortComparator != null) {
View Full Code Here

        ContentRegistry registry = getContentRegistry();

        //
        CategoryDefinition categoryDef = registry.getCategory(name);
        if (categoryDef != null) {
            ApplicationCategory applicationCategory = load(categoryDef);
            return applicationCategory;
        }

        //
        return null;
View Full Code Here

        categoryDef.setCreationDate(category.getCreatedDate());
        categoryDef.setLastModificationDate(category.getModifiedDate());
    }

    private ApplicationCategory load(CategoryDefinition categoryDef, ApplicationType<?>... appTypes) {
        ApplicationCategory category = new ApplicationCategory();

        //
        category.setName(categoryDef.getName());
        category.setDisplayName(categoryDef.getDisplayName());
        category.setDescription(categoryDef.getDescription());
        category.setAccessPermissions(new ArrayList<String>(categoryDef.getAccessPermissions()));
        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);
            }
        }

        //
        return category;
View Full Code Here

TOP

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

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.