Revision: 1074
Author:
tbc...@gmail.com
Date: Tue May 28 08:45:32 2013
Log: Person ocurrences updated @ mhk_families
http://code.google.com/p/mhk/source/detail?r=1074
Modified:
/branches/mhk_families/idb/pt/uc/cisuc/jrc/mhk/parser/GedcomParser.java
=======================================
--- /branches/mhk_families/idb/pt/uc/cisuc/jrc/mhk/parser/GedcomParser.java
Sat Apr 27 15:42:45 2013
+++ /branches/mhk_families/idb/pt/uc/cisuc/jrc/mhk/parser/GedcomParser.java
Tue May 28 08:45:32 2013
@@ -582,66 +582,66 @@
root.addContent(attribute);
//CREATE PERSON OCURRENCE
-// attribute=new Element("GROUP");
-// String
ocurrenceId="GEDCOM-"+this.filename+"-person_oc-"+count_person_ocur;
-// writeRpt("[GedcomParser]\t\t\t\tWrite person occurrence: \n");
-// attribute.setAttribute("ID",ocurrenceId);
-// attribute.setAttribute("NAME","event");
-// attribute.setAttribute("CLASS","person");
-//
-// s=new Element("ELEMENT");
-// s.setAttribute("NAME","id");
-// s.setAttribute("CLASS","id");
-// core=new Element("core");
-// core.addContent(ocurrenceId);
-// s.addContent(core);
-// attribute.addContent(s);
-//
-// writeRpt("[GedcomParser]\t\t\t\t\t\tperson_occurrence
id="+ocurrenceId+"\n");
-//
-// s=new Element("ELEMENT");
-// s.setAttribute("NAME","groupname");
-// s.setAttribute("CLASS","groupname");
-// core=new Element("core");
-// core.addContent("event");
-// s.addContent(core);
-// attribute.addContent(s);
-//
-// writeRpt("[GedcomParser]\t\t\t\t\t\tperson_occurrence
groupname=event\n");
-//
-// s=new Element("ELEMENT");
-// s.setAttribute("NAME","inside");
-// s.setAttribute("CLASS","inside");
-// core=new Element("core");
-// core.addContent(eventId);
-// s.addContent(core);
-// attribute.addContent(s);
-//
-// writeRpt("[GedcomParser]\t\t\t\t\t\tperson_occurrence
inside="+eventId+"\n");
-//
-// s=new Element("ELEMENT");
-// s.setAttribute("NAME","class");
-// s.setAttribute("CLASS","class");
-// core=new Element("core");
-// core.addContent("person");
-// s.addContent(core);
-// attribute.addContent(s);
-//
-// writeRpt("[GedcomParser]\t\t\t\t\t\tperson_occurrence
inside=person\n");
-//
-// s=new Element("ELEMENT");
-// s.setAttribute("NAME","nome");
-// s.setAttribute("CLASS","name");
-// core=new Element("core");
-// core.addContent(name);
-// s.addContent(core);
-// attribute.addContent(s);
-//
-// writeRpt("[GedcomParser]\t\t\t\t\t\tperson_occurrence
name="+name+"\n");
-//
-// root.addContent(attribute);
+ attribute=new Element("GROUP");
+ String
ocurrenceId="GEDCOM-"+this.filename+"-person_oc-"+count_person_ocur;
+ writeRpt("[GedcomParser]\t\t\t\tWrite person occurrence: \n");
+ attribute.setAttribute("ID",ocurrenceId);
+ attribute.setAttribute("NAME","event");
+ attribute.setAttribute("CLASS","person");
- //PUT RELATION GROUP OF FUNCTION-IN-EVENT
+ s=new Element("ELEMENT");
+ s.setAttribute("NAME","id");
+ s.setAttribute("CLASS","id");
+ core=new Element("core");
+ core.addContent(ocurrenceId);
+ s.addContent(core);
+ attribute.addContent(s);
+
+ writeRpt("[GedcomParser]\t\t\t\t\t\tperson_occurrence
id="+ocurrenceId+"\n");
+
+ s=new Element("ELEMENT");
+ s.setAttribute("NAME","groupname");
+ s.setAttribute("CLASS","groupname");
+ core=new Element("core");
+ core.addContent("event");
+ s.addContent(core);
+ attribute.addContent(s);
+
+ writeRpt("[GedcomParser]\t\t\t\t\t\tperson_occurrence
groupname=event\n");
+
+ s=new Element("ELEMENT");
+ s.setAttribute("NAME","inside");
+ s.setAttribute("CLASS","inside");
+ core=new Element("core");
+ core.addContent(eventId);
+ s.addContent(core);
+ attribute.addContent(s);
+
+ writeRpt("[GedcomParser]\t\t\t\t\t\tperson_occurrence
inside="+eventId+"\n");
+
+ s=new Element("ELEMENT");
+ s.setAttribute("NAME","class");
+ s.setAttribute("CLASS","class");
+ core=new Element("core");
+ core.addContent("person");
+ s.addContent(core);
+ attribute.addContent(s);
+
+ writeRpt("[GedcomParser]\t\t\t\t\t\tperson_occurrence
inside=person\n");
+
+ s=new Element("ELEMENT");
+ s.setAttribute("NAME","nome");
+ s.setAttribute("CLASS","name");
+ core=new Element("core");
+ core.addContent(name);
+ s.addContent(core);
+ attribute.addContent(s);
+
+ writeRpt("[GedcomParser]\t\t\t\t\t\tperson_occurrence
name="+name+"\n");
+
+ root.addContent(attribute);
+
+ //PUT RELATION GROUP OF FUNCTION-IN-EVENT FOR OCURRENCE
attribute=new Element("GROUP");
String relationId="GEDCOM-"+this.filename+"-relation-"+count_relations;
writeRpt("[GedcomParser]\t\t\t\tWrite Relation: \n");
@@ -649,6 +649,119 @@
attribute.setAttribute("NAME","relation");
attribute.setAttribute("CLASS","relation");
+ s=new Element("ELEMENT");
+ s.setAttribute("NAME","groupname");
+ s.setAttribute("CLASS","groupname");
+ core=new Element("core");
+ core.addContent("relation");
+ s.addContent(core);
+ attribute.addContent(s);
+
+ writeRpt("[GedcomParser]\t\t\t\t\t\tRelation groupname=relation \n");
+
+ s=new Element("ELEMENT");
+ s.setAttribute("NAME","inside");
+ s.setAttribute("CLASS","inside");
+ core=new Element("core");
+ core.addContent(ocurrenceId);
+ s.addContent(core);
+ attribute.addContent(s);
+
+ writeRpt("[GedcomParser]\t\t\t\t\t\tRelation inside="+ocurrenceId+" \n");
+
+ s=new Element("ELEMENT");
+ s.setAttribute("NAME","class");
+ s.setAttribute("CLASS","class");
+ core=new Element("core");
+ core.addContent("relation");
+ s.addContent(core);
+ attribute.addContent(s);
+
+ writeRpt("[GedcomParser]\t\t\t\t\t\tRelation class=relation \n");
+
+ s=new Element("ELEMENT");
+ s.setAttribute("NAME","tipo");
+ s.setAttribute("CLASS","type");
+ core=new Element("core");
+ core.addContent("function-in-act");
+ s.addContent(core);
+ attribute.addContent(s);
+
+ writeRpt("[GedcomParser]\t\t\t\t\t\tRelation type=function-in-act \n");
+
+ s=new Element("ELEMENT");
+ s.setAttribute("NAME","destname");
+ s.setAttribute("CLASS","destname");
+ core=new Element("core");
+ core.addContent("event");
+ s.addContent(core);
+ attribute.addContent(s);
+
+ writeRpt("[GedcomParser]\t\t\t\t\t\tRelation destname=event \n");
+
+ s=new Element("ELEMENT");
+ s.setAttribute("NAME","origin");
+ s.setAttribute("CLASS","origin");
+ core=new Element("core");
+ core.addContent(ocurrenceId);
+ s.addContent(core);
+ attribute.addContent(s);
+
+ writeRpt("[GedcomParser]\t\t\t\t\t\tRelation origin="+ocurrenceId+" \n");
+
+ s=new Element("ELEMENT");
+ s.setAttribute("NAME","destination");
+ s.setAttribute("CLASS","destination");
+ core=new Element("core");
+ core.addContent(eventId);
+ s.addContent(core);
+ attribute.addContent(s);
+
+ writeRpt("[GedcomParser]\t\t\t\t\t\tRelation destination="+eventId+"
\n");
+
+ s=new Element("ELEMENT");
+ s.setAttribute("NAME","id");
+ s.setAttribute("CLASS","id");
+ core=new Element("core");
+ core.addContent(relationId);
+ s.addContent(core);
+ attribute.addContent(s);
+
+ writeRpt("[GedcomParser]\t\t\t\t\t\tRelation id="+relationId+" \n");
+
+ s=new Element("ELEMENT");
+ s.setAttribute("NAME","date");
+ s.setAttribute("CLASS","date");
+ core=new Element("core");
+ core.addContent("0");
+ s.addContent(core);
+ attribute.addContent(s);
+
+ writeRpt("[GedcomParser]\t\t\t\t\t\tRelation date=0 \n");
+
+ s=new Element("ELEMENT");
+ s.setAttribute("NAME","value");
+ s.setAttribute("CLASS","value");
+ core=new Element("core");
+ core.addContent(tag_dictionary.get(type));
+ s.addContent(core);
+ attribute.addContent(s);
+
+ writeRpt("[GedcomParser]\t\t\t\t\t\tRelation
value="+tag_dictionary.get(type)+" \n");
+
+ root.addContent(attribute);
+
+ count_relations++;
+
+
+ //PUT RELATION GROUP OF FUNCTION-IN-EVENT FOR INDIVUAL
+ attribute=new Element("GROUP");
+ relationId="GEDCOM-"+this.filename+"-relation-"+count_relations;
+ writeRpt("[GedcomParser]\t\t\t\tWrite Relation: \n");
+ attribute.setAttribute("ID",relationId);
+ attribute.setAttribute("NAME","relation");
+ attribute.setAttribute("CLASS","relation");
+
s=new Element("ELEMENT");
s.setAttribute("NAME","groupname");
s.setAttribute("CLASS","groupname");