You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@clerezza.apache.org by it...@apache.org on 2010/07/14 22:22:31 UTC

svn commit: r964178 - in /incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main: java/org/apache/clerezza/platform/usermanager/webinterface/ resources/org/apache/clerezza/platform/usermanager...

Author: ito
Date: Wed Jul 14 20:22:30 2010
New Revision: 964178

URL: http://svn.apache.org/viewvc?rev=964178&view=rev
Log:
custom-user-info-template refactored (from seedsnipe to ssp)

Modified:
    incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/java/org/apache/clerezza/platform/usermanager/webinterface/UserManagerWeb.java
    incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/add-user-template.xhtml
    incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/custom-user-infos-template.xhtml

Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/java/org/apache/clerezza/platform/usermanager/webinterface/UserManagerWeb.java
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/java/org/apache/clerezza/platform/usermanager/webinterface/UserManagerWeb.java?rev=964178&r1=964177&r2=964178&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/java/org/apache/clerezza/platform/usermanager/webinterface/UserManagerWeb.java (original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/java/org/apache/clerezza/platform/usermanager/webinterface/UserManagerWeb.java Wed Jul 14 20:22:30 2010
@@ -63,7 +63,6 @@ import org.apache.clerezza.platform.dash
 import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
 import org.apache.clerezza.platform.typerendering.RenderletManager;
 import org.apache.clerezza.platform.typerendering.scalaserverpages.ScalaServerPagesRenderlet;
-import org.apache.clerezza.platform.typerendering.seedsnipe.SeedsnipeRenderlet;
 import org.apache.clerezza.platform.usermanager.UserComparator;
 import org.apache.clerezza.platform.usermanager.UserManager;
 import org.apache.clerezza.platform.usermanager.webinterface.ontology.USERMANAGER;
@@ -194,7 +193,7 @@ public class UserManagerWeb implements G
 				USERMANAGER.MultipleCustomPropertyPage,
 				"naked", MediaType.APPLICATION_XHTML_XML_TYPE, true);
 		renderletManager
-				.registerRenderlet(SeedsnipeRenderlet.class.getName(),
+				.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
 						new UriRef(getClass().getResource(
 								"custom-user-infos-template.xhtml").toURI().toString()),
 						USERMANAGER.CustomUserInformationPage, "naked",

Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/add-user-template.xhtml
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/add-user-template.xhtml?rev=964178&r1=964177&r2=964178&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/add-user-template.xhtml (original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/add-user-template.xhtml Wed Jul 14 20:22:30 2010
@@ -13,7 +13,21 @@ resultDocModifier.addNodes2Elem("tx-cont
 resultDocModifier.addNodes2Elem("tx-contextual-buttons-ol", <li><a id="addButton" class="tx-button tx-button-create" href="javascript:saveUser()">Save</a></li>);
 
         <div id="tx-content">  
-            
+            <script type="text/javascript">
+
+				$(document).ready(function() {{
+
+					refreshCustomInformation(null);
+
+					 $("#userRoles option").each(function() {{
+						$(this).bind("click", function() {{
+							refreshCustomInformation(null);
+						}});
+					 }});
+				}});
+
+				var multiplefield = new Array();
+			</script>
             <div class="tx-tree" id="tx-tree">
 				<div class="tx-edit">
 				<h3 class="tx-edit-header">Add new User</h3>
@@ -58,7 +72,7 @@ resultDocModifier.addNodes2Elem("tx-cont
 									</select>
 								</span>
 							</li>
-							
+							<div id="custominfos"></div>
 
 						</ol>
 						<br/>

Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/custom-user-infos-template.xhtml
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/custom-user-infos-template.xhtml?rev=964178&r1=964177&r2=964178&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/custom-user-infos-template.xhtml (original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/custom-user-infos-template.xhtml Wed Jul 14 20:22:30 2010
@@ -1,29 +1,46 @@
-		${ns:umr=http://clerezza.org/2009/05/usermanager#}
-		${ns:cp=http://clerezza.org/2009/06/custompropery#}
-			
+def umr(s: Any) = new UriRef("http://clerezza.org/2009/05/usermanager#" + s)
+def cp(s: Any) = new UriRef("http://clerezza.org/2009/06/custompropery#" + s)
 
-				${loop}
-					<li class="tx-line" style="background-image: none">
-					<label >${cp:customfield/cp:presentationlabel}:</label>
-						<span class="tx-item">
-					${if cp:customfield/cp:value}
-						${if cp:customfield/cp:multiselectable = "multiple"}
-							<select id="${cp:customfield/cp:property}" name="${cp:customfield/cp:property}" size="3" multiple="multiple">
-							${loop}
-								<option value="${cp:customfield/cp:value}">${cp:customfield/cp:value}</option>
-							${/loop}
-							</select>
-						${else}
-							<select id="${cp:customfield/cp:property}" name="${cp:customfield/cp:property}" size="1">
-							${loop}
-								<option value="${cp:customfield/cp:value}" ${if cp:customfield/cp:value = cp:customfield/cp:actualvalues} selected="selected"${/if} >${cp:customfield/cp:value}</option>
-							${/loop}
-							</select>
-						${/if}
-					${else}	
-						<input name="${cp:customfield/cp:property}" type="text" maxlength="${cp:customfield/cp:length}" value="${if cp:customfield/cp:actualvalues}${cp:customfield/cp:actualvalues}${/if}" />
-					${/if}
-						</span>
-					</li>
-				${/loop}
+
+	for(customField <- (res/cp("customfield"))) yield {
+		val multipleSelection = if ((customField/cp("value")).length > 0 &&
+			(customField/cp("multiselectable")*	).equals("multiple")) { true } else { false }
+
+		<li class="tx-line" style={"background-image: none; " + (if (multipleSelection) { "height: 6em;" } else { "" })}>
+		<label >{(customField/cp("presentationlabel")*) + ":"}</label>
+			<span class="tx-item">
+		{
+		if ((customField/cp("value")).length > 0) {
+			if (multipleSelection) {
+				<select id={customField/cp("property")*} name={customField/cp("property")*} size="3" multiple="multiple">
+				{
+				for(cpValue <- (customField/cp("value"))) yield{
+					if((customField/cp("actualvalues")*).equals(cpValue*)) {
+						<option value={cpValue*} selected="selected">{cpValue*}</option>
+					} else {
+						<option value={cpValue*}>{cpValue*}</option>
+					}
+				}
+				}
+				</select>
+			} else {
+				<select id={customField/cp("property")*} name={customField/cp("property")*} size="1">
+				{
+				for(cpValue <- (customField/cp("value"))) yield{
+					if((customField/cp("actualvalues")*).equals(cpValue*)) {
+						<option value={cpValue*} selected="selected">{cpValue*}</option>
+					} else {
+						<option value={cpValue*}>{cpValue*}</option>
+					}
+				}
+				}
+				</select>
+			}
+		} else {
+			<input name={customField/cp("property")*} type="text" maxlength={customField/cp("length")*} value={customField/cp("actualvalues")*} />
+		}
+		}
+			</span>
+		</li>
+	}