Package edu.monash.merc.dto

Examples of edu.monash.merc.dto.PartyBean


        List<PartyBean> partyBeans = mdRegistrationBean.getPartyBeans();
        for (PartyBean p : partyBeans) {
            try {
                String rifcs = null;
                if (p.isFromRm()) {
                    PartyBean pb = this.paWsService.getParty(p.getPartyKey());
                    String rifcsContents = pb.getRifcsContent();
                    StringBuilder rifcsbuilder = new StringBuilder();
                    rifcsbuilder.append(getRifcsHeader());
                    rifcsbuilder.append(rifcsContents);
                    rifcsbuilder.append(getRifcsEnder());
                    rifcs = rifcsbuilder.toString();
View Full Code Here


      String nlaId = this.partyActivitySvc.getNlaId(authcateId);
      System.out.println("nlaId: " + nlaId);

      // get the researcher party from rm ws
      PartyBean partyBean = this.partyActivitySvc.getParty(nlaId);
      System.out.println("partyBean: " + partyBean.toString());
      String rifcsContent = partyBean.getRifcsContent();
      stringResult = genSuccessMsg(rifcsContent);
    } catch (Exception e) {
      String errorMsg = e.getMessage();
      String errorMessage;
      if (StringUtils.containsIgnoreCase(errorMsg, "NLA Id not found") ||
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    private PartyBean parseParty(SOAPEnvelope respEnvelope) {
        PartyBean pb = new PartyBean();
        pb.setFromRm(true);
        // System.out.println("=== party envelope: " + respEnvelope);
        OMElement partyRegistryObjectsElement = respEnvelope.getBody().getFirstElement();
        OMElement registryObject = partyRegistryObjectsElement.getFirstElement();

        //System.out.println("====> registryObject: " + registryObject);
        // get the party group
        OMAttribute groupAtt = registryObject.getAttribute(new QName("group"));
        pb.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();
            pb.setPartyKey(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
            pb.setOriginateSourceType(typeAtt.getAttributeValue());

            // set originating source type value
            pb.setOriginateSourceValue(origvalue);
        }

        // originating source
        Iterator<OMElement> partyIt = registryObject.getChildrenWithName(new QName(DEFAULT_RESPONSE_NAMESPACE, "party"));
        if (partyIt.hasNext()) {
            OMElement partyElement = partyIt.next();
            // identifier
            Iterator<OMElement> identifierIt = partyElement.getChildrenWithName(new QName(DEFAULT_RESPONSE_NAMESPACE, "identifier"));
            if (identifierIt.hasNext()) {
                OMElement identifierEle = identifierIt.next();
                OMAttribute typeAtt = identifierEle.getAttribute(new QName("type"));

                // set the identifier
                pb.setIdentifierType(typeAtt.getAttributeValue());
                pb.setIdentifierValue(identifierEle.getText());
            }

            // person name and name part
            Iterator<OMElement> pNameIt = partyElement.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"));
                while (pNamePartIt.hasNext()) {
                    OMElement pnamePartElement = pNamePartIt.next();
                    OMAttribute typeAtt = pnamePartElement.getAttribute(new QName("type"));
                    String typeValue = typeAtt.getAttributeValue();
                    if (typeValue.equals("title")) {
                        // set the person title
                        pb.setPersonTitle(pnamePartElement.getText());
                    }
                    if (typeValue.equals("given")) {
                        // set the person givenname
                        pb.setPersonGivenName(pnamePartElement.getText());
                    }
                    if (typeValue.equals("family")) {
                        // set the person family name
                        pb.setPersonFamilyName(pnamePartElement.getText());
                    }
                }
            }
            // location
            Iterator<OMElement> locationIt = partyElement.getChildrenWithName(new QName(DEFAULT_RESPONSE_NAMESPACE, "location"));
            if (locationIt.hasNext()) {
                OMElement locElement = locationIt.next();
                Iterator<OMElement> addressIt = locElement.getChildrenWithName(new QName(DEFAULT_RESPONSE_NAMESPACE, "address"));
                if (addressIt.hasNext()) {
                    OMElement addressElement = addressIt.next();
                    Iterator<OMElement> electronicaddIt = addressElement.getChildrenWithName(new QName(DEFAULT_RESPONSE_NAMESPACE, "electronic"));
                    while (electronicaddIt.hasNext()) {
                        OMElement electronicElement = electronicaddIt.next();
                        OMAttribute typeAtt = electronicElement.getAttribute(new QName("type"));
                        OMElement valueElement = electronicElement.getFirstElement();
                        String typeValue = typeAtt.getAttributeValue();
                        if (typeValue.equals("url")) {
                            // set url
                            pb.setUrl(valueElement.getText());
                        }
                        if (typeValue.equals("email")) {
                            // set email
                            pb.setEmail(valueElement.getText());
                        }
                    }
                }
            }
        }

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

        long time2 = System.currentTimeMillis();

        for (int i = 0; i < 1; i++) {
            try {
                PartyBean pb = ws.getPartyRegistryObject(nlaid);

                System.out.println("====> party - key: " + pb.getPartyKey() + " - group: " + pb.getGroupName() + " - identifier type: "
                        + pb.getIdentifierType() + " - identifier value: " + pb.getIdentifierValue() + " - person title: " + pb.getPersonTitle()
                        + " - given name: " + pb.getPersonGivenName() + " - family name: " + pb.getPersonFamilyName() + " - orig type:  "
                        + pb.getOriginateSourceType() + " - orig source value: " + pb.getOriginateSourceValue() + " - url: " + pb.getUrl()
                        + " - email: " + pb.getEmail());
                System.out.println("====> party rifcs: " + pb.getRifcsContent());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        long time3 = System.currentTimeMillis();
View Full Code Here

TOP

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

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.