Author: bblfish
Date: Fri Jul  1 15:13:35 2011
New Revision: 1141959

URL: http://svn.apache.org/viewvc?rev=1141959&view=rev
Log:
CLEREZZA-510 unicode notation is problematic to read on some versions of linux 
it seems, changing to ascii notation.

Modified:
    
incubator/clerezza/trunk/parent/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/PingBack.scala
    
incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/scala/org/apache/clerezza/foafssl/test/WebIDTester.scala

Modified: 
incubator/clerezza/trunk/parent/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/PingBack.scala
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/trunk/parent/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/PingBack.scala?rev=1141959&r1=1141958&r2=1141959&view=diff
==============================================================================
--- 
incubator/clerezza/trunk/parent/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/PingBack.scala
 (original)
+++ 
incubator/clerezza/trunk/parent/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/PingBack.scala
 Fri Jul  1 15:13:35 2011
@@ -34,7 +34,7 @@ import org.apache.clerezza.rdf.ontologie
 import org.apache.clerezza.rdf.core.{UriRef, MGraph}
 import org.apache.clerezza.rdf.utils.{UnionMGraph, GraphNode}
 import org.apache.clerezza.rdf.core.impl.SimpleMGraph
-import org.apache.clerezza.rdf.scala.utils.{EzGraphNodeU, EzStyleChoice, 
EzGraphNode, EzGraph}
+import org.apache.clerezza.rdf.scala.utils._
 
 object PingBack {
        private val log: Logger = Logger(classOf[PingBack])
@@ -88,7 +88,7 @@ object PingBack {
 class PingBack {
 
        import PingBack._
-       import EzStyleChoice.unicode
+       import EzStyleChoice.arrow
 
        protected def activate(componentContext: ComponentContext): Unit = {
        }
@@ -99,7 +99,7 @@ class PingBack {
         * @param id: the user id
         * @param uriInfo jax-rs info
         */
-       def  pingCollection(id: String, uriInfo: UriInfo): EzGraphNodeU = {
+       def  pingCollection(id: String, uriInfo: UriInfo): EzGraphNodeA = {
                val pingRef = new UriRef(pingCollUri(id, uriInfo))
                val pingCollG: EzGraph = pingColl(pingRef)
                pingCollG.node(pingRef)
@@ -111,8 +111,8 @@ class PingBack {
                                         @QueryParam("uri") uri: UriRef,
                                         @PathParam("id") id: String): 
GraphNode = {
 
-               ( pingCollection(id, uriInfo) ∈ PLATFORM.HeadedPage
-                               ∈ PINGBACK.Container )
+               ( pingCollection(id, uriInfo).a(PLATFORM.HeadedPage)
+                               .a(PINGBACK.Container) )
        }
 
 
@@ -224,17 +224,19 @@ class PingBack {
                //create a new Resource for this ping (we'll use time stamps to 
get going)
                val pingCollUriStr: String = pingCollUri(id, uriInfo)
                val pingItem = new UriRef(pingCollUriStr + "/ts" + 
System.currentTimeMillis)
+               import org.apache.clerezza.rdf.scala.utils.EzGraph._
 
                //build the graph and add to the store if ok
                val pingColGr = pingColl(new UriRef(pingCollUriStr))
                val item = (
-                       pingColGr.node(pingItem) ∈ PINGBACK.Item
-                        ⟝ PINGBACK.source ⟶  source
-                        ⟝ PINGBACK.target ⟶  target
-                        ⟝ SIOC.content ⟶  comment
-                        ⟵ SIOC.container_of ⟞ pingCollUriStr)
+                       pingColGr.node(pingItem).a(PINGBACK.Item)
+                        -- PINGBACK.source -->  source
+                        -- PINGBACK.target -->  target
+                                  -- SIOC.content --> comment
+                             -<- SIOC.container_of -- pingCollUriStr
+                       )
 
-               val resultNode = item.protect() ∈ PLATFORM.HeadedPage
+               val resultNode = item.protect().a(PLATFORM.HeadedPage)
 
                //response
                Response.ok(resultNode).header("Content-Location",new 
URI(pingItem.getUnicodeString).getPath).build()
@@ -252,9 +254,9 @@ class PingBack {
        def viewCollection(@Context uriInfo: UriInfo,
                           @QueryParam("to") to: UriRef,
                                                         @PathParam("id") id: 
String): GraphNode = {
-               val gn = (pingCollection(id,uriInfo ) ∈ PLATFORM.HeadedPage
-                                                                               
∈  PINGBACK.Container )
-               if (to != null) gn  ⟝ PINGBACK.to ⟶ to
+               val gn = (pingCollection(id,uriInfo ).a(PLATFORM.HeadedPage)
+                                                                               
.a(PINGBACK.Container))
+               if (to != null) gn  -- PINGBACK.to --> to
                else gn
        }
 
@@ -282,10 +284,10 @@ class PingBack {
           //get the source graph
                 val targetGrph = tcManager.getMGraph(target)
                (
-                       new EzGraph(new UnionMGraph(new 
SimpleMGraph(),targetGrph)).bnode ∈ PLATFORM.HeadedPage
-                                                 ∈ ProxyForm
-                               ⟝ PINGBACK.source ⟶ { if (source == null) 
ProfilePanel.webID(id,uriInfo) else source }
-                               ⟝ PINGBACK.target ⟶ target
+                       new EzGraph(new UnionMGraph(new 
SimpleMGraph(),targetGrph)).bnode.a(PLATFORM.HeadedPage)
+                                                                   
.a(ProxyForm)
+                               -- PINGBACK.source --> { if (source == null) 
ProfilePanel.webID(id,uriInfo) else source }
+                               -- PINGBACK.target --> target
                )
        }
 
@@ -316,8 +318,8 @@ class PingBack {
                //ITS the wrong ping collection!!!
 
                val pinG = pingColl(new UriRef(pingCollUri(id, uriInfo)))
-               ( pinG.node(new UriRef(uriInfo.getAbsolutePath.toString)) ∈ 
PLATFORM.HeadedPage
-                                                               ∈ 
PINGBACK.Item
+               ( pinG.node(new 
UriRef(uriInfo.getAbsolutePath.toString)).a(PLATFORM.HeadedPage)
+                                                               
.a(PINGBACK.Item)
                        )
        }
 

Modified: 
incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/scala/org/apache/clerezza/foafssl/test/WebIDTester.scala
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/scala/org/apache/clerezza/foafssl/test/WebIDTester.scala?rev=1141959&r1=1141958&r2=1141959&view=diff
==============================================================================
--- 
incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/scala/org/apache/clerezza/foafssl/test/WebIDTester.scala
 (original)
+++ 
incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/scala/org/apache/clerezza/foafssl/test/WebIDTester.scala
 Fri Jul  1 15:13:35 2011
@@ -43,8 +43,7 @@ import javax.security.auth.Subject
 import collection.JavaConversions._
 import org.apache.clerezza.platform.users.WebIdGraphsService
 import org.apache.clerezza.rdf.scala.utils._
-import EzStyleChoice.unicode
-
+import EzStyleChoice.arrow
 
 /**
  * implementation of (very early) version of test server for WebID so that the 
following tests
@@ -130,8 +129,8 @@ class CertTester(subj: Subject, webIdGra
 
        def runTests() {
 
-               val thisDoc = (g.bnode ∈ FOAF.Document //there really has to 
be a way to get THIS doc url, to add relative urls to the graph
-                                      ⟝ DCTERMS.created ⟶ now
+               val thisDoc = (g.bnode.a(FOAF.Document) //there really has to 
be a way to get THIS doc url, to add relative urls to the graph
+                                      -- DCTERMS.created --> now
                        )
                //
                // Description of certificates and their public profileKeys
@@ -139,8 +138,8 @@ class CertTester(subj: Subject, webIdGra
                val x509claimRefs = for (claim <- creds) yield {
                        val cert = g.bnode
                        (
-                               cert ∈ CERT.Certificate
-                                       ⟝ CERT.base64der ⟶ 
Base64.encode(claim.cert.getEncoded())
+                               cert.a(CERT.Certificate)
+                                       -- CERT.base64der --> 
Base64.encode(claim.cert.getEncoded())
                                )
 
                        //
@@ -151,11 +150,11 @@ class CertTester(subj: Subject, webIdGra
 
                        pubkey match {
                                case rsa: RSAPublicKey => {
-                                       val pk = (g.bnode ∈ RSA.RSAPublicKey
-                                               ⟝ RSA.modulus ⟶ new 
TypedLiteralImpl(rsa.getModulus.toString(16), CERT.hex)
-                                               ⟝ RSA.public_exponent ⟶ new 
TypedLiteralImpl(rsa.getPublicExponent.toString(10), CERT.int_)
+                                       val pk = (g.bnode.a(RSA.RSAPublicKey)
+                                               -- RSA.modulus --> new 
TypedLiteralImpl(rsa.getModulus.toString(16), CERT.hex)
+                                               -- RSA.public_exponent --> new 
TypedLiteralImpl(rsa.getPublicExponent.toString(10), CERT.int_)
                                                )
-                                       cert ⟝ CERT.principal_key ⟶ pk
+                                       cert -- CERT.principal_key --> pk
                                        val res = testCertKey.result;
                                        res.description = "Certificate contains 
RSA key which is recognised"
                                        res.outcome = EARL.passed
@@ -192,13 +191,13 @@ class CertTester(subj: Subject, webIdGra
                //
                val eC = x509claimRefs.size > 0
                val ass = (
-                       g.bnode ∈ EARL.Assertion
-                               ⟝ EARL.test ⟶ TEST.certificateProvided
-                               ⟝ EARL.result ⟶ (g.bnode ∈ EARL.TestResult
-                                                    ⟝ DC.description ⟶ {if 
(eC) "Certificate available" else "No Certificate Found"}
-                                                    ⟝ EARL.outcome ⟶ {if 
(eC) EARL.passed else EARL.failed})
+                       g.bnode.a(EARL.Assertion)
+                               -- EARL.test --> TEST.certificateProvided
+                               -- EARL.result --> (g.bnode.a(EARL.TestResult)
+                                                    -- DC.description --> {if 
(eC) "Certificate available" else "No Certificate Found"}
+                                                    -- EARL.outcome --> {if 
(eC) EARL.passed else EARL.failed})
                        )
-               if (eC) ass ⟝ EARL.subject ⟶* x509claimRefs.map(p => p._1)
+               if (eC) ass -- EARL.subject -->> x509claimRefs.map(p => p._1)
                else return g.graph
 
 
@@ -207,14 +206,14 @@ class CertTester(subj: Subject, webIdGra
                //
                val principals = for (p <- subj.getPrincipals
                                      if p.isInstanceOf[WebIdPrincipal]) yield 
p.asInstanceOf[WebIdPrincipal]
-               (g.bnode ∈ EARL.Assertion
-                       ⟝ EARL.test ⟶ TEST.webidAuthentication
-                       ⟝ EARL.result ⟶ (g.bnode ∈ EARL.TestResult
-                                               ⟝ DC.description ⟶ {"found 
" + principals.size + " valid principals"}
-                                               ⟝ EARL.outcome ⟶ {if 
(principals.size > 0) EARL.passed else EARL.failed}
-                                               ⟝ EARL.pointer ⟶* 
principals.map(p => p.webId)
+               (g.bnode.a(EARL.Assertion)
+                       -- EARL.test --> TEST.webidAuthentication
+                       -- EARL.result --> (g.bnode.a(EARL.TestResult)
+                                               -- DC.description --> {"found " 
+ principals.size + " valid principals"}
+                                               -- EARL.outcome --> {if 
(principals.size > 0) EARL.passed else EARL.failed}
+                                               -- EARL.pointer -->> 
principals.map(p => p.webId)
                                                )
-                       ⟝ EARL.subject ⟶* x509claimRefs.map(p => p._1)
+                       -- EARL.subject -->> x509claimRefs.map(p => p._1)
                        )
                import collection.JavaConversions._
 
@@ -601,7 +600,7 @@ class CertTester(subj: Subject, webIdGra
                        sout.serialize(out, graph, "text/rdf+n3")
                        val n3String = out.toString("UTF-8")
                        //todo: turtle mime type literal?
-                       val keylit: EzGraphNode = g.bnode ⟝  OWL.sameAs ⟶ 
(n3String^^"http://example.com/turtle".uri)
+                       val keylit: EzGraphNode = g.bnode --  OWL.sameAs --> 
(n3String^^"http://example.com/turtle".uri)
 
 
                        //
@@ -708,10 +707,10 @@ class Assertor {
                }
 
                def toRdf(): EzGraphNode = (
-                       g.bnode ∈ EARL.Assertion
-                               ⟝ EARL.test ⟶ testName
-                               ⟝ EARL.result ⟶ result.toRdf()
-                               ⟝ EARL.subject ⟶* subjects
+                       g.bnode.a(EARL.Assertion)
+                               -- EARL.test --> testName
+                               -- EARL.result --> result.toRdf()
+                               -- EARL.subject -->> subjects
                        )
        }
 
@@ -740,11 +739,11 @@ class Assertor {
 
 
                def toRdf(): EzGraphNode =  (
-                               g.bnode ∈ EARL.TestResult
-                                       ⟝ DC.description ⟶ description
-                                       ⟝ EARL.outcome ⟶ outcome
-                                       ⟝ EARL.pointer ⟶* pointers
-                                  ⟝ EARL.info ⟶* { for (e <- exceptions) 
yield new PlainLiteralImpl(e.toString)  }
+                               g.bnode.a(EARL.TestResult)
+                                       -- DC.description --> description
+                                       -- EARL.outcome --> outcome
+                                       -- EARL.pointer -->> pointers
+                                  -- EARL.info -->> { for (e <- exceptions) 
yield new PlainLiteralImpl(e.toString)  }
                                )
 
        }


Reply via email to