Package org.wso2.carbon.registry.core

Examples of org.wso2.carbon.registry.core.Resource.addProperty()


        Resource resource;
        if (registry != null) {
            if (!registry.resourceExists(resourcePath)) {
                resource = registry.newResource();

                resource.addProperty(ActivityPublisherConstants.XPATH_PROPERTY, xpathConfigData.getXpath());

                String[] nameSpaces = xpathConfigData.getNameSpaces();

                if (nameSpaces != null) {
                    for (int i = 0; i < xpathConfigData.getNameSpaces().length; i++) {
View Full Code Here


                String[] nameSpaces = xpathConfigData.getNameSpaces();

                if (nameSpaces != null) {
                    for (int i = 0; i < xpathConfigData.getNameSpaces().length; i++) {
                        String property = ActivityPublisherConstants.NAMESAPCE_PROPERTY_PREFIX + i;
                        resource.addProperty(property, nameSpaces[i]);
                    }
                }

            } else {
                if (xpathConfigData.isEditing()) {
View Full Code Here

            } else {
                if (xpathConfigData.isEditing()) {
                    resource = registry.get(resourcePath);
                    clearXpathProperties(resource);

                    resource.addProperty(ActivityPublisherConstants.XPATH_PROPERTY, xpathConfigData.getXpath());

                    String[] nameSpaces = xpathConfigData.getNameSpaces();

                    if (nameSpaces != null) {
                        for (int i = 0; i < xpathConfigData.getNameSpaces().length; i++) {
View Full Code Here

                    String[] nameSpaces = xpathConfigData.getNameSpaces();

                    if (nameSpaces != null) {
                        for (int i = 0; i < xpathConfigData.getNameSpaces().length; i++) {
                            String property = ActivityPublisherConstants.NAMESAPCE_PROPERTY_PREFIX + i;
                            resource.addProperty(property, nameSpaces[i]);
                        }
                    }
                } else {
                    throw new RegistryException("XPath Expression Key should be unique..");
                }
View Full Code Here

  public void updateConfigurationProperty(String propertyName, String value) throws RegistryException {
    String resourcePath = ServiceStatisticsPublisherConstants.STATISTISTICS_REG_PATH + propertyName;
    Resource resource;
    if (!registry.resourceExists(resourcePath)) {
      resource = registry.newResource();
      resource.addProperty(propertyName, value);
      registry.put(resourcePath, resource);
    } else {
      resource = registry.get(resourcePath);
      resource.setProperty(propertyName, value);
      registry.put(resourcePath, resource);
View Full Code Here

                (UserRegistry) configSystemRegistry;

        Resource q1 = registry.newResource();
        q1.setContent(queryContent);
        q1.setMediaType(RegistryConstants.SQL_QUERY_MEDIA_TYPE);
        q1.addProperty(RegistryConstants.RESULT_TYPE_PROPERTY_NAME,
                       RegistryConstants.RESOURCES_RESULT_TYPE);
        registry.put(queryPath, q1);

    }
View Full Code Here

        UserRegistry registry = (UserRegistry) getRootRegistry();
        if (RegistryUtils.isRegistryReadOnly(registry.getRegistryContext())) {
            return;
        }
        Resource resource = registry.get(path);
        resource.addProperty(name, value);
        registry.put(resource.getPath(), resource);
        resource.discard();
    }

    /**
 
View Full Code Here

                (UserRegistry) Utils.getRegistry();

        Resource q1 = registry.newResource();
        q1.setContent(queryContent);
        q1.setMediaType(RegistryConstants.SQL_QUERY_MEDIA_TYPE);
        q1.addProperty(RegistryConstants.RESULT_TYPE_PROPERTY_NAME,
                RegistryConstants.RESOURCES_RESULT_TYPE);
        registry.put(queryPath, q1);

    }
View Full Code Here

  private void storeSQLQuery(String path) throws RegistryException, Exception {
    String sql1 = "SELECT REG_PATH_ID, REG_NAME FROM REG_RESOURCE R WHERE R.REG_MEDIA_TYPE LIKE ?";
    Resource q1 = registry.newResource();
    q1.setContent(sql1);
    q1.setMediaType(RegistryConstants.SQL_QUERY_MEDIA_TYPE);
    q1.addProperty(RegistryConstants.RESULT_TYPE_PROPERTY_NAME,
        RegistryConstants.RESOURCES_RESULT_TYPE);
    registry.put(path, q1);
  }
   
    public void testExecuteQueries() throws RegistryException{
View Full Code Here

                                            String value) throws RegistryException {
        String resourcePath = RegistryResources.LOGGING + propertyName;
        Resource resource;
        if (!registry.resourceExists(resourcePath)) {
            resource = registry.newResource();
            resource.addProperty(propertyName, value);
            registry.put(resourcePath, resource);
        } else {
            resource = registry.get(resourcePath);
            resource.setProperty(propertyName, value);
            registry.put(resourcePath, resource);
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.