Author: xlawrence
Date: Thu May 31 11:12:33 2007
New Revision: 688

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D688&repname=
=3Dcorporate_portal_templates_v2
Log:
Improvements for the form generator:
- in case of files, store the file in a FileField
- Put ID field in second position
- Better display of files in container list values

Modified:
    branches/JAHIA-5-0-SP-BRANCH/src/jsp/common/declarations.inc
    branches/JAHIA-5-0-SP-BRANCH/src/jsp/form_generator/definitions.inc
    branches/JAHIA-5-0-SP-BRANCH/src/jsp/form_generator/display_form.inc
    branches/JAHIA-5-0-SP-BRANCH/src/jsp/form_generator/form_generator.jsp
    branches/JAHIA-5-0-SP-BRANCH/src/jsp/form_generator/process_post.inc

Modified: branches/JAHIA-5-0-SP-BRANCH/src/jsp/common/declarations.inc
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/src/jsp/common/declarations.inc&rev=3D688&repname=3Dcorporate_porta=
l_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/common/declarations.inc (original)
+++ branches/JAHIA-5-0-SP-BRANCH/src/jsp/common/declarations.inc Thu May 31=
 11:12:33 2007
@@ -37,7 +37,7 @@
     org.jahia.exceptions.*,
     org.jahia.gui.*,
     org.jahia.params.*,
-    org.jahia.registries.ServicesRegistry,
+    org.jahia.registries.*,
     org.jahia.resourcebundle.*,
     org.jahia.security.license.*,
     org.jahia.services.*,

Modified: branches/JAHIA-5-0-SP-BRANCH/src/jsp/form_generator/definitions.i=
nc
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/src/jsp/form_generator/definitions.inc&rev=3D688&repname=3Dcorporat=
e_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/form_generator/definitions.inc (or=
iginal)
+++ branches/JAHIA-5-0-SP-BRANCH/src/jsp/form_generator/definitions.inc Thu=
 May 31 11:12:33 2007
@@ -1,18 +1,18 @@
 <%--
 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
+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
+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.
 --%><content:declareContainerList name=3D"forms" title=3D"List of forms" c=
ontainerListType=3D"<%=3DJahiaContainerDefinition.SINGLE_TYPE%>">
 <content:declareContainer>
@@ -53,16 +53,26 @@
             value=3D"<%=3DgetMultivalues(resBundleID,formTypes)%>"/>
         <content:declareField name=3D"defaultValue" title=3D"Default value=
(s) separated by semi-column ':'" type=3D"SmallText"
             titleKey=3D"form.defaultValue" bundleKey=3D"<%=3DresBundleID%>=
"/>
-        <content:declareContainerList name=3D"values" title=3D"Values" con=
tainerListType=3D"<%=3DJahiaContainerDefinition.SINGLE_TYPE%>">
-        <content:declareContainer>
-        <content:declareField name=3D"id" title=3D"Id" type=3D"SmallText" =
readOnly=3D"true"
-            titleKey=3D"form.id" bundleKey=3D"<%=3DresBundleID%>"/>
-        <content:declareField name=3D"value" title=3D"Value" type=3D"BigTe=
xt"
-            titleKey=3D"form.value" bundleKey=3D"<%=3DresBundleID%>"/>
-        </content:declareContainer>
+        <content:declareContainerList name=3D"textValues" aliasNames=3D"te=
xtValues"
+                       title=3D"Values" 
containerListType=3D"<%=3DJahiaContainerDefinit=
ion.SINGLE_TYPE%>">
+                       <content:declareContainer>
+                                       <content:declareField 
name=3D"textValue" title=3D"Value" type=
=3D"BigText"
+                                       titleKey=3D"form.value" 
bundleKey=3D"<%=3DresBundleID%>"/>
+                                       <content:declareField name=3D"id" 
title=3D"Id" type=3D"SharedS=
mallText" readOnly=3D"true"
+                                       titleKey=3D"form.id" 
bundleKey=3D"<%=3DresBundleID%>"/>    =

