Package org.wso2.carbon.registry.resource.ui.clients

Examples of org.wso2.carbon.registry.resource.ui.clients.ResourceServiceClient.addResource()


        // read Item elements under Resources
        Iterator itemItr = resourcesElement.getChildrenWithLocalName(RegistryConfig.ITEM);
        while (itemItr.hasNext()) {
            OMElement itemElement = (OMElement) itemItr.next();
            regConfig.addResource(readChildText(itemElement, RegistryConfig.PATH),
                    readChildText(itemElement, RegistryConfig.FILE),
                    readChildText(itemElement, RegistryConfig.REGISTRY_TYPE));
        }

        // read Collection elements under Resources
View Full Code Here


                }
                return false;
            }
            DataHandler dataHandler = fileItemData.getDataHandler();

            client.addResource(
                    calcualtePath(parentPath, resourceName), mediaType, description, dataHandler,
                    symlinkLocation);

            response.setContentType("text/html; charset=utf-8");
            String msg = "Successfully uploaded content.";
View Full Code Here

      }

      /* add the resources */
      for (Iterator<OMElement> itr = dbsElement.getChildrenWithName(
          new QName(DBSFields.RESOURCE)); itr.hasNext();) {
        dataService.addResource(ResourceFactory.createResource(dataService,
            itr.next()));
      }
   
      /* init the data service object */
      dataService.init();
 
View Full Code Here

            // enable MTOM and set the previous cookie
            stub._getServiceClient().getOptions().setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
            stub._getServiceClient().getOptions().setProperty(HTTPConstants.COOKIE_STRING, sessionCookie);
            DataHandler dataHandler = new DataHandler(new FileDataSource(filepath));
            // adding the resource
            stub.addResource(path, mediaType, description, dataHandler,null);
        } catch (Exception ex){
            ex.printStackTrace();
        }
    }
}
View Full Code Here

        try {
            resourceAdminServiceStub.delete("/_system/config/xslt");
            resourceAdminServiceStub.addCollection("/_system/config/", "xslt", "",
                    "Contains test XSLT files");
            resourceAdminServiceStub.addResource(
                    "/_system/config/xslt/transform_back.xslt", "application/xml", "xslt files",
                    new DataHandler(new URL("file:///" + getClass().getResource("/transform_back.xslt").getPath())), null);
            Thread.sleep(1000);
            resourceAdminServiceStub.addResource(
                    "/_system/config/xslt/transform.xslt", "application/xml", "xslt files",
View Full Code Here

                    "Contains test XSLT files");
            resourceAdminServiceStub.addResource(
                    "/_system/config/xslt/transform_back.xslt", "application/xml", "xslt files",
                    new DataHandler(new URL("file:///" + getClass().getResource("/transform_back.xslt").getPath())), null);
            Thread.sleep(1000);
            resourceAdminServiceStub.addResource(
                    "/_system/config/xslt/transform.xslt", "application/xml", "xslt files",
                    new DataHandler(new URL("file:///" + getClass().getResource("/transform.xslt").getPath())), null);
        } catch (MalformedURLException e) {
            handleError("Malformed URL", e);
        } catch (InterruptedException e) {
View Full Code Here

        try {
            resourceAdminServiceStub.delete("/_system/config/xslt");
            resourceAdminServiceStub.addCollection("/_system/config/", "xslt", "",
                    "Contains test XSLT files");
            resourceAdminServiceStub.addResource(
                    "/_system/config/xslt/transform_back.xslt", "application/xml", "xslt files",
                    new DataHandler(new URL("file:///" + getClass().getResource("/transform_back.xslt").getPath())), null);
            Thread.sleep(1000);
            resourceAdminServiceStub.addResource(
                    "/_system/config/xslt/transform.xslt", "application/xml", "xslt files",
View Full Code Here

                    "Contains test XSLT files");
            resourceAdminServiceStub.addResource(
                    "/_system/config/xslt/transform_back.xslt", "application/xml", "xslt files",
                    new DataHandler(new URL("file:///" + getClass().getResource("/transform_back.xslt").getPath())), null);
            Thread.sleep(1000);
            resourceAdminServiceStub.addResource(
                    "/_system/config/xslt/transform.xslt", "application/xml", "xslt files",
                    new DataHandler(new URL("file:///" + getClass().getResource("/transform.xslt").getPath())), null);
        } catch (MalformedURLException e) {
            handleError("Malformed URL", e);
        } catch (InterruptedException e) {
View Full Code Here

            log.info("collection added to " + collectionPath);
            // Changing media type
            collectionPath = resourceAdminServiceStub.addCollection("/_system/config/", "ResFiles", "application/vnd.wso2.esb", "application/vnd.wso2.esb media type collection");
            String resource = frameworkPath + File.separator + "components" + File.separator + "mediators-property" + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "addToCollection" + File.separator + "synapse.xml";

            resourceAdminServiceStub.addResource("/ResFiles/synapse.xml", "application/xml", "resDesc", new DataHandler(new URL("file:///" + resource)), null);

            String textContent = resourceAdminServiceStub.getTextContent("/ResFiles/synapse.xml");

            if (textContent.equals(null)) {
                log.error("Unable to get text content");
View Full Code Here

                buildUIError(request, response, webContext, errorRedirect, msg);
                return false;
            }
            DataHandler dataHandler = fileItemData.getDataHandler();

            client.addResource(
                    calcualtePath(parentPath, resourceName), mediaType, description, dataHandler,
                    symlinkLocation);

            response.setContentType("text/html; charset=utf-8");
            String msg = "Successfully uploaded content.";
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.