Package org.dom4j.tree

Examples of org.dom4j.tree.DefaultElement


        {
            element = root.addElement( SEARCH_RESULT_DONE_TAG );
        }
        else
        {
            element = new DefaultElement( SEARCH_RESULT_DONE_TAG );
        }

        LdapResultDsml ldapResultDsml =
            new LdapResultDsml( getCodecService(), getDecorated().getLdapResult(), getDecorated() );
        if ( ldapResultDsml != null )
View Full Code Here


        {
            element = root.addElement( SEARCH_RESPONSE_TAG );
        }
        else
        {
            element = new DefaultElement( SEARCH_RESPONSE_TAG );
        }


        // RequestID
        if ( getDecorated() != null )
View Full Code Here

        {
            element = root.addElement( EXTENDED_RESPONSE_TAG );
        }
        else
        {
            element = new DefaultElement( EXTENDED_RESPONSE_TAG );
        }
       
        ExtendedResponse extendedResponse = ( ExtendedResponse ) getDecorated();

        // LDAP Result
View Full Code Here

      if (log.isDebugEnabled())
      {
        log.debug("SubProcessName after eval: " + subProcessNameResolved);
      }
      attributes.add(new FlyweightAttribute("name", subProcessNameResolved));
      Element subProcessElement = new DefaultElement("sub-process");
      subProcessElement.setAttributes(attributes);

      usedSubProcessDefinition = subProcessResolver.findSubProcess(subProcessElement);
    }

    // create the subprocess
View Full Code Here

    }

    @SuppressWarnings({"unchecked"})
    IdMappingData addId(PersistentClass pc) {
        // Xml mapping which will be used for relations
        Element rel_id_mapping = new DefaultElement("properties");
        // Xml mapping which will be used for the primary key of the versions table
        Element orig_id_mapping = new DefaultElement("composite-id");

        Property id_prop = pc.getIdentifierProperty();
        Component id_mapper = pc.getIdentifierMapper();

        // Checking if the id mapping is supported
        if (id_mapper == null && id_prop == null) {
            return null;
        }

        SimpleIdMapperBuilder mapper;
        if (id_mapper != null) {
            // Multiple id

            mapper = new MultipleIdMapper(((Component) pc.getIdentifier()).getComponentClassName());
            addIdProperties(rel_id_mapping, (Iterator<Property>) id_mapper.getPropertyIterator(), mapper, false);

            // null mapper - the mapping where already added the first time, now we only want to generate the xml
            addIdProperties(orig_id_mapping, (Iterator<Property>) id_mapper.getPropertyIterator(), null, true);
        } else if (id_prop.isComposite()) {
            // Embedded id

            Component id_component = (Component) id_prop.getValue();

            mapper = new EmbeddedIdMapper(getIdPropertyData(id_prop), id_component.getComponentClassName());
            addIdProperties(rel_id_mapping, (Iterator<Property>) id_component.getPropertyIterator(), mapper, false);

            // null mapper - the mapping where already added the first time, now we only want to generate the xml
            addIdProperties(orig_id_mapping, (Iterator<Property>) id_component.getPropertyIterator(), null, true);
        } else {
            // Single id
           
            mapper = new SingleIdMapper();

            // Last but one parameter: ids are always insertable
            mainGenerator.getBasicMetadataGenerator().addBasic(rel_id_mapping,
                    getIdPersistentPropertyAuditingData(id_prop),
                    id_prop.getValue(), mapper, true, false);

            // null mapper - the mapping where already added the first time, now we only want to generate the xml
            mainGenerator.getBasicMetadataGenerator().addBasic(orig_id_mapping,
                    getIdPersistentPropertyAuditingData(id_prop),
                    id_prop.getValue(), null, true, true);
        }

        orig_id_mapping.addAttribute("name", mainGenerator.getVerEntCfg().getOriginalIdPropName());

        // Adding a relation to the revision entity (effectively: the "revision number" property)
        mainGenerator.addRevisionInfoRelation(orig_id_mapping);

        return new IdMappingData(mapper, orig_id_mapping, rel_id_mapping);
View Full Code Here

    @Override
    public void endNode() {
        try {
            if (!children) {
                final Element element = new DefaultElement(elementStack.pop());
                for (int i = 0; i < attributes.getLength(); ++i) {
                    element.addAttribute(attributes.getQName(i), attributes.getValue(i));
                }
                writer.write(element);
                attributes.clear();
                children = true; // node just closed is child of node on top of stack
                started = true;
View Full Code Here

  public void jBpmVariableMap() throws Exception
  {
        SAXReader reader = new SAXReader();
        Document document = reader.read(this.getClass().getResourceAsStream("/" + PROCESS_DEF_XML));
        Element element = document.getRootElement();
        DefaultElement bpmToEsbVars = (DefaultElement) element.element("start-state").element("transition").element("action").element("bpmToEsbVars");

    String helloWorldTokenScope  = "Hello world token scope";
        String helloWorldGlobalScope = "Hello world process-instance scope";
        TestJBPMVariable objectTokenScope = new TestJBPMVariable("Object token scope") ;
        TestJBPMVariable objectGlobalScope = new TestJBPMVariable("Object global scope") ;
View Full Code Here

     */
    @Test
    public void jBpmCompleteVariableMap() throws Exception
    {
        //Let's NOT give a mapping, this should get us all the variables in the VariableMap.
        DefaultElement jbpmToEsbVars = null;

        String helloWorldTokenScope  = "Hello world token scope";
        String helloWorldGlobalScope = "Hello world process-instance scope";
        TestJBPMVariable objectTokenScope = new TestJBPMVariable("Object token scope") ;
        TestJBPMVariable objectGlobalScope = new TestJBPMVariable("Object global scope") ;
View Full Code Here

    {
        SAXReader reader = new SAXReader();
        Document document = reader.read(this.getClass().getResourceAsStream("/" + PROCESS_DEF_XML));
        Element element = document.getRootElement();
        Element secondMiddleState = (Element) element.elements("state").toArray()[0];
        DefaultElement bpmToEsbVars = (DefaultElement) secondMiddleState.element("transition").element("action").element("bpmToEsbVars");

        String helloWorldTokenScope  = "Hello world token scope";
        String helloWorldGlobalScope = "Hello world process-instance scope";
        TestJBPMVariable objectTokenScope = new TestJBPMVariable("Object token scope") ;
        TestJBPMVariable objectGlobalScope = new TestJBPMVariable("Object global scope") ;
View Full Code Here

    {
        SAXReader reader = new SAXReader();
        Document document = reader.read(this.getClass().getResourceAsStream("/" + PROCESS_DEF_XML));
        Element element = document.getRootElement();
        Element secondMiddleState = (Element) element.elements("state").toArray()[1];
        DefaultElement bpmToEsbVars = (DefaultElement) secondMiddleState.element("transition").element("action").element("bpmToEsbVars");

        Token token = processInstance.getRootToken();
        ExecutionContext executionContext = new ExecutionContext(token);
        Node node = executionContext.getNode();
        Transition transition = (Transition) node.getLeavingTransitions().get(0);
View Full Code Here

TOP

Related Classes of org.dom4j.tree.DefaultElement

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.