Author: dpillot
Date: Wed Aug 1 17:01:43 2007
New Revision: 755
URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D755&repname=
=3Dcorporate_portal_templates_v2
Log:
http://www.jahia.net/jira/browse/TEMPLATES-234:
added succes message for poll
port functionnalities on poll box
various cosmetics and label enhancements
Added:
branches/JAHIA-5-0-SP-BRANCH/src/jsp/box/pollbox.inc
Modified:
branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/Corporate_portal_t=
emplates_v2.properties
branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/Corporate_portal_t=
emplates_v2_en.properties
branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/Corporate_portal_t=
emplates_v2_fr.properties
branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/org/jahia/corporat=
eportalv2/ldap/GroupWrapper.java
branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/org/jahia/corporat=
eportalv2/ldap/UserWrapper.java
branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/org/jahia/corporat=
eportalv2/ldap/adminBundleProvider.java
branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/org/jahia/corporat=
eportalv2/ldap/enginesBundleProvider.java
branches/JAHIA-5-0-SP-BRANCH/src/jsp/box/box.jsp
branches/JAHIA-5-0-SP-BRANCH/src/jsp/box/declarations.inc
branches/JAHIA-5-0-SP-BRANCH/src/jsp/poll/definitions.inc
branches/JAHIA-5-0-SP-BRANCH/src/jsp/poll/form.inc
branches/JAHIA-5-0-SP-BRANCH/src/jsp/poll/poll.jsp
branches/JAHIA-5-0-SP-BRANCH/src/jsp/poll/process.inc
Modified: branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/Corporate_po=
rtal_templates_v2.properties
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/src/java/jahiatemplates/Corporate_portal_templates_v2.properties&re=
v=3D755&repname=3Dcorporate_portal_templates_v2
=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
--- branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/Corporate_portal_t=
emplates_v2.properties (original)
+++ branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/Corporate_portal_t=
emplates_v2.properties Wed Aug 1 17:01:43 2007
@@ -176,6 +176,10 @@
news.startDate =3D Start date
news.endDate =3D End date
=
+boxContainer.pollbox =3D Poll box
+
+
+
splashs =3D banner
splashs.splash =3D Banner
add.splash =3D Add a banner
@@ -192,6 +196,7 @@
savedSearch =3D Search result
searchBox =3D File search box
webdav =3D Mount webdav repository
+pollbox =3D Poll
layout0 =3D Blank box
layout1 =3D Outline box
layout3 =3D Filled box
Modified: branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/Corporate_po=
rtal_templates_v2_en.properties
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/src/java/jahiatemplates/Corporate_portal_templates_v2_en.properties=
&rev=3D755&repname=3Dcorporate_portal_templates_v2
=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
--- branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/Corporate_portal_t=
emplates_v2_en.properties (original)
+++ branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/Corporate_portal_t=
emplates_v2_en.properties Wed Aug 1 17:01:43 2007
@@ -726,4 +726,6 @@
noTitle=3DNo title
poll.successMsg=3DThanks for your participation
poll.successMsgLabel=3DMessage thanks in case of successful answering
-poll.updatePrefsMsg=3DPlease update the message Preferences
\ No newline at end of file
+poll.updatePrefsMsg=3DPlease update the message Preferences
+boxContainer.pollbox=3DPoll box
+pollbox=3DPoll
\ No newline at end of file
Modified: branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/Corporate_po=
rtal_templates_v2_fr.properties
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/src/java/jahiatemplates/Corporate_portal_templates_v2_fr.properties=
&rev=3D755&repname=3Dcorporate_portal_templates_v2
=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
--- branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/Corporate_portal_t=
emplates_v2_fr.properties (original)
+++ branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/Corporate_portal_t=
emplates_v2_fr.properties Wed Aug 1 17:01:43 2007
@@ -637,4 +637,6 @@
noTitle=3DSans titre
poll.successMsg=3DMerci de votre participation
poll.successMsgLabel=3DMessage en cas de succ=C3=A8s
-poll.updatePrefsMsg=3DVeuillez mettre a jour les messages
\ No newline at end of file
+poll.updatePrefsMsg=3DVeuillez mettre a jour les messages
+boxContainer.pollbox=3DBoite de sondage
+pollbox=3DSondage
\ No newline at end of file
Modified: branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/org/jahia/co=
rporateportalv2/ldap/GroupWrapper.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/src/java/jahiatemplates/org/jahia/corporateportalv2/ldap/GroupWrapp=
er.java&rev=3D755&repname=3Dcorporate_portal_templates_v2
=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
--- branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/org/jahia/corporat=
eportalv2/ldap/GroupWrapper.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/org/jahia/corporat=
eportalv2/ldap/GroupWrapper.java Wed Aug 1 17:01:43 2007
@@ -127,7 +127,7 @@
if (thestring =3D=3D null) return "-";
return StringUtils.trimToEmpty(thestring);
}
- return "-";
+ return "-"; =
}
}
=
Modified: branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/org/jahia/co=
rporateportalv2/ldap/UserWrapper.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/src/java/jahiatemplates/org/jahia/corporateportalv2/ldap/UserWrappe=
r.java&rev=3D755&repname=3Dcorporate_portal_templates_v2
=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
--- branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/org/jahia/corporat=
eportalv2/ldap/UserWrapper.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/org/jahia/corporat=
eportalv2/ldap/UserWrapper.java Wed Aug 1 17:01:43 2007
@@ -1,20 +1,20 @@
-/*
- * Copyright 2002-2006 Jahia Ltd
- *
- * Licensed under the JAHIA COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (J=
CDDL), =
- * 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 hav=
e =
- * received a copy of the License along with this program; if not, you may=
obtain =
- * 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.
- */
+/*
+ * Copyright 2002-2006 Jahia Ltd
+ *
+ * Licensed under the JAHIA COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (J=
CDDL), =
+ * 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 hav=
e =
+ * received a copy of the License along with this program; if not, you may=
obtain =
+ * 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.
+ */
package jahiatemplates.org.jahia.corporateportalv2.ldap;
=
import org.apache.commons.lang.StringUtils;
@@ -152,7 +152,7 @@
v =3D GroupService.getUserMembership(u);
}
*/
- return v;
+ return v; =
}
}
=
Modified: branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/org/jahia/co=
rporateportalv2/ldap/adminBundleProvider.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/src/java/jahiatemplates/org/jahia/corporateportalv2/ldap/adminBundl=
eProvider.java&rev=3D755&repname=3Dcorporate_portal_templates_v2
=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
--- branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/org/jahia/corporat=
eportalv2/ldap/adminBundleProvider.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/org/jahia/corporat=
eportalv2/ldap/adminBundleProvider.java Wed Aug 1 17:01:43 2007
@@ -1,20 +1,20 @@
-/*
- * Copyright 2002-2006 Jahia Ltd
- *
- * Licensed under the JAHIA COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (J=
CDDL), =
- * 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 hav=
e =
- * received a copy of the License along with this program; if not, you may=
obtain =
- * 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.
- */
+/*
+ * Copyright 2002-2006 Jahia Ltd
+ *
+ * Licensed under the JAHIA COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (J=
CDDL), =
+ * 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 hav=
e =
+ * received a copy of the License along with this program; if not, you may=
obtain =
+ * 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.
+ */
package jahiatemplates.org.jahia.corporateportalv2.ldap;
=
import org.apache.log4j.Logger;
@@ -42,7 +42,7 @@
org.apache.log4j.Logger log =3D Logger.getLogger(adminBundleProvider.c=
lass);
=
public adminBundleProvider() {
- log.debug("instanciating"); =
+ log.debug("instanciating"); =
=
}
=
Modified: branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/org/jahia/co=
rporateportalv2/ldap/enginesBundleProvider.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/src/java/jahiatemplates/org/jahia/corporateportalv2/ldap/enginesBun=
dleProvider.java&rev=3D755&repname=3Dcorporate_portal_templates_v2
=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
--- branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/org/jahia/corporat=
eportalv2/ldap/enginesBundleProvider.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/src/java/jahiatemplates/org/jahia/corporat=
eportalv2/ldap/enginesBundleProvider.java Wed Aug 1 17:01:43 2007
@@ -1,20 +1,20 @@
-/*
- * Copyright 2002-2006 Jahia Ltd
- *
- * Licensed under the JAHIA COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (J=
CDDL), =
- * 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 hav=
e =
- * received a copy of the License along with this program; if not, you may=
obtain =
- * 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.
- */
+/*
+ * Copyright 2002-2006 Jahia Ltd
+ *
+ * Licensed under the JAHIA COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (J=
CDDL), =
+ * 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 hav=
e =
+ * received a copy of the License along with this program; if not, you may=
obtain =
+ * 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.
+ */
package jahiatemplates.org.jahia.corporateportalv2.ldap;
=
import org.apache.log4j.Logger;
@@ -43,7 +43,7 @@
=
=
public enginesBundleProvider() {
- log.debug("instanciating"); =
+ log.debug("instanciating"); =
=
}
=
Modified: branches/JAHIA-5-0-SP-BRANCH/src/jsp/box/box.jsp
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/src/jsp/box/box.jsp&rev=3D755&repname=3Dcorporate_portal_templates_=
v2
=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
--- branches/JAHIA-5-0-SP-BRANCH/src/jsp/box/box.jsp (original)
+++ branches/JAHIA-5-0-SP-BRANCH/src/jsp/box/box.jsp Wed Aug 1 17:01:43 20=
07
@@ -29,6 +29,11 @@
<bean:define id=3D"links" value=3D'<%=3DResourceBundleMarke=
r.getValue(ResourceBundleMarker.drawMarker(resBundleID,"links",""),jParams.=
getLocale())%>'/>
<bean:define id=3D"pages" value=3D'<%=3DResourceBundleMarke=
r.getValue(ResourceBundleMarker.drawMarker(resBundleID,"pages",""),jParams.=
getLocale())%>'/>
<!--bean:define id=3D"filterWizards" value=3D'<%=3DResourceBun=
dleMarker.getValue(ResourceBundleMarker.drawMarker(resBundleID,"filterWizar=
ds",""),jParams.getLocale())%>'/-->
+ <%
+ String bundlevaluekey=3D ResourceBundleMarker.getValue(Resou=
rceBundleMarker.drawMarker(resBundleID,"pollbox",""),jParams.getLocale());
+ logger.debug("valuebox=3D"+bundlevaluekey);
+ %>
+ <bean:define id=3D"pollbox" value=3D'<%=3DResourceBundleMarke=
r.getValue(ResourceBundleMarker.drawMarker(resBundleID,"pollbox",""),jParam=
s.getLocale())%>'/>
<bean:define id=3D"webapps" value=3D'<%=3DResourceBundleMarke=
r.getValue(ResourceBundleMarker.drawMarker(resBundleID,"webapps",""),jParam=
s.getLocale())%>'/>
<bean:define id=3D"lastNews" value=3D'<%=3DResourceBundleM=
arker.getValue(ResourceBundleMarker.drawMarker(resBundleID,"lastNews",""),j=
Params.getLocale())%>'/>
<bean:define id=3D"webdav" value=3D'<%=3DResourceBundleMark=
er.getValue(ResourceBundleMarker.drawMarker(resBundleID,"webdav",""),jParam=
s.getLocale())%>'/>
@@ -90,6 +95,9 @@
<c:when test=3D"${boxTypeRealValue =3D=3D groupsCo=
ntainer}">
<%@ include file=3D"groupsContainer.inc"%>
</c:when>
+ <c:when test=3D"${boxTypeRealValue =3D=3D pollbox}=
">
+ <%@ include file=3D"pollbox.inc"%>
+ </c:when>
<c:otherwise>
<%@ include file=3D"texts.inc"%>
</c:otherwise>
Modified: branches/JAHIA-5-0-SP-BRANCH/src/jsp/box/declarations.inc
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/src/jsp/box/declarations.inc&rev=3D755&repname=3Dcorporate_portal_t=
emplates_v2
=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
--- branches/JAHIA-5-0-SP-BRANCH/src/jsp/box/declarations.inc (original)
+++ branches/JAHIA-5-0-SP-BRANCH/src/jsp/box/declarations.inc Wed Aug 1 17=
:01:43 2007
@@ -22,7 +22,7 @@
%>
<%!
//String boxTypes[] =3D {"files", "links", "lastNews", "texts", "webapps",=
"filterWizards"};
-String boxTypes[] =3D {"files", "links", "pages", "lastNews", "texts", "we=
bapps","savedSearch","usersContainer", "groupsContainer","webdav"};
+String boxTypes[] =3D {"files", "links", "pages", "lastNews", "texts", "we=
bapps","savedSearch","usersContainer", "groupsContainer","webdav","pollbox"=
};
String boxLayouts[] =3D {"layout0", "layout1"};
=
public String getCss (String layout, String resBundleID)
@@ -244,6 +244,26 @@
</content:declareContainer>
</content:declareContainerList>
=
+ =
+ <%//------------poll'sBox-------------------------- %>
+ <content:declareContainerList name=3D'<%=3D"pollbox" + id%>'
+ title=3D"pollbox Container"
+ titleKey=3D"pollbox"
+ bundleKey=3D"<%=3DresBundleID%>"
+ containerListType=3D"<%=3DJahiaConta=
inerDefinition.SINGLE_MANDATORY_TYPE%>"
+
+ >
+ <content:declareContainer>
+ <content:declareField name=3D"errorMsgIfNoValue" title=3D"Erro=
r message if no value" type=3D"SmallText"
+ titleKey=3D"poll.errorMsgIfNoValue" bundleKey=3D"<%=3DresBundleID%=
>"/>
+ <content:declareField name=3D"errorMsgIfalreadyPosted" title=3D"Error =
message if the poll already posted" type=3D"SmallText"
+ titleKey=3D"poll.errorMsgIfalreadyPosted" bundleKey=3D"<%=3DresBun=
dleID%>"/>
+ <content:declareField name=3D"succesMessage" title=3D"Success message"=
type=3D"SmallText"
+ titleKey=3D"poll.successMsgLabel" bundleKey=3D"<%=3DresBundleID%>"=
/>
+
+ </content:declareContainer>
+ </content:declareContainerList>
+
<%//--------------------------------------------------------------=
--- %>
<content:declareContainerList
name=3D'<%=3D"savedSearch" + id%>' title=3D"savedSearch"
Added: branches/JAHIA-5-0-SP-BRANCH/src/jsp/box/pollbox.inc
URL: https://svndev.jahia.net/websvn/filedetails.php?path=3D/branches/JAHIA=
-5-0-SP-BRANCH/src/jsp/box/pollbox.inc&rev=3D755&repname=3Dcorporate_portal=
_templates_v2
=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
--- branches/JAHIA-5-0-SP-BRANCH/src/jsp/box/pollbox.inc (added)
+++ branches/JAHIA-5-0-SP-BRANCH/src/jsp/box/pollbox.inc Wed Aug 1 17:01:4=
3 2007
@@ -0,0 +1,499 @@
+<%@ page import=3D"java.text.DecimalFormat" %>
+<%--
+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.
+--%>
+<%
+logger.debug("Entering box poll");
+// to get an id for anwsers and results binded on title of the pollbox
+String pollboxId=3D(String)pageContext.findAttribute("boxtitle");
+String pollboxQuestionId=3D"questionContainerList_"+pollboxId;
+String pollboxAnswerId=3D"answerContainerList_"+pollboxId;
+%>
+
+<%@ include file=3D"../poll/declarations.inc"%>
+
+
+<content:declareContainerList name=3D"<%=3DpollboxQuestionId%>" title=3D"L=
ist of questions"
+ containerListType=3D"<%=3DJahiaContainerDefinition.SINGLE_MANDATORY_TY=
PE%>"
+>
+<content:declareContainer>
+ <content:declareField name=3D"question" title=3D"Question" type=3D"Sma=
llText"
+ titleKey=3D"poll.question" bundleKey=3D"<%=3DresBundleID%>"/>
+
+ <content:declareContainerList name=3D"<%=3DpollboxAnswerId%>" title=3D=
"List of answers">
+ <content:declareContainer>
+ <content:declareField name=3D"answer" title=3D"Answer" type=3D"Sma=
llText"
+ titleKey=3D"poll.answer" bundleKey=3D"<%=3DresBundleID%>"/>
+ </content:declareContainer>
+ </content:declareContainerList>
+
+</content:declareContainer>
+</content:declareContainerList>
+
+<%
+ JahiaContainerList questionContainerList =3D null;
+ JahiaContainer questionContainer =3D null;
+ DecimalFormat df =3D new DecimalFormat("###.#");
+
+
+
+JahiaContainerList pollPrefContainerList =3D jData.containers().getContain=
erList( "pollbox" + id );
+String errorMsgIfNoValue =3D getResourceBundle("poll.chooseAValue","Please=
choose a value",jData);
+String errorMsgIfalreadyPosted =3D getResourceBundle("poll.alreadyPostedAt=
","Sorry, but you have already posted this poll",jData);
+String successMessage =3D getResourceBundle("poll.successMsg","Thanks for =
your participation",jData);
+logger.debug(errorMsgIfNoValue+" "+errorMsgIfalreadyPosted);
+ContainerBean pollPrefContainerBean =3D null;
+
+if (pollPrefContainerList !=3D null) {
+ Enumeration pollPrefContainerEnum =3D pollPrefContainerList.getContain=
ers();
+ while (pollPrefContainerEnum.hasMoreElements()) {
+ JahiaContainer pollPrefContainer =3D (JahiaContainer) pollPrefCont=
ainerEnum.nextElement();
+ pollPrefContainerBean =3D new ContainerBean(pollPrefContainer,jPar=
ams);
+ // prefs messages
+ errorMsgIfNoValue =3D pollPrefContainer.getFieldValue("errorMsgIfN=
oValue","");
+ errorMsgIfalreadyPosted =3D
pollPrefContainer.getFieldValue("errorMsgIfa=
lreadyPosted","");
+ successMessage =3D pollPrefContainer.getFieldValue("succesMessage"=
,"");
+
+ if ("<empty>".equals(errorMsgIfNoValue)||"".equals(errorMsgIfNoVal=
ue)) {
+ errorMsgIfNoValue =3D getResourceBundle("poll.chooseAValue","P=
lease choose a value",jData);
+ }
+
+ if ("<empty>".equals(errorMsgIfalreadyPosted)||"".equals(errorMsgI=
falreadyPosted)) {
+ errorMsgIfalreadyPosted =3D getResourceBundle("poll.alreadyPos=
tedAt","Sorry, but you have already posted this poll",jData);
+ }
+ if
("<empty>".equals(successMessage)||"".equals(successMessage)) {
+ successMessage =3D getResourceBundle("poll.successMsg","Thanks=
for your participation",jData);
+ }
+ }
+}
+logger.debug("default messages:"+errorMsgIfNoValue+" "+errorMsgIfalreadyPo=
sted+" "+successMessage);
+String sendForm =3D request.getParameter("sendForm");
+String pollboxAnsweredId=3Drequest.getParameter("pollboxid");
+if (sendForm !=3D null && pollboxAnsweredId!=3Dnull && pollboxAnsweredId.e=
quals(pollboxId)) {
+ // process form
+ logger.debug("processing form for pollbox "+pollboxId);
+
+questionContainerList =3D jData.containers().getContainerList( pollboxQues=
tionId );
+if (questionContainerList !=3D null) {
+ Enumeration postedQuestionsEnum =3D questionContainerList.getContainer=
s();
+
+ while (postedQuestionsEnum.hasMoreElements()) {
+ questionContainer =3D (JahiaContainer) postedQuestionsEnum.nextEle=
ment();
+ String postedValue =3D request.getParameter("answer_" + questionCo=
ntainer.getID());
+ long votedTime =3D getVotedTime(jData,questionContainer.getID());
+ if (postedValue =3D=3D null) {
+ if (votedTime =3D=3D -1) {
+ %>
+ <span style=3D"color:red;">
+ <%=3DerrorMsgIfNoValue%>
+ </span><br/>
+
+
+ <%
+ // form.inc
+if (hasWriteAccess && isEditMode) {
+ %>
+ <div style=3D"background-color:#e9e9e9;border:1px solid #666666;paddin=
g:5px;">
+ <h2><%=3DgetResourceBundle("poll.preferences","Preferences",jData)%>
+ <%
+ if (pollPrefContainerBean !=3D null) {
+ jData.gui().html().drawBeginActionMenu(pollPrefContainerBean, null=
, null, false, "", "jahiatemplates.Corporate_portal_templates_v2", null, ou=
t);
+ }
+ %></h2>
+ <strong><%=3DgetResourceBundle("poll.errorMsgIfNoValue","Error text if=
no value",jData)%>: </strong> <%=3DerrorMsgIfNoValue%><br/>
+ <strong><%=3DgetResourceBundle("poll.errorMsgIfalreadyPosted","Error m=
essage if already answered",jData)%>: </strong> <%=3DerrorMsgIfalreadyPoste=
d%><br/>
+ <strong><%=3DgetResourceBundle("poll.succesMsg","Message thanks in cas=
e of successful answering",jData)%>: </strong> <%=3DsuccessMessage%><br/>
+ <%=3DgetResourceBundle("poll.updatePrefsMsg","Please update the prefer=
ences of your poll",jData)%><br/>
+ </div>
+ <%
+}
+
+//questionContainerList =3D jData.containers().getContainerList( "question=
ContainerList" );
+//ContainerListBean questionContainerListBean =3D new ContainerListBean(qu=
estionContainerList,jParams);
+String labelquestion =3D getResourceBundle("poll.typeYourQuestionHere","Ty=
pe your question here",jData);
+String question=3D"";
+boolean isQuestionEmpty =3D true;
+boolean haveAnswers=3Dfalse;
+
+ Enumeration questionsEnum =3D questionContainerList.getContainers();
+ while (questionsEnum.hasMoreElements()) {
+ isQuestionEmpty =3D false;
+ questionContainer =3D (JahiaContainer) questionsEnum.nextElement();
+ ContainerBean questionContainerBean =3D new ContainerBean(question=
Container,jParams);
+ question =3D questionContainer.getFieldValue("question","");
+
+ if ("".equals(question) || "<empty>".equals(question)) {
+ isQuestionEmpty =3D true;
+ } else {
+ isQuestionEmpty =3D false;
+ }
+ %>
+ <form method=3D"post" action=3D"<%=3DbypassUrl%>"
+ name=3D"submitToContainerList" id=3D"form_<%=3DquestionCon=
tainer.getID()%>">
+ <input type=3D"hidden" name=3D"formId" value=3D"<%=3DquestionConta=
iner.getID()%>"/>
+ <input type=3D"hidden" name=3D"sendForm" value=3D"true"/>
+ <h2>
+ <%
+ //logger.debug(isEditMode+" "+isQuestionEmpty+ " q:"+question);
+ if(isEditMode && isQuestionEmpty){
+ %><%=3Dlabelquestion%>
+ <% } else if(!isQuestionEmpty){
+ %><%=3Dquestion%>
+ <%
+ }
+ if (isEditMode) {
+ jData.gui().html().drawBeginActionMenu(questionContainerBean,=
null, null, false, "", "jahiatemplates.Corporate_portal_templates_v2", nul=
l, out);
+ }
+ %>
+ </h2>
+ <%
+ if (!isQuestionEmpty) {
+ JahiaContainerList answerContainerList =3D questionContainer.g=
etContainerList( pollboxAnswerId );
+ if (answerContainerList !=3D null) {
+ ContainerListBean answerContainerListBean =3D new Containe=
rListBean(answerContainerList,jParams);
+ logger.debug("answerContainerList has " + answerContainerL=
ist.getFullSize() + " elements");
+
+ if (isEditMode) {
+
+ if(answerContainerList.getFullSize()<3){
+ out.print(getResourceBundle("poll.addresponses","Add
your=
answers",jData));
+ haveAnswers=3Dfalse;
+ }
+ jData.gui().html().drawBeginActionMenu(answerContainer=
ListBean,
+ null, null, true, "",
+ "jahiatemplates.Corporate_portal_templates_v2", nu=
ll, out);
+
+ }
+ Enumeration answersEnum =3D answerContainerList.getContain=
ers();
+ while (answersEnum.hasMoreElements()) {
+
+ JahiaContainer answerContainer =3D (JahiaContainer) an=
swersEnum.nextElement();
+ ContainerBean answerContainerBean =3D new ContainerBea=
n(answerContainer,jParams);
+ String answer =3D answerContainer.getFieldValue("answe=
r","");
+ haveAnswers=3Dtrue;
+ %>
+ <label>
+ <input name=3D"answer_<%=3DquestionContainer.getID=
()%>" type=3D"radio"
+ value=3D"<%=3DanswerContainer.getID()%>" /> <%=
=3Danswer%>
+ </label>
+ <%
+ if (isEditMode) {
+ jData.gui().html().drawBeginActionMenu(answerConta=
inerBean,
+ null, null, false, "",
+ "jahiatemplates.Corporate_portal_templates_v2"=
, null, out);
+ }
+ %>
+ <br/>
+ <%
+ }
+ if (isEditMode) {
+ jData.gui().html().drawEndActionMenu(answerContainerLi=
stBean,
+ null, null, true, "",
+ "jahiatemplates.Corporate_portal_templates_v2", nu=
ll, out);
+ }
+ } else {
+ logger.debug("answerContainerList is NULL");
+ }
+ %>
+ <br/>
+ <%
+ if(haveAnswers && answerContainerList.getFullSize()>=3D2){
+ %>
+
+ <input type=3D"submit" name=3D"submit_<%=3DquestionContainer.g=
etID()%>" value=3D'<content:resourceBundle
+ resourceBundle=3D"jahiatemplates.Corporate_portal_template=
s_v2"
+ resourceName=3D"poll.submit"/>'/>
+ <%
+ }
+ }
+ %>
+ </form>
+ <%
+ }
+
+%>
+
+
+
+
+
+
+
+
+
+
+
+
+ <%
+ } else {
+ SimpleDateFormat sdf =3D new SimpleDateFormat( "dd/MM/yy k=
k:mm" );
+ sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
+ %>
+ <span style=3D"color:red;">
+ <%=3DerrorMsgIfalreadyPosted%> <!--<%=3Dsdf.format( (n=
ew Date(votedTime)) )%>-->
+ </span>
+ <%
+ }
+ } else {
+ logger.debug("Value for question [" + questionContainer.getID(=
) + "] is [" + postedValue + "]");
+ if (votedTime !=3D -1) {
+ SimpleDateFormat sdf =3D new SimpleDateFormat( "dd/MM/yy k=
k:mm" );
+ sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
+ %>
+ <span style=3D"color:red;">
+ <%=3DerrorMsgIfalreadyPosted%> <!--<%=3Dsdf.format( (n=
ew Date(votedTime)) )%>-->
+ </span>
+ <%
+ } else {
+ // ok all is fine
+ savePoll(jData,questionContainer.getID(),postedValue);
+%>
+<span>
+ <%=3DsuccessMessage%>
+</span>
+<%
+ }
+
+// results
+
+
+float totalAnswerCount =3D 0;
+
+ Enumeration questionsEnum =3D questionContainerList.getContainers();
+ while (questionsEnum.hasMoreElements()) {
+ questionContainer =3D (JahiaContainer) questionsEnum.nextElement();
+ String question =3D questionContainer.getFieldValue("question","");
+ %>
+ <h2><%=3Dquestion%></h2>
+ <%
+ JahiaContainerList answerContainerList =3D questionContainer.getCo=
ntainerList( pollboxAnswerId );
+
+ ArrayList answerKeys =3D new ArrayList();
+ Hashtable answerKeysToValueKey =3D new Hashtable();
+ Hashtable answerKeysToAnswer =3D new Hashtable();
+
+ if (answerContainerList !=3D null) {
+
+ Enumeration answersEnum =3D answerContainerList.getContainers(=
);
+ while (answersEnum.hasMoreElements()) {
+ JahiaContainer answerContainer =3D (JahiaContainer) answer=
sEnum.nextElement();
+ String answer =3D answerContainer.getFieldValue("answer","=
");
+ String valueKey =3D questionContainer.getID() + "_" + answ=
erContainer.getID();
+ //logger.debug("Result - get answers for key [" + valueKey=
+ "]");
+ float answerCount =3D 0;
+ String answerCountStr =3D contentPage.getProperty(valueKey=
);
+ if (answerCountStr !=3D null) {
+ try {
+ answerCount =3D Float.parseFloat(answerCountStr);
+ totalAnswerCount +=3D answerCount;
+ } catch (NumberFormatException nfe) {
+ }
+ }
+ // following key will be user to sort the results
+ String answerKey =3D "00000000000000000000" + answerCount =
+ "_" + answerContainer.getRank() + "_" + valueKey;
+ //logger.debug("Generate answerKey: " + answerKey);
+ answerKey =3D answerKey.substring(answerKey.length()-16,an=
swerKey.length());
+ answerKeys.add(answerKey);
+ answerKeysToValueKey.put(answerKey,valueKey);
+ answerKeysToAnswer.put(answerKey,answer);
+ }
+ Collections.sort(answerKeys,new Comparator() {
+ public int compare(Object o1, Object o2) {
+ String str1 =3D (String) o1;
+ String str2 =3D (String) o2;
+ return str2.compareTo(str1);
+ }
+ });
+
+ %>
+ <table>
+ <%
+ for (int i =3D 0; i < answerKeys.size(); i++) {
+ String answerKey =3D (String) answerKeys.get(i);
+ String answer =3D (String)answerKeysToAnswer.get(answerKey=
);
+ String valueKey =3D (String)answerKeysToValueKey.get(answe=
rKey);
+ logger.debug("Result - get answers for key [" + valueKey +=
"]");
+ float answerCount =3D 0;
+ String answerCountStr =3D contentPage.getProperty(valueKey=
);
+ if (answerCountStr !=3D null) {
+ try {
+ answerCount =3D Float.parseFloat(answerCountStr);
+ } catch (NumberFormatException nfe) {
+ }
+ }
+ float percent =3D (answerCount / totalAnswerCount) * 100;
+ int percentInt =3D (new Float(percent)).intValue();
+ %>
+ <tr>
+ <td><%=3Danswer%></td>
+ <td>
+ <div class=3D"graph">
+ <strong <%
+ if (answerCount !=3D 0) {
+ %> class=3D"bar" style=3D"width: <%=3DpercentI=
nt%>%;"<%
+ }
+ %>>
+ <%=3Ddf.format(percent)%>%
+ </strong>
+ </div>
+ </td>
+ </tr>
+ <%
+ }
+
+ %>
+ <tr><td></td><td><strong><br/>
+ <content:resourceBundle
+ resourceBundle=3D"jahiatemplates.Corporate_portal_template=
s_v2"
+ resourceName=3D"poll.totalAanswers"/>: <%=3D(new Float(tot=
alAnswerCount)).intValue()%></strong></td></tr>
+ </table>
+ <%
+ }
+ }
+
+
+ }
+ }
+}
+%>
+ <%
+} else {
+ // to send the form with questions answered
+
+if (hasWriteAccess && isEditMode) {
+ %>
+ <div style=3D"background-color:#e9e9e9;border:1px solid #666666;paddin=
g:5px;">
+ <h2><%=3DgetResourceBundle("poll.preferences","Preferences",jData)%>
+ <%
+ if (pollPrefContainerBean !=3D null) {
+ jData.gui().html().drawBeginActionMenu(pollPrefContainerBean, null=
, null, false, "", "jahiatemplates.Corporate_portal_templates_v2", null, ou=
t);
+ }
+ %></h2>
+ <strong><%=3DgetResourceBundle("poll.errorMsgIfNoValue","Error text if=
no value",jData)%>: </strong> <%=3DerrorMsgIfNoValue%><br/>
+ <strong><%=3DgetResourceBundle("poll.errorMsgIfalreadyPosted","Error m=
essage if already answered",jData)%>: </strong> <%=3DerrorMsgIfalreadyPoste=
d%><br/>
+ <strong><%=3DgetResourceBundle("poll.succesMsg","Message thanks in cas=
e of successful answering",jData)%>: </strong> <%=3DsuccessMessage%><br/>
+ <%=3DgetResourceBundle("poll.updatePrefsMsg","Please update the prefer=
ences of your poll",jData)%><br/>
+ </div>
+ <%
+}
+
+questionContainerList =3D jData.containers().getContainerList( pollboxQues=
tionId );
+//ContainerListBean questionContainerListBean =3D new ContainerListBean(qu=
estionContainerList,jParams);
+String labelquestion =3D getResourceBundle("poll.typeYourQuestionHere","Ty=
pe your question here",jData);
+String question=3D"";
+boolean isQuestionEmpty =3D true;
+boolean haveAnswers=3Dfalse;
+if (questionContainerList !=3D null) {
+ Enumeration questionsEnum =3D questionContainerList.getContainers();
+ while (questionsEnum.hasMoreElements()) {
+ isQuestionEmpty =3D false;
+ questionContainer =3D (JahiaContainer) questionsEnum.nextElement();
+ ContainerBean questionContainerBean =3D new ContainerBean(question=
Container,jParams);
+ question =3D questionContainer.getFieldValue("question","");
+
+ if ("".equals(question) || "<empty>".equals(question)) {
+ isQuestionEmpty =3D true;
+ } else {
+ isQuestionEmpty =3D false;
+ }
+ %>
+ <form method=3D"get" action=3D"<%=3DbypassUrl%>"
+ name=3D"submitToContainerList" id=3D"form_<%=3DquestionCon=
tainer.getID()%>">
+ <input type=3D"hidden" name=3D"formId" value=3D"<%=3DquestionConta=
iner.getID()%>"/>
+ <input type=3D"hidden" name=3D"sendForm" value=3D"true"/>
+ <input type=3D"hidden" name=3D"pollboxid" value=3D"<%=3DpollboxId%=
>"/>
+ <h2>
+ <%
+ //logger.debug(isEditMode+" "+isQuestionEmpty+ " q:"+question);
+ if(isEditMode && isQuestionEmpty){
+ %><%=3Dlabelquestion%>
+ <% } else if(!isQuestionEmpty){
+ %><%=3Dquestion%>
+ <%
+ }
+ if (isEditMode) {
+ jData.gui().html().drawBeginActionMenu(questionContainerBean,=
null, null, false, "", "jahiatemplates.Corporate_portal_templates_v2", nul=
l, out);
+ }
+ %>
+ </h2>
+ <%
+ if (!isQuestionEmpty) {
+ JahiaContainerList answerContainerList =3D questionContainer.g=
etContainerList( pollboxAnswerId );
+ if (answerContainerList !=3D null) {
+ ContainerListBean answerContainerListBean =3D new Containe=
rListBean(answerContainerList,jParams);
+ logger.debug("answerContainerList has " + answerContainerL=
ist.getFullSize() + " elements");
+
+ if (isEditMode) {
+
+ if(answerContainerList.getFullSize()<3){
+ out.print(getResourceBundle("poll.addresponses","Add
your=
answers",jData));
+ haveAnswers=3Dfalse;
+ }
+ jData.gui().html().drawBeginActionMenu(answerContainer=
ListBean,
+ null, null, true, "",
+ "jahiatemplates.Corporate_portal_templates_v2", nu=
ll, out);
+
+ }
+ Enumeration answersEnum =3D answerContainerList.getContain=
ers();
+ while (answersEnum.hasMoreElements()) {
+
+ JahiaContainer answerContainer =3D (JahiaContainer) an=
swersEnum.nextElement();
+ ContainerBean answerContainerBean =3D new ContainerBea=
n(answerContainer,jParams);
+ String answer =3D answerContainer.getFieldValue("answe=
r","");
+ haveAnswers=3Dtrue;
+ %>
+ <label>
+ <input name=3D"answer_<%=3DquestionContainer.getID=
()%>" type=3D"radio"
+ value=3D"<%=3DanswerContainer.getID()%>" /> <%=
=3Danswer%>
+ </label>
+ <%
+ if (isEditMode) {
+ jData.gui().html().drawBeginActionMenu(answerConta=
inerBean,
+ null, null, false, "",
+ "jahiatemplates.Corporate_portal_templates_v2"=
, null, out);
+ }
+ %>
+ <br/>
+ <%
+ }
+ if (isEditMode) {
+ jData.gui().html().drawEndActionMenu(answerContainerLi=
stBean,
+ null, null, true, "",
+ "jahiatemplates.Corporate_portal_templates_v2", nu=
ll, out);
+ }
+ } else {
+ logger.debug("answerContainerList is NULL");
+ }
+ %>
+ <br/>
+ <%
+ if(haveAnswers && answerContainerList.getFullSize()>=3D2){
+ %>
+ <input type=3D"submit" name=3D"submit_<%=3DquestionContainer.g=
etID()%>" value=3D'<content:resourceBundle
+ resourceBundle=3D"jahiatemplates.Corporate_portal_template=
s_v2"
+ resourceName=3D"poll.submit"/>'/>
+ <%
+ }
+ }
+ %>
+ </form>
+ <%
+ }
+}
+
+}
+%>
Modified: branches/JAHIA-5-0-SP-BRANCH/src/jsp/poll/definitions.inc
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/src/jsp/poll/definitions.inc&rev=3D755&repname=3Dcorporate_portal_t=
emplates_v2
=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
--- branches/JAHIA-5-0-SP-BRANCH/src/jsp/poll/definitions.inc (original)
+++ branches/JAHIA-5-0-SP-BRANCH/src/jsp/poll/definitions.inc Wed Aug 1 17=
:01:43 2007
@@ -23,6 +23,8 @@
titleKey=3D"poll.errorMsgIfNoValue" bundleKey=3D"<%=3DresBundleID%=
>"/>
<content:declareField name=3D"errorMsgIfalreadyPosted" title=3D"Error =
message if the poll already posted" type=3D"SmallText"
titleKey=3D"poll.errorMsgIfalreadyPosted" bundleKey=3D"<%=3DresBun=
dleID%>"/>
+ <content:declareField name=3D"succesMessage" title=3D"Success message"=
type=3D"SmallText"
+ titleKey=3D"poll.successMsgLabel" bundleKey=3D"<%=3DresBundleID%>"=
/>
</content:declareContainer>
</content:declareContainerList>
=
Modified: branches/JAHIA-5-0-SP-BRANCH/src/jsp/poll/form.inc
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/src/jsp/poll/form.inc&rev=3D755&repname=3Dcorporate_portal_template=
s_v2
=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
--- branches/JAHIA-5-0-SP-BRANCH/src/jsp/poll/form.inc (original)
+++ branches/JAHIA-5-0-SP-BRANCH/src/jsp/poll/form.inc Wed Aug 1 17:01:43 =
2007
@@ -27,7 +27,9 @@
}
%></h2>
<strong><%=3DgetResourceBundle("poll.errorMsgIfNoValue","Error text if=
no value",jData)%>: </strong> <%=3DerrorMsgIfNoValue%><br/>
- <strong><%=3DgetResourceBundle("poll.errorMsgIfalreadyPosted","Sorry, =
but you have already posted this poll",jData)%>: </strong> <%=3DerrorMsgIfa=
lreadyPosted%><br/>
+ <strong><%=3DgetResourceBundle("poll.errorMsgIfalreadyPosted","Error m=
essage if already answered",jData)%>: </strong> <%=3DerrorMsgIfalreadyPoste=
d%><br/>
+ <strong><%=3DgetResourceBundle("poll.succesMsg","Message thanks in cas=
e of successful answering",jData)%>: </strong> <%=3DsuccessMessage%><br/>
+ <%=3DgetResourceBundle("poll.updatePrefsMsg","Please update the prefer=
ences of your poll",jData)%><br/>
</div>
<%
}
@@ -79,7 +81,7 @@
=
if (isEditMode) {
=
- if(answerContainerList.getFullSize()<2){
+ if(answerContainerList.getFullSize()<3){
out.print(getResourceBundle("poll.addresponses","Add
your=
answers",jData));
haveAnswers=3Dfalse;
}
@@ -121,7 +123,7 @@
%>
<br/>
<%
- if(haveAnswers){
+ if(haveAnswers && answerContainerList.getFullSize()>=3D2){
%>
<input type=3D"submit" name=3D"submit_<%=3DquestionContainer.g=
etID()%>" value=3D'<content:resourceBundle
resourceBundle=3D"jahiatemplates.Corporate_portal_template=
s_v2"
Modified: branches/JAHIA-5-0-SP-BRANCH/src/jsp/poll/poll.jsp
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/src/jsp/poll/poll.jsp&rev=3D755&repname=3Dcorporate_portal_template=
s_v2
=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
--- branches/JAHIA-5-0-SP-BRANCH/src/jsp/poll/poll.jsp (original)
+++ branches/JAHIA-5-0-SP-BRANCH/src/jsp/poll/poll.jsp Wed Aug 1 17:01:43 =
2007
@@ -40,6 +40,7 @@
JahiaContainerList pollPrefContainerList =3D jData.containers().getContain=
erList( "pollPrefContainerList" );
String errorMsgIfNoValue =3D getResourceBundle("poll.chooseAValue","Please=
choose a value",jData);
String errorMsgIfalreadyPosted =3D getResourceBundle("poll.alreadyPostedAt=
","Sorry, but you have already posted this poll",jData);
+String successMessage =3D getResourceBundle("poll.successMsg","Thanks for =
your participation",jData);
logger.debug(errorMsgIfNoValue+" "+errorMsgIfalreadyPosted);
ContainerBean pollPrefContainerBean =3D null;
=
@@ -48,17 +49,24 @@
while (pollPrefContainerEnum.hasMoreElements()) {
JahiaContainer pollPrefContainer =3D (JahiaContainer) pollPrefCont=
ainerEnum.nextElement();
pollPrefContainerBean =3D new ContainerBean(pollPrefContainer,jPar=
ams);
+ // prefs messages
errorMsgIfNoValue =3D pollPrefContainer.getFieldValue("errorMsgIfN=
oValue","");
- if ("".equals(errorMsgIfNoValue)) {
+ errorMsgIfalreadyPosted =3D
pollPrefContainer.getFieldValue("errorMsgIfa=
lreadyPosted","");
+ successMessage =3D pollPrefContainer.getFieldValue("succesMessage"=
,"");
+
+ if ("<empty>".equals(errorMsgIfNoValue)||"".equals(errorMsgIfNoVal=
ue)) {
errorMsgIfNoValue =3D getResourceBundle("poll.chooseAValue","P=
lease choose a value",jData);
}
- errorMsgIfalreadyPosted =3D pollPrefContainer.getFieldValue("error=
MsgIfalreadyPosted","");
- if ("".equals(errorMsgIfalreadyPosted)) {
+
+ if ("<empty>".equals(errorMsgIfalreadyPosted)||"".equals(errorMsgI=
falreadyPosted)) {
errorMsgIfalreadyPosted =3D getResourceBundle("poll.alreadyPos=
tedAt","Sorry, but you have already posted this poll",jData);
}
+ if
("<empty>".equals(successMessage)||"".equals(successMessage)) {
+ successMessage =3D getResourceBundle("poll.successMsg","Thanks=
for your participation",jData);
+ }
}
}
-
+logger.debug("default messages:"+errorMsgIfNoValue+" "+errorMsgIfalreadyPo=
sted+" "+successMessage);
String sendForm =3D request.getParameter("sendForm");
if (sendForm !=3D null) {
%><%@ include file=3D"process.inc"%>
Modified: branches/JAHIA-5-0-SP-BRANCH/src/jsp/poll/process.inc
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/src/jsp/poll/process.inc&rev=3D755&repname=3Dcorporate_portal_templ=
ates_v2
=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
--- branches/JAHIA-5-0-SP-BRANCH/src/jsp/poll/process.inc (original)
+++ branches/JAHIA-5-0-SP-BRANCH/src/jsp/poll/process.inc Wed Aug 1 17:01:=
43 2007
@@ -52,9 +52,16 @@
</span>
<%
} else {
+ // ok all is fine
savePoll(jData,questionContainer.getID(),postedValue);
+%>
+<span>
+ <%=3DsuccessMessage%>
+</span>
+<%
}
%>
+
<%@ include file=3D"results.inc"%>
<%
}
_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list