Package org.wso2.carbon.ui.deployment.beans

Examples of org.wso2.carbon.ui.deployment.beans.CarbonUIDefinitions


        Component component = ComponentBuilder.build(bundle, bundleContext);
        if (component == null) {
            return;
        } else {
            ServiceReference reference = bundleContext.getServiceReference(CarbonUIDefinitions.class.getName());
            CarbonUIDefinitions carbonUIDefinitions = null;
            if (reference != null) {
                carbonUIDefinitions = (CarbonUIDefinitions) bundleContext.getService(reference);
            }
            if (carbonUIDefinitions != null) {
                if (log.isDebugEnabled()) {
                    log.debug("Found carbonUIDefinitions in OSGi context");
                }
                if (CarbonConstants.ADD_UI_COMPONENT.equals(action)) {
                    if (log.isDebugEnabled()) {
                        log.debug("Adding UI component using existing Carbon Definition");
                    }
                    ArrayList<Menu> menusToAdd = new ArrayList<Menu>();
          for (Menu menu : component.getMenus()) {
           
            // Prevent adding the menu if it is defined to be hidden.
            if (!(hideMenuIds.contains(menu.getId()))) {
              menusToAdd.add(menu);
            }
          }
          if(menusToAdd.size() > 0) {
            Menu[] menus = new Menu[menusToAdd.size()];
            menus = menusToAdd.toArray(menus);
            carbonUIDefinitions.addMenuItems(menus);
          }

                    carbonUIDefinitions.addServletItems(component.getServlets());
                    carbonUIDefinitions.addUnauthenticatedUrls(component.getUnauthenticatedUrlList());
                    carbonUIDefinitions.addSkipTilesUrls(component.getSkipTilesUrlList());
                    carbonUIDefinitions.addHttpUrls(component.getSkipHttpsUrlList());
                    carbonUIDefinitions.addContexts(component.getContextsList());
                } else if (CarbonConstants.REMOVE_UI_COMPONENT.equals(action)) {
                    if (log.isDebugEnabled()) {
                        log.debug("Removing UI component using existing carbon definition");
                    }
                    carbonUIDefinitions.removeMenuItems(component.getMenus());
                    carbonUIDefinitions.removeServletItems(component.getServlets());
                    carbonUIDefinitions.removeUnauthenticatedUrls(component.getUnauthenticatedUrlList());
                    carbonUIDefinitions.removeSkipTilesUrls(component.getSkipTilesUrlList());
                    carbonUIDefinitions.removeHttpUrls(component.getSkipHttpsUrlList());
                    carbonUIDefinitions.removeContexts(component.getContextsList());
                }
            } else {
                if (log.isDebugEnabled()) {
                    log.debug("CarbonUIDefinitions is NULL. Registering new...");
                }
                carbonUIDefinitions = new CarbonUIDefinitions();
                carbonUIDefinitions.addMenuItems(component.getMenus());
                carbonUIDefinitions.addServletItems(component.getServlets());
                carbonUIDefinitions.addUnauthenticatedUrls(component.getUnauthenticatedUrlList());
                carbonUIDefinitions.addSkipTilesUrls(component.getSkipTilesUrlList());
                carbonUIDefinitions.addHttpUrls(component.getSkipHttpsUrlList());
                carbonUIDefinitions.addContexts(component.getContextsList());
                bundleContext.registerService(CarbonUIDefinitions.class.getName(), carbonUIDefinitions, null);
            }
        }
        //processing servlet definitions
        processServletDefinitions(component,action);
View Full Code Here


        HashMap<String, String> urlsToBeByPassed = new HashMap<String, String>();
        if (bundle != null) {
            ServiceReference reference = bundle.getBundleContext()
                    .getServiceReference(CarbonUIDefinitions.class.getName());
            CarbonUIDefinitions carbonUIDefinitions = null;
            if (reference != null) {
                carbonUIDefinitions =
                        (CarbonUIDefinitions) bundle.getBundleContext().getService(reference);
                if (carbonUIDefinitions != null) {
                    urlsToBeByPassed = carbonUIDefinitions.getSkipTilesUrls();
                }
            }
        }

        //if the current uri is marked to be by-passed, let it pass through
