Package jeeves.server.dispatchers.guiservices

Examples of jeeves.server.dispatchers.guiservices.XmlCacheManager


     * @param key the key to look up.  may contain / but cannot start with one.  for example: categories/water
     * @return
     */
    public static Map<String, String> translate(ServiceContext context, String type, String key) throws JDOMException, IOException {
        String appPath = context.getAppPath();
        XmlCacheManager cacheManager = context.getXmlCacheManager();
        File loc = new File(appPath, "loc");
        String typeWithExtension = "xml"+File.separator+type+".xml";
        Map<String, String> translations = new HashMap<String, String>();
       
        for (File file : loc.listFiles()) {
            if(file.isDirectory() && new File(file, typeWithExtension).exists()) {
                Element xml = cacheManager.get(context, true, loc.getAbsolutePath(), typeWithExtension, file.getName(), file.getName());
                String translation = Xml.selectString(xml, key);
                if(translation != null && !translation.trim().isEmpty()) {
                    translations.put(file.getName(), translation);
                }
            }
View Full Code Here


    @Override
    public Element exec(Element params, ServiceContext context) throws Exception {
        SchemaManager schemaManager = context.getApplicationContext().getBean(SchemaManager.class);
        SchematronCriteriaGroupRepository criteriaGroupRepo = context.getApplicationContext().getBean(SchematronCriteriaGroupRepository.class);
        final XmlCacheManager cacheManager = context.getBean(XmlCacheManager.class);

        Element schematrons = schematronService.exec(params, context);
        Element results = new Element(Jeeves.Elem.RESPONSE);
        Element schemas = new Element("schemas");
        results.addContent(schemas);
View Full Code Here

    private void addCriteriaTypeDefinition(ServiceContext context, SchemaManager schemaManager, Element schemaEl, String schemaName) throws IOException, JDOMException {

        final String schemaDir = schemaManager.getSchemaDir(schemaName);
        File file = new File(schemaDir, "schematron" + File.separator + "criteria-type.xml");

        final XmlCacheManager cacheManager = context.getBean(XmlCacheManager.class);
        Element criteriaTypeTranslations = loadTranslations(context, schemaDir, "criteria-type.xml", cacheManager);

        if (file.exists()) {
            Element criteriaType = Xml.loadFile(file);
            criteriaType.setName("criteriaTypes");
View Full Code Here

TOP

Related Classes of jeeves.server.dispatchers.guiservices.XmlCacheManager

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.