Package org.ofbiz.base.config

Examples of org.ofbiz.base.config.ResourceHandler


    public JunitSuiteWrapper(String componentName, String testCase) {
        List testSuiteInfoList = ComponentConfig.getAllTestSuiteInfos(componentName);
        Iterator testSuiteInfoIter = testSuiteInfoList.iterator();
        while (testSuiteInfoIter.hasNext()) {
            ComponentConfig.TestSuiteInfo testSuiteInfo = (ComponentConfig.TestSuiteInfo) testSuiteInfoIter.next();
            ResourceHandler testSuiteResource = testSuiteInfo.createResourceHandler();

            try {
                Document testSuiteDocument = testSuiteResource.getDocument();
                // TODO create TestSuite object based on this that will contain its TestCase objects

                Element documentElement = testSuiteDocument.getDocumentElement();
                ModelTestSuite modelTestSuite = new ModelTestSuite(documentElement, testCase);

                // make sure there are test-cases configured for the suite
                if (modelTestSuite.getTestList().size() > 0) {
                    this.modelTestSuiteList.add(modelTestSuite);
                }
            } catch (GenericConfigException e) {
                String errMsg = "Error reading XML document from ResourceHandler for loader [" + testSuiteResource.getLoaderName() + "] and location [" + testSuiteResource.getLocation() + "]";
                Debug.logError(e, errMsg, module);
                throw new IllegalArgumentException(errMsg);
            }
        }
    }
