Package edu.monash.merc.dto

Examples of edu.monash.merc.dto.ActivityBean


    }

    @SuppressWarnings("unchecked")
    private ActivityBean parseActivity(SOAPEnvelope respEnvelope) {
        ActivityBean ab = new ActivityBean();

        OMElement activityRegistryObjectsElement = respEnvelope.getBody().getFirstElement();
        // System.out.println("activity: rif-cs: " + activityRegistryObjectsElement);
        OMElement registryObject = activityRegistryObjectsElement.getFirstElement();

        // get the party group
        OMAttribute groupAtt = registryObject.getAttribute(new QName("group"));
        ab.setGroupName(groupAtt.getAttributeValue());

        // set the party key
        Iterator<OMElement> keyit = registryObject.getChildrenWithName(new QName(DEFAULT_RESPONSE_NAMESPACE, "key"));
        if (keyit.hasNext()) {
            OMElement keyElement = keyit.next();
            String key = keyElement.getText();
            ab.setActivityKey(key);
        }

        // originating source
        Iterator<OMElement> origit = registryObject.getChildrenWithName(new QName(DEFAULT_RESPONSE_NAMESPACE, "originatingSource"));
        if (origit.hasNext()) {
            OMElement orig = origit.next();
            OMAttribute typeAtt = orig.getAttribute(new QName("type"));
            String origvalue = orig.getText();
            // set originating source type
            ab.setOriginateSourceType(typeAtt.getAttributeValue());
            // set originating source type value
            ab.setOriginateSourceValue(origvalue);
        }

        // originating source
        Iterator<OMElement> activityIt = registryObject.getChildrenWithName(new QName(DEFAULT_RESPONSE_NAMESPACE, "activity"));
        if (activityIt.hasNext()) {
            OMElement activityElement = activityIt.next();
            // identifier
            Iterator<OMElement> identifierIt = activityElement.getChildrenWithName(new QName(DEFAULT_RESPONSE_NAMESPACE, "identifier"));
            if (identifierIt.hasNext()) {
                OMElement identifierEle = identifierIt.next();
                OMAttribute typeAtt = identifierEle.getAttribute(new QName("type"));
                // set the identifier
                ab.setIdentifierType(typeAtt.getAttributeValue());
                ab.setIdentifierValue(identifierEle.getText());
            }

            // activity name and name part
            Iterator<OMElement> pNameIt = activityElement.getChildrenWithName(new QName(DEFAULT_RESPONSE_NAMESPACE, "name"));
            if (pNameIt.hasNext()) {
                OMElement pNameElement = pNameIt.next();
                Iterator<OMElement> pNamePartIt = pNameElement.getChildrenWithName(new QName(DEFAULT_RESPONSE_NAMESPACE, "namePart"));
                if (pNamePartIt.hasNext()) {
                    OMElement pnamePartElement = pNamePartIt.next();
                    // set the name part value - title
                    ab.setNamePartValue(pnamePartElement.getText());
                }
            }
            // desc
            Iterator<OMElement> descIt = activityElement.getChildrenWithName(new QName(DEFAULT_RESPONSE_NAMESPACE, "description"));
            if (descIt.hasNext()) {
                OMElement descElement = descIt.next();
                OMAttribute typeAtt = descElement.getAttribute(new QName("type"));
                // set the desc type
                ab.setDescType(typeAtt.getAttributeValue());
                // set the desc
                ab.setDescValue(descElement.getText());
            }
        }

        ab.setRifcsContent(normalizerifcs(registryObject.toString()));
        // System.out.println("activity rifcs content: " + ab.getRifcsContent());
        return ab;
    }
View Full Code Here


        }

        long time4 = System.currentTimeMillis();
        for (int i = 0; i < 1; i++) {
            try {
                ActivityBean ab = ws.getActivityRegistryObject("MON:2010002282");
                System.out.println("====> activity - key: " + ab.getActivityKey() + " - group: " + ab.getGroupName() + " - identifier type: "
                        + ab.getIdentifierType() + " - identifier value: " + ab.getIdentifierValue() + " - orig type:  "
                        + ab.getOriginateSourceType() + " - orig source value: " + ab.getOriginateSourceValue() + " - name part title: "
                        + ab.getNamePartValue() + " - desc type: " + ab.getDescType() + " - desc: " + ab.getDescValue());
                System.out.println("====> activity rifcs: " + ab.getRifcsContent());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
View Full Code Here

TOP

Related Classes of edu.monash.merc.dto.ActivityBean

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.