Update of 
/var/cvs/contributions/CMSContainer_Modules/community/src/webapp/editors/community
In directory james.mmbase.org:/tmp/cvs-serv15371/src/webapp/editors/community

Modified Files:
      Tag: b1_5
        import.jsp import_success.jsp report_overview.jsp 
Log Message:
CMSC-1265 - Community: improve import and export options of community users


See also: 
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer_Modules/community/src/webapp/editors/community
See also: http://www.mmbase.org/jira/browse/CMSC-1265


Index: import.jsp
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer_Modules/community/src/webapp/editors/community/import.jsp,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -b -r1.2.2.1 -r1.2.2.2
--- import.jsp  15 Dec 2008 13:01:13 -0000      1.2.2.1
+++ import.jsp  23 Feb 2009 15:34:21 -0000      1.2.2.2
@@ -16,20 +16,31 @@
                            // alert(did);
                             CheckedDiv=document.getElementById("msg");
                            // FmtParam=document.getElementById("inmsg");
+
                             if (getOs()) {
                                          Text=CheckedDiv.innerText;
                                          
Text=Text.replace("#",CheckedSpan.innerText);
-                                            if(confirm(Text))
-                                                          
{document.forms[0].submit();}
+           if(confirm(Text)&&checkExtention()){
+               document.forms[0].submit();}
                              } else {
                                         Text=CheckedDiv.textContent;
                                          
Text=Text.replace("#",CheckedSpan.textContent);
-                                            if(confirm(Text))
+             if(confirm(Text)&&checkExtention())
                                                           
{document.forms[0].submit();}
                              }
      } 
   }
 } 
+function checkExtention(){
+   var ext = document.forms[0].file.value;
+      ext = ext.substring(ext.length-3,ext.length);
+      ext = ext.toLowerCase();
+      if(ext != 'xml'&& ext != 'csv') {
+         alert('Only CSV or XML files are accepted.');
+         return false; }
+      else{
+         return true; }
+}
 function getOs()
 {
    
@@ -51,9 +62,10 @@
                </div>
        </div>
 </div>
+
 <div class="editor">
        <div class="body">
-
+   <div style="color:red;"><c:if test="${not empty 
requestScope.warning}">Please check the input data.</c:if></div>
                <html:form 
action="/editors/community/ReferenceImportExportAction"
                        enctype="multipart/form-data">
                        <tr>
@@ -74,10 +86,12 @@
                        <br>
                        <br>
                        <br>
-                       <html:file property="datafile" />
+                       
+         <input type="file" accept="text/xml,text/csv" name="file"/>
                        <input type="hidden" name="action" 
value="importsubscription" />
                        <input type="hidden" name="newsletterId"
                                value="${requestScope.newsletterId}" />
+         <input type="hidden" name="groupId" value="${groupId}"/>
                        <input type="button" value="Import" id="bn" 
onclick="checkid(level);" />
                </html:form>
                <div style="margin:4px;color:red;">


Index: import_success.jsp
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer_Modules/community/src/webapp/editors/community/import_success.jsp,v
retrieving revision 1.2.2.2
retrieving revision 1.2.2.3
diff -u -b -r1.2.2.2 -r1.2.2.3
--- import_success.jsp  15 Dec 2008 13:01:13 -0000      1.2.2.2
+++ import_success.jsp  23 Feb 2009 15:34:21 -0000      1.2.2.3
@@ -41,6 +41,9 @@
    <div class="body">
 
       <p>
+         ${confirm_userNum} users are added or overwritten successfully.
+      </p>
+      <p>
          <fmt:message key="community.datafile.import.success"/>
       </p>
 


Index: report_overview.jsp
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer_Modules/community/src/webapp/editors/community/report_overview.jsp,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -b -r1.4 -r1.4.2.1
--- report_overview.jsp 19 Sep 2008 11:23:36 -0000      1.4
+++ report_overview.jsp 23 Feb 2009 15:34:21 -0000      1.4.2.1
@@ -3,7 +3,23 @@
 %><mm:content type="text/html" encoding="UTF-8" expires="0">
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
 <fmt:setBundle basename="cmsc-community" scope="request" />
-<cmscedit:head title="community.data.title"/>
+<cmscedit:head title="community.data.title">
+   <script type="text/javascript">
+      function commitToXml(){
+         document.getElementById("fileType").value="xml";
+         docummnt.forms[0].submit();
+      }
+      function commitToCsv(){
+         document.getElementById("fileType").value="csv";
+         docummnt.forms[0].submit();
+      }
+      function commitImport(){
+         var groupId = document.getElementById("imgroups").value;
+         document.getElementById("imGroupId").value = groupId;
+      }
+   </script>
+
+</cmscedit:head>
 <div class="tabs">
    <div class="tab_active">
       <div class="body">
@@ -14,19 +30,43 @@
    </div>
 </div>
 <div class="editor">
+   <div class="ruler_green">
+      <div>&nbsp;<fmt:message key="community.data.export.title"/>&nbsp;</div>
+   </div>
    <div class="body">     
-      <div> 
-         <p>
-            <a href="ReferenceImportExportAction.do?action=export">
-               <fmt:message key="community.data.export"/>
-            </a>
-         </p>
-         <p>
-            <a href="${pageContext.request.contextPath 
}/editors/community/import.jsp">
-               <fmt:message key="community.data.import"/>
-            </a>
-         </p>         
+      <html:form 
action="/editors/community/ReferenceImportExportAction.do?action=export">
+         <input type="hidden" id="fileType" name="fileType"/>
+         <p><input type="submit" onclick="javascript:commitToXml()" 
value="<fmt:message key="community.data.export.xml"/>"/></p>
+         <p><input type="submit" onclick="javascript:commitToCsv()" 
value="<fmt:message key="community.data.export.csv"/>"/></p>
+         <b>Options</b>
+         <select property="groups" style="width:150px" name="groups">
+            <option value="0">ALL GROUP</option>
+            <c:if test="${not empty requestScope.groups}">
+               <c:forEach items="${requestScope.groups}" var="groupItem">
+                  <option value="${groupItem.id}">${groupItem.name}</option>
+               </c:forEach>
+            </c:if>
+         </select>
+      </html:form>
       </div>
+   <div class="ruler_green">
+      <div>&nbsp;<fmt:message key="community.data.import.title"/>&nbsp;</div>
+   </div>
+   
+   <div class="body">
+      <html:form 
action="/editors/community/ReferenceImportExportAction.do?action=showImportPage">
+         <input type="hidden" name="imGroupId" id="imGroupId"/>
+         <p><input type="submit" onclick="javascript:commitImport()" 
value="<fmt:message key="community.data.import.from"/>"/></p>
+         <b>Options</b>
+         <select property="groups" style="width:150px" name="groups" 
id="imgroups">
+            <option value="0">NO GROUP</option>
+            <c:if test="${not empty requestScope.groups}">
+               <c:forEach items="${requestScope.groups}" var="groupItem">
+                  <option value="${groupItem.id}">${groupItem.name}</option>
+               </c:forEach>
+            </c:if>
+         </select>
+      </html:form>
    </div>
 </div>
 </mm:content>
\ No newline at end of file
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to