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/01/23 17:03:43 UTC
svn commit: r1062459 - in
/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core:
./ src/main/java/org/apache/clerezza/platform/accountcontrolpanel/ sr...
Author: bblfish
Date: Sun Jan 23 16:03:42 2011
New Revision: 1062459
URL: http://svn.apache.org/viewvc?rev=1062459&view=rev
Log:
Profile Panel shows and enables deletion of public keys now. Removed SSP, and went back to scala for ease of comprehension.
Added:
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/OSGI-INF/
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/OSGI-INF/serviceComponents.xml
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/scala/
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/scala/org/
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/scala/org/apache/
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/profile_panel.scala
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/settings_panel.scala
- copied, changed from r1061301, incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/settings-panel.ssp
Removed:
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/profile-panel.ssp
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/settings-panel.ssp
Modified:
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/pom.xml
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/AcpPermissionDescriptionsProvider.java
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/MenuItemProvider.java
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/ProfilePanel.java
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/SettingsPanel.java
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/profile-staticweb/style/profile.css
Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/pom.xml
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/pom.xml?rev=1062459&r1=1062458&r2=1062459&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/pom.xml (original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/pom.xml Sun Jan 23 16:03:42 2011
@@ -14,6 +14,42 @@
<build>
<plugins>
<plugin>
+ <groupId>org.scala-tools</groupId>
+ <artifactId>maven-scala-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>compile</goal>
+ <goal>testCompile</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <!-- <scalaVersion>${scala.version}</scalaVersion> -->
+ <!-- <args>
+ <arg>-target:jvm-1.5</arg>
+ </args> -->
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Service-Component>OSGI-INF/serviceComponents.xml</Service-Component>
+ <Export-Package>org.apache.clerezza.platform.accountcontrolpanel</Export-Package>
+ <Bundle-SymbolicName>org.apache.clerezza.platform.accountcontrolpanel</Bundle-SymbolicName>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
<groupId>org.codehaus.xsite</groupId>
<artifactId>xsite-maven-plugin</artifactId>
<configuration>
@@ -30,7 +66,7 @@
</goals>
</execution>
</executions>
- </plugin>
+ </plugin>
</plugins>
</build>
<dependencies>
@@ -74,10 +110,11 @@
<groupId>org.apache.clerezza</groupId>
<artifactId>org.apache.clerezza.platform.users.core</artifactId>
</dependency>
- <dependency>
+ <!--dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>
- </dependency>
+ <version></version>
+ </dependency-->
<dependency>
<groupId>org.apache.clerezza</groupId>
<artifactId>org.apache.clerezza.platform.config</artifactId>
@@ -88,6 +125,10 @@
</dependency>
<dependency>
<groupId>org.apache.clerezza</groupId>
+ <artifactId>org.apache.clerezza.platform.typerendering.scala</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.clerezza</groupId>
<artifactId>org.apache.clerezza.platform.dashboard.core</artifactId>
</dependency>
<dependency>
@@ -109,7 +150,10 @@
<dependency>
<groupId>org.apache.clerezza</groupId>
<artifactId>org.apache.clerezza.ssl.keygen.base</artifactId>
- <version>0.5-incubating-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.clerezza</groupId>
+ <artifactId>org.apache.clerezza.platform.security.foafssl.ontologies</artifactId>
</dependency>
</dependencies>
</project>
Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/AcpPermissionDescriptionsProvider.java
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/AcpPermissionDescriptionsProvider.java?rev=1062459&r1=1062458&r2=1062459&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/AcpPermissionDescriptionsProvider.java (original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/AcpPermissionDescriptionsProvider.java Sun Jan 23 16:03:42 2011
@@ -38,8 +38,8 @@ import org.apache.felix.scr.annotations.
*
* @author mir
*/
-@Component
-@Service(PermissionDescriptionsProvider.class)
+//@Component
+//@Service(PermissionDescriptionsProvider.class)
public class AcpPermissionDescriptionsProvider implements PermissionDescriptionsProvider{
private static final Set<PermissionDescripton> ACP_PERMISSION_DESCRIPTIONS = new HashSet<PermissionDescripton>();
Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/MenuItemProvider.java
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/MenuItemProvider.java?rev=1062459&r1=1062458&r2=1062459&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/MenuItemProvider.java (original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/MenuItemProvider.java Sun Jan 23 16:03:42 2011
@@ -47,8 +47,8 @@ import org.apache.clerezza.platform.secu
*
* @author reto
*/
-@Component
-@Service(value = GlobalMenuItemsProvider.class)
+//@Component
+//@Service(value = GlobalMenuItemsProvider.class)
public class MenuItemProvider implements GlobalMenuItemsProvider{
Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/ProfilePanel.java
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/ProfilePanel.java?rev=1062459&r1=1062458&r2=1062459&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/ProfilePanel.java (original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/ProfilePanel.java Sun Jan 23 16:03:42 2011
@@ -18,6 +18,7 @@
*/
package org.apache.clerezza.platform.accountcontrolpanel;
+import java.util.Iterator;
import org.apache.clerezza.ssl.keygen.CertSerialisation;
import org.apache.clerezza.ssl.keygen.Certificate;
import org.apache.clerezza.foafssl.ontologies.CERT;
@@ -59,6 +60,10 @@ import java.net.URL;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.interfaces.RSAPublicKey;
+import java.util.List;
+import org.apache.clerezza.platform.typerendering.scala.PageRenderlet;
+import org.apache.clerezza.rdf.ontologies.RDFS;
+import org.apache.clerezza.ssl.keygen.KeygenService;
/**
*
@@ -66,31 +71,34 @@ import java.security.interfaces.RSAPubli
*
* @author reto
*/
-@Component
-@Service(value = Object.class)
-@Property(name = "javax.ws.rs", boolValue = true)
+//@Component
+//@Service(value = Object.class)
+//@Property(name = "javax.ws.rs", boolValue = true)
@Path("/user/{id}/profile")
public class ProfilePanel extends FileServer {
private static final Logger logger = LoggerFactory.getLogger(ProfilePanel.class);
- @Reference
+// @Reference
private UserManager userManager;
- @Reference
+// @Reference
private org.apache.clerezza.ssl.keygen.KeygenService keygenSrvc;
- @Reference
+// @Reference
private TcManager tcManager;
- @Reference
+// @Reference
private RenderletManager renderletManager;
- @Reference
+// @Reference
private WebIdGraphsService webIdGraphsService;
- @Reference
+// @Reference
private PlatformConfig platformConfig;
protected void activate(ComponentContext componentContext) {
- URL templateURL = getClass().getResource("profile-panel.ssp");
- renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
- new UriRef(templateURL.toString()), CONTROLPANEL.ProfilePage,
- "naked", MediaType.APPLICATION_XHTML_XML_TYPE, true);
+// URL templateURL = getClass().getResource("profile_panel.scala");
+// renderletManager.registerRenderlet(PageRenderlet.class.getName(),
+// null, CONTROLPANEL.ProfilePage,
+// "naked", MediaType.APPLICATION_XHTML_XML_TYPE, true);
+//equivalent of above with no ssp?
+// renderletManager.registerRenderlet("org.apache.clerezza.platform.accountcontrolpanel.profile_panel",
+// null, CONTROLPANEL.ProfilePage, "naked", MediaType.APPLICATION_XHTML_XML_TYPE, true);
configure(componentContext.getBundleContext(), "profile-staticweb");
}
@@ -195,7 +203,8 @@ public class ProfilePanel extends FileSe
@FormParam("crmf") String crmf,
@FormParam("hours") String hours,
@FormParam("days") String days,
- @FormParam("csr") String csr) {
+ @FormParam("csr") String csr,
+ @FormParam("comment") String comment) {
logger.info("in keygen code. webId={}", webId);
logger.info("cn={}", commonName);
@@ -249,6 +258,10 @@ public class ProfilePanel extends FileSe
final GraphNode agent = new GraphNode(webId, webIdGraphs.localGraph());
certNode.addPropertyValue(RSA.modulus, modulus);
certNode.addPropertyValue(RSA.public_exponent, publicExponent);
+ if (comment != null && comment.length() > 0) {
+ certNode.addPropertyValue(RDFS.comment, comment);
+ }
+ certNode.addPropertyValue(DC.date, cert.getStartDate());
Response.ResponseBuilder resBuild = Response.ok(ser.getContent(), MediaType.valueOf(ser.getMimeType()));
return resBuild.build();
@@ -256,6 +269,39 @@ public class ProfilePanel extends FileSe
}
@POST
+ @Path("deletekey")
+ public Response deleteKey(@Context final UriInfo uriInfo,
+ @FormParam("webId") final UriRef webId,
+ @FormParam("keyhash") List<String> keys) {
+ final WebIdGraphsService.WebIdGraphs webIdGraphs = webIdGraphsService.getWebIdGraphs(webId);
+ final GraphNode agent = new GraphNode(webId, webIdGraphs.localGraph());
+ Iterator<GraphNode> subjects = agent.getSubjectNodes(CERT.identity);
+ for (GraphNode nl; subjects.hasNext(); ) {
+ nl = subjects.next();
+ Iterator<Resource> modulusIt = nl.getObjects(RSA.modulus);
+ if (!modulusIt.hasNext()) break;
+ Resource modLit = modulusIt.next(); //we only get the first, any more would be an error
+ if (modulusIt.hasNext()) logger.warn("data error, a modulus too many in cert for "+webId);
+ if (!(modLit instanceof TypedLiteral)) {
+ logger.warn("a public key has a modulus that is not a literal for "+webId);
+ break;
+ }
+ BigInteger modulus = LiteralFactory.getInstance().createObject(BigInteger.class, (TypedLiteral)modLit);
+ for (String key : keys) {
+ if (modulus.hashCode() == Integer.decode(key)) {
+ //we delete the key. Even thous it is extreemly unlikely that anything could go wrong here
+ //it would be a bitch to debug this. So one should probably just send the full key.
+ //in fact it would be impossible to duplicate the problem
+ nl.deleteNodeContext();
+ break;
+ }
+ }
+ }
+ //shoud one really have a redirect? or should the post just be to the profile page?
+ return RedirectUtil.createSeeOtherResponse("../profile", uriInfo);
+ }
+
+ @POST
@Path("modify")
public Response modifyProfile(@Context final UriInfo uriInfo,
@PathParam(value = "id") final String userName,
@@ -271,4 +317,64 @@ public class ProfilePanel extends FileSe
logger.debug("local graph (uri: {}) is now of size {}", webIdGraphs.localGraphUri(), webIdGraphs.localGraph().size());
return RedirectUtil.createSeeOtherResponse("../profile", uriInfo);
}
+
+ protected void bindUserManager(UserManager usermanager) {
+ userManager = usermanager;
+ }
+
+ protected void unbindUserManager(UserManager usermanager) {
+ if (userManager == usermanager) {
+ userManager = null;
+ }
+ }
+
+ protected void bindKeygenSrvc(KeygenService keygenservice) {
+ keygenSrvc = keygenservice;
+ }
+
+ protected void unbindKeygenSrvc(KeygenService keygenservice) {
+ if (keygenSrvc == keygenservice) {
+ keygenSrvc = null;
+ }
+ }
+
+ protected void bindTcManager(TcManager tcmanager) {
+ tcManager = tcmanager;
+ }
+
+ protected void unbindTcManager(TcManager tcmanager) {
+ if (tcManager == tcmanager) {
+ tcManager = null;
+ }
+ }
+
+ protected void bindRenderletManager(RenderletManager renderletmanager) {
+ renderletManager = renderletmanager;
+ }
+
+ protected void unbindRenderletManager(RenderletManager renderletmanager) {
+ if (renderletManager == renderletmanager) {
+ renderletManager = null;
+ }
+ }
+
+ protected void bindWebIdGraphsService(WebIdGraphsService webidgraphsservice) {
+ webIdGraphsService = webidgraphsservice;
+ }
+
+ protected void unbindWebIdGraphsService(WebIdGraphsService webidgraphsservice) {
+ if (webIdGraphsService == webidgraphsservice) {
+ webIdGraphsService = null;
+ }
+ }
+
+ protected void bindPlatformConfig(PlatformConfig platformconfig) {
+ platformConfig = platformconfig;
+ }
+
+ protected void unbindPlatformConfig(PlatformConfig platformconfig) {
+ if (platformConfig == platformconfig) {
+ platformConfig = null;
+ }
+ }
}
Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/SettingsPanel.java
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/SettingsPanel.java?rev=1062459&r1=1062458&r2=1062459&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/SettingsPanel.java (original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/SettingsPanel.java Sun Jan 23 16:03:42 2011
@@ -73,6 +73,7 @@ import org.apache.clerezza.platform.acco
import org.apache.clerezza.platform.config.SystemConfig;
import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
import org.apache.clerezza.platform.typerendering.RenderletManager;
+import org.apache.clerezza.platform.typerendering.scala.PageRenderlet;
import org.apache.clerezza.platform.typerendering.scalaserverpages.ScalaServerPagesRenderlet;
import org.apache.clerezza.rdf.core.BNode;
import org.apache.clerezza.rdf.core.Graph;
@@ -101,20 +102,20 @@ import org.apache.clerezza.triaxrs.prefi
*
* @author mir, hasan
*/
-@Component
-@Service(value = Object.class)
-@Property(name = "javax.ws.rs", boolValue = true)
-@Reference(name = "configurationAdmin", cardinality = ReferenceCardinality.OPTIONAL_UNARY,
-policy = ReferencePolicy.DYNAMIC, referenceInterface = ConfigurationAdmin.class)
+//@Component
+//@Service(value = Object.class)
+//@Property(name = "javax.ws.rs", boolValue = true)
+//@Reference(name = "configurationAdmin", cardinality = ReferenceCardinality.OPTIONAL_UNARY,
+// policy = ReferencePolicy.DYNAMIC, referenceInterface = ConfigurationAdmin.class)
@Path("/user/{id}/control-panel")
public class SettingsPanel {
private ComponentContext componentContext;
- @Reference(target = SystemConfig.SYSTEM_GRAPH_FILTER)
+// @Reference(target = SystemConfig.SYSTEM_GRAPH_FILTER)
private MGraph systemGraph; // System graph for user data access
- @Reference
+// @Reference
private RenderletManager renderletManager;
- @Reference
+// @Reference
private ContentGraphProvider cgProvider;
private final Logger logger = LoggerFactory.getLogger(SettingsPanel.class);
private ConfigurationAdmin configAdmin;
@@ -159,18 +160,17 @@ public class SettingsPanel {
} catch (AccessControlException e) {
graphNode.addProperty(CONTROLPANEL.changePasswordPermission,
SimpleLiteralFactory.getInstance().createTypedLiteral(
- Boolean.valueOf(false)));
+ Boolean.valueOf(false)));
}
if (changedPassword != null && changedPassword.equals("false")) {
graphNode.addProperty(CONTROLPANEL.changedPassword,
- new PlainLiteralImpl("false"));
+ new PlainLiteralImpl("false"));
}
graphNode.addProperty(RDF.type, CONTROLPANEL.SettingsPage);
graphNode.addProperty(RDF.type, PLATFORM.HeadedPage);
return graphNode;
}
-
private void addBundleDescriptionToGraph(MGraph responseGraph, Bundle bundle) {
TypedLiteral status = LiteralFactory.getInstance().
createTypedLiteral(bundle.getState());
@@ -542,6 +542,7 @@ public class SettingsPanel {
final String id = idP;
AccessController.checkPermission(new AccountControlPanelAppPermission(id, ""));
AccessController.doPrivileged(new PrivilegedAction() {
+
@Override
public Object run() {
GraphNode userNode = new GraphNode(getAgent(id), systemGraph);
@@ -587,7 +588,7 @@ public class SettingsPanel {
}
return currentPassword;
}
-
+
@Override
public Boolean run() {
final NonLiteral agent = getAgent(id);
@@ -611,8 +612,8 @@ public class SettingsPanel {
new PlainLiteralImpl(getEncodedPW(newPW)));
if (currentPassword != null) {
Triple oldPWTriple = new TripleImpl(agent,
- PERMISSION.passwordSha1, new PlainLiteralImpl(
- currentPassword));
+ PERMISSION.passwordSha1, new PlainLiteralImpl(
+ currentPassword));
systemGraph.remove(oldPWTriple);
logger.debug("removed old password from systemgraph");
}
@@ -674,12 +675,15 @@ public class SettingsPanel {
*/
protected void activate(ComponentContext componentContext) {
this.componentContext = componentContext;
- URL templateURL = getClass().getResource("settings-panel.ssp");
- renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
- new UriRef(templateURL.toString()), CONTROLPANEL.SettingsPage,
- "naked", MediaType.APPLICATION_XHTML_XML_TYPE, true);
+// URL templateURL = getClass().getResource("profile_panel.scala");
+// renderletManager.registerRenderlet(PageRenderlet.class.getName(),
+// null, CONTROLPANEL.SettingsPage,
+// "naked", MediaType.APPLICATION_XHTML_XML_TYPE, true);
+ //todo: broken, because one has to put the full path instead of a reference due to scala/java compilation priorities
+//equivalent of above with no ssp?
+// renderletManager.registerRenderlet("org.apache.clerezza.platform.accountcontrolpanel.settings_panel",
+// null, CONTROLPANEL.SettingsPage, "naked", MediaType.APPLICATION_XHTML_XML_TYPE, true);
- logger.info("Account Control Panel activated.");
}
protected void bindConfigurationAdmin(ConfigurationAdmin configAdmin) {
@@ -692,4 +696,33 @@ public class SettingsPanel {
this.configAdmin = null;
}
+ protected void bindSystemGraph(MGraph mgraph) {
+ systemGraph = mgraph;
+ }
+
+ protected void unbindSystemGraph(MGraph mgraph) {
+ if (systemGraph == mgraph) {
+ systemGraph = null;
+ }
+ }
+
+ protected void bindRenderletManager(RenderletManager renderletmanager) {
+ renderletManager = renderletmanager;
+ }
+
+ protected void unbindRenderletManager(RenderletManager renderletmanager) {
+ if (renderletManager == renderletmanager) {
+ renderletManager = null;
+ }
+ }
+
+ protected void bindCgProvider(ContentGraphProvider contentgraphprovider) {
+ cgProvider = contentgraphprovider;
+ }
+
+ protected void unbindCgProvider(ContentGraphProvider contentgraphprovider) {
+ if (cgProvider == contentgraphprovider) {
+ cgProvider = null;
+ }
+ }
}
Added: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/OSGI-INF/serviceComponents.xml
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/OSGI-INF/serviceComponents.xml?rev=1062459&view=auto
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/OSGI-INF/serviceComponents.xml (added)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/OSGI-INF/serviceComponents.xml Sun Jan 23 16:03:42 2011
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
+ <scr:component enabled="true" name="org.apache.clerezza.platform.accountcontrolpanel.AcpPermissionDescriptionsProvider">
+ <implementation class="org.apache.clerezza.platform.accountcontrolpanel.AcpPermissionDescriptionsProvider"/>
+ <service servicefactory="false">
+ <provide interface="org.apache.clerezza.permissiondescriptions.PermissionDescriptionsProvider"/>
+ </service>
+ <property name="service.pid" value="org.apache.clerezza.platform.accountcontrolpanel.AcpPermissionDescriptionsProvider"/>
+ </scr:component>
+ <scr:component enabled="true" name="org.apache.clerezza.platform.accountcontrolpanel.MenuItemProvider">
+ <implementation class="org.apache.clerezza.platform.accountcontrolpanel.MenuItemProvider"/>
+ <service servicefactory="false">
+ <provide interface="org.apache.clerezza.platform.dashboard.GlobalMenuItemsProvider"/>
+ </service>
+ <property name="service.pid" value="org.apache.clerezza.platform.accountcontrolpanel.MenuItemProvider"/>
+ </scr:component>
+ <scr:component enabled="true" name="org.apache.clerezza.platform.accountcontrolpanel.SettingsPanel">
+ <implementation class="org.apache.clerezza.platform.accountcontrolpanel.SettingsPanel"/>
+ <service servicefactory="false">
+ <provide interface="java.lang.Object"/>
+ </service>
+ <property name="javax.ws.rs" type="Boolean" value="true"/>
+ <property name="service.pid" value="org.apache.clerezza.platform.accountcontrolpanel.SettingsPanel"/>
+ <reference name="configurationAdmin" interface="org.osgi.service.cm.ConfigurationAdmin" cardinality="0..1" policy="dynamic" bind="bindConfigurationAdmin" unbind="unbindConfigurationAdmin"/>
+ <reference name="systemGraph" interface="org.apache.clerezza.rdf.core.MGraph" cardinality="1..1" policy="static" target="(name=http://tpf.localhost/system.graph)" bind="bindSystemGraph" unbind="unbindSystemGraph"/>
+ <reference name="renderletManager" interface="org.apache.clerezza.platform.typerendering.RenderletManager" cardinality="1..1" policy="static" bind="bindRenderletManager" unbind="unbindRenderletManager"/>
+ <reference name="cgProvider" interface="org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider" cardinality="1..1" policy="static" bind="bindCgProvider" unbind="unbindCgProvider"/>
+ </scr:component>
+ <scr:component enabled="true" name="org.apache.clerezza.platform.accountcontrolpanel.ProfilePanel">
+ <implementation class="org.apache.clerezza.platform.accountcontrolpanel.ProfilePanel"/>
+ <service servicefactory="false">
+ <provide interface="java.lang.Object"/>
+ </service>
+ <property name="javax.ws.rs" type="Boolean" value="true"/>
+ <property name="service.pid" value="org.apache.clerezza.platform.accountcontrolpanel.ProfilePanel"/>
+ <reference name="userManager" interface="org.apache.clerezza.platform.usermanager.UserManager" cardinality="1..1" policy="static" bind="bindUserManager" unbind="unbindUserManager"/>
+ <reference name="keygenSrvc" interface="org.apache.clerezza.ssl.keygen.KeygenService" cardinality="1..1" policy="static" bind="bindKeygenSrvc" unbind="unbindKeygenSrvc"/>
+ <reference name="tcManager" interface="org.apache.clerezza.rdf.core.access.TcManager" cardinality="1..1" policy="static" bind="bindTcManager" unbind="unbindTcManager"/>
+ <reference name="renderletManager" interface="org.apache.clerezza.platform.typerendering.RenderletManager" cardinality="1..1" policy="static" bind="bindRenderletManager" unbind="unbindRenderletManager"/>
+ <reference name="webIdGraphsService" interface="org.apache.clerezza.platform.users.WebIdGraphsService" cardinality="1..1" policy="static" bind="bindWebIdGraphsService" unbind="unbindWebIdGraphsService"/>
+ <reference name="platformConfig" interface="org.apache.clerezza.platform.config.PlatformConfig" cardinality="1..1" policy="static" bind="bindPlatformConfig" unbind="unbindPlatformConfig"/>
+ </scr:component>
+ <scr:component enabled="true" name="org.apache.clerezza.platform.accountcontrolpanel.profile_panel">
+ <implementation class="org.apache.clerezza.platform.accountcontrolpanel.profile_panel"/>
+ <service servicefactory="false">
+ <provide interface="org.apache.clerezza.platform.typerendering.Renderlet"/>
+ </service>
+ <property name="service.pid" value="org.apache.clerezza.platform.accountcontrolpanel.profile_panel"/>
+ <reference name="renderletManager" interface="org.apache.clerezza.platform.typerendering.RenderletManager" cardinality="1..1" policy="static" bind="bindRenderletManager" unbind="unbindRenderletManager"/>
+ </scr:component>
+ <scr:component enabled="true" name="org.apache.clerezza.platform.accountcontrolpanel.settings_panel">
+ <implementation class="org.apache.clerezza.platform.accountcontrolpanel.settings_panel"/>
+ <service servicefactory="false">
+ <provide interface="org.apache.clerezza.platform.typerendering.Renderlet"/>
+ </service>
+ <property name="service.pid" value="org.apache.clerezza.platform.accountcontrolpanel.settings_panel"/>
+ <reference name="renderletManager" interface="org.apache.clerezza.platform.typerendering.RenderletManager" cardinality="1..1" policy="static" bind="bindRenderletManager" unbind="unbindRenderletManager"/>
+ </scr:component>
+</components>
Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/profile-staticweb/style/profile.css
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/profile-staticweb/style/profile.css?rev=1062459&r1=1062458&r2=1062459&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/profile-staticweb/style/profile.css (original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/profile-staticweb/style/profile.css Sun Jan 23 16:03:42 2011
@@ -6,4 +6,17 @@
}
#setExistingWebId {
display: none
+}
+/* we need to override a table td:first-child in /style/table.css */
+td.propvalue:first-child {
+ text-align: right;
+}
+
+td.formlabel:first-child {
+ width: 10em;
+ text-align: right;
+}
+
+td.multiline:first-child {
+ vertical-align: text-top;
}
\ No newline at end of file
Added: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/profile_panel.scala
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/profile_panel.scala?rev=1062459&view=auto
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/profile_panel.scala (added)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/profile_panel.scala Sun Jan 23 16:03:42 2011
@@ -0,0 +1,244 @@
+/*
+ * Copyright 2010 Apache.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.clerezza.platform.accountcontrolpanel
+
+import org.apache.clerezza.rdf.core._
+import org.apache.clerezza.rdf.ontologies._
+import org.apache.clerezza.rdf.utils._
+import org.apache.clerezza.rdf.scala.utils._
+import org.apache.clerezza.rdf.scala.utils.Preamble._
+import org.apache.clerezza.foafssl.ontologies.CERT
+import org.apache.clerezza.foafssl.ontologies.RSA
+import org.apache.clerezza.platform.accountcontrolpanel.ontologies.CONTROLPANEL
+import org.apache.clerezza.platform.typerendering.scala._
+import java.math.BigInteger
+import java.util.Date
+import java.text._
+import javax.ws.rs.core.UriInfo
+import org.apache.clerezza.rdf.core.UriRef
+
+
+class profile_panel extends PageRenderlet {
+ val rdfType = CONTROLPANEL.ProfilePage
+ override def mode = "naked"
+
+ override def renderedPage(arguments: RenderedPage.Arguments): RenderedPage = {
+ new RenderedPage(arguments) {
+
+ override def content = {
+ def cp(s: Any) = new UriRef("http://clerezza.org/2009/03/controlpanel#" + s)
+ def platform(s: Any) = new UriRef("http://clerezza.org/2009/08/platform#" + s)
+ resultDocModifier.addStyleSheet("profile/style/profile.css");
+ resultDocModifier.addScriptReference("profile/scripts/profile.js");
+ resultDocModifier.addScriptReference("profile/scripts/IEKeygen.js");
+ resultDocModifier.setTitle("Account Control Panel");
+ resultDocModifier.addNodes2Elem("tx-module", <h1>Account Control Panel</h1>);
+ resultDocModifier.addNodes2Elem("tx-module-tabs-ol", <li class="tx-active"><a href="#">Profile</a></li>);
+ resultDocModifier.addNodes2Elem("tx-module-tabs-ol", <li><a href="control-panel">Settings</a></li>);
+ val agent: RichGraphNode = res / FOAF.primaryTopic
+ var webId =""
+
+ def createWebId() = {
+ <h3>Associate Profile to WebID</h3>
+ <div id="newOrExistingSelection">
+ <p>Your profile is not currently associated to a WebID. A WebID allows you
+ to link your friends as well as to log-in to many sites (supporting foaf+ssl
+ or open-id).
+ </p>
+ <p>You may either create a new WebID or associate your account to an
+ existing WebID. Only creating a WebID here will allow you to manage your
+ profile here.
+ </p>
+ <form action="#" id="associateSelection">
+ <button type="button" id="newWebIdButton">Create a new Web-Id</button>
+ <button type="button" id="existingWebIdButton">I already have a Web-ID and want to use it</button>
+ </form>
+ </div>
+ <div id="createNewWebId">
+ <p>You have chosen to create a new Web-Id.</p>
+ <p>The Web-ID will be created as follows:
+ <br/>
+ <ol>
+ <li>Web-Id:
+ {webId = res / cp("suggestedPPDUri") *;
+ webId += "#me";
+ webId}
+ </li>
+ <li>Personal-Profile Document: {res/cp("suggestedPPDUri")*}</li>
+ </ol>
+ </p>
+ <form method="post" action="profile/create-new-web-id">
+ <input value="Create it!" type="submit"/>
+ </form>
+ </div>
+ <div id="setExistingWebId">
+ <p>Please enter your Web-Id, if your Web-Id supports Foaf+SSL you will
+ be able to use it to log in to this site.</p>
+ <form method="post" action="profile/set-existing-webid">
+ <label for="webid">WebID</label> <input type="text" name="webid" size="80" title="Web-ID"/>
+ <br/>
+ <input value="Associate Profile to Web-Id" type="submit"/>
+ <p/>
+ </form>
+ </div>
+
+ }
+
+ def existingWebId() = {
+ if ((res / cp("isLocalProfile")).as[Boolean]) {
+ existingLocalWebId()
+ } else {
+ roamingUser()
+ }
+ }
+
+
+ def existingLocalWebId() = {
+ <h3>Manage your profile</h3>
+ <p>Here you can change your public profile.</p>
+
+ <form method="post" action="profile/modify">
+ <input type="hidden" name="webId" value={agent *}/>
+ <table>
+ <tr><td class="formlabel">Name:</td>
+ <td><input type="text" name="name" value={agent / FOAF.name *}/></td>
+ </tr>
+ <tr><td class="formlabel multiline">Description:</td>
+ <td><textarea name="description" rows="3" cols="80">{agent / DC.description *}</textarea></td>
+ </tr>
+ <tr><td class="formlabel"><input value="Modify" type="submit"/></td><td/></tr>
+ </table>
+
+ <p/>
+ </form>
+
+ <h3>Key and Certificate Creation</h3>
+
+ <script type="text/javascript"> <![CDATA[$(document).ready( function(){ configurePage(); } ); ]]> </script>
+
+ <div id="iehelptext" style="display: none;">
+ <p>Using Internet Explorer under Windows Vista or above or Windows
+ Server 2008, you need to configure the following for this to work:</p>
+ <ul>
+ <li>Add this site to the <i>Trusted Sites</i> list: in Internet
+ Options -> Security -> Trusted Sites -> Sites -> Add ...</li>
+ <li>You may need to configure the trust level (in this tab), using
+ <i>Custom Level...</i>: enable <i>Initialize and script ActiveX
+ controls not marked as safe for scripting</i>.</li>
+ <li>If you are using Windows Vista without SP1 or above, you will
+ probably need to install <a href="cacert.crt">this certificate</a> as a
+ Trusted Root Certification Authority Certificate for your own
+ certificate installation to succeed. You should probably remove that
+ trusted root CA certificate afterwards.</li>
+ </ul>
+ </div>
+ <form id="keygenform" method="post" action="profile/keygen">
+ <input name="webId" id="webId" type="hidden" value={agent*} />
+ <table>
+ <colgroup><col width="1*"/><col/></colgroup>
+ <tr>
+ <td class="formlabel">Certificate Name:</td>
+ <td>
+ <input alt="create a certificate name that will help you distinguish it from others you may have" name="cn" size="35" id="cn" type="text" value={ ((agent/FOAF.name*)+"@clerezza")}/>
+ </td>
+ </tr>
+ <tr>
+ <td class="formlabel">Key strength:</td>
+ <td id="keystrenghtd">
+ <keygen id="spkac" name="spkac" challenge="TheChallenge1"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="formlabel">Valid for:</td>
+ <td>
+ <input type="text" name="days" value="365" size="4"/>
+ days <input type="text" name="hours" value="0.0" size="4"/> hours</td>
+ </tr>
+ <tr>
+ <td class="formlabel">Comment:</td>
+ <td><input type="text" name="comment" value="" size="80"/></td>
+ </tr>
+ <tr><td class="formlabel"><input id="keygensubmit" type="submit" value="create certificate" /></td><td/></tr>
+ </table>
+ </form>
+ <h3>Existing Certificates</h3>
+ <form method="post" action="profile/deletekey">
+ <table>
+ <tr><th>Delete</th><th>Certificate Details</th></tr>
+ <input name="webId" id="webId" type="hidden" value={agent*} />
+ <tbody>{
+ for (cert <- agent/-CERT.identity )
+ yield { val modulus = (cert/RSA.modulus).as[BigInteger]
+ if (modulus == null) <span/> //todo: broken public key, should delete it
+ else <tr><td><input type="checkbox" name="keyhash" value={modulus.hashCode().toString()}/></td>
+ <td><table>
+ <tr><td class="propvalue">Created:</td><td>{beautify((cert/DC.date).as[Date])}</td></tr>
+ <tr><td class="propvalue">Comment:</td><td>{ cert/RDFS.comment* }</td></tr>
+ <tr><td class="propvalue multiline">Modulus:</td><td><code>{ beautify((cert/RSA.modulus).as[BigInteger]) }</code></td></tr>
+ <tr><td class="propvalue">Exponent:</td><td><code>{ beautify((cert/RSA.public_exponent).as[Integer]) }</code></td></tr>
+ </table>
+ </td>
+ </tr>}
+ }</tbody>
+ </table>
+ <input type="submit" value="Disable Keys"/>
+ </form>
+ <p></p>
+
+ }
+
+ def roamingUser() = {
+ <h3>Using remote profile</h3>
+ <p>
+ {agent / FOAF.nick *}, you have accessed this site using your WebID
+ {"<" + (agent *) + ">"}
+ which has not been
+ created on this site.To edit your profile you should visit the site issuing the
+ profile.</p>
+ }
+
+ <div id="tx-content">
+ <h2>Personal Profile</h2>{agent ! match {
+ case _: BNode => createWebId()
+ case _: UriRef => existingWebId()
+ }}
+ </div>
+ }
+ }
+ }
+
+ def beautify(resource: Object) = {
+ resource match {
+ case bigint: BigInteger => {
+ val bstr = bigint.toString(16).toUpperCase;
+ val sbuf = new StringBuffer(bstr.size + (bstr.size/2)+10)
+ var cnt = 0
+ for (c <- bstr.toCharArray) {
+ if ((cnt % 2) == 0) { sbuf.append(' ') }
+ sbuf.append(c)
+ cnt += 1
+ }
+ sbuf.toString
+ }
+ case date: Date => {DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.FULL).format(date)}
+ case intg: Integer => intg.toString
+ case string: String => string
+ case _ => resource.toString
+ }
+ }
+}
+
+
Copied: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/settings_panel.scala (from r1061301, incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/settings-panel.ssp)
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/settings_panel.scala?p2=incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/settings_panel.scala&p1=incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/settings-panel.ssp&r1=1061301&r2=1062459&rev=1062459&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/settings-panel.ssp (original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/settings_panel.scala Sun Jan 23 16:03:42 2011
@@ -1,3 +1,38 @@
+/*
+ * Copyright 2010 Apache.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.clerezza.platform.accountcontrolpanel
+
+import org.apache.clerezza.rdf.core._
+import org.apache.clerezza.rdf.ontologies._
+import org.apache.clerezza.rdf.utils._
+import org.apache.clerezza.rdf.scala.utils.Preamble._
+import org.apache.clerezza.platform.accountcontrolpanel.ontologies.CONTROLPANEL
+import org.apache.clerezza.platform.typerendering.scala._
+import javax.ws.rs.core.UriInfo
+import org.apache.clerezza.rdf.core.UriRef
+
+class settings_panel extends PageRenderlet {
+
+ val rdfType = CONTROLPANEL.SettingsPage
+ override def mode = "naked"
+
+ override def renderedPage(arguments: RenderedPage.Arguments): RenderedPage = {
+ new RenderedPage(arguments) {
+
+ override def content = {
import org.apache.clerezza.rdf.core.UriRef
import scala.xml.NodeBuffer
import scala.collection.mutable.ListBuffer
@@ -69,7 +104,7 @@ if ((res/cp("userBundlePermission")*) ==
if((res/cp("changePasswordPermission")*) == "true") {
nodeBuff +=(<h2>Change Password</h2>
-
+
<form action="control-panel/change-password" method="post">
<fieldset>
@@ -125,4 +160,8 @@ nodeBuff +=(<h2>Change user's default la
nodeBuff
}
</div>
-</div>
\ No newline at end of file
+</div>
+ }
+ }
+ }
+}