You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@clerezza.apache.org by bb...@apache.org on 2011/07/01 17:13:35 UTC
svn commit: r1141959 - in /incubator/clerezza/trunk/parent:
platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/
platform.security.foafssl/test/src/main/scala/org/apache/clerezz...
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) }
)
}