Package org.apache.cocoon.forms.binding.library

Examples of org.apache.cocoon.forms.binding.library.Library$Dependency


   * @see org.apache.cocoon.forms.binding.JXPathBindingBuilderBase#buildBinding(org.w3c.dom.Element, org.apache.cocoon.forms.binding.JXPathBindingManager.Assistant)
   */
  public JXPathBindingBase buildBinding(Element bindingElm, Assistant assistant)
    throws BindingException {

    Library lib = assistant.getContext().getLocalLibrary();

    String id = DomHelper.getAttribute(bindingElm, "id", null);

        if (id == null) {
            throw new BindingException("Attribute id is required! (at " + DomHelper.getLocation(bindingElm) + ")");
        }

        try {
            return (JXPathBindingBase) lib.getBinding(id);
        } catch (LibraryException e) {
            throw new BindingException("Could not expand binding from library! (at " + DomHelper.getLocation(bindingElm) + ")", e);
        }
    }
View Full Code Here


            JXPathBindingBuilderBase bindingBuilder = getBindingBuilder(bindingType);

            boolean flag = false;
            if (context.getLocalLibrary() == null) {
                // FIXME Use newLibrary()?
                Library lib = new Library(libraryManager);
                lib.enableLogging(getMyLogger());
                context.setLocalLibrary(lib);
                lib.setAssistant(getBuilderAssistant());
                lib.setSourceURI(LocationAttributes.getURI(configElm));
                flag = true;
            }

            if (context.getLocalLibrary() != null && configElm.hasAttribute("extends")) {
                try {
View Full Code Here

  /* (non-Javadoc)
   * @see JXPathBindingBuilderBase#buildBinding(Element, JXPathBindingManager.Assistant)
   */
  public JXPathBindingBase buildBinding(Element bindingElm, Assistant assistant)
    throws BindingException {
    Library lib = assistant.getContext().getLocalLibrary();

        String prefix = DomHelper.getAttribute(bindingElm, "prefix", null);
        String uri = DomHelper.getAttribute(bindingElm, "uri", null);

        if (prefix == null || uri == null) {
            throw new BindingException("Import needs to specify both @uri and @prefix! (at " + DomHelper.getLocation(bindingElm) + ")");
        }

        try {
            lib.includeAs(prefix, uri);
        } catch (LibraryException e) {
            throw new BindingException("Could not import library !(at " + DomHelper.getLocation(bindingElm) + ")", e);
        }

        return new ImportJXPathBinding();
View Full Code Here

                Connector15DCBRoot root = (Connector15DCBRoot) config.getDConfigBeanRoot(ddBeanRoot);
                ConnectorDCB connector = (ConnectorDCB) root.getDConfigBean(ddBeanRoot.getChildBean(root.getXpaths()[0])[0]);
                connector.setConfigID("user/database-pool-"+data.getName() + "/1/car");
                // Use a parentId of null to pick up the default
                if(data.jar1 != null && !data.jar1.equals("")) {
                    Dependency dep = new Dependency();
                    connector.setDependency(new Dependency[]{dep});
                    dep.setURI(data.jar1);
                }
                if(data.jar2 != null && !data.jar2.equals("")) {
                    Dependency dep = new Dependency();
                    Dependency[] old = connector.getDependency();
                    Dependency[] longer = new Dependency[old.length+1];
                    System.arraycopy(old, 0, longer, 0, old.length);
                    longer[old.length] = dep;
                    connector.setDependency(longer);
                    dep.setURI(data.jar2);
                }
                if(data.jar3 != null && !data.jar3.equals("")) {
                    Dependency dep = new Dependency();
                    Dependency[] old = connector.getDependency();
                    Dependency[] longer = new Dependency[old.length+1];
                    System.arraycopy(old, 0, longer, 0, old.length);
                    longer[old.length] = dep;
                    connector.setDependency(longer);
                    dep.setURI(data.jar3);
                }
                ResourceAdapter adapter = connector.getResourceAdapter()[0];
                ConnectionDefinition definition = new ConnectionDefinition();
                adapter.setConnectionDefinition(new ConnectionDefinition[]{definition});
                definition.setConnectionFactoryInterface("javax.sql.DataSource");
View Full Code Here

TOP

Related Classes of org.apache.cocoon.forms.binding.library.Library$Dependency

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.