Examples of ObjectFactory


Examples of com.sun.xml.ws.security.wsu10.ObjectFactory

        return otherAttributes.get(name);
    }
   
    public javax.xml.stream.XMLStreamReader readHeader() throws javax.xml.stream.XMLStreamException {
        XMLStreamBufferResult xbr = new XMLStreamBufferResult();
        JAXBElement<TimestampType> tsElem = new ObjectFactory().createTimestamp(this);
        try{
            getMarshaller().marshal(tsElem, xbr);
           
        } catch(JAXBException je){
            throw new XMLStreamException(je);
View Full Code Here

Examples of com.sun.xml.wss.saml.internal.saml11.jaxb20.ObjectFactory

     *            sender or in the element definition.
     */
    public Subject(
        NameIdentifier nameIdentifier, SubjectConfirmation subjectConfirmation)
        {
        ObjectFactory factory = new ObjectFactory();
       
        if ( nameIdentifier != null)
            getContent().add(factory.createNameIdentifier(nameIdentifier));
       
        if ( subjectConfirmation != null)
            getContent().add(factory.createSubjectConfirmation(subjectConfirmation));
    }
View Full Code Here

Examples of com.sun.xml.wss.saml.internal.saml20.jaxb20.ObjectFactory

     * @exception SAMLException if it could not process the
     *            Element properly, implying that there is an error in the
     *            sender or in the element definition.
     */
    public Subject(NameID nameId, SubjectConfirmation subjectConfirmation){
        ObjectFactory factory = new ObjectFactory();
       
        if ( nameId != null)
            getContent().add(factory.createNameID(nameId));
       
        if ( subjectConfirmation != null)
            getContent().add(factory.createSubjectConfirmation(subjectConfirmation));
    }
View Full Code Here

Examples of com.tuscanyscatours.emailgateway.ObjectFactory

    @Test
    public void testEmailGateway() {
        SCAClient client = (SCAClient)node;
        EmailGateway cc = client.getService(EmailGateway.class, "EmailGatewayClient");
        ObjectFactory objectFactory = new ObjectFactory();
        EmailType email = objectFactory.createEmailType();
        email.setTo("Fred");
        email.setTitle("An email");
        email.setBody("A message");
        System.out.println(cc.sendEmail(email));
    }
View Full Code Here

Examples of com.tuscanyscatours.payment.creditcard.ObjectFactory

    @Test
    public void testCreditCardPayment() {
        SCAClient client = (SCAClient)node;
        CreditCardPayment cc = client.getService(CreditCardPayment.class, "CreditCardPayment");

        ObjectFactory objectFactory = new ObjectFactory();
        CreditCardDetailsType ccDetails = objectFactory.createCreditCardDetailsType();
        ccDetails.setCreditCardType(CreditCardTypeType.fromValue("Visa"));
        PayerType ccOwner = objectFactory.createPayerType();
        ccOwner.setName("Fred");
        ccDetails.setCardOwner(ccOwner);

        try {
            System.out.println(cc.authorize(ccDetails, 100.00f));
View Full Code Here

Examples of com.wot.shared.ObjectFactory

  @Override
  public Clan getClans(String input, int offset) throws IllegalArgumentException {
    //////////
    log.warning("========lancement getClans ==============");
    ObjectFactory objFactory = null;
    try {
      JAXBContext context = JAXBContext.newInstance(XmlWiki.class);
     
//      //création WIKI
      if (wiki== null) {
        objFactory = new ObjectFactory();
     
        wiki = objFactory.createXmlWiki();

        //A partir du XML instancié les classes !!
        Unmarshaller unmarshaller = context.createUnmarshaller();
        wiki = (XmlWiki) unmarshaller.unmarshal(new File("wotWiki.xml"));
        log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>unmarshaller wotWiki.xml");
View Full Code Here

Examples of de.willuhn.datasource.serialize.ObjectFactory

        Reader reader = null;
        try
        {
          InputStream is = new BufferedInputStream(new FileInputStream(file));
          reader = new XmlReader(is,new ObjectFactory() {
         
            public GenericObject create(String type, String id, Map values) throws Exception
            {
              AbstractDBObject object = (AbstractDBObject) Settings.getDBService().createObject(loader.loadClass(type),null);
              object.setID(id);
View Full Code Here

Examples of edu.mayo.bmi.guoqian.claml.ObjectFactory

      //this.generateCodes(icdCategories);
     
      //this.getSortedSubclassCodes(icdContentModel.getICDCategoryClass());
     
      FileOutputStream fos = new FileOutputStream(output);
      ObjectFactory factory = new ObjectFactory();
     
          ClaML claml = factory.createClaML();
          claml.setVersion("2.0.0");
         
          Title title = factory.createTitle();
          title.setDate("2010-06-01");
          title.setName("ICD-11-alpha");
          title.setVersion("June 2010");
         
          claml.setTitle(title);
         
          Identifier identifier = factory.createIdentifier();
          identifier.setAuthority("WHO");
          identifier.setUid("id-to-be-added-later");
          claml.getIdentifier().add(identifier);
         
          Meta meta = factory.createMeta();
          meta.setName("lang");
          meta.setValue("en");
          claml.getMeta().add(meta);

          Meta metaTop = factory.createMeta();
          metaTop.setName("TopLevelSort");
          metaTop.setValue("I II III IV V VI VII VIII IX X XI XII XIII XIV XV XVI XVII XVIII XIX XX XXI XXII");
          claml.getMeta().add(metaTop)
         
         
          ClassKinds clsKinds = factory.createClassKinds();
      ClassKind cKind1 = factory.createClassKind();
      cKind1.setName("chapter");
      clsKinds.getClassKind().add(cKind1);
      ClassKind cKind2 = factory.createClassKind();
      cKind2.setName("block");
      clsKinds.getClassKind().add(cKind2);
      ClassKind cKind3 = factory.createClassKind();
      cKind3.setName("category");
      clsKinds.getClassKind().add(cKind3);
      //ClassKind cKind4 = factory.createClassKind();
      //cKind4.setName("modifiedcategory");
      //clsKinds.getClassKind().add(cKind4);

      claml.setClassKinds(clsKinds);
         
          /*
          UsageKinds useKinds = factory.createUsageKinds();
          UsageKind useKind = factory.createUsageKind();
          useKind.setMark("!");
          useKind.setName("optional");
          useKinds.getUsageKind().add(useKind);
          claml.setUsageKinds(useKinds);
          */
          RubricKinds rubKinds = factory.createRubricKinds();
        
          //preferred
          RubricKind rKind1 = factory.createRubricKind();
          rKind1.setInherited("false");
          rKind1.setName(icdContentModel.getPreferredProperty().getBrowserText());
          rubKinds.getRubricKind().add(rKind1);
         
          //synonym property
          /*
          RubricKind rKind1_1 = factory.createRubricKind();
          rKind1_1.setInherited("false");
          rKind1_1.setName(icdContentModel.getSynonymProperty().getBrowserText());
          rubKinds.getRubricKind().add(rKind1_1);
          */
         
          //definition property
          RubricKind rKind1_2 = factory.createRubricKind();
          rKind1_2.setInherited("false");
          rKind1_2.setName(icdContentModel.getDefinitionProperty().getBrowserText());
          rubKinds.getRubricKind().add(rKind1_2);
         
          //prefilled definition property
          /*
          RubricKind rKind1_3 = factory.createRubricKind();
          rKind1_3.setInherited("false");
          rKind1_3.setName(icdContentModel.getPrefilledDefinitionProperty().getBrowserText());
          rubKinds.getRubricKind().add(rKind1_3);
          */
         
          //inclusion
          RubricKind rKind2 = factory.createRubricKind();
          rKind2.setInherited("false");
          rKind2.setName(icdContentModel.getInclusionProperty().getBrowserText());
          rubKinds.getRubricKind().add(rKind2);
         
          //exclusion
          RubricKind rKind3 = factory.createRubricKind();
          rKind3.setInherited("false");
          rKind3.setName(icdContentModel.getExclusionProperty().getBrowserText());
          rubKinds.getRubricKind().add(rKind3);
         
          //note property
          RubricKind rKind5 = factory.createRubricKind();
          rKind5.setInherited("false");
          rKind5.setName(icdContentModel.getNoteProperty().getBrowserText());
          rubKinds.getRubricKind().add(rKind5);
         
          //MorbidityParent property
          /*
          RubricKind rKind6 = factory.createRubricKind();
          rKind6.setInherited("false");
          rKind6.setName(icdContentModel.getMorbidityParentProperty().getBrowserText());
          rubKinds.getRubricKind().add(rKind6);
          */
         
          //coding hint property
          RubricKind rKind7 = factory.createRubricKind();
          rKind7.setInherited("false");
          rKind7.setName(icdContentModel.getCodingHintProperty().getBrowserText());
          rubKinds.getRubricKind().add(rKind7);
         

         
          //icd Reference property
          //RubricKind rKind9 = factory.createRubricKind();
          //rKind9.setInherited("false");
          //rKind9.setName(icdContentModel.getIcdRefProperty().getBrowserText());
          //rubKinds.getRubricKind().add(rKind9);
         
       
          //set rubric kinds
          claml.setRubricKinds(rubKinds);
         
         
         
         
          //iterating icd categories
         
          int index = 1;
          for(Iterator it = icdCategories.iterator(); it.hasNext();){
           
            RDFSNamedClass icdCategory = (RDFSNamedClass) it.next();
           
            if(this.mapGeneratedCodes.containsKey(icdCategory)){ //only those categories with codes
     
            //is included?
            //if(this.isIncludedInLinearizationForType(icdCategory, linearizationType)){
           
           
              //RDFSNamedClass icdCategory = icdContentModel.getICDCategory("http://who.int/icd#I82.0");
              //System.out.println("Displayed as in the tree: " + icdCategory.getBrowserText());
           
              //System.out.println(index++ + "|" + icdCategory.getBrowserText());
           
              edu.mayo.bmi.guoqian.claml.Class cls = factory.createClass();

              /*
              //get original code, if not availabel it is "TBD"
              String classCode = getClassCode(icdCategory);
             
              //if the code is "TBD", then find it from generated codes
              if(classCode.equals("TBD")){
                String generatedCode = (String)this.mapGeneratedCodes.get(icdCategory);
                if(generatedCode != null){
                  classCode = generatedCode;
                }else{// in case, no code generated
                  System.out.println("Code not generated for:" + icdCategory.getBrowserText());
                }
              }
              */
             
              String classCode = (String) this.mapGeneratedCodes.get(icdCategory);
             
              cls.setCode(classCode);
             
             
              String cKindName = getClassKind(icdCategory);
             
            ClassKind cKind = factory.createClassKind();
            cKind.setName(cKindName);
            cls.setKind(cKind);
           
           
            //meta icat id
                Meta metaICatId = factory.createMeta();
                metaICatId.setName("iCatID");
                metaICatId.setValue(icdCategory.getName());
                cls.getMeta().add(metaICatId);

           
/*           
            //superclass codes    
                if(!cKindName.equals("chapter")){// chapter is the root
                  Collection superclassCodes = getSuperclassCodes(icdCategory);
           
                  if(superclassCodes != null){

                    for(Iterator it1 = superclassCodes.iterator(); it1.hasNext();){           
                      String superclassCode = (String) it1.next();
                      SuperClass superclass = factory.createSuperClass();
                      superclass.setCode(superclassCode);
                      cls.getSuperClass().add(superclass);
             
                    } 
             
                  }
                }

*/               
                //linearization parent code

                if(!cKindName.equals("chapter")){// chapter is the root
                 
                  //String linearizationParent = this.getLinearizationParentForType(icdCategory, linearizationType);
                  String linearizationParent = model.getLinearParentCode(icdCategory); //20100613
                 
                  //RDFSNamedClass realLinearParent = this.getRealLinearizationParent(icdCategory, linearizationParent);
                  //String superclassCode = (String)this.mapGeneratedCodes.get(realLinearParent);
                     //System.out.println(icdCategory.getBrowserText() + "|linear parent: " + linearizationParent);
                 
                  SuperClass superclass = factory.createSuperClass();
                  superclass.setCode(linearizationParent);
                  cls.getSuperClass().add(superclass);
               
               



            //subclass codes sorted with sortingLabel
              //Object[] arrayCodes = getSubclassCodesSortingLabels(icdCategory);
                Object[] arrayCodes = model.getLinearSubclassCodes(icdCategory); //20100613
              if(arrayCodes != null){
                for(int it2 = 0; it2 < arrayCodes.length; it2 ++){
                //for(Iterator it2 = subclassCodes.iterator(); it2.hasNext();){
                  String subclassCode = (String) arrayCodes[it2];
                  //System.out.println(code + "|" + subclassCode);
                  SubClass subclass = factory.createSubClass();
                  subclass.setCode(subclassCode);
                  cls.getSubClass().add(subclass);
                }       
              }
              
/*               
            //subclass codes
              Collection subclassCodes = getSubclassCodes(icdCategory);
              if(subclassCodes != null){
                Object[] arrayCodes = subclassCodes.toArray();
                Arrays.sort(arrayCodes);
                for(int it2 = 0; it2 < arrayCodes.length; it2 ++){
                //for(Iterator it2 = subclassCodes.iterator(); it2.hasNext();){
                  String subclassCode = (String) arrayCodes[it2];
                  if(subclassCode.equals("TBD"))
                     System.out.println(icdCategory.getBrowserText() + "|" + subclassCode);
                  SubClass subclass = factory.createSubClass();
                  subclass.setCode(subclassCode);
                  cls.getSubClass().add(subclass);
                }       
              }
*/             
           
              //set preferred label and language
             

              String sortingLabel = this.getSortingLabel(icdCategory);
                String label = this.getClassPreferredLabel(icdCategory);
                label = label.replaceAll("'", "");
              String clsCode = getClassCode(icdCategory);            
              if(clsCode.equals("TBD")){
                //label = this.getUserAssignedLabel(icdCategory);
                label += "[" + sortingLabel + "]";
                            
                Rubric rubricLabel = factory.createRubric();
                //rubricLabel.setId("id-to-be-added-later");
                ClassKind cKindPreferred = factory.createClassKind();
                cKindPreferred.setName("preferred");
                rubricLabel.setKind(cKindPreferred);

                Label clsLabel = factory.createLabel();
                clsLabel.setLang("en");
                clsLabel.setSpace("default");
                clsLabel.getContent().add(label);
                rubricLabel.getLabel().add(clsLabel);
                cls.getRubric().add(rubricLabel);
              }else{
               
                label += "{" + clsCode + "}"; //add ICD10 code in label
                label += "[" + sortingLabel + "]";               
                Rubric rubricLabel = factory.createRubric();
                String rubricId = this.getClassPreferredLabelRubricID(icdCategory);
                rubricLabel.setId(rubricId);
                ClassKind cKindPreferred = factory.createClassKind();
                cKindPreferred.setName("preferred");
                rubricLabel.setKind(cKindPreferred);

                Label clsLabel = factory.createLabel();
                clsLabel.setLang("en");
                clsLabel.setSpace("default");
                clsLabel.getContent().add(label);

               
/*
            try{
             
              Collection<RDFResource> clamlRefCodes = this.getTermClaMLReferences(icdContentModel.getTerm(icdCategory, icdContentModel.getIcdTitleProperty()));
             
              if(clamlRefCodes != null){
                for (RDFResource clamlRefCode : clamlRefCodes) {

                 
                      Reference refCode = factory.createReference();
                      refCode.setClazz("in brackets");               
                  refCode.setContent((String)clamlRefCode.getPropertyValue(icdContentModel.getTextProperty()));
                  //String refCodeText = ((RDFResource)clamlRefCode.getPropertyValue(icdContentModel.getIcdRefProperty())).getBrowserText();
                 
                  String thisCode = (String)clamlRefCode.getPropertyValue(icdContentModel.getTextProperty());
                  if(thisCode.indexOf("-") >= 0){
                    thisCode = this.getCodeFromLabel(thisCode);
                  }
                 
                 
                 
                  refCode.setCode(thisCode);
                  clsLabel.getContent().add(refCode);                   
               
                  }
              }               
              }catch(Exception e){
            e.printStackTrace();
                  System.out.println("preferred" + "|" + icdCategory.getBrowserText());
                 
              Collection clamlRefCodes = this.getTermClaMLReferences(icdContentModel.getTerm(icdCategory, icdContentModel.getIcdTitleProperty()));
             
              if(clamlRefCodes != null){
                for (Iterator itref = clamlRefCodes.iterator(); itref.hasNext();){
                  String clamlRefCode = (String) itref.next();
               

                 
                      Reference refCode = factory.createReference();
                      refCode.setClazz("in brackets");               
                  refCode.setContent(clamlRefCode);
                  //String refCodeText = ((RDFResource)clamlRefCode.getPropertyValue(icdContentModel.getIcdRefProperty())).getBrowserText();
                 
                  String thisCode = clamlRefCode;
                  if(thisCode.indexOf("-") >= 0){
                    thisCode = this.getCodeFromLabel(thisCode);
                  }
                  refCode.setCode(thisCode);
                  clsLabel.getContent().add(refCode);                   
               
                  }
              }                  
                 
                 
                    continue;
          }
             
*/             
                rubricLabel.getLabel().add(clsLabel);
                             
               
               
               
                cls.getRubric().add(rubricLabel);               
              }

          //synonyms
         
              /*
          Collection colSynonyms = this.getSynonyms(icdCategory);
          if(colSynonyms != null){
            for(Iterator itpd = colSynonyms.iterator(); itpd.hasNext();){
           
              String synonym = (String) itpd.next();
              if(synonym != null && synonym.length() > 0){
              Rubric rubricSynonym = factory.createRubric();
              rubricSynonym.setId("id-to-be-added-later-" + rubricIndex++);
              ClassKind cKindSynonym = factory.createClassKind();
              cKindSynonym.setName(icdContentModel.getSynonymProperty().getBrowserText());
              rubricSynonym.setKind(cKindSynonym);
              Label labelSynonym = factory.createLabel();
              labelSynonym.setLang("en");
              labelSynonym.setSpace("default");
              labelSynonym.getContent().add(synonym);
              rubricSynonym.getLabel().add(labelSynonym);
              cls.getRubric().add(rubricSynonym);
              }
           
            } 
          }
          */
             
             
              //definition
             
              Collection definitions = this.getClassDefinitions(icdCategory);
              if(definitions != null){
             
                for(Iterator itdef = definitions.iterator(); itdef.hasNext();){
                  RDFResource defTerm = (RDFResource) itdef.next();
                 
                  String defText = this.getDefinitionTermText(defTerm);
                  String defRubricID = this.getTermRubricID(defTerm);
                 
                  if(definitions.size() > 1){
                    //System.out.println(classCode + "|" + defRubricID + "|" + defText);
                  }
                 
                  //if(defText != null){
                 
                      Rubric rubricDefinition = factory.createRubric();
                      rubricDefinition.setId(defRubricID);
                      ClassKind cKindDefinition = factory.createClassKind();
                      cKindDefinition.setName(icdContentModel.getDefinitionProperty().getBrowserText());
                      rubricDefinition.setKind(cKindDefinition);
                      Label labelDefinition = factory.createLabel();
                  labelDefinition.setLang("en");
                  labelDefinition.setSpace("default");
                  labelDefinition.getContent().add(defText);
                  rubricDefinition.getLabel().add(labelDefinition);
                  cls.getRubric().add(rubricDefinition);  
                  //}// not null
                }


              }
             

          //prefilled definitions
          /*
          Collection colPrefilledDefinitions = this.getPrefilledDefinitions(icdCategory);
          if(colPrefilledDefinitions != null){
            for(Iterator itpd = colPrefilledDefinitions.iterator(); itpd.hasNext();){
           
              String pdefinition = (String) itpd.next();
              if(pdefinition != null){
              Rubric rubricpDefinition = factory.createRubric();
              rubricpDefinition.setId("id-to-be-added-later-" + rubricIndex++);
              ClassKind cKindpDefinition = factory.createClassKind();
              cKindpDefinition.setName(icdContentModel.getPrefilledDefinitionProperty().getBrowserText());
              rubricpDefinition.setKind(cKindpDefinition);
              Label labelpDefinition = factory.createLabel();
              labelpDefinition.setLang("en");
              labelpDefinition.setSpace("default");
              labelpDefinition.getContent().add(definition);
              rubricpDefinition.getLabel().add(labelpDefinition);
              cls.getRubric().add(rubricpDefinition);
              }
           
            }
          }
          */
             
                
              //inclusion terms
              Collection colInclusions = this.getInclusionTerms(icdCategory);
             
              Collection colSortedInclusions = new ArrayList();
              Map mapSortedInclusions = new HashMap();

              if(colInclusions != null){
                for(Iterator it3 = colInclusions.iterator(); it3.hasNext();){
                  RDFResource inclusion = (RDFResource) it3.next();
                 
                        String inclusionLabel = this.getInclusionTermText(inclusion);
                        String inclusionId = this.getTermRubricID(inclusion);
                       
                        String inclusionLabelId = inclusionLabel + "|" + inclusionId;
                        colSortedInclusions.add(inclusionLabelId);
                        mapSortedInclusions.put(inclusionLabelId, inclusion);
                }
               
                    //alphabetically sort the rubrics
                        Object[] arraySortedInclusions = colSortedInclusions.toArray();
                        List listSortedInclusions = Arrays.asList(arraySortedInclusions);
                        Collections.sort(listSortedInclusions, String.CASE_INSENSITIVE_ORDER);
                        for(ListIterator li0 = listSortedInclusions.listIterator(); li0.hasNext();){
                          String sortedInclusionLabelId = (String)li0.next();
                          String[] labelId = sortedInclusionLabelId.split("\\|");
                          RDFResource sortedInclusion = (RDFResource)mapSortedInclusions.get(sortedInclusionLabelId);
                 
                          Rubric rubricInclusion = factory.createRubric();
                      if(!labelId[1].equals("null")) //if null, do nothing
                        rubricInclusion.setId(labelId[1]);
                          ClassKind cKindInclusion = factory.createClassKind();
                          cKindInclusion.setName("inclusion");
                          rubricInclusion.setKind(cKindInclusion);
                          Label labelInclusion = factory.createLabel();
                          labelInclusion.setLang("en");
                          labelInclusion.setSpace("default");
                          labelInclusion.getContent().add(labelId[0]);
                          Collection<RDFResource> clamlRefCodes = this.getTermClaMLReferences(sortedInclusion);

                     try{
                  if(clamlRefCodes != null){
                    for (RDFResource clamlRefCode : clamlRefCodes) {

                      Reference refCode = factory.createReference();
                          refCode.setClazz("in brackets");
                      String thisCode = (String)clamlRefCode.getPropertyValue(icdContentModel.getTextProperty());
                      if(thisCode.indexOf("-") >= 0){
                        thisCode = this.getCodeFromLabel(thisCode);
                      }
                     
                      String thisGeneratedCode = this.getGeneratedCodeForICDCategoryCode(thisCode);
                        if(thisGeneratedCode == null){
                          thisGeneratedCode = thisCode;
                        }
                         
                         
                         
                      refCode.setContent(thisGeneratedCode);
                      //String refCodeText = ((RDFResource)clamlRefCode.getPropertyValue(icdContentModel.getIcdRefProperty())).getBrowserText();
                     
                      refCode.setCode(thisGeneratedCode);
                      labelInclusion.getContent().add(refCode);                   
                   
                      }
                  }
                  }catch(Exception e){
                    e.printStackTrace();
                          System.out.println("inclusion" + "|" + icdCategory.getBrowserText());
                            continue;
                  }
                 
                 
                  rubricInclusion.getLabel().add(labelInclusion);
                  cls.getRubric().add(rubricInclusion);
               

                }
              }             

              //exclusion terms
              Collection colExclusions = this.getExclusionTerms(icdCategory);

              Collection<String> colSortedExclusions = new ArrayList();
              Map<String, RDFResource> mapSortedExclusions = new HashMap();
             
             
             
              if(colExclusions != null){
                for(Iterator it4 = colExclusions.iterator(); it4.hasNext();){
                  RDFResource exclusion = (RDFResource) it4.next();
                        String exclusionLabel = this.getExclusionTermText(exclusion);
                        String exclusionId = this.getTermRubricID(exclusion);
                        //Collection<RDFResource> clamlRefCodes = this.getTermClaMLReferences(exclusion);
                       
                        String exclusionLabelId = exclusionLabel + "|" + exclusionId;
                        colSortedExclusions.add(exclusionLabelId);
                        mapSortedExclusions.put(exclusionLabelId, exclusion);
                       

                }
                        //alphabetically sort the rubrics
                        Object[] arraySortedExclusions = colSortedExclusions.toArray();
                        List listSortedExclusions = Arrays.asList(arraySortedExclusions);
                        Collections.sort(listSortedExclusions, String.CASE_INSENSITIVE_ORDER);
                        for(ListIterator li1 = listSortedExclusions.listIterator(); li1.hasNext();){
                        //for(int jj = 0; jj < arraySortedExclusions.length; jj++){
                          String sortedExclusionLabelId = (String)li1.next();
                       
                         
                          String[] labelId = sortedExclusionLabelId.split("\\|");
                          RDFResource sortedExclusion = (RDFResource)mapSortedExclusions.get(sortedExclusionLabelId);
                 
                  //System.out.println(icdCategory.getBrowserText() + "|" + sortedExclusionLabelId);
                         
                  Rubric rubricInclusion = factory.createRubric();
                  if(!labelId[1].equals("null")) //if null, do nothing
                    rubricInclusion.setId(labelId[1]);
                  ClassKind cKindInclusion = factory.createClassKind();
                  cKindInclusion.setName("exclusion");
                  rubricInclusion.setKind(cKindInclusion);
                  Label labelInclusion = factory.createLabel();
                  labelInclusion.setLang("en");
                  labelInclusion.setSpace("default");
                  labelInclusion.getContent().add(labelId[0]);
                 
                  Collection<RDFResource> clamlRefCodes = this.getTermClaMLReferences(sortedExclusion);
                 
                 
                  //if(sortedExclusion.getPropertyValues(icdContentModel.getClamlReferencesProperty()) != null){
                  //Collection<RDFResource> clamlRefCodes = sortedExclusion.getPropertyValues(icdContentModel.getClamlReferencesProperty());
                 
                  try{
                  if(clamlRefCodes != null){
                   
                   
                    for (RDFResource clamlRefCode : clamlRefCodes) {
                   
                          Reference refCode = factory.createReference();
                          refCode.setClazz("in brackets");
                         
                      String thisCode = (String)clamlRefCode.getPropertyValue(icdContentModel.getTextProperty());
                      if(thisCode.indexOf("-") >= 0){
                        thisCode = this.getCodeFromLabel(thisCode);
                      }
                     
                      String thisGeneratedCode = this.getGeneratedCodeForICDCategoryCode(thisCode);
                        if(thisGeneratedCode == null){
                          thisGeneratedCode = thisCode;
                        }
                         
                         
                      refCode.setContent(thisGeneratedCode);
                      //String refCodeText = ((RDFResource)clamlRefCode.getPropertyValue(icdContentModel.getIcdRefProperty())).getBrowserText();

                     
                      refCode.setCode(thisGeneratedCode);
                      labelInclusion.getContent().add(refCode);                   
                   
                      }
                  }
                  }catch(Exception e){
                    e.printStackTrace();
                          System.out.println("exclusion" + "|" + icdCategory.getBrowserText());
                    continue;
                  }
                 
                  //}
                 

                  rubricInclusion.getLabel().add(labelInclusion);
                 
                  cls.getRubric().add(rubricInclusion);

                }
              } 
             
              //notes term
              Collection colNotes = this.getNoteTerms(icdCategory);
              if(colNotes != null){
                for(Iterator it6 = colNotes.iterator(); it6.hasNext();){
                  RDFResource note = (RDFResource) it6.next();

                        String noteLabel = this.getNoteTermText(note);
                        String noteId = this.getTermRubricID(note);
                 
                  Rubric rubricNote = factory.createRubric();
                  rubricNote.setId(noteId);
                  ClassKind cKindNote = factory.createClassKind();
                  cKindNote.setName("note");
                  rubricNote.setKind(cKindNote);
                  Label labelNote = factory.createLabel();
                  labelNote.setLang("en");
                  labelNote.setSpace("default");
                  labelNote.getContent().add(noteLabel);
                  rubricNote.getLabel().add(labelNote);
                  cls.getRubric().add(rubricNote);
                 
               
                }
             
              }
             
              //codinghint term
              Collection colCodingHints = this.getCodingHintTerms(icdCategory);
              if(colCodingHints != null){
                for(Iterator it7 = colCodingHints.iterator(); it7.hasNext();){
                  RDFResource note = (RDFResource) it7.next();

                        String noteLabel = this.getCodingHintTermText(note);
                        String noteId = this.getTermRubricID(note);
                 
                  Rubric rubricNote = factory.createRubric();
                  rubricNote.setId(noteId);
                  ClassKind cKindNote = factory.createClassKind();
                  cKindNote.setName(icdContentModel.getCodingHintProperty().getBrowserText());
                  rubricNote.setKind(cKindNote);
                  Label labelNote = factory.createLabel();
                  labelNote.setLang("en");
                  labelNote.setSpace("default");
                  labelNote.getContent().add(noteLabel);
                  rubricNote.getLabel().add(labelNote);
                  cls.getRubric().add(rubricNote);
View Full Code Here

Examples of edu.yale.cs.hadoopdb.catalog.xml.ObjectFactory

  public void generateCatalog() throws JAXBException, PropertyException, FileNotFoundException, IOException {
    JAXBContext jc = JAXBContext.newInstance("edu.yale.cs.hadoopdb.catalog.xml");
    Marshaller marshaller = jc.createMarshaller();
    marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,new Boolean(true));
   
    ObjectFactory factory = new ObjectFactory();
    Configuration configuration = factory.createConfiguration();
   
    int node_counter = 0;

    for(String node : nodes){
      Node n = factory.createNode();
      n.setDriver(properties.getProperty(DRIVER));
      n.setPassword(properties.getProperty(PASSWORD));
      n.setUsername(properties.getProperty(USERNAME));
      n.setLocation(node);

      for(String relation : relations_unchunked){
        Relation r = factory.createRelation();
        r.setId(relation);
        Partition p = factory.createPartition();
        p.setId(new Integer(node_counter).toString());
        p.setUrl(properties.getProperty(URL_PREFIX) + node + ":" + properties.getProperty(PORT)
            + "/" + properties.getProperty(UNCHUNKED_DB_PREFIX) + node_counter);
        r.getPartitions().add(p);
        n.getRelations().add(r);
      }
     
     
      for(String relation : relations_chunked){
        Relation r = factory.createRelation();
        r.setId(relation);
       
        int start_index = node_counter*(new Integer(properties.getProperty(CHUNKS_PER_NODE)));
        for(int index = start_index; index < start_index + (new Integer(properties.getProperty(CHUNKS_PER_NODE))); index ++) {
          Partition p = factory.createPartition();
          p.setId(new Integer(index).toString());
          p.setUrl(properties.getProperty(URL_PREFIX) + node + ":" + properties.getProperty(PORT)
              + "/" + properties.getProperty(CHUNKED_DB_PREFIX) + index);
          r.getPartitions().add(p);
        }
        n.getRelations().add(r);
      }     
     
      node_counter++;
      configuration.getNodes().add(n);
    }
    JAXBElement<Configuration> jaxb = factory.createDBClusterConfiguration(configuration);
    marshaller.marshal(jaxb, new FileOutputStream(new File(properties.getProperty(CATALOG_FILE))));
  }
View Full Code Here

Examples of eu.admire.gateway.common.errors.ObjectFactory

   
    public DISPELProcessBackgroundThread(DISPELProcess dispelProcess)
    {
        mDISPELProcess = dispelProcess;
        mDISPEL = dispelProcess.getDISPELString();
        mErrors = new ObjectFactory().createErrors();
        try
        {
            mMarshaller = JAXBContext.newInstance(Errors.class).createMarshaller();
            mMarshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.