svn commit: r1818646 - in /ofbiz/ofbiz-framework/trunk: applications/content/data/ applications/datamodel/data/seed/ applications/party/template/visit/ applications/party/webapp/partymgr/WEB-INF/ framework/common/src/main/java/org/apache/ofbiz/common/ ...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1818646 - in /ofbiz/ofbiz-framework/trunk: applications/content/data/ applications/datamodel/data/seed/ applications/party/template/visit/ applications/party/webapp/partymgr/WEB-INF/ framework/common/src/main/java/org/apache/ofbiz/common/ ...

jleroux@apache.org
Author: jleroux
Date: Tue Dec 19 10:33:15 2017
New Revision: 1818646

URL: http://svn.apache.org/viewvc?rev=1818646&view=rev
Log:
Completed: Remove applet concept in OFBiz
(OFBIZ-10094)

Following discussion at http://markmail.org/message/dlp4zoo3xxuiefpn :

While reviewing http://svn.apache.org/viewvc?view=revision&revision=1811438 
I stumbled upon the usage of Java Applets

It's still possible to use Java Applets in browsers but most of the time it's
not OOTB https://www.digitalcitizen.life/how-enable-java-all-major-web-browsers

And Java 9 deprecates it https://www.java.com/en/download/faq/jdk9_plugin.xml

Modified:
    ofbiz/ofbiz-framework/trunk/applications/content/data/ContentSecurityGroupDemoData.xml
    ofbiz/ofbiz-framework/trunk/applications/datamodel/data/seed/ContentSeedData.xml
    ofbiz/ofbiz-framework/trunk/applications/party/template/visit/VisitDetail.ftl
    ofbiz/ofbiz-framework/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml
    ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/CommonEvents.java
    ofbiz/ofbiz-framework/trunk/framework/security/config/SecurityEntityLabels.xml
    ofbiz/ofbiz-framework/trunk/framework/webtools/webapp/webtools/WEB-INF/web.xml

Modified: ofbiz/ofbiz-framework/trunk/applications/content/data/ContentSecurityGroupDemoData.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/data/ContentSecurityGroupDemoData.xml?rev=1818646&r1=1818645&r2=1818646&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/data/ContentSecurityGroupDemoData.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/data/ContentSecurityGroupDemoData.xml Tue Dec 19 10:33:15 2017
@@ -36,7 +36,4 @@ under the License.
     <SecurityGroupPermission fromDate="2001-05-13 12:00:00.0" groupId="CONTENT_USER" permissionId="CONTENTMGR_VIEW"/>
     <SecurityGroupPermission fromDate="2001-05-13 12:00:00.0" groupId="CONTENT_USER" permissionId="OFBTOOLS_VIEW"/>
 
-    <!-- Control Applet security -->
-    <SecurityGroupPermission fromDate="2001-05-13 12:00:00.0" groupId="FULLADMIN" permissionId="SEND_CONTROL_APPLET"/>
-    <SecurityGroupPermission fromDate="2001-05-13 12:00:00.0" groupId="FLEXADMIN" permissionId="SEND_CONTROL_APPLET"/>
 </entity-engine-xml>

Modified: ofbiz/ofbiz-framework/trunk/applications/datamodel/data/seed/ContentSeedData.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/datamodel/data/seed/ContentSeedData.xml?rev=1818646&r1=1818645&r2=1818646&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/datamodel/data/seed/ContentSeedData.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/datamodel/data/seed/ContentSeedData.xml Tue Dec 19 10:33:15 2017
@@ -2089,12 +2089,8 @@ ${txt}
     <SecurityPermission description="Limited Update operations in the Content Manager." permissionId="CONTENTMGR_ROLE_UPDATE"/>
     <SecurityPermission description="Limited Delete operations in the Content Manager." permissionId="CONTENTMGR_ROLE_DELETE"/>
 
-    <!-- Control Applet security -->
-    <SecurityPermission description="Send to the Control Applet." permissionId="SEND_CONTROL_APPLET"/>
-    
     <!-- add admin to SUPER permission group -->
     <SecurityGroupPermission fromDate="2001-05-13 12:00:00.0" groupId="SUPER" permissionId="CONTENTMGR_ADMIN"/>
