You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2007/10/30 22:51:51 UTC

svn commit: r590480 - /lenya/sandbox/modules/person/java/src/org/apache/lenya/modules/person/Person.java

Author: andreas
Date: Tue Oct 30 14:51:39 2007
New Revision: 590480

URL: http://svn.apache.org/viewvc?rev=590480&view=rev
Log:
Adding ID attribute to Person class

Modified:
    lenya/sandbox/modules/person/java/src/org/apache/lenya/modules/person/Person.java

Modified: lenya/sandbox/modules/person/java/src/org/apache/lenya/modules/person/Person.java
URL: http://svn.apache.org/viewvc/lenya/sandbox/modules/person/java/src/org/apache/lenya/modules/person/Person.java?rev=590480&r1=590479&r2=590480&view=diff
==============================================================================
--- lenya/sandbox/modules/person/java/src/org/apache/lenya/modules/person/Person.java (original)
+++ lenya/sandbox/modules/person/java/src/org/apache/lenya/modules/person/Person.java Tue Oct 30 14:51:39 2007
@@ -42,6 +42,7 @@
     private Document document;
     private Map knownPersons;
 
+    private String id;
     private String title;
     private String givenName;
     private String familyName;
@@ -101,6 +102,8 @@
 
             Element rdf = xml.getDocumentElement();
             Element person = helper.getFirstChild(rdf, "Person");
+            
+            this.id = person.getAttributeNS(RDF_NAMESPACE, "ID");
 
             Element title = helper.getFirstChild(person, "title");
             this.title = DocumentHelper.getSimpleElementText(title);
@@ -145,6 +148,7 @@
             NamespaceHelper helper = new NamespaceHelper(FOAF_NAMESPACE, FOAF_PREFIX, xml);
 
             Element person = helper.createElement("Person");
+            person.setAttributeNS(RDF_NAMESPACE, "rdf:ID", this.id);
             xml.getDocumentElement().appendChild(person);
 
             Element title = helper.createElement("title", this.title);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org