+                       </content:declareContainer>
+        </content:declareContainerList>
+        <content:declareContainerList name=3D"fileValues" aliasNames=3D"fi=
leValues"
+                       title=3D"Values" 
containerListType=3D"<%=3DJahiaContainerDefinit=
ion.SINGLE_TYPE%>">
+                       <content:declareContainer>
+                                       <content:declareField 
name=3D"fileValue" title=3D"Value" type=
=3D"File"
+                                       titleKey=3D"form.value" 
bundleKey=3D"<%=3DresBundleID%>"/>
+                                       <content:declareField name=3D"id" 
title=3D"Id" type=3D"SharedS=
mallText" readOnly=3D"true"
+                                       titleKey=3D"form.id" 
bundleKey=3D"<%=3DresBundleID%>"/>    =

+                       </content:declareContainer>
         </content:declareContainerList>
     </content:declareContainer>
     </content:declareContainerList>
 =

 </content:declareContainer>
-</content:declareContainerList>
+</content:declareContainerList>
\ No newline at end of file

Modified: branches/JAHIA-5-0-SP-BRANCH/src/jsp/form_generator/display_form.=
inc
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/src/jsp/form_generator/display_form.inc&rev=3D688&repname=3Dcorpora=
te_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/form_generator/display_form.inc (o=
riginal)
+++ branches/JAHIA-5-0-SP-BRANCH/src/jsp/form_generator/display_form.inc Th=
u May 31 11:12:33 2007
@@ -1,18 +1,18 @@
 <%--
 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
+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
+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.
 --%><%
 //JahiaContainerList forms =3D jData.containers().getContainerList( "forms=
" );
@@ -21,23 +21,30 @@
     %>
     <%=3DdisplayTextAfterPostValue%>
     <%
