Examples of newResource()


Examples of org.apache.tapestry.services.ClasspathResourceFactory.newResource()

        String path = "/foo/bar";

        ClasspathResource expected = new ClasspathResource(cr, path);

        assertEquals(expected, f.newResource(path));
    }

    public void testGlobalPropertyObjectProviderSuccess()
    {
        MockControl sourceControl = newControl(IPropertySource.class);
View Full Code Here

Examples of org.eclipse.core.internal.resources.Workspace.newResource()

                IPath path = new Path(suiteStatus.getSuitePath());

                Workspace w = (Workspace) ResourcesPlugin.getWorkspace();

                File file = (File) w.newResource(path, IResource.FILE);

                FileEditorInput input = new FileEditorInput(file);

                try
                {
View Full Code Here

Examples of org.wso2.carbon.registry.core.Registry.newResource()

            if (registry.resourceExists(parentCollectionPath) == true) {
                return;
            }
            registry.put(parentCollectionPath, registry.newCollection());

            Resource bucketProperties = registry.newResource();
            bucketProperties.addProperty(CEPConstants.CEP_CONF_ELE_NAME, bucket.getName());
            bucketProperties.addProperty(CEPConstants.CEP_CONF_ELE_DESCRIPTION, bucket.getDescription());
            bucketProperties.addProperty(CEPConstants.CEP_CONF_ELE_CEP_ENGINE_PROVIDER, bucket.getEngineProvider());
            bucketProperties.addProperty(CEPConstants.CEP_CONF_ELE_CEP_BUCKET_OWNER, bucket.getOwner());
            registry.put(parentCollectionPath + CEPConstants.CEP_REGISTRY_BS + CEPConstants.CEP_REGISTRY_PROPERTIES, bucketProperties);
View Full Code Here

Examples of org.wso2.carbon.registry.core.Registry.newResource()

            for (Input input : bucket.getInputs()) {
                String inputResourcePath = inputsCollectionPath + "/" + input.getTopic();

                registry.put(inputResourcePath, registry.newCollection());

                Resource inputTopic = registry.newResource();
                inputTopic.addProperty(CEPConstants.CEP_CONF_ELE_TOPIC, input.getTopic());
                inputTopic.addProperty(CEPConstants.CEP_CONF_ELE_BROKER_NAME, input.getBrokerName());
                registry.put(inputResourcePath + CEPConstants.CEP_REGISTRY_BS + CEPConstants.CEP_REGISTRY_DETAILS, inputTopic);
                registry.put(inputResourcePath + CEPConstants.CEP_REGISTRY_BS + CEPConstants.CEP_REGISTRY_MAPPING, registry.newCollection());
                String mappingPath = inputResourcePath + CEPConstants.CEP_REGISTRY_BS + CEPConstants.CEP_REGISTRY_MAPPING + CEPConstants.CEP_REGISTRY_BS;
View Full Code Here

Examples of org.wso2.carbon.registry.core.Registry.newResource()

                inputTopic.addProperty(CEPConstants.CEP_CONF_ELE_BROKER_NAME, input.getBrokerName());
                registry.put(inputResourcePath + CEPConstants.CEP_REGISTRY_BS + CEPConstants.CEP_REGISTRY_DETAILS, inputTopic);
                registry.put(inputResourcePath + CEPConstants.CEP_REGISTRY_BS + CEPConstants.CEP_REGISTRY_MAPPING, registry.newCollection());
                String mappingPath = inputResourcePath + CEPConstants.CEP_REGISTRY_BS + CEPConstants.CEP_REGISTRY_MAPPING + CEPConstants.CEP_REGISTRY_BS;

                Resource streamResource = registry.newResource();
                streamResource.addProperty(CEPConstants.CEP_REGISTRY_STREAM, input.getMapping().getStream());
                registry.put(mappingPath + CEPConstants.CEP_REGISTRY_STREAM, streamResource);

              /*  Map<String, String> xpathDefinitionsTable = input.getMapping().getXpathNamespacePrefixes();
                if (xpathDefinitionsTable != null && xpathDefinitionsTable.size() > 0) {
View Full Code Here

Examples of org.wso2.carbon.registry.core.Registry.newResource()

                List<XpathDefinition> xpathDefinitionList = input.getMapping().getXpathNamespacePrefixes();
                if(xpathDefinitionList != null && xpathDefinitionList.size() >0){
                    for(XpathDefinition xpathDefinition : xpathDefinitionList){
                        String key = xpathDefinition.getPrefix();
                        String value = xpathDefinition.getNamespace();
                        Resource xpathDef = registry.newResource();
                        xpathDef.addProperty(key, value);
                        registry.put(mappingPath + CEPConstants.CEP_REGISTRY_XPATH_DEFS + CEPConstants.CEP_REGISTRY_BS + key, xpathDef);
                    }
                }
View Full Code Here

Examples of org.wso2.carbon.registry.core.Registry.newResource()

                }


                if (input.getMapping().getProperties() != null) {
                    for (Property property : input.getMapping().getProperties()) {
                        Resource propertyResource = registry.newResource();
                        propertyResource.addProperty(CEPConstants.CEP_REGISTRY_NAME, property.getName());
                        propertyResource.addProperty(CEPConstants.CEP_REGISTRY_TYPE, property.getType());
                        propertyResource.addProperty(CEPConstants.CEP_REGISTRY_XPATH, property.getXpath());
                        registry.put(mappingPath + CEPConstants.CEP_REGISTRY_PROPERTIES + CEPConstants.CEP_REGISTRY_BS + property.getName(), propertyResource);
                    }
View Full Code Here

Examples of org.wso2.carbon.registry.core.Registry.newResource()

            String queriesCollectionPath = parentCollectionPath + CEPConstants.CEP_REGISTRY_BS + CEPConstants.CEP_REGISTRY_QUERIES;
            registry.put(queriesCollectionPath, registry.newCollection());
            for (Query query : bucket.getQueries()) {
                String queryPath = queriesCollectionPath + "/" + query.getName();
                registry.put(queryPath, registry.newCollection());
                Resource queryResource = registry.newResource();
                queryResource.setProperty(CEPConstants.CEP_REGISTRY_NAME, query.getName());
                queryResource.setProperty(CEPConstants.CEP_REGISTRY_TYPE, query.getExpression().getType());
//                queryResource.setProperty(CEPConstants.CEP_REGISTRY_EXPRESSION,query.getExpression().getText());
                queryResource.setContent(query.getExpression().getText());
                registry.put(queryPath + CEPConstants.CEP_REGISTRY_BS + CEPConstants.CEP_REGISTRY_DETAILS, queryResource);
View Full Code Here

Examples of org.wso2.carbon.registry.core.Registry.newResource()

                registry.put(queryPath + CEPConstants.CEP_REGISTRY_BS + CEPConstants.CEP_REGISTRY_DETAILS, queryResource);

                registry.put(queryPath + CEPConstants.CEP_REGISTRY_BS + CEPConstants.CEP_REGISTRY_OUTPUT, registry.newCollection());

                Output output = query.getOutput();
                Resource outputResource = registry.newResource();
                outputResource.addProperty(CEPConstants.CEP_REGISTRY_TOPIC, output.getTopic());
                outputResource.addProperty(CEPConstants.CEP_CONF_ELE_BROKER_NAME, output.getBrokerName());
                outputResource.addProperty(CEPConstants.CEP_REGISTRY_TYPE,
                        output.getElementMapping() == null ? CEPConstants.CEP_REGISTRY_XML_MAPPING : CEPConstants.CEP_REGISTRY_ELEMENT_MAPPING);
                registry.put(queryPath + CEPConstants.CEP_REGISTRY_BS + CEPConstants.CEP_REGISTRY_OUTPUT +
View Full Code Here

Examples of org.wso2.carbon.registry.core.Registry.newResource()

                    String elementMappingPathString = CEPConstants.CEP_REGISTRY_BS +
                            CEPConstants.CEP_REGISTRY_OUTPUT +
                            CEPConstants.CEP_REGISTRY_BS +
                            CEPConstants.CEP_REGISTRY_ELEMENT_MAPPING;
                    registry.put(queryPath + elementMappingPathString, registry.newCollection());
                    Resource elementMappingResource = registry.newResource();
                    elementMappingResource.addProperty(CEPConstants.CEP_REGISTRY_DOC_ELEMENT, elementMapping.getDocumentElement());
                    elementMappingResource.addProperty(CEPConstants.CEP_REGISTRY_NS, elementMapping.getNamespace());
                    registry.put(queryPath + elementMappingPathString +
                            CEPConstants.CEP_REGISTRY_BS + CEPConstants.CEP_REGISTRY_DETAILS, elementMappingResource);
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.