View Full Code Here

                setDefaultMenus(loggedInUserName, isSuperTenant, userPermission, request);
            }
           
        String filtered = (String)request.getSession().getAttribute(MenuAdminClient.USER_MENU_ITEMS_FILTERED);
        if("false".equals(filtered)){
          CarbonUIDefinitions o = new CarbonUIDefinitions();
          Menu[] filteredMenus = o.getMenuDefinitions(loggedInUserName, isSuperTenant, userPermission, request, menus);
          menus = filteredMenus;
          request.getSession().setAttribute(USER_MENU_ITEMS,menus);
        }
        if(menus != null){
          if(log.isDebugEnabled()){
View Full Code Here

                                 ArrayList<String> userPermission,
                                 HttpServletRequest request) {
        BundleContext bundleContext = CarbonUIUtil.getBundleContext();
        if (bundleContext != null) {
            ServiceReference reference = bundleContext.getServiceReference(CarbonUIDefinitions.class.getName());
            CarbonUIDefinitions carbonUIDefinitions;
            if (reference != null) {
                carbonUIDefinitions = (CarbonUIDefinitions) bundleContext.getService(reference);
                Menu[] userMenus = carbonUIDefinitions.getMenuDefinitions(loggedInUserName,
                            isSuperTenant, userPermission,request);
                if (userMenus != null) {
                    Set<Menu> menuList = new LinkedHashSet<Menu>();
                    menuList.addAll(Arrays.<Menu>asList(userMenus));
                    Menu[] customMenus =
View Full Code Here

            //Retrieving available contexts
            Context defaultContext = null;
            Context defaultAdditionalContext = null;
            ServiceReference reference = ctxt.getBundleContext().getServiceReference(CarbonUIDefinitions.class.getName());
            CarbonUIDefinitions carbonUIDefinitions = null;
            if (reference != null) {
                carbonUIDefinitions =
                        (CarbonUIDefinitions) ctxt.getBundleContext().getService(reference);
                if (carbonUIDefinitions != null) {
                    if (carbonUIDefinitions.getContexts().containsKey("default-context")) {
                        defaultContext = carbonUIDefinitions.getContexts().get("default-context");
                    }if (carbonUIDefinitions.getContexts().containsKey("default-additional-context")) {
                        defaultAdditionalContext = carbonUIDefinitions.getContexts().get("default-additional-context");
                    }

                }
            }
View Full Code Here

        ConfigurationContext clientConfigContext = getConfigurationContextService().getClientConfigContext();
        //This is applicable only when the FE and BE runs in the same JVM.
        ConfigurationContext serverConfigContext = getConfigurationContextService().getServerConfigContext();

        CarbonUIDefinitions carbonUIDefinitions = new CarbonUIDefinitions();
        context.registerService(CarbonUIDefinitions.class.getName(), carbonUIDefinitions, null);

        // create a CustomUIDefinitions object and set it as a osgi service. UIBundleDeployer can access this
        // service and populate it with custom UI definitions of the deployed UI bundle, if available.
        CustomUIDefenitions customUIDefenitions = new CustomUIDefenitions();
View Full Code Here

    @SuppressWarnings({ "unchecked", "rawtypes" })
    private void populateUrlsToBeBypassed() {
        if (bundle != null && urlsToBeByPassed.isEmpty()) {
            ServiceReference reference = bundle.getBundleContext().getServiceReference(
                    CarbonUIDefinitions.class.getName());
            CarbonUIDefinitions carbonUIDefinitions;
            if (reference != null) {
                carbonUIDefinitions = (CarbonUIDefinitions) bundle.getBundleContext().getService(
                        reference);
                if (carbonUIDefinitions != null) {
                    urlsToBeByPassed = carbonUIDefinitions.getUnauthenticatedUrls();
                }
            }
        }
    }
View Full Code Here

        }

        public void run() {
            try {
                MessageContext msgCtx = ((Axis2MessageContext) synCtx).getAxis2MessageContext();
                Event<MessageContext> event = new Event(msgCtx);
                subscriptions = subscriptionManager.getMatchingSubscriptions(event);
            } catch (EventException e) {
                handleException("Matching subscriptions fetching error", e);
            }
View Full Code Here

     * @throws EventException event
     */
    private void processGetStatusRequest(MessageContext mc,
                                         ResponseMessageBuilder messageBuilder)
            throws AxisFault, EventException {
        Subscription subscription =
                SubscriptionMessageBuilder.createGetStatusMessage(mc);
        if (log.isDebugEnabled()) {
            log.debug("GetStatus request recived for SynapseSubscription ID : " +
                    subscription.getId());
        }
        subscription = subscriptionManager.getSubscription(subscription.getId());
        if (subscription != null) {
            if (log.isDebugEnabled()) {
                log.debug("Sending GetStatus responce for SynapseSubscription ID : " +
                        subscription.getId());
            }
            //send the responce
            SOAPEnvelope soapEnvelope = messageBuilder.genGetStatusResponse(subscription);
            dispatchResponse(soapEnvelope, EventingConstants.WSE_GET_STATUS_RESPONSE,
                    mc, false);
View Full Code Here


    public SynapseSubscription() {
        this.setId(UIDGenerator.generateURNString());
        this.setDeliveryMode(EventingConstants.WSE_DEFAULT_DELIVERY_MODE);
        SubscriptionData subscriptionData = new SubscriptionData();
        subscriptionData.setProperty(SynapseEventingConstants.STATIC_ENTRY, "false");
        this.setSubscriptionData(subscriptionData);
    }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.ui.deployment.beans.CarbonUIDefinitions

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.