Examples of CustomUIServiceClient


Examples of org.wso2.carbon.registry.resource.ui.clients.CustomUIServiceClient

    public static EndpointBean getEndpointBean(
            String path, ServletConfig config, HttpSession session) throws UIException {

        try {
            CustomUIServiceClient customUIServiceClient =
                    new CustomUIServiceClient(config, session);

            String content = customUIServiceClient.getTextContent(path);
            OMElement endpointElement = AXIOMUtil.stringToOM(content);

            String name = endpointElement.getAttributeValue(new QName(null, "name"));

            OMElement addressElement = endpointElement.getFirstChildWithName(new QName(null, "address"));
View Full Code Here

Examples of org.wso2.carbon.registry.resource.ui.clients.CustomUIServiceClient

    public static void addEndpointBean(
            HttpServletRequest request, ServletConfig config, HttpSession session) throws UIException {

        try {
            CustomUIServiceClient customUIServiceClient =
                    new CustomUIServiceClient(config, session);

            String parentPath = request.getParameter("parentPath");
            String resourceName = request.getParameter("resourceName");
            String eprName = request.getParameter("eprName");
            String uri = request.getParameter("uri");
            String format = request.getParameter("format");
            String optimize = request.getParameter("optimize");
            String sd = request.getParameter("sd");

            OMFactory fac = OMAbstractFactory.getOMFactory();
            OMElement endpointElement = fac.createOMElement("endpoint", null);
            endpointElement.addAttribute("name", eprName, null);

            OMElement addressElement = fac.createOMElement("address", null);
            addressElement.addAttribute("uri", uri, null);
            addressElement.addAttribute("format", format, null);
            addressElement.addAttribute("optimize", optimize, null);
            endpointElement.addChild(addressElement);

            OMElement sdElement = fac.createOMElement("suspendDurationOnFailure", null);
            sdElement.setText(sd);
            addressElement.addChild(sdElement);

            String content = endpointElement.toString();

            customUIServiceClient.addTextContent(parentPath, resourceName, "epr", null, content);

        } catch (Exception e) {
            String msg = "Failed to get end point details. " + e.getMessage();
            log.error(msg, e);
            throw new UIException(msg, e);
View Full Code Here

Examples of org.wso2.carbon.registry.resource.ui.clients.CustomUIServiceClient

    public static void saveEndpointBean(
            String path, HttpServletRequest request, ServletConfig config, HttpSession session) throws UIException {

        try {
            CustomUIServiceClient customUIServiceClient =
                    new CustomUIServiceClient(config, session);

            String name = request.getParameter("name");
            String uri = request.getParameter("uri");
            String format = request.getParameter("format");
            String optimize = request.getParameter("optimize");
            String sd = request.getParameter("sd");

            OMFactory fac = OMAbstractFactory.getOMFactory();
            OMElement endpointElement = fac.createOMElement("endpoint", null);
            endpointElement.addAttribute("name", name, null);

            OMElement addressElement = fac.createOMElement("address", null);
            addressElement.addAttribute("uri", uri, null);
            addressElement.addAttribute("format", format, null);
            addressElement.addAttribute("optimize", optimize, null);
            endpointElement.addChild(addressElement);

            OMElement sdElement = fac.createOMElement("suspendDurationOnFailure", null);
            sdElement.setText(sd);
            addressElement.addChild(sdElement);

            String content = endpointElement.toString();

            customUIServiceClient.updateTextContent(path, content);

        } catch (Exception e) {
            String msg = "Failed to get end point details. " + e.getMessage();
            log.error(msg, e);
            throw new UIException(msg, e);
View Full Code Here

Examples of org.wso2.carbon.registry.resource.ui.clients.CustomUIServiceClient

    public static void saveEndpointBean(
            String path, HttpServletRequest request, ServletConfig config, HttpSession session) throws UIException {

        try {
            CustomUIServiceClient customUIServiceClient =
                    new CustomUIServiceClient(config, session);

            String name = request.getParameter("name");
            String uri = request.getParameter("uri");
            String format = request.getParameter("format");
            String optimize = request.getParameter("optimize");
            String sd = request.getParameter("sd");

            OMFactory fac = OMAbstractFactory.getOMFactory();
            OMElement endpointElement = fac.createOMElement("endpoint", null);
            endpointElement.addAttribute("name", name, null);

            OMElement addressElement = fac.createOMElement("address", null);
            addressElement.addAttribute("uri", uri, null);
            addressElement.addAttribute("format", format, null);
            addressElement.addAttribute("optimize", optimize, null);
            endpointElement.addChild(addressElement);

            OMElement sdElement = fac.createOMElement("suspendDurationOnFailure", null);
            sdElement.setText(sd);
            addressElement.addChild(sdElement);

            String content = endpointElement.toString();

            customUIServiceClient.updateTextContent(path, content);

        } catch (Exception e) {
            String msg = "Failed to get end point details. " + e.getMessage();
            log.error(msg, e);
            throw new UIException(msg, e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.