Package org.apache.geronimo.management.geronimo.WebManager

Examples of org.apache.geronimo.management.geronimo.WebManager.ConnectorType


            String connectorType = actionRequest.getParameter(PARM_CONNECTOR_TYPE);
            actionResponse.setRenderParameter(PARM_CONNECTOR_TYPE, connectorType);
        } else if(mode.equals("add")) { // User just submitted the form to add a new connector
            // Create and configure the connector
            WebManager manager = PortletManager.getWebManager(actionRequest, new AbstractName(URI.create(managerURI)));
            ConnectorType connectorType = new ConnectorType(actionRequest.getParameter(PARM_CONNECTOR_TYPE));
           
            String uniqueName = actionRequest.getParameter(PARM_DISPLAY_NAME);
            actionResponse.setRenderParameter(PARM_DISPLAY_NAME, uniqueName);
            // set the connector attributes from the form post
            List<ConnectorAttribute> connectorAttributes = manager.getConnectorAttributes(connectorType);
            for (ConnectorAttribute attribute : connectorAttributes) {
                String name = attribute.getAttributeName();
                String value = actionRequest.getParameter(name);
               
                // handle booelan type special
                if (attribute.getAttributeClass().equals(Boolean.class)) {
                    // browser sends value of checked checkbox as "on" or "checked"
                    if ("on".equalsIgnoreCase(value) || "checked".equalsIgnoreCase(value)) {
                        value=Boolean.toString(true);
                    } else {
                        value=Boolean.toString(false);
                    }
                }
                // set the string form of the attribute's value as submitted by the browser
                if (value == null || value.trim().length()<1) {
                    // special case for KeystoreManager gbean
                    if ("trustStore".equals(attribute.getAttributeName())) {
                        attribute.setValue(null);
                    }
                } else {
                    attribute.setStringValue(value.trim());
                }
            }
            // create the connector gbean based on the configuration data
            AbstractName newConnectorName = manager.getConnectorConfiguration(connectorType, connectorAttributes, webContainer, uniqueName);
           
            // set the keystore properties if its a secure connector
            setKeystoreProperties(actionRequest, newConnectorName);
           
            // Start the connector
            try {
                GeronimoManagedBean managedBean = PortletManager.getManagedBean(actionRequest, newConnectorName);
                managedBean.startRecursive();
            } catch (Exception e) {
                log.error("Unable to start connector", e); //TODO: get into rendered page
            }
            actionResponse.setRenderParameter(PARM_MODE, "list");
        } else if(mode.equals("save")) { // User just submitted the form to update a connector
            // Get submitted values
            //todo: lots of validation
            String connectorURI = actionRequest.getParameter(PARM_CONNECTOR_URI);
            // Identify and update the connector
            AbstractName connectorName = new AbstractName(URI.create(connectorURI));
            NetworkConnector connector = PortletManager.getNetworkConnector(actionRequest, connectorName);
            if(connector != null) {
                WebManager manager = PortletManager.getWebManager(actionRequest, new AbstractName(URI.create(managerURI)));
                ConnectorType connectorType = manager.getConnectorType(connectorName);
               
                // set the connector attributes from the form post
                for (ConnectorAttribute attribute : manager.getConnectorAttributes(connectorType)) {
                    String name = attribute.getAttributeName();
                    String value = actionRequest.getParameter(name);
View Full Code Here


            renderRequest.setAttribute(PARM_SERVER, server);

            if(mode.equals("new")) {
                String connectorType = renderRequest.getParameter(PARM_CONNECTOR_TYPE);
                WebManager webManager = PortletManager.getWebManager(renderRequest, new AbstractName(URI.create(managerURI)));
                ConnectorType type = new ConnectorType(connectorType);
                List<ConnectorAttribute> connectorAttributes = webManager.getConnectorAttributes(type);
                sortConnectorAttributes(connectorAttributes);
                renderRequest.setAttribute(PARM_CONNECTOR_ATTRIBUTES, connectorAttributes);
                renderRequest.setAttribute(PARM_CONNECTOR_TYPE, connectorType);
                renderRequest.setAttribute(PARM_MODE, "add");
                populateEnumAttributes(renderRequest);
                editConnectorView.include(renderRequest, renderResponse);
            } else if(mode.equals("edit")) {
                String connectorURI = renderRequest.getParameter(PARM_CONNECTOR_URI);
                NetworkConnector connector = PortletManager.getNetworkConnector(renderRequest, new AbstractName(URI.create(connectorURI)));
                if(connector == null) {
                    doList(renderRequest, renderResponse);
                } else {
                    AbstractName connectorName = new AbstractName(URI.create(connectorURI));
                    String uniqueName = connectorName.getName().get("name").toString();
                    renderRequest.setAttribute(PARM_DISPLAY_NAME, uniqueName);
                    WebManager webManager = PortletManager.getWebManager(renderRequest, new AbstractName(URI.create(managerURI)));
                    ConnectorType connectorType = webManager.getConnectorType(connectorName);
                    List<ConnectorAttribute> connectorAttributes = webManager.getConnectorAttributes(connectorType);
                    sortConnectorAttributes(connectorAttributes);
                   
                    // populate the connector attributes from the connector
                    for (ConnectorAttribute attribute : connectorAttributes) {
View Full Code Here

            String connectorType = actionRequest.getParameter(PARM_CONNECTOR_TYPE);
            actionResponse.setRenderParameter(PARM_CONNECTOR_TYPE, connectorType);
        } else if(mode.equals("add")) { // User just submitted the form to add a new connector
            // Create and configure the connector
            WebManager manager = PortletManager.getWebManager(actionRequest, new AbstractName(URI.create(managerURI)));
            ConnectorType connectorType = new ConnectorType(actionRequest.getParameter(PARM_CONNECTOR_TYPE));
           
            String uniqueName = actionRequest.getParameter(PARM_DISPLAY_NAME);
            actionResponse.setRenderParameter(PARM_DISPLAY_NAME, uniqueName);
            // set the connector attributes from the form post
            List<ConnectorAttribute> connectorAttributes = manager.getConnectorAttributes(connectorType);
            for (ConnectorAttribute attribute : connectorAttributes) {
                String name = attribute.getAttributeName();
                String value = actionRequest.getParameter(name);
               
                // handle booelan type special
                if (attribute.getAttributeClass().equals(Boolean.class)) {
                    // browser sends value of checked checkbox as "on" or "checked"
                    if ("on".equalsIgnoreCase(value) || "checked".equalsIgnoreCase(value)) {
                        value=Boolean.toString(true);
                    } else {
                        value=Boolean.toString(false);
                    }
                }
                // set the string form of the attribute's value as submitted by the browser
                if (value == null || value.trim().length()<1) {
                    // special case for KeystoreManager gbean
                    if ("trustStore".equals(attribute.getAttributeName())) {
                        attribute.setValue(null);
                    }
                } else {
                    attribute.setStringValue(value.trim());
                }
            }
            // create the connector gbean based on the configuration data
            AbstractName newConnectorName = manager.getConnectorConfiguration(connectorType, connectorAttributes, webContainer, uniqueName);
           
            // set the keystore properties if its a secure connector
            setKeystoreProperties(actionRequest, newConnectorName);
           
            // Start the connector
            try {
                GeronimoManagedBean managedBean = PortletManager.getManagedBean(actionRequest, newConnectorName);
                managedBean.startRecursive();
            } catch (Exception e) {
                log.error("Unable to start connector", e); //TODO: get into rendered page
            }
            actionResponse.setRenderParameter(PARM_MODE, "list");
        } else if(mode.equals("save")) { // User just submitted the form to update a connector
            // Get submitted values
            //todo: lots of validation
            String connectorURI = actionRequest.getParameter(PARM_CONNECTOR_URI);
            // Identify and update the connector
            AbstractName connectorName = new AbstractName(URI.create(connectorURI));
            NetworkConnector connector = PortletManager.getNetworkConnector(actionRequest, connectorName);
            if(connector != null) {
                WebManager manager = PortletManager.getWebManager(actionRequest, new AbstractName(URI.create(managerURI)));
                ConnectorType connectorType = manager.getConnectorType(connectorName);
               
                // set the connector attributes from the form post
                for (ConnectorAttribute attribute : manager.getConnectorAttributes(connectorType)) {
                    String name = attribute.getAttributeName();
                    String value = actionRequest.getParameter(name);
View Full Code Here

            renderRequest.setAttribute(PARM_SERVER, server);

            if(mode.equals("new")) {
                String connectorType = renderRequest.getParameter(PARM_CONNECTOR_TYPE);
                WebManager webManager = PortletManager.getWebManager(renderRequest, new AbstractName(URI.create(managerURI)));
                ConnectorType type = new ConnectorType(connectorType);
                List<ConnectorAttribute> connectorAttributes = webManager.getConnectorAttributes(type);
                sortConnectorAttributes(connectorAttributes);
                renderRequest.setAttribute(PARM_CONNECTOR_ATTRIBUTES, connectorAttributes);
                renderRequest.setAttribute(PARM_CONNECTOR_TYPE, connectorType);
                renderRequest.setAttribute(PARM_MODE, "add");
                populateEnumAttributes(renderRequest);
                editConnectorView.include(renderRequest, renderResponse);
            } else if(mode.equals("edit")) {
                String connectorURI = renderRequest.getParameter(PARM_CONNECTOR_URI);
                NetworkConnector connector = PortletManager.getNetworkConnector(renderRequest, new AbstractName(URI.create(connectorURI)));
                if(connector == null) {
                    doList(renderRequest, renderResponse);
                } else {
                    AbstractName connectorName = new AbstractName(URI.create(connectorURI));
                    String uniqueName = connectorName.getName().get("name").toString();
                    renderRequest.setAttribute(PARM_DISPLAY_NAME, uniqueName);
                    WebManager webManager = PortletManager.getWebManager(renderRequest, new AbstractName(URI.create(managerURI)));
                    ConnectorType connectorType = webManager.getConnectorType(connectorName);
                    List<ConnectorAttribute> connectorAttributes = webManager.getConnectorAttributes(connectorType);
                    sortConnectorAttributes(connectorAttributes);
                   
                    // populate the connector attributes from the connector
                    for (ConnectorAttribute attribute : connectorAttributes) {
View Full Code Here

            String connectorType = actionRequest.getParameter(PARM_CONNECTOR_TYPE);
            actionResponse.setRenderParameter(PARM_CONNECTOR_TYPE, connectorType);
        } else if(mode.equals("add")) { // User just submitted the form to add a new connector
            // Create and configure the connector
            WebManager manager = PortletManager.getWebManager(actionRequest, new AbstractName(URI.create(managerURI)));
            ConnectorType connectorType = new ConnectorType(actionRequest.getParameter(PARM_CONNECTOR_TYPE));
           
            String uniqueName = actionRequest.getParameter(PARM_DISPLAY_NAME);
            actionResponse.setRenderParameter(PARM_DISPLAY_NAME, uniqueName);
            // set the connector attributes from the form post
            List<ConnectorAttribute> connectorAttributes = manager.getConnectorAttributes(connectorType);
            for (ConnectorAttribute attribute : connectorAttributes) {
                String name = attribute.getAttributeName();
                String value = actionRequest.getParameter(name);
               
                // handle booelan type special
                if (attribute.getAttributeClass().equals(Boolean.class)) {
                    // browser sends value of checked checkbox as "on" or "checked"
                    if ("on".equalsIgnoreCase(value) || "checked".equalsIgnoreCase(value)) {
                        value=Boolean.toString(true);
                    } else {
                        value=Boolean.toString(false);
                    }
                }
                // set the string form of the attribute's value as submitted by the browser
                if (value == null || value.trim().length()<1) {
                    // special case for KeystoreManager gbean
                    if ("trustStore".equals(attribute.getAttributeName())) {
                        attribute.setValue(null);
                    }
                } else {
                    attribute.setStringValue(value.trim());
                }
            }
            // create the connector gbean based on the configuration data
            AbstractName newConnectorName = manager.getConnectorConfiguration(connectorType, connectorAttributes, webContainer, uniqueName);
           
            // set the keystore properties if its a secure connector
            setKeystoreProperties(actionRequest, newConnectorName);
           
            // Start the connector
            try {
                GeronimoManagedBean managedBean = PortletManager.getManagedBean(actionRequest, newConnectorName);
                managedBean.startRecursive();
            } catch (Exception e) {
                log.error("Unable to start connector", e); //TODO: get into rendered page
            }
           
            try {
                manager.updateConnectorConfig(newConnectorName);
            } catch (Exception e) {
                log.error("Unable to update connector in server.xml", e); //TODO: get into rendered page
            }
            actionResponse.setRenderParameter(PARM_MODE, "list");
        } else if(mode.equals("save")) { // User just submitted the form to update a connector
            // Get submitted values
            //todo: lots of validation
            String connectorURI = actionRequest.getParameter(PARM_CONNECTOR_URI);
            // Identify and update the connector
            AbstractName connectorName = new AbstractName(URI.create(connectorURI));
            GBeanData connectorGBeanData=null;
            try {
                connectorGBeanData=PortletManager.getKernel().getGBeanData(connectorName);
            } catch (Exception e) {
                log.error("Unable to get connectorGBeanData by abstractName:"+connectorName.toURI(), e);
            }
           
            NetworkConnector connector = PortletManager.getNetworkConnector(actionRequest, connectorName);
            if(connector != null) {
                WebManager manager = PortletManager.getWebManager(actionRequest, new AbstractName(URI.create(managerURI)));
                ConnectorType connectorType = manager.getConnectorType(connectorName);
               
                // set the connector attributes from the form post
                for (ConnectorAttribute attribute : manager.getConnectorAttributes(connectorType)) {
                    String name = attribute.getAttributeName();
                    String value = actionRequest.getParameter(name);
View Full Code Here

            renderRequest.setAttribute(PARM_SERVER, server);

            if(mode.equals("new")) {
                String connectorType = renderRequest.getParameter(PARM_CONNECTOR_TYPE);
                WebManager webManager = PortletManager.getWebManager(renderRequest, new AbstractName(URI.create(managerURI)));
                ConnectorType type = new ConnectorType(connectorType);
                List<ConnectorAttribute> connectorAttributes = webManager.getConnectorAttributes(type);
                sortConnectorAttributes(connectorAttributes);
                renderRequest.setAttribute(PARM_CONNECTOR_ATTRIBUTES, connectorAttributes);
                renderRequest.setAttribute(PARM_CONNECTOR_TYPE, connectorType);
                renderRequest.setAttribute(PARM_MODE, "add");
                populateEnumAttributes(renderRequest);
                editConnectorView.include(renderRequest, renderResponse);
            } else if(mode.equals("edit")) {
                String connectorURI = renderRequest.getParameter(PARM_CONNECTOR_URI);
                NetworkConnector connector = PortletManager.getNetworkConnector(renderRequest, new AbstractName(URI.create(connectorURI)));
                if(connector == null) {
                    doList(renderRequest, renderResponse);
                } else {
                    AbstractName connectorName = new AbstractName(URI.create(connectorURI));
                    String uniqueName = connectorName.getName().get("name").toString();
                    renderRequest.setAttribute(PARM_DISPLAY_NAME, uniqueName);
                    WebManager webManager = PortletManager.getWebManager(renderRequest, new AbstractName(URI.create(managerURI)));
                    ConnectorType connectorType = webManager.getConnectorType(connectorName);
                    List<ConnectorAttribute> connectorAttributes = webManager.getConnectorAttributes(connectorType);
                    sortConnectorAttributes(connectorAttributes);
                   
                    // populate the connector attributes from the connector
                    for (ConnectorAttribute attribute : connectorAttributes) {
View Full Code Here

            String connectorType = actionRequest.getParameter(PARM_CONNECTOR_TYPE);
            actionResponse.setRenderParameter(PARM_CONNECTOR_TYPE, connectorType);
        } else if(mode.equals("add")) { // User just submitted the form to add a new connector
            // Create and configure the connector
            WebManager manager = PortletManager.getWebManager(actionRequest, new AbstractName(URI.create(managerURI)));
            ConnectorType connectorType = new ConnectorType(actionRequest.getParameter(PARM_CONNECTOR_TYPE));

            String uniqueName = actionRequest.getParameter(PARM_DISPLAY_NAME);
            actionResponse.setRenderParameter(PARM_DISPLAY_NAME, uniqueName);
            // set the connector attributes from the form post
            List<ConnectorAttribute> connectorAttributes = manager.getConnectorAttributes(connectorType);
            for (ConnectorAttribute attribute : connectorAttributes) {
                String name = attribute.getAttributeName();
                String value = actionRequest.getParameter(name);

                // handle booelan type special
                if (attribute.getAttributeClass().equals(Boolean.class)) {
                    // browser sends value of checked checkbox as "on" or "checked"
                    if ("on".equalsIgnoreCase(value) || "checked".equalsIgnoreCase(value)) {
                        value=Boolean.toString(true);
                    } else {
                        value=Boolean.toString(false);
                    }
                }
                // set the string form of the attribute's value as submitted by the browser
                if (value == null || value.trim().length()<1) {
                    // special case for KeystoreManager gbean
                    if ("trustStore".equals(attribute.getAttributeName())) {
                        attribute.setValue(null);
                    }
                } else {
                    attribute.setStringValue(value.trim());
                }
            }
            // create the connector gbean based on the configuration data
            AbstractName newConnectorName = manager.getConnectorConfiguration(connectorType, connectorAttributes, webContainer, uniqueName);

            // set the keystore properties if its a secure connector
            setKeystoreProperties(actionRequest, newConnectorName);

            // Start the connector
            try {
                GeronimoManagedBean managedBean = PortletManager.getManagedBean(actionRequest, newConnectorName);
                managedBean.startRecursive();
            } catch (Exception e) {
                log.error("Unable to start connector", e); //TODO: get into rendered page
            }

            try {
                manager.updateConnectorConfig(newConnectorName);
            } catch (Exception e) {
                log.error("Unable to update connector in server.xml", e); //TODO: get into rendered page
            }
            actionResponse.setRenderParameter(PARM_MODE, "list");
        } else if(mode.equals("save")) { // User just submitted the form to update a connector
            // Get submitted values
            //todo: lots of validation
            String connectorURI = actionRequest.getParameter(PARM_CONNECTOR_URI);
            // Identify and update the connector
            AbstractName connectorName = new AbstractName(URI.create(connectorURI));
            GBeanData connectorGBeanData=null;
            try {
                connectorGBeanData=PortletManager.getKernel().getGBeanData(connectorName);
            } catch (Exception e) {
                log.error("Unable to get connectorGBeanData by abstractName:"+connectorName.toURI(), e);
            }

            NetworkConnector connector = PortletManager.getNetworkConnector(actionRequest, connectorName);
            if(connector != null) {
                WebManager manager = PortletManager.getWebManager(actionRequest, new AbstractName(URI.create(managerURI)));
                ConnectorType connectorType = manager.getConnectorType(connectorName);

                // set the connector attributes from the form post
                for (ConnectorAttribute attribute : manager.getConnectorAttributes(connectorType)) {
                    String name = attribute.getAttributeName();
                    String value = actionRequest.getParameter(name);
View Full Code Here

            renderRequest.setAttribute(PARM_SERVER, server);

            if(mode.equals("new")) {
                String connectorType = renderRequest.getParameter(PARM_CONNECTOR_TYPE);
                WebManager webManager = PortletManager.getWebManager(renderRequest, new AbstractName(URI.create(managerURI)));
                ConnectorType type = new ConnectorType(connectorType);
                List<ConnectorAttribute> connectorAttributes = webManager.getConnectorAttributes(type);
                sortConnectorAttributes(connectorAttributes);
                renderRequest.setAttribute(PARM_CONNECTOR_ATTRIBUTES, connectorAttributes);
                renderRequest.setAttribute(PARM_CONNECTOR_TYPE, connectorType);
                renderRequest.setAttribute(PARM_MODE, "add");
                populateEnumAttributes(renderRequest);
                editConnectorView.include(renderRequest, renderResponse);
            } else if(mode.equals("edit")) {
                String connectorURI = renderRequest.getParameter(PARM_CONNECTOR_URI);
                NetworkConnector connector = PortletManager.getNetworkConnector(renderRequest, new AbstractName(URI.create(connectorURI)));
                if(connector == null) {
                    doList(renderRequest, renderResponse);
                } else {
                    AbstractName connectorName = new AbstractName(URI.create(connectorURI));
                    String uniqueName = connectorName.getName().get("name").toString();
                    renderRequest.setAttribute(PARM_DISPLAY_NAME, uniqueName);
                    WebManager webManager = PortletManager.getWebManager(renderRequest, new AbstractName(URI.create(managerURI)));
                    ConnectorType connectorType = webManager.getConnectorType(connectorName);
                    List<ConnectorAttribute> connectorAttributes = webManager.getConnectorAttributes(connectorType);
                    sortConnectorAttributes(connectorAttributes);

                    // populate the connector attributes from the connector
                    for (ConnectorAttribute attribute : connectorAttributes) {
View Full Code Here

            String connectorType = actionRequest.getParameter(PARM_CONNECTOR_TYPE);
            actionResponse.setRenderParameter(PARM_CONNECTOR_TYPE, connectorType);
        } else if(mode.equals("add")) { // User just submitted the form to add a new connector
            // Create and configure the connector
            WebManager manager = PortletManager.getWebManager(actionRequest, new AbstractName(URI.create(managerURI)));
            ConnectorType connectorType = new ConnectorType(actionRequest.getParameter(PARM_CONNECTOR_TYPE));

            String uniqueName = actionRequest.getParameter(PARM_DISPLAY_NAME);
            actionResponse.setRenderParameter(PARM_DISPLAY_NAME, uniqueName);
            // set the connector attributes from the form post
            List<ConnectorAttribute> connectorAttributes = manager.getConnectorAttributes(connectorType);
            for (ConnectorAttribute attribute : connectorAttributes) {
                String name = attribute.getAttributeName();
                String value = actionRequest.getParameter(name);

                // handle booelan type special
                if (attribute.getAttributeClass().equals(Boolean.class)) {
                    // browser sends value of checked checkbox as "on" or "checked"
                    if ("on".equalsIgnoreCase(value) || "checked".equalsIgnoreCase(value)) {
                        value=Boolean.toString(true);
                    } else {
                        value=Boolean.toString(false);
                    }
                }
                // set the string form of the attribute's value as submitted by the browser
                if (value == null || value.trim().length()<1) {
                    // special case for KeystoreManager gbean
                    if ("trustStore".equals(attribute.getAttributeName())) {
                        attribute.setValue(null);
                    }
                } else {
                    attribute.setStringValue(value.trim());
                }
            }
            // create the connector gbean based on the configuration data
            AbstractName newConnectorName = manager.getConnectorConfiguration(connectorType, connectorAttributes, webContainer, uniqueName);

            // set the keystore properties if its a secure connector
            setKeystoreProperties(actionRequest, newConnectorName);

            // Start the connector
            try {
                GeronimoManagedBean managedBean = PortletManager.getManagedBean(actionRequest, newConnectorName);
                managedBean.startRecursive();
            } catch (Exception e) {
                log.error("Unable to start connector", e); //TODO: get into rendered page
            }

            try {
                manager.updateConnectorConfig(newConnectorName);
            } catch (Exception e) {
                log.error("Unable to update connector in server.xml", e); //TODO: get into rendered page
            }
            actionResponse.setRenderParameter(PARM_MODE, "list");
        } else if(mode.equals("save")) { // User just submitted the form to update a connector
            // Get submitted values
            //todo: lots of validation
            String connectorURI = actionRequest.getParameter(PARM_CONNECTOR_URI);
            // Identify and update the connector
            AbstractName connectorName = new AbstractName(URI.create(connectorURI));
            GBeanData connectorGBeanData=null;
            try {
                connectorGBeanData=PortletManager.getKernel().getGBeanData(connectorName);
            } catch (Exception e) {
                log.error("Unable to get connectorGBeanData by abstractName:"+connectorName.toURI(), e);
            }

            // Store the port info of the connector currently modified
            String toBeUpdatedConnectorName = (String) connectorGBeanData.getAttribute("name");
            Integer toBeUpdatedConnectorPort = (Integer) connectorGBeanData.getAttribute("port");
           
            NetworkConnector connector = PortletManager.getNetworkConnector(actionRequest, connectorName);
            if(connector != null) {
                WebManager manager = PortletManager.getWebManager(actionRequest, new AbstractName(URI.create(managerURI)));
                ConnectorType connectorType = manager.getConnectorType(connectorName);
               

                // set the connector attributes from the form post
                for (ConnectorAttribute attribute : manager.getConnectorAttributes(connectorType)) {
                    String name = attribute.getAttributeName();
View Full Code Here

            renderRequest.setAttribute(PARM_SERVER, server);

            if(mode.equals("new")) {
                String connectorType = renderRequest.getParameter(PARM_CONNECTOR_TYPE);
                WebManager webManager = PortletManager.getWebManager(renderRequest, new AbstractName(URI.create(managerURI)));
                ConnectorType type = new ConnectorType(connectorType);
                List<ConnectorAttribute> connectorAttributes = webManager.getConnectorAttributes(type);
                sortConnectorAttributes(connectorAttributes);
                renderRequest.setAttribute(PARM_CONNECTOR_ATTRIBUTES, connectorAttributes);
                renderRequest.setAttribute(PARM_CONNECTOR_TYPE, connectorType);
                renderRequest.setAttribute(PARM_MODE, "add");
                populateEnumAttributes(renderRequest);
                editConnectorView.include(renderRequest, renderResponse);
            } else if(mode.equals("edit")) {
                String connectorURI = renderRequest.getParameter(PARM_CONNECTOR_URI);
                NetworkConnector connector = PortletManager.getNetworkConnector(renderRequest, new AbstractName(URI.create(connectorURI)));
                if(connector == null) {
                    doList(renderRequest, renderResponse);
                } else {
                    AbstractName connectorName = new AbstractName(URI.create(connectorURI));
                    String uniqueName = connectorName.getName().get("name").toString();
                    renderRequest.setAttribute(PARM_DISPLAY_NAME, uniqueName);
                    WebManager webManager = PortletManager.getWebManager(renderRequest, new AbstractName(URI.create(managerURI)));
                    ConnectorType connectorType = webManager.getConnectorType(connectorName);
                    List<ConnectorAttribute> connectorAttributes = webManager.getConnectorAttributes(connectorType);
                    sortConnectorAttributes(connectorAttributes);

                    // populate the connector attributes from the connector
                    for (ConnectorAttribute attribute : connectorAttributes) {
View Full Code Here

TOP

Related Classes of org.apache.geronimo.management.geronimo.WebManager.ConnectorType

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.