Author: xlawrence
Date: Thu Nov 8 11:02:03 2007
New Revision: 15
URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D15&repname=3D=
corporate_portal_templates_v3
Log:
put old v2 mysettings file.
Still need to be taglibified and cleaned
Added:
trunk/src/jsp/mysettingschanged.jsp
Modified:
trunk/src/jsp/mysettings.jsp
Modified: trunk/src/jsp/mysettings.jsp
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/src/jsp/mysetti=
ngs.jsp&rev=3D15&repname=3Dcorporate_portal_templates_v3
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/src/jsp/mysettings.jsp (original)
+++ trunk/src/jsp/mysettings.jsp Thu Nov 8 11:02:03 2007
@@ -1 +1,246 @@
-to be completed...
\ No newline at end of file
+<%@ page import=3D"org.jahia.engines.mysettings.MySettingsEngine" %>
+<%@ page import=3D"org.jahia.services.usermanager.JahiaUser" %>
+<%--
+Copyright 2002-2006 Jahia Ltd
+
+Licensed under the JAHIA COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (JCDD=
L),
+Version 1.0 (the "License"), or (at your option) any later version; you may
+not use this file except in compliance with the License. You should have
+received a copy of the License along with this program; if not, you may ob=
tain
+a copy of the License at
+
+ http://www.jahia.org/license/
+
+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.
+--%>
+<%@ include file=3D"common/top_declarations.jspf" %>
+<%@ include file=3D"common/header.jspf" %>
+<%@ include file=3D"common/menu.jspf" %>
+
+<%!
+ public String getUserProp(Map engineMap, String propName) {
+ UserProperty propValue =3D
+ (UserProperty) engineMap.get(MySettingsEngine.USER_PROPERT=
Y_PREFIX + propName);
+ if (propValue =3D=3D null) {
+ return "";
+ } else {
+ return propValue.getValue();
+ }
+ }
+
+ public boolean isPropReadOnly(Map engineMap, String propName) {
+ UserProperty propValue =3D (
+ UserProperty) engineMap.get(MySettingsEngine.USER_PROPERTY=
_PREFIX + propName);
+ return propValue !=3D null && propValue.isReadOnly();
+ }
+
+ private String getRessource(String label, Locale l) {
+ try {
+ return ResourceBundle.getBundle("jahiatemplates.Corporate_port=
al_templates_v2", l).getString(label);
+ } catch (Exception e) {
+ return "";
+ }
+ }
+%>
+
+<jesi:template>
+<div id=3D"main">
+<div id=3D"column-left"> </div>
+<div id=3D"column-main">
+<jesi:fragment cache=3D"no">
+<%
+ Locale locale =3D (Locale) session.getAttribute(ParamBean.SESSION_LOCA=
LE);
+ String[] defaultkeys =3D {"firstname", "lastname", "organization", "em=
ail"};
+ String[] defaultRkeys =3D {"mySettingsFirstName", "mySettingsLastName"=
, "mySettingsOrganization", "mySettingsEmail"};
+%>
+
+<script type=3D"text/javascript" language=3D"javascript">
+ <!--
+ var addprop =3D false;
+
+ //preloading icons
+ adding =3D new Image();
+ adding.src =3D "<%=3Drequest.getContextPath()%>/jsp/jahia/engines/imag=
es/adding.png";
+ deleting =3D new Image();
+ deleting.src =3D "<%=3Drequest.getContextPath()%>/jsp/jahia/engines/im=
ages/deleting.png";
+
+ //functions
+ function keytoRemove(id) {
+ document.mainForm.keytoremove.value =3D id;
+ document.mainForm.submit();
+ }
+ function showAdd() {
+ var elm =3D document.getElementById('personal');
+ var elmvis =3D elm.style.visibility;
+ var icon =3D document.getElementById('addingicon');
+ if (elmvis =3D=3D "hidden") {
+ elm.style.visibility =3D 'visible';
+ icon.src =3D deleting.src;
+ } else {
+ elm.style.visibility =3D 'hidden';
+ icon.src =3D adding.src;
+ document.getElementById("pkey").value =3D '';
+ document.getElementById("pval").value =3D '';
+ }
+
+ }
+ //-->
+</script>
+<h1><content:resourceBundle resourceBundle=3D"jahiatemplates.Corporate_por=
tal_templates_v2"
+ resourceName=3D"mySettings"/></h1>
+
+<content:resourceBundle resourceBundle=3D"jahiatemplates.Corporate_portal_=
templates_v2"
+ resourceName=3D"mySettingsIntro"/>
+<br/>
+<br/>
+
+<logic:present name=3D"engineMessages">
+ <div id=3D"errors">
+ <content:resourceBundle resourceBundle=3D"jahiatemplates.Corporate=
_portal_templates_v2"
+ resourceName=3D"mySettingsErrors"/> : <br/>
+ <ul>
+ <logic:iterate name=3D"engineMessages" property=3D"messages" i=
d=3D"curMessage">
+ <li><content:message name=3D"curMessage"/></li>
+ </logic:iterate>
+ </ul>
+ </div>
+</logic:present>
+
+<form name=3D"mainForm" method=3D"POST" action=3D"?mode=3Ddisplay&screen=
=3Dsave">
+
+<% if (!jData.getProcessingContext().getUser().isPasswordReadOnly()) { %>
+<table>
+ <tr>
+ <td><content:resourceBundle
+ resourceBundle=3D"jahiatemplates.Corporate_portal_template=
s_v2"
+ resourceName=3D"mySettingsPassword1"/> :
+ </td>
+ <td><input type=3D"password"
+ name=3D"<%=3DMySettingsEngine.REQUEST_PASSWORD_KEY%>" v=
alue=3D""></td>
+ </tr>
+ <tr>
+ <td><content:resourceBundle
+ resourceBundle=3D"jahiatemplates.Corporate_portal_template=
s_v2"
+ resourceName=3D"mySettingsPassword2"/> :
+ </td>
+ <td><input type=3D"password"
+ name=3D"<%=3DMySettingsEngine.REQUEST_PASSWORD_CONFIRMA=
TION_KEY%>" value=3D""></td>
+ </tr>
+</table>
+<% } %>
+
+<p> </p>
+
+<h2><content:resourceBundle resourceBundle=3D"jahiatemplates.Corporate_por=
tal_templates_v2"
+ resourceName=3D"mySettingsProperties"/>(defaul=
t)</h2>
+<table>
+ <%
+ for (int i =3D 0; i < defaultkeys.length; i++) {
+ %>
+ <tr>
+ <td><content:resourceBundle resourceBundle=3D"jahiatemplates.Corpo=
rate_portal_templates_v2"
+ resourceName=3D"<%=3DdefaultRkeys[i]%>=
"/> :
+ </td>
+ <td><input type=3D"text" <%
+
+ if (isPropReadOnly(engineMap,defaultkeys[i] )) {
+
+
+ %>disabled=3D"true"<%}%> name=3D'<%=3DMySettingsEngine.USER_PROPER=
TY_PREFIX+defaultkeys[i]%>'
+ value=3D'<%=3DgetUserProp(engineMap, defaul=
tkeys[i])%>'/></td>
+ </tr>
+ <%
+ }
+ %>
+
+</table>
+
+
+<%
+ JahiaUser u =3D jData.getProcessingContext().getUser();
+ StringBuffer sb =3D new StringBuffer();
+ int cp =3D 0;
+ Iterator propit =3D u.getUserProperties().propertyNameIterator();
+ logger.debug(u.getUserProperties());
+ while (propit.hasNext()) {
+ String n =3D (String) propit.next();
+ //logger.debug("key=3D"+n+" "+u.getUserProperty(n).getValue());
+ if (n.startsWith(MySettingsEngine.USER_PROPERTY_PREFIX)) {
+ sb.append("<tr><td>");
+ sb.append(n.substring(n.indexOf(MySettingsEngine.SEPARATOR) + =
1));
+ sb.append(" :</td><td><input type=3D\"text\"");
+ if (isPropReadOnly(engineMap, n)) {
+ sb.append(" disabled=3D\"true\"");
+ }
+ sb.append(" name=3D\"").append(n).append("\" value=3D\"").appe=
nd(getUserProp(engineMap, n)).append("\"/> ");
+ sb.append("<a href=3D\"javascript:keytoRemove('").append(n).ap=
pend("')\"><img src=3D\"").append(request.getContextPath());
+ sb.append("/jsp/jahia/engines/images/deleting.png\" width=3D\"=
16\" height=3D\"16\" border=3D\"0\" alt=3D\"");
+ sb.append(getRessource("mySettingsremoveProperty", locale));
+ sb.append("\"/></a></td></tr>");
+
+ cp++;
+ }
+ }
+ if (cp > 0) {
+%>
+<p> </p>
+
+<h2><content:resourceBundle resourceBundle=3D"jahiatemplates.Corporate_por=
tal_templates_v2"
+ resourceName=3D"mySettingsPersonalProperties"/=
></h2>
+<table>
+ <%=3Dsb.toString()%>
+</table>
+<%
+ }
+%>
+<p> </p>
+
+<h2><content:resourceBundle resourceBundle=3D"jahiatemplates.Corporate_por=
tal_templates_v2"
+ resourceName=3D"mySettingsaddPersonalPropertie=
s"/></h2>
+<table>
+ <tr valign=3D"middle">
+ <td><a href=3D"javascript:showAdd();"><img alt=3D"" id=3D"addingic=
on"
+ src=3D"<%=3Drequest.getCo=
ntextPath()%>/jsp/jahia/engines/images/adding.png"
+ width=3D"16" height=3D"16=
" border=3D"0"/></a></td>
+ <td>
+ <table id=3D"personal" style=3D"visibility:hidden;">
+ <tr>
+ <td><content:resourceBundle resourceBundle=3D"jahiatem=
plates.Corporate_portal_templates_v2"
+ resourceName=3D"mySettings=
newproplabel"/> :<input type=3D"text" id=3D"pkey"
+ =
name=3D'<%=3DMySettingsEngine.USER_NEWPROPERTY_PREFIX=
%>'
+ =
value=3D''/></td>
+ <td><content:resourceBundle resourceBundle=3D"jahiatem=
plates.Corporate_portal_templates_v2"
+ resourceName=3D"mySettings=
newpropvalue"/>:<input type=3D"text" id=3D"pval"
+ =
name=3D'<%=3DMySettingsEngine.USER_NEWPROPERTYVALUE_PR=
EFIX%>'
+ =
value=3D''/></td>
+ </tr>
+
+ <input type=3D"hidden" id=3D"keytoremove" name=3D"keytorem=
ove" value=3D""/>
+
+
+ </table>
+ </td>
+ </tr>
+</table>
+
+<br>
+
+<div id=3D"buttons">
+ <div class=3D"button">
+ <a href=3D"javascript:document.mainForm.submit();"
+ title=3D"<content:resourceBundle
+ resourceBundle=3D"jahiatemplates.Corporate_portal_templates_v2=
" resourceName=3D"mySettingsSubmit"/>"><content:resourceBundle
+ resourceBundle=3D"jahiatemplates.Corporate_portal_template=
s_v2" resourceName=3D"mySettingsSubmit"/></a>
+ </div>
+</div>
+</form>
+</div>
+</div>
+</jesi:fragment>
+</jesi:template>
+
+<%@ include file=3D"common/footer.jspf" %>
Added: trunk/src/jsp/mysettingschanged.jsp
URL: https://svndev.jahia.net/websvn/filedetails.php?path=3D/trunk/src/jsp/=
mysettingschanged.jsp&rev=3D15&repname=3Dcorporate_portal_templates_v3
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/src/jsp/mysettingschanged.jsp (added)
+++ trunk/src/jsp/mysettingschanged.jsp Thu Nov 8 11:02:03 2007
@@ -0,0 +1,34 @@
+<%--
+Copyright 2002-2006 Jahia Ltd
+
+Licensed under the JAHIA COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (JCDD=
L), =
+Version 1.0 (the "License"), or (at your option) any later version; you ma=
y =
+not use this file except in compliance with the License. You should have =
+received a copy of the License along with this program; if not, you may ob=
tain =
+a copy of the License at =
+
+ http://www.jahia.org/license/
+
+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.
+--%>
+<%@ include file=3D"common/top_declarations.jspf" %>
+<%@ include file=3D"common/header.jspf" %>
+<%@ include file=3D"common/menu.jspf" %>
+<jesi:template>
+ <div id=3D"main">
+ <div id=3D"column-left"> </div>
+ <div id=3D"column-main">
+ <jesi:fragment cache=3D"no">
+ <br/>
+ <content:resourceBundle resourceBundle=3D"jahiatemplates.Corporate=
_portal_templates_v2"
+ resourceName=3D"mySettingsSuccessIntro"/>
+ </div>
+ </div>
+ </jesi:fragment>
+</jesi:template>
+
+<%@ include file=3D"common/footer.jspf" %>
\ No newline at end of file
_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list