View Full Code Here


            Debug.logError(e, "Error getting Service Engine XML root element", module);
            return;
        }

        for (Element serviceMcasElement: UtilXml.childElementList(rootElement, "service-mcas")) {
            ResourceHandler handler = new MainResourceHandler(ServiceConfigUtil.SERVICE_ENGINE_XML_FILENAME, serviceMcasElement);
            addMcaDefinitions(handler);
        }

        // get all of the component resource eca stuff, ie specified in each ofbiz-component.xml file
        for (ComponentConfig.ServiceResourceInfo componentResourceInfo: ComponentConfig.getAllServiceResourceInfos("mca")) {
View Full Code Here

                        Debug.logError(e, "Error getting Service Engine XML root element", module);
                        return null;
                    }

                    for (Element globalServicesElement: UtilXml.childElementList(rootElement, "global-services")) {
                        ResourceHandler handler = new MainResourceHandler(
                                ServiceConfigUtil.SERVICE_ENGINE_XML_FILENAME, globalServicesElement);

                        Map<String, ModelService> servicesMap = ModelServiceReader.getModelServiceMap(handler, this);
                        if (servicesMap != null) {
                            serviceMap.putAll(servicesMap);
View Full Code Here

            throw new GenericEntityConfException("Cound not find an entity-model-reader with the name " + modelName);
        }

        // get all of the main resource model stuff, ie specified in the entityengine.xml file
        for (Element resourceElement: entityModelReaderInfo.resourceElements) {
            ResourceHandler handler = new MainResourceHandler(EntityConfigUtil.ENTITY_ENGINE_XML_FILENAME, resourceElement);
            entityResourceHandlers.add(handler);
        }
       
        // get all of the component resource model stuff, ie specified in each ofbiz-component.xml file
        for (ComponentConfig.EntityResourceInfo componentResourceInfo: ComponentConfig.getAllEntityResourceInfos("model")) {
View Full Code Here

        }

        Iterator eecaResourceIter = entityEcaReaderInfo.resourceElements.iterator();
        while (eecaResourceIter.hasNext()) {
            Element eecaResourceElement = (Element) eecaResourceIter.next();
            ResourceHandler handler = new MainResourceHandler(EntityConfigUtil.ENTITY_ENGINE_XML_FILENAME, eecaResourceElement);
            addEcaDefinitions(handler, ecaCache);
        }

        // get all of the component resource eca stuff, ie specified in each ofbiz-component.xml file
        List componentResourceInfos = ComponentConfig.getAllEntityResourceInfos("eca");
View Full Code Here

                // get all of the main resource model stuff, ie specified in the entityengine.xml file
                EntityDataReaderInfo entityDataReaderInfo = EntityConfigUtil.getEntityDataReaderInfo(readerName);
               
                if (entityDataReaderInfo != null) {
                    for (Element resourceElement: entityDataReaderInfo.resourceElements) {
                        ResourceHandler handler = new MainResourceHandler(EntityConfigUtil.ENTITY_ENGINE_XML_FILENAME, resourceElement);
                        try {
                            urlList.add(handler.getURL());
                        } catch (GenericConfigException e) {
                            String errorMsg = "Could not get URL for Main ResourceHandler: " + e.toString();
                            Debug.logWarning(errorMsg, module);
                        }
                    }
       
                    // get all of the component resource model stuff, ie specified in each ofbiz-component.xml file
                    for (ComponentConfig.EntityResourceInfo componentResourceInfo: ComponentConfig.getAllEntityResourceInfos("data", componentName)) {
                        if (readerName.equals(componentResourceInfo.readerName)) {
                            ResourceHandler handler = componentResourceInfo.createResourceHandler();
                            try {
                                urlList.add(handler.getURL());
                            } catch (GenericConfigException e) {
                                String errorMsg = "Could not get URL for Component ResourceHandler: " + e.toString();
                                Debug.logWarning(errorMsg, module);
                            }
                        }
View Full Code Here

                    List globalServicesElements = UtilXml.childElementList(rootElement, "global-services");
                    Iterator gseIter = globalServicesElements.iterator();
                    while (gseIter.hasNext()) {
                        Element globalServicesElement = (Element) gseIter.next();
                        ResourceHandler handler = new MainResourceHandler(
                                ServiceConfigUtil.SERVICE_ENGINE_XML_FILENAME, globalServicesElement);

                        Map servicesMap = ModelServiceReader.getModelServiceMap(handler, this);
                        if (servicesMap != null) {
                            serviceMap.putAll(servicesMap);
View Full Code Here

        List serviceGroupElements = UtilXml.childElementList(rootElement, "service-groups");
        Iterator groupsIter = serviceGroupElements.iterator();
        while (groupsIter.hasNext()) {
            Element serviceGroupElement = (Element) groupsIter.next();
            ResourceHandler handler = new MainResourceHandler(ServiceConfigUtil.SERVICE_ENGINE_XML_FILENAME, serviceGroupElement);
            addGroupDefinitions(handler);
        }

        // get all of the component resource group stuff, ie specified in each ofbiz-component.xml file
        List componentResourceInfos = ComponentConfig.getAllServiceResourceInfos("group");
View Full Code Here

        List serviceEcasElements = UtilXml.childElementList(rootElement, "service-ecas");
        Iterator secasIter = serviceEcasElements.iterator();
        while (secasIter.hasNext()) {
            Element serviceEcasElement = (Element) secasIter.next();
            ResourceHandler handler = new MainResourceHandler(ServiceConfigUtil.SERVICE_ENGINE_XML_FILENAME, serviceEcasElement);
            addEcaDefinitions(handler);
        }

        // get all of the component resource eca stuff, ie specified in each ofbiz-component.xml file
        List componentResourceInfos = ComponentConfig.getAllServiceResourceInfos("eca");
View Full Code Here

        }

        Iterator eecaResourceIter = entityEcaReaderInfo.resourceElements.iterator();
        while (eecaResourceIter.hasNext()) {
            Element eecaResourceElement = (Element) eecaResourceIter.next();
            ResourceHandler handler = new MainResourceHandler(EntityConfigUtil.ENTITY_ENGINE_XML_FILENAME, eecaResourceElement);
            addEcaDefinitions(handler, ecaCache);
        }

        // get all of the component resource eca stuff, ie specified in each ofbiz-component.xml file
        List componentResourceInfos = ComponentConfig.getAllEntityResourceInfos("eca");
View Full Code Here

TOP

Related Classes of org.ofbiz.base.config.ResourceHandler

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.