Package org.exoplatform.application.registry

Examples of org.exoplatform.application.registry.ApplicationRegistryService


      public void execute(Event<UIApplicationOrganizer> event) throws Exception
      {
         String categoryName = event.getRequestContext().getRequestParameter(OBJECTID);
         WebuiRequestContext ctx = event.getRequestContext();
         UIApplicationOrganizer uiOrganizer = event.getSource();
         ApplicationRegistryService service = uiOrganizer.getApplicationComponent(ApplicationRegistryService.class);
         ApplicationCategory existingCate = service.getApplicationCategory(categoryName);
         if (existingCate == null)
         {
            UIApplication uiApp = ctx.getUIApplication();
            uiApp.addMessage(new ApplicationMessage("UIOrganizer.msg.categoryNoExist", null));
            uiOrganizer.reload();
View Full Code Here


   {

      public void execute(Event<UIApplicationOrganizer> event) throws Exception
      {
         UIApplicationOrganizer uiOrganizer = event.getSource();
         ApplicationRegistryService service = uiOrganizer.getApplicationComponent(ApplicationRegistryService.class);

         service.importAllPortlets();
         service.importExoGadgets();
         uiOrganizer.reload();
         event.getRequestContext().addUIComponentToUpdateByAjax(uiOrganizer);
      }
View Full Code Here

      {
         WebuiRequestContext ctx = event.getRequestContext();
         String appName = ctx.getRequestParameter(OBJECTID);
         UIApplicationOrganizer uiOrganizer = event.getSource();
         Application selectedApp = uiOrganizer.getApplication(appName);
         ApplicationRegistryService service = uiOrganizer.getApplicationComponent(ApplicationRegistryService.class);
         String selectedAppId = selectedApp.getId();
         if (service.getApplication(selectedAppId) == null)
         {
            UIApplication uiApp = ctx.getUIApplication();
            uiApp.addMessage(new ApplicationMessage("UIOrganizer.msg.applicationNoExist", null));
            ApplicationCategory selectedCategory = uiOrganizer.getSelectedCategory();
            if (service.getApplicationCategory(selectedCategory.getName()) != null)
            {
               uiOrganizer.setSelectedCategory(selectedCategory);
            }
            else
            {
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

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

      UIFormInputSet uiInputSet;
      UIFormCheckBoxInput<Boolean> checkBoxInput;
      UIFormInputInfo uiInfo;

      //
      ApplicationRegistryService appRegService = getApplicationComponent(ApplicationRegistryService.class);
      List<ApplicationCategory> categories = getAllCategories();
      List<UIFormInputSet> uiInputSetList = new ArrayList<UIFormInputSet>();
      for (ApplicationCategory category : categories)
      {
         uiInputSet = new UIFormInputSet(category.getName());
         boolean defaultValue = false;
         if (application != null)
         {
            String definitionName = application.getDisplayName().replace(' ', '_');
            defaultValue = appRegService.getApplication(category.getName(), definitionName) != null;
         }
         checkBoxInput = new UIFormCheckBoxInput<Boolean>("category_" + category.getName(), null, defaultValue);
         uiInfo = new UIFormInputInfo("categoryName", null, category.getDisplayName());
         uiInputSet.addChild(checkBoxInput);
         uiInputSet.addChild(uiInfo);
View Full Code Here

   static public class SaveActionListener extends EventListener<UICategorySelector>
   {
      public void execute(Event<UICategorySelector> event) throws Exception
      {
         UICategorySelector selector = event.getSource();
         ApplicationRegistryService appRegService = selector.getApplicationComponent(ApplicationRegistryService.class);
         List<ApplicationCategory> categories = appRegService.getApplicationCategories();
         categories = categories != null ? categories : new ArrayList<ApplicationCategory>();
         UIFormCheckBoxInput<Boolean> chkInput;
         for (ApplicationCategory category : categories)
         {
            chkInput = selector.getUIInput("category_" + category.getName());
            if (chkInput != null && chkInput.isChecked())
            {
               Application newApp = cloneApplication(selector.getApplication());
               UIApplicationRegistryPortlet.setPermissionToEveryone(newApp);
               appRegService.save(category, newApp);
            }
         }
         UIContainer appInfo = selector.getParent();
         appInfo.getChild(UICategorySelector.class).setRendered(false);
         UIApplicationRegistryPortlet uiPortlet = appInfo.getAncestorOfType(UIApplicationRegistryPortlet.class);
View Full Code Here

    public ApplicationCategory getSelectedCategory() {
        return selectedCategory;
    }

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

        String remoteUser = ((WebuiRequestContext) WebuiRequestContext.getCurrentInstance()).getRemoteUser();
        List<ApplicationCategory> listCategories = new ArrayList<ApplicationCategory>();

        Iterator<ApplicationCategory> appCateIte = service.getApplicationCategories(remoteUser, ApplicationType.GADGET)
                .iterator();
        while (appCateIte.hasNext()) {
            ApplicationCategory cate = appCateIte.next();
            for (String p : cate.getAccessPermissions()) {
                if (acl.hasPermission(p)) {
View Full Code Here

            }
            int col = Integer.parseInt(context.getRequestParameter(COLINDEX));
            int row = Integer.parseInt(context.getRequestParameter(ROWINDEX));
            String objectId = context.getRequestParameter(UIComponent.OBJECTID);

            ApplicationRegistryService service = uiDashboard.getApplicationComponent(ApplicationRegistryService.class);
            Application application = service.getApplication(objectId);
            if (application == null) {
                UIApplication uiApplication = context.getUIApplication();
                uiApplication.addMessage(new ApplicationMessage("UIDashboard.msg.ApplicationNotExisted", null));
                context.setAttribute(UIDashboard.APP_NOT_EXIST, true);
                return;
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.