Package org.exoplatform.application.registry

Examples of org.exoplatform.application.registry.ApplicationCategory


        public void execute(Event<UIApplicationOrganizer> event) throws Exception {
            UIApplicationOrganizer uiOrganizer = event.getSource();
            String name = event.getRequestContext().getRequestParameter(OBJECTID);
            UICategoryForm uiCategoryForm = uiOrganizer.getChild(UICategoryForm.class);
            if (uiCategoryForm != null) {
                ApplicationCategory edittingCategory = uiCategoryForm.getCategory();
                if (edittingCategory != null && edittingCategory.getName().equals(name)) {
                    UIApplication uiApp = event.getRequestContext().getUIApplication();
                    uiApp.addMessage(new ApplicationMessage("UIOrganizer.msg.deleteCategoryInUse", null));
                    return;
                }
            }
View Full Code Here


        public void execute(Event<UICategoryForm> event) throws Exception {
            UICategoryForm uiForm = event.getSource();
            WebuiRequestContext ctx = event.getRequestContext();
            UIApplicationOrganizer uiOrganizer = uiForm.getParent();
            ApplicationRegistryService service = uiForm.getApplicationComponent(ApplicationRegistryService.class);
            ApplicationCategory category = uiForm.getCategory();
            boolean isCreateNew = category == null;
            if (isCreateNew) {
                category = new ApplicationCategory();
            }
            UIFormInputSet uiSetting = uiForm.getChildById(FIELD_SETTING);
            UIFormInputSet uiPermission = uiForm.getChildById(FIELD_PERMISSION);
            category.setName(uiSetting.getUIStringInput(FIELD_NAME).getValue());
            String displayName = uiSetting.getUIStringInput(FIELD_DISPLAY_NAME).getValue();
            category.setDisplayName(displayName);

            category.setDescription(uiSetting.getUIFormTextAreaInput(FIELD_DESCRIPTION).getValue());

            UIListPermissionSelector uiListPermissionSelector = uiPermission.getChild(UIListPermissionSelector.class);
            ArrayList<String> pers = new ArrayList<String>();
            if (uiListPermissionSelector.getValue() != null) {
                for (String per : uiListPermissionSelector.getValue()) {
                    pers.add(per);
                }
            }
            category.setAccessPermissions(pers);
            ApplicationCategory existCategory = service.getApplicationCategory(category.getName());
            if (!isCreateNew) {
                if (existCategory == null) {
                    uiOrganizer.reload();
                    UIApplication uiApp = ctx.getUIApplication();
                    uiApp.addMessage(new ApplicationMessage("category.msg.changeNotExist", null));
View Full Code Here

        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();
                return;
View Full Code Here

            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 {
                    uiOrganizer.reload();
                }
                return;
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;
            }

            if (uiForm.getApplications().size() == 0) {
                ctx.getUIApplication().addMessage(new ApplicationMessage("UIAddApplicationForm.msg.appNotExists", null));
                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

            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

            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);
            uiOrganizer.setSelectedApplication(application);
            ctx.addUIComponentToUpdateByAjax(uiOrganizer);
        }
View Full Code Here

      {
         UICategoryForm uiForm = event.getSource();
         WebuiRequestContext ctx = event.getRequestContext();
         UIApplicationOrganizer uiOrganizer = uiForm.getParent();
         ApplicationRegistryService service = uiForm.getApplicationComponent(ApplicationRegistryService.class);
         ApplicationCategory category = uiForm.getCategory();
         boolean isCreateNew = category == null;
         if (isCreateNew)
         {
            category = new ApplicationCategory();
         }
         UIFormInputSet uiSetting = uiForm.getChildById(FIELD_SETTING);
         UIFormInputSet uiPermission = uiForm.getChildById(FIELD_PERMISSION);
         category.setName(uiSetting.getUIStringInput(FIELD_NAME).getValue());
         String displayName = uiSetting.getUIStringInput(FIELD_DISPLAY_NAME).getValue();
         if (displayName == null || displayName.length() < 1)
         {
            category.setDisplayName(category.getName());
         }
         else
         {
            category.setDisplayName(displayName);
         }
         category.setDescription(uiSetting.getUIFormTextAreaInput(FIELD_DESCRIPTION).getValue());

         UIListPermissionSelector uiListPermissionSelector = uiPermission.getChild(UIListPermissionSelector.class);
         ArrayList<String> pers = new ArrayList<String>();
         if (uiListPermissionSelector.getValue() != null)
         {
            for (String per : uiListPermissionSelector.getValue())
            {
               pers.add(per);
            }
         }
         category.setAccessPermissions(pers);
         ApplicationCategory existCategory = service.getApplicationCategory(category.getName());
         if (!isCreateNew)
         {
            if (existCategory == null)
            {
               uiOrganizer.reload();
View Full Code Here

      {
         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

         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

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.