Package org.milyn.cdr

Examples of org.milyn.cdr.SmooksConfigurationException


            BeanWriter beanWriter = beanWriterClass.newInstance();

            Configurator.configure(beanWriter, config, appContext);
            getBeanWriters(beanClass, appContext).put(config.getSelectorNamespaceURI(), beanWriter);           
        } catch (InstantiationException e) {
            throw new SmooksConfigurationException("Unable to create BeanWriter instance.", e);
        } catch (IllegalAccessException e) {
            throw new SmooksConfigurationException("Unable to create BeanWriter instance.", e);
        }
    }
View Full Code Here


          Element keyElement = (Element)keys.item(i);

          String from = DomUtils.getAttributeValue(keyElement, KEY_MAP_KEY_ELEMENT_FROM_ATTRIBUTE);

          if(StringUtils.isBlank(from)) {
            throw new SmooksConfigurationException("The '"+ KEY_MAP_KEY_ELEMENT_FROM_ATTRIBUTE +"' attribute isn't defined or is empty for the key element: " + keyElement);
          }
          from = from.trim();

          String value = DomUtils.getAttributeValue(keyElement, KEY_MAP_KEY_ELEMENT_TO_ATTRIBUTE);
          if(value == null) {
View Full Code Here

                                    config.setSelectorNamespaceURI(namespace.uri);
                                }
                            }
                        }
                    } catch (URISyntaxException e) {
                        throw new SmooksConfigurationException("Unexpected configuration digest exception.", e);
                    }

                    smooks.getApplicationContext().getStore().addSmooksResourceConfigurationList(configList);
                } else {
                    throw new SAXException("Binding configuration resolver '" + bindingResolver.getClass().getName() + "' failed to resolve binding configuration for namespace '" + namespace + "'.  Resolver must return an InputStream in the InputSource.");
View Full Code Here

                Namespace namespace = new Namespace();
                String namespaceUri = (String) property.getValue();
                String namespaceId = getNamespaceId(namespaceUri, descriptor);

                if(namespaceId == null) {
                    throw new SmooksConfigurationException("Unable to resolve namespace ID for namespace URI '" + namespaceUri + "'.");
                }

                String namespaceOrder = descriptor.getProperty(namespaceId + DESCRIPTOR_ORDER_POSTFIX, Integer.toString(Integer.MAX_VALUE)).trim();

                namespace.uri = namespaceUri;
                try {
                    namespace.order = Integer.parseInt(namespaceOrder);
                } catch(NumberFormatException e) {
                    throw new SmooksConfigurationException("Invalid value for descriptor config value '" + namespaceId + DESCRIPTOR_ORDER_POSTFIX + "'.  Must be a valid Integer value.");
                }

                namespaces.add(namespace);
            }
        }
View Full Code Here

            getParameters().setProperty("bindBeanId", binding.getBeanId());
            getParameters().setProperty("bindBeanClass", binding.getBeanClass().getName());
            getParameters().setProperty("bindingType", binding.getBindingType().toString());
            if(binding.getBindingType() == BindingType.MAP) {
                if(binding.getKeyField() == null) {
                    throw new SmooksConfigurationException("CSV 'MAP' Binding must specify a 'keyField' property on the binding configuration.");
                }
                getParameters().setProperty("bindMapKeyField", binding.getKeyField());
            }
        }
View Full Code Here

          Element keyElement = (Element)keys.item(i);

          String from = DomUtils.getAttributeValue(keyElement, KEY_MAP_KEY_ELEMENT_FROM_ATTRIBUTE);

          if(StringUtils.isBlank(from)) {
            throw new SmooksConfigurationException("The '"+ KEY_MAP_KEY_ELEMENT_FROM_ATTRIBUTE +"' attribute isn't defined or is empty for the key element: " + keyElement);
          }
          from = from.trim();

          String value = DomUtils.getAttributeValue(keyElement, KEY_MAP_KEY_ELEMENT_TO_ATTRIBUTE);
          if(value == null) {
View Full Code Here

            RuleProviderAccessor.add(applicationContext, providerImpl);
        }
        else
        {
            throw new SmooksConfigurationException("Invalid rule provider configuration :'" + this + "'");
        }
    }
View Full Code Here

            Element rootElement = xslDoc.getDocumentElement();
            String rootElementNS = rootElement.getNamespaceURI();

            return (inlineXSL && !(rootElementNS != null && rootElementNS.equals("http://www.w3.org/1999/XSL/Transform") && DomUtils.getName(rootElement).equals("stylesheet")));
        } catch (ParserConfigurationException e) {
            throw new SmooksConfigurationException("Unable to parse XSL Document (Stylesheet/Templatelet).", e);
        } catch (IOException e) {
            throw new SmooksConfigurationException("Unable to parse XSL Document (Stylesheet/Templatelet).", e);
        } catch (SAXException e) {
            return inlineXSL;
        }
    }
View Full Code Here

            }

            try {
                loadTemplate(config);
            } catch (Exception e) {
                throw new SmooksConfigurationException("Error loading Templating resource: " + config, e);
            }
        } else if(smooksConfig != null) {
            if(smooksConfig.getResource() == null) {
                throw new SmooksConfigurationException("Templating resource undefined in resource configuration: " + smooksConfig);
            }

            try {
                loadTemplate(smooksConfig);
            } catch (Exception e) {
                throw new SmooksConfigurationException("Error loading Templating resource: " + smooksConfig, e);
            }
            String visitBefore = smooksConfig.getStringParameter("visitBefore");
            if(visitBefore != null) {
                if(!legactVisitBeforeParamWarn) {
                    logger.warn("Templating <param> 'visitBefore' deprecated.  Use 'applyTemplateBefore'.");
                    legactVisitBeforeParamWarn = true;
                }
                this.applyTemplateBefore = visitBefore.equalsIgnoreCase("true");
            }

            if(action == Action.BIND_TO) {
                if(bindId == null) {
                    throw new SmooksConfigurationException("'bindto' templating action configurations must also specify a 'bindId' configuration for the Id under which the result is bound to the ExecutionContext");
                } else {
                    bindBeanId = applicationContext.getBeanIdStore().register(bindId);
                }
            }
        } else {
            throw new SmooksConfigurationException(getClass().getSimpleName() + " not configured.");
        }
    }
View Full Code Here

        CSVReader csvLineReader = new CSVReader(new InputStreamReader(ruleStream));
        List<String[]> entries;
        try {
            entries = csvLineReader.readAll();
        } catch (IOException e) {
            throw new SmooksConfigurationException("Error reading MVEL rule file (CSV format) '" + src + "'.", e);
        } finally {
            try {
                ruleStream.close();
            } catch (IOException e) {
                logger.debug("Error closing MVEL rule file '" + src + "'.", e);
View Full Code Here

TOP

Related Classes of org.milyn.cdr.SmooksConfigurationException

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.