-    <SecurityGroupPermission fromDate="2001-05-13 12:00:00.0" groupId="SUPER" permissionId="SEND_CONTROL_APPLET"/>
 
     <DataResource dataResourceId="NOCONTENTFOUND" dataResourceTypeId="OFBIZ_FILE" dataTemplateTypeId="NONE" objectInfo="/applications/content/webapp/content/images/nocontentfound.png"
 mimeTypeId="image/png" createdDate="2004-08-06 11:40:15.818"/>

Modified: ofbiz/ofbiz-framework/trunk/applications/party/template/visit/VisitDetail.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/party/template/visit/VisitDetail.ftl?rev=1818646&r1=1818645&r2=1818646&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/party/template/visit/VisitDetail.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/applications/party/template/visit/VisitDetail.ftl Tue Dec 19 10:33:15 2017
@@ -168,53 +168,3 @@ under the License.
       </#if>
   </div>
 </div>
-
-<!--
-*******************************************************************************
-JIRA OFBIZ-4488: BEGIN
-https://issues.apache.org/jira/browse/OFBIZ-4488
-*******************************************************************************
-<div class="screenlet">
-  <div class="screenlet-title-bar">
-    <ul>
-      <li class="h3">${uiLabelMap.PartyPagePushFollowing}</li>
-    </ul>
-    <br class="clear"/>
-  </div>  
-  <div class="screenlet-body">
-      <#if security.hasPermission("SEND_CONTROL_APPLET", session)>
-        <table class="basic-table" cellspacing="0">
-            <tr>
-              <th>${uiLabelMap.PartyPushURL}</th>
-              <td>
-                <form name="pushPage" method="get" action="<@ofbizUrl>pushPage</@ofbizUrl>">
-                  <input type="hidden" name="followerSid" value="${visit.sessionId}" />
-                  <input type="hidden" name="visitId" value="${visit.visitId}" />
-                  <input type="text" name="pageUrl" />
-                  <input type="submit" value="${uiLabelMap.CommonSubmit}" />
-                </form>
-              </td>
-            </tr>
-            <tr>
-              <td colspan="3"><hr /></td>
-            </tr>
-            <tr>
-              <th>${uiLabelMap.PartyFollowSession}</th>
-              <td>
-                <form name="setFollower" method="get" action="<@ofbizUrl>setAppletFollower</@ofbizUrl>">
-                  <input type="hidden" name="followerSid" value="${visit.sessionId}" />
-                  <input type="hidden" name="visitId" value="${visit.visitId}" />
-                  <input type="text" name="followSid" />
-                  <input type="submit" value="${uiLabelMap.CommonSubmit}" />
-                </form>
-              </td>
-            </tr>
-        </table>
-      </#if>
-  </div>
-</div>
-*******************************************************************************
-JIRA OFBIZ-4488: END
-*******************************************************************************
--->
-

Modified: ofbiz/ofbiz-framework/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml?rev=1818646&r1=1818645&r2=1818646&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml Tue Dec 19 10:33:15 2017
@@ -625,11 +625,6 @@ under the License.
         <event type="java" path="org.apache.ofbiz.common.CommonEvents" invoke="setFollowerPage"/>
         <response name="success" type="view" value="visitdetail"/>
     </request-map>
-    <request-map uri="setAppletFollower">
-        <security https="true" auth="true"/>
-        <event type="java" path="org.apache.ofbiz.common.CommonEvents" invoke="setAppletFollower"/>
-        <response name="success" type="view" value="visitdetail"/>
-    </request-map>
 
     <!-- communication event requests -->
     <request-map uri="setCommunicationEventRoleStatus">

Modified: ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/CommonEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/CommonEvents.java?rev=1818646&r1=1818645&r2=1818646&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/CommonEvents.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/CommonEvents.java Tue Dec 19 10:33:15 2017
@@ -25,12 +25,10 @@ import java.awt.Graphics2D;
 import java.awt.geom.AffineTransform;
 import java.awt.image.BufferedImage;
 import java.io.IOException;
-import java.io.PrintWriter;
 import java.io.UnsupportedEncodingException;
 import java.io.Writer;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