-} else {
+} else {               =

     if (forms !=3D null) {
         ContainerListBean formsBean =3D new ContainerListBean(forms,jParam=
s);
         formsEnum =3D forms.getContainers();
         boolean isFormOK =3D false;
         int t =3D 0;
         final String searchString =3D (String)request.getParameter("search=
String");
-                               if (searchString !=3D null && 
searchString.length() > 0) {      =

-                               final FormGeneratorContainerSearcher 
containerSearcher =3D new For=
mGeneratorContainerSearcher("values",
-                                                       jParams, searchString, 
jParams.getEntryLoadRequest(), "id");=
                                                        =

-                       String ids =3D 
containerSearcher.searchContainerIds(searchString=
, jParams);     =

+        final boolean searchSubmitted =3D searchString !=3D null && search=
String.length() > 0;
+                               if (searchSubmitted) {  =

+                               final FormGeneratorContainerSearcher 
textContainerSearcher =3D new=
 FormGeneratorContainerSearcher("textValues",
+                                                       jParams, searchString, 
jParams.getEntryLoadRequest(), "id");    =

+                       final FormGeneratorContainerSearcher 
fileContainerSearcher =3D n=
ew FormGeneratorContainerSearcher("fileValues",
+                                                       jParams, searchString, 
jParams.getEntryLoadRequest(), "id");=
                                                                                
=

+                       String ids =3D 
textContainerSearcher.searchContainerIds(searchSt=
ring, jParams) + " " +
+                                                               
fileContainerSearcher.searchContainerIds(searchString, jPar=
ams);   =

                        if (ids =3D=3D null ||ids.trim().length() =3D=3D 0) {
                                        ids =3D 
String.valueOf(System.currentTimeMillis());     =

                        }
-                       ContainerSearcher theSearcher =3D new 
ContainerSearcher("values",
-                                                       jParams, ids, 
jParams.getEntryLoadRequest());                                           =

-                               request.setAttribute("values_search_handler", 
theSearcher);
+                       ContainerSearcher theTextSearcher =3D new 
ContainerSearcher("tex=
tValues",
+                                                       jParams, ids, 
jParams.getEntryLoadRequest());   =

+                       ContainerSearcher theFileSearcher =3D new 
ContainerSearcher("fil=
eValues",
+                                                       jParams, ids, 
jParams.getEntryLoadRequest());                                                 
                                  =

+                               
request.setAttribute("textValues_search_handler", theTextSearcher);
+                               
request.setAttribute("fileValues_search_handler", theFileSearcher);
                                }
 =

         while (formsEnum.hasMoreElements()) {
@@ -156,7 +163,7 @@
                             <td>
                                 <%
                                 if (ResourceBundleMarker.drawMarker(resBun=
dleID,"smallTextarea","").equals(type)) {
-                                    if (formIdStr !=3D null) {            =
                                =

+                                    if (formIdStr !=3D null) {
                                                final String postedValue;
                                                if (fupload =3D=3D null) {
                                                                                
                                                postedValue =3D 
request.getParameter("field_=
" + currentField.getID());
@@ -285,7 +292,7 @@
                                             resourceName=3D"form.defaultVa=
lueRequired"/></span><%
                                         }
                                     }
-                                    =

+
                                 } else if (ResourceBundleMarker.drawMarker=
(resBundleID,"fileUpload","").equals(type)) {    =

                                        if (! "".equals(defaultValue)) { =

                                                %>
@@ -294,7 +301,7 @@
                                                                                
                                                        
document.submitToContainerList.encoding =3D "multi=
part/form-data";
                                                </script>
                                                <input size=3D"80" 
type=3D"file" name=3D=
"field_<%=3DcurrentField.getID()%>" />
-                                       <%      =

+                                    <%
                                        } else {
                                                if (isEditMode) {
                                         %><span style=3D"color:red;"><cont=
ent:resourceBundle
@@ -345,19 +352,26 @@
                                "add", out);
                     =

                     if (showPostedValues) { =

-                       fieldsEnum =3D fields.getContainers();
-                       final Map valuesByRow =3D new HashMap();
-                       final List theContainers =3D new ArrayList();
-                       while (fieldsEnum.hasMoreElements()) {
+                       fieldsEnum =3D fields.getContainers();
+                               final Map valuesByRow =3D new HashMap();
+                               final Map idsByRow =3D new HashMap();
+                               final List theContainers =3D new ArrayList();
+                        while (fieldsEnum.hasMoreElements()) {
                                        final JahiaContainer currentField =3D 
(JahiaContain=
er) fieldsEnum.nextElement();
                           final String type =3D currentField.getFieldValue=
("type","");
-                          if (! ResourceBundleMarker.drawMarker(resBundleI=
D,"submitButton","").equals(type)) {
+                            if (! ResourceBundleMarker.drawMarker(resBundl=
eID,"submitButton","").equals(type)) {
                               theContainers.add(currentField);
                           }
                           =

-                          final JahiaContainerList list =3D currentField.g=
etContainerList("values");
+                          final JahiaContainerList list;
+                          if (ResourceBundleMarker.drawMarker(resBundleID,=
"fileUpload","").equals(type)) {
+                                       list =3D 
currentField.getContainerList("fileVa=
lues");
+                               } else {
+                                               list =3D 
currentField.getContainerList("textVal=
ues");
+                               }
                           final Enumeration values =3D list.getContainers(=
); =

                           =

+                          int j =3D 0;
                           while (values.hasMoreElements()) {
                                  final JahiaContainer c =3D (JahiaContainer)va=
lues.nextElement();
                                        final String key =3D 
c.getFieldValue("id");
@@ -367,46 +381,80 @@
                                        }
                                        rowValues.add(c);
                                        valuesByRow.put(key, rowValues);
-                          } =

-                       }
-                      =

+                                       final Integer ID =3D new Integer(j);
+                                       if (! idsByRow.containsKey(ID)) 
idsByRow.put(I=
D, key);
+                                       j++;
+                            }
+                        }
+
+                                                                               
        request.setAttribute("idsByRow", idsByRow);
                        request.setAttribute( "formResultList", new ArrayList=
(valuesByRow.values()));
                       final org.jahia.utils.displaytag.CaseInsensitiveComp=
arator comparator =3D
                             new org.jahia.utils.displaytag.CaseInsensitive=
Comparator(jData.getProcessingContext().getLocale());
                        =

-                       %>      =

+                                    %>
                        <br/>&nbsp;<br/>                =

                        <div class=3D"formResultListing">               =

+                       <% int row =3D 0; %>            =

                        <display:table name=3D"formResultList" class=3D"formR=
esultListing" pagesize=3D"15" id=3D"formResultListID"
                                requestURI=3D'<%=3DbypassUrl%>' 
defaultsort=3D"1"=
 defaultorder=3D"descending" >
-                        <% =

+                                    <%
                                final List rowValues =3D (List) 
pageContext.getAt=
tribute("formResultListID");
+                               final Map map =3D (Map) 
request.getAttribute("ids=
ByRow");
+                               final String rowID =3D (String)map.get(new 
Intege=
r(row));
                                final Iterator columns =3D 
theContainers.iterator=
();
                                int i=3D0;
                                while (columns.hasNext()) {
                                                                                
                                        final JahiaContainer currentField =3D 
(JahiaContainer) colu=
mns.next(); =

                                                                                
                                        JahiaContainer currentValue =3D null;
                                                                                
                                        String theValue =3D "";
+                                                                               
                                        boolean isFile =3D 
ResourceBundleMarker.drawMarker(resBundl=
eID,"fileUpload","").equals(currentField.getFieldValue("type",""));
                                                                                
                                        try { =

                                                                                
                                                        currentValue =3D 
(JahiaContainer) rowValues.get(i); =

-                                                                               
                                                        theValue =3D 
currentValue.getFieldValue("value");
+                                                                               
                                                        if (isFile) {
+                                                                               
                                                                        
theValue =3D currentValue.getFieldValue("fileValue");
+                                                                               
                                                        } else {
+                                                                               
                                                                        
theValue =3D currentValue.getFieldValue("textValue");
+                                                                               
                                                        }
                                                        if (theValue =3D=3D 
null) {
                                                                        
theValue =3D "";
-                                                       }
+                                       }
                                                                                
                                                        =

-                                                                               
                                                        if 
(theValue.startsWith(contextPath)) {
-                                                                               
                                                                        final 
StringBuffer buff =3D new StringBuffer(); =

-                                                                               
                                                                        
buff.append("<a href=3D\"");
-                                                                               
                                                                        
buff.append(theValue);
-                                                                               
                                                                        
buff.append("\">");
-                                                                               
                                                                        
buff.append(org.jahia.engines.filemanager.TableEntry.j=
avascriptDecode(theValue));
-                                                                               
                                                                        
buff.append("</a>");    =

-                                                                               
                                                                        
theValue =3D buff.toString();
-                                                                               
                                                        }
+                                                                               
                                                        if (isFile) {
+                                                                               
                                                                        
JahiaFileField file =3D (JahiaFileField) currentValue.=
getFieldObject("fileValue");
+                                                                               
                                                String fileName =3D "null";
+                                                                               
                                                String downloadUrl =3D "#";
+                                                                               
                                                String picto =3D "file";
+                                                                               
                                                if (file !=3D null ) { =

+                                                                               
                                                downloadUrl =3D 
file.getDownloadUrl();
+                                                                               
                                                fileName =3D 
file.getFileFieldTitle();
+                                                                               
                                                if (fileName.equals("")){
+                                                                               
                                                        fileName =3D 
file.getRealName();
+                                                                               
                                                }
+                                                                               
                                                picto =3D 
getPicto(file.getRealName());
+                                                                               
                                                }
+                                                                               
                                                if (fileName.equals("null") || 
fileName =3D=3D null=
 || fileName.length() =3D=3D 0) {
+                                                                               
                                                                theValue =3D 
"&nbsp;";          =

+                                                                               
                                                } else {
+                                                                               
                                                                                
        final StringBuffer buff =3D new StringBuffer(); =

+                                                                               
                                                                                
        buff.append("<a class=3D\"");
+                                                                               
                                                                                
        buff.append(picto);
+                                                                               
                                                                                
        buff.append("\" href=3D\"");
+                                                                               
                                                                                
        buff.append(downloadUrl);
+                                                                               
                                                                                
        buff.append("\" title=3D\"");
+                                                                               
                                                                                
        buff.append(fileName);
+                                                                               
                                                                                
        buff.append("\">");
+                                                                               
                                                                                
        buff.append(fileName);
+                                                                               
                                                                                
        buff.append("</a>");    =

+                                                                               
                                                                                
        theValue =3D buff.toString();
+                                                                               
                                                                        }
+                                               }
                                                                                
                                        } catch (Exception e) {
-                                                                               
                                        } =

+                        }
+                        =

                         %>
-                               <% if (i =3D=3D 0) { %>
+                               <% if (i =3D=3D 0) { =

+                                       %>
                                <display:column 
title=3D"<%=3DcreationDateTitle%>=
" sortable=3D"true" comparator=3D"<%=3D comparator %>" >
                                                
<%=3DcurrentValue.getContentContainer().getMeta=
dataDateValue("creationDate", jParams, "-", sdf) %>
                                </display:column>       =

@@ -414,16 +462,52 @@
                                =

                                <display:column 
title=3D"<%=3DcurrentField.getFie=
ldValue("fieldTitle","")%>" sortable=3D"true" comparator=3D"<%=3D comparato=
r %>" >
                                <%=3DtheValue%>
-                               <% final ContainerBean currentFieldBean =3D new 
C=
ontainerBean(currentValue, jParams);    =

-                                        
jData.gui().html().drawBeginActionMenu(currentF=
ieldBean ,
-                                    null, null, false, "", "jahiatemplates=
.Corporate_portal_templates_v2",
-                                    null, out);
+                               <% =

+                                               if (currentValue =3D=3D null || 
currentValue.ge=
tID() < 1 || "".equals(currentValue.getFieldValue("id",""))) {
+                                       final JahiaContainerList theList;
+                                       final JahiaContainerDefinition def;
+                                  if (isFile) {
+                                               theList =3D 
currentField.getContainerL=
ist("fileValues");
+                                               def =3D 
JahiaContainerDefinitionsRegis=
try.
+                                                                               
                                                                        
getInstance().getDefinition(jParams.getSi=
teID(), "fileValues");
+                                       } else {
+                                                       theList =3D 
currentField.getContainerLi=
st("textValues");
+                                                       def =3D 
JahiaContainerDefinitionsRegist=
ry.
+                                                                               
                                                                        
getInstance().getDefinition(jParams.getSi=
teID(), "textValues");
+                                       }
+
+                                       currentValue =3D new JahiaContainer(0,
+                                                                               
                                                                        
jParams.getJahiaID(),
+                                                                               
                                                                        
jParams.getPageID(),
+                                                                               
                                                                        
theList.getID(),
+                                                                               
                                                                        0,
+                                                                               
                                                                        0,
+                                                                               
                                                                        
def.getID(),
+                                                                               
                                                                        0,
+                                                                               
                                                                        
EntryLoadRequest.STAGING_WORKFLOW_STATE);=
   =

+                                                                               
                                                                        =

+                                                                               
        ServicesRegistry.getInstance().getJahiaContainers=
Service().saveContainer(currentValue, 0, jParams);
+                                       currentValue =3D 
ServicesRegistry.getInsta=
nce().getJahiaContainersService().loadContainer(
+                                                                               
                                        currentValue.getID(), LoadFlags.ALL, 
jParams,=
 EntryLoadRequest.STAGED); =

+                                                                               
        currentValue.setLanguageCode(jParams.getLocale().=
toString());
+                                                                               
                currentValue.fieldsStructureCheck(jParams);                     
        =

+                                                                               
        JahiaField field =3D currentValue.getField("id");=
                        =

+                                                                               
        field.setValue(rowID);   =

+                                                                               
        field.save(jParams);                                  =

+                              }
+                                                                               
                                        %>
+                                                                               
                                        <a 
href=3D"javascript:<%=3DjData.gui().html().drawUpdateCon=
tainerLauncher(currentValue)%>">
+                                                                               
                                                <img border=3D"0" 
alt=3D"update" src=3D"<%=3DcontextURL%>/=
img/actions/update.gif" />
+                                                                               
                                        </a>
+                                                                               
                                        =

+                                                                               
                                        <%
                                  %>    =

                                </display:column>
                                <% i++; %>
                                <% } %> =

+                               <% row++; %>
                       </display:table> =

-                      <% if (valuesByRow.values().size() > 0) { %>     =

+                      <% if (valuesByRow.values().size() > 0 || searchSubm=
itted) { %>             =

                        <form method=3D"post" action=3D"<%=3DbypassUrl%>" nam=
e=3D"search" >
                                        <content:resourceBundle 
resourceBundle=3D"jahiatemp=
lates.Corporate_portal_templates_v2"
                                                                
resourceName=3D"search"/>: <input type=3D"text" =
name=3D"searchString"/>
@@ -435,15 +519,16 @@
                         <%
                     }
                 }
-                %></div><% =

+                %></div><%
             }
         }
         if (t =3D=3D 0) {
             if (! formsEnum.hasMoreElements()) {
-                   if ( ! 
"".equals(jData.gui().html().drawAddContainerLauncher(=
 forms )) ) {
+               final String launcher =3D jData.gui().html().drawAddContainer=
Launcher( forms );
+                   if ( ! "".equals(launcher) ) {
                        %>
                        <div class=3D"step1">
-                       <a 
href=3D"javascript:<%=3DjData.gui().html().drawAddCont=
ainerLauncher( forms )%>">
+                       <a href=3D"javascript:<%=3Dlauncher%>">
                        <img src=3D'<content:contextURL/>/img/actions/add.gif' 
al=
t=3D'Add form' width=3D'11' height=3D'11' border=3D'0'/>
                        <content:resourceBundle 
resourceBundle=3D"jahiatemplates.=
Corporate_portal_templates_v2"
                         resourceName=3D"form.addSender"/></a>

Modified: branches/JAHIA-5-0-SP-BRANCH/src/jsp/form_generator/form_generato=
r.jsp
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/src/jsp/form_generator/form_generator.jsp&rev=3D688&repname=3Dcorpo=
rate_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/form_generator/form_generator.jsp =
(original)
+++ branches/JAHIA-5-0-SP-BRANCH/src/jsp/form_generator/form_generator.jsp =
Thu May 31 11:12:33 2007
@@ -22,7 +22,7 @@
 Vector emptyMandatoryFields =3D new Vector();
 boolean storePostedValues =3D false;
 final String creationDateTitle =3D JahiaResourceBundle.getString(ResourceB=
undle.getBundle("jahiatemplates.Corporate_portal_templates_v2", jParams.get=
Locale()), "doc.creationDate", jParams.getLocale());    =

-final SimpleDateFormat sdf =3D new SimpleDateFormat("dd.MM.yyyy");
+final SimpleDateFormat sdf =3D new SimpleDateFormat("dd.MM.yyyy HH'h'mm");
 %>
 <%@ include file=3D"definitions.inc"%>
 <%@ include file=3D"process_post.inc"%>

Modified: branches/JAHIA-5-0-SP-BRANCH/src/jsp/form_generator/process_post.=
inc
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/src/jsp/form_generator/process_post.inc&rev=3D688&repname=3Dcorpora=
te_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/form_generator/process_post.inc (o=
riginal)
+++ branches/JAHIA-5-0-SP-BRANCH/src/jsp/form_generator/process_post.inc Th=
u May 31 11:12:33 2007
@@ -1,18 +1,18 @@
 <%--
 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
+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
+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.
 --%><%
 final String formIdStr;
@@ -109,17 +109,22 @@
                     logger.debug("Field [" + fieldTitle + "] is mandatory"=
);
                     emptyMandatoryFields.add(new Integer(currentField.getI=
D()));
                 }
-                if (storePostedValues) {
-                    JahiaContainerList storePostedForm =3D currentField.ge=
tContainerList("values");
-                    if ( storePostedForm !=3Dnull && storePostedForm.getID=
()=3D=3D0 ) {
-                        logger.debug("storePostedForm !=3Dnull && storePos=
tedForm.getID()=3D=3D0");
-                        ContainerListBean storePostedFormBean =3D new Cont=
ainerListBean(storePostedForm,jParams);
+        if (storePostedValues) {
+              JahiaContainerList storePostedForm;
+              if (isFileUploadType) {
+                       storePostedForm =3D 
currentField.getContainerList("fileVal=
ues");  =

+              } else {
+                       storePostedForm =3D 
currentField.getContainerList("textVal=
ues");
+              }
+            if ( storePostedForm !=3Dnull && storePostedForm.getID()=3D=3D=
0 ) {
+                logger.debug("storePostedForm !=3Dnull && storePostedForm.=
getID()=3D=3D0");
+                ContainerListBean storePostedFormBean =3D new ContainerLis=
tBean(storePostedForm,jParams);
                         ServicesRegistry.getInstance().getJahiaContainersS=
ervice().
                                 saveContainerListInfo(storePostedForm, jPa=
rams.getContentPage().getAclID(), jParams);
-                        storePostedForm =3D storePostedFormBean.getJahiaCo=
ntainerList();
-                    }
-                    ContainerListBean storePostedFormBean =3D new Containe=
rListBean(storePostedForm,jParams);
-                    pageContext.setAttribute("storePostedFormBean",storePo=
stedFormBean);
+               storePostedForm =3D storePostedFormBean.getJahiaContainerLi=
st();
+            }
+            ContainerListBean storePostedFormBean =3D new ContainerListBea=
n(storePostedForm,jParams);
+            pageContext.setAttribute("storePostedFormBean",storePostedForm=
Bean);
 =

                     if (forHasBeenPosted && emptyMandatoryFields.isEmpty()=
) {
                         Map map =3D new HashMap();
@@ -131,20 +136,20 @@
                                                }
                          =

                         if (isFileUploadType) {
-                                       map.put("value", new String[] {(path 
=3D=3D null=
 ? "" : path)});                =

+                                       map.put("fileValue", new String[] 
{(path =3D=3D =
null ? "" : path)});            =

                        } else {
                                        if (fupload =3D=3D null) {
-                                                                               
map.put("value",request.getParameterValues("field_=
" + currentField.getID()));
+                                                                               
map.put("textValue",request.getParameterValues("fi=
eld_" + currentField.getID()));
                                                                } else {
-                                                                               
map.put("value",fupload.getParameterValues("field_=
" + currentField.getID()));
+                                                                               
map.put("textValue",fupload.getParameterValues("fi=
eld_" + currentField.getID()));
                                                                }       =

                        }
                         map.put("id",new String[] {id});
                         jData.getProcessingContext().setParameterMap(map);
-                        %>
-                        <content:formContentMapperHandler listName=3D'stor=
ePostedFormBean'
+                %>
+                <content:formContentMapperHandler listName=3D'storePostedF=
ormBean'
                             submitMarker=3D"formId" immediatePublication=
=3D"<%=3DshowPostedValues%>"/>
-                        <%
+                <%
                         jData.getProcessingContext().setParameterMap(oldMa=
p);
                     }
                 }

_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list

Reply via email to