@@ -45,17 +43,13 @@ import org.apache.commons.lang.RandomStr
 import org.apache.commons.lang.StringUtils;
 import org.apache.ofbiz.base.lang.JSON;
 import org.apache.ofbiz.base.util.Debug;
-import org.apache.ofbiz.base.util.StringUtil;
 import org.apache.ofbiz.base.util.UtilGenerics;
 import org.apache.ofbiz.base.util.UtilHttp;
-import org.apache.ofbiz.base.util.UtilMisc;
 import org.apache.ofbiz.base.util.UtilProperties;
 import org.apache.ofbiz.base.util.UtilValidate;
-import org.apache.ofbiz.base.util.cache.UtilCache;
 import org.apache.ofbiz.entity.Delegator;
 import org.apache.ofbiz.entity.GenericEntityException;
 import org.apache.ofbiz.entity.GenericValue;
-import org.apache.ofbiz.entity.util.EntityQuery;
 import org.apache.ofbiz.entity.util.EntityUtilProperties;
 import org.apache.ofbiz.security.Security;
 import org.apache.ofbiz.widget.model.ThemeFactory;
@@ -82,105 +76,6 @@ public class CommonEvents {
         "thisRequestUri"
     };
 
-    private static final UtilCache<String, Map<String, String>> appletSessions = UtilCache.createUtilCache("AppletSessions", 0, 600000, true);
-
-    public static String checkAppletRequest(HttpServletRequest request, HttpServletResponse response) {
-        Delegator delegator = (Delegator) request.getAttribute("delegator");
-        String sessionId = request.getParameter("sessionId");
-        String visitId = request.getParameter("visitId");
-        sessionId = sessionId.trim();
-        visitId = visitId.trim();
-
-        String responseString = "";
-
-        GenericValue visit = null;
-        try {
-            visit = EntityQuery.use(delegator).from("Visit").where("visitId", visitId).queryOne();
-        } catch (GenericEntityException e) {
-            Debug.logError(e, "Cannot Visit Object", module);
-        }
-
-        if (visit != null && visit.getString("sessionId").equals(sessionId) && appletSessions.containsKey(sessionId)) {
-            Map<String, String> sessionMap = appletSessions.get(sessionId);
-            if (sessionMap != null && sessionMap.containsKey("followPage")) {
-                responseString = sessionMap.remove("followPage");
-            }
-        }
-
-        try {
-            PrintWriter out = response.getWriter();
-            response.setContentType("text/plain");
-            out.println(responseString);
-            out.close();
-        } catch (IOException e) {
-            Debug.logError(e, "Problems writing servlet output!", module);
-        }
-
-        return "success";
-    }
-
-    public static String receiveAppletRequest(HttpServletRequest request, HttpServletResponse response) {
-        Delegator delegator = (Delegator) request.getAttribute("delegator");
-        String sessionId = request.getParameter("sessionId");
-        String visitId = request.getParameter("visitId");
-        sessionId = sessionId.trim();
-        visitId = visitId.trim();
-
-        String responseString = "ERROR";
-
-        GenericValue visit = null;
-        try {
-            visit = EntityQuery.use(delegator).from("Visit").where("visitId", visitId).queryOne();
-        } catch (GenericEntityException e) {
-            Debug.logError(e, "Cannot Visit Object", module);
-        }
-
-        if (visit.getString("sessionId").equals(sessionId)) {
-            String currentPage = request.getParameter("currentPage");
-            Map<String, String> sessionMap = appletSessions.get(sessionId);
-            if (sessionMap != null) {
-                String followers = sessionMap.get("followers");
-                List<String> folList = StringUtil.split(followers, ",");
-                for (String follower: folList) {
-                    Map<String, String> folSesMap = UtilMisc.toMap("followPage", currentPage);
-                    appletSessions.put(follower, folSesMap);
-                }
-            }
-            responseString = "OK";
-        }
-
-        try {
-            PrintWriter out = response.getWriter();
-            response.setContentType("text/plain");
-            out.println(responseString);
-            out.close();
-        } catch (IOException e) {
-            Debug.logError(e, "Problems writing servlet output!", module);
-        }
-
-        return "success";
-    }
-
-    public static String setAppletFollower(HttpServletRequest request, HttpServletResponse response) {
-        Security security = (Security) request.getAttribute("security");
-        GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin");
-        String visitId = request.getParameter("visitId");
-        if (visitId != null) {
-            request.setAttribute("visitId", visitId);
-        }
-        if (security.hasPermission("SEND_CONTROL_APPLET", userLogin)) {
-            String followerSessionId = request.getParameter("followerSid");
-            String followSessionId = request.getParameter("followSid");
-            Map<String, String> follow = appletSessions.get(followSessionId);
-            if (follow == null) {
-                follow = new LinkedHashMap<>();
-            }
-            appletSessions.put(followSessionId, follow);
-            appletSessions.put(followerSessionId, null);
-        }
-        return "success";
-    }
-
     public static String setFollowerPage(HttpServletRequest request, HttpServletResponse response) {
         Security security = (Security) request.getAttribute("security");
         GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin");
@@ -188,16 +83,6 @@ public class CommonEvents {
         if (visitId != null) {
             request.setAttribute("visitId", visitId);
         }
-        if (security.hasPermission("SEND_CONTROL_APPLET", userLogin)) {
-            String followerSessionId = request.getParameter("followerSid");
-            String pageUrl = request.getParameter("pageUrl");
-            Map<String, String> follow = appletSessions.get(followerSessionId);
-            if (follow == null) {
-                follow = new LinkedHashMap<>();
-            }
-            follow.put("followPage", pageUrl);
-            appletSessions.put(followerSessionId, follow);
-        }
         return "success";
     }
 

Modified: ofbiz/ofbiz-framework/trunk/framework/security/config/SecurityEntityLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/security/config/SecurityEntityLabels.xml?rev=1818646&r1=1818645&r2=1818646&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/security/config/SecurityEntityLabels.xml (original)
+++ ofbiz/ofbiz-framework/trunk/framework/security/config/SecurityEntityLabels.xml Tue Dec 19 10:33:15 2017
@@ -1968,17 +1968,6 @@
         <value xml:lang="zh">在安全管理页面中的浏览操作。</value>
         <value xml:lang="zh-TW">在安全管理畫面中的檢視操作.</value>
     </property>
-    <property key="SecurityPermission.description.SEND_CONTROL_APPLET">
-        <value xml:lang="en">Send to the Control Applet.</value>
-        <value xml:lang="es">Enviar a Applet de Control.</value>
-        <value xml:lang="fr">Envoyer à l'applet de contrôle</value>
-        <value xml:lang="it">Invia all'Applet.</value>
-        <value xml:lang="ja">コントロールアプレットに送信。</value>
-        <value xml:lang="ru">Отсылка в контрольный апплет.</value>
-        <value xml:lang="th">Send to the Control Applet.</value>
-        <value xml:lang="zh">发送到控制小程序。</value>
-        <value xml:lang="zh-TW">發送到控制Applet.</value>
-    </property>
     <property key="SecurityPermission.description.SERVER_STATS_VIEW">
         <value xml:lang="en">View the Server Statistics pages.</value>
         <value xml:lang="es">Ver las páginas de Estadísticas del Servidor.</value>

Modified: ofbiz/ofbiz-framework/trunk/framework/webtools/webapp/webtools/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/webtools/webapp/webtools/WEB-INF/web.xml?rev=1818646&r1=1818645&r2=1818646&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/webtools/webapp/webtools/WEB-INF/web.xml (original)
+++ ofbiz/ofbiz-framework/trunk/framework/webtools/webapp/webtools/WEB-INF/web.xml Tue Dec 19 10:33:15 2017
@@ -51,7 +51,7 @@ under the License.
         <filter-class>org.apache.ofbiz.webapp.control.ControlFilter</filter-class>
         <init-param>
             <param-name>allowedPaths</param-name>
-            <param-value>/ping.txt:/error:/control:/select:/index.html:/index.jsp:/default.html:/default.jsp:/applet</param-value>
+            <param-value>/ping.txt:/error:/control:/select:/index.html:/index.jsp:/default.html:/default.jsp</param-value>
         </init-param>
         <init-param>
             <param-name>redirectPath</param-name>