details:   /erp/devel/pi/rev/62d87bda6d0c
changeset: 10590:62d87bda6d0c
user:      Iván Perdomo <ivan.perdomo <at> openbravo.com>
date:      Fri Feb 11 11:32:13 2011 +0100
summary:   Client benchmark - Check user role before loading the View

details:   /erp/devel/pi/rev/dd6dac0b5ec2
changeset: 10591:dd6dac0b5ec2
user:      Iván Perdomo <ivan.perdomo <at> openbravo.com>
date:      Fri Feb 11 18:18:48 2011 +0100
summary:   Initial implementation of Getting Started widget

diffstat:

 
modules/org.openbravo.client.kernel/web/org.openbravo.client.kernel/benchmark/index.html
             |  15 +-
 
modules/org.openbravo.client.myob/src-db/database/sourcedata/OBKMO_WIDGET_CLASS.xml
                  |  15 +++
 
modules/org.openbravo.client.myob/src/org/openbravo/client/myob/CommunityBrandingWidgetProvider.java
 |   1 +
 
modules/org.openbravo.client.myob/src/org/openbravo/client/myob/GettingStartedWidgetProvider.java
    |  47 ++++++++++
 
modules/org.openbravo.client.myob/src/org/openbravo/client/myob/MyOpenbravoComponentProvider.java
    |   6 +-
 
modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-getting-started-widget.js
      |  45 +++++++++
 
modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-url-widget.js
                  |   7 +-
 modules/org.openbravo.client.myob/web/org.openbravo.client.myob/proxy.html     
                      |  27 +++++
 8 files changed, 153 insertions(+), 10 deletions(-)

diffs (236 lines):

diff -r 83f81d4ac280 -r dd6dac0b5ec2 
modules/org.openbravo.client.kernel/web/org.openbravo.client.kernel/benchmark/index.html
--- 
a/modules/org.openbravo.client.kernel/web/org.openbravo.client.kernel/benchmark/index.html
  Fri Feb 11 17:41:28 2011 +0100
+++ 
b/modules/org.openbravo.client.kernel/web/org.openbravo.client.kernel/benchmark/index.html
  Fri Feb 11 18:18:48 2011 +0100
@@ -32,17 +32,18 @@
 var isomorphicDir='../../org.openbravo.userinterface.smartclient/isomorphic/';
 
 function OBStartApplication() {
+  var s = document.getElementById('summary');
+
+  if(OB.User.roleName.indexOf('System Administrator') == -1) {
+    s.innerHTML = 'Test must be executed with System Administrator role';
+    return;
+  }
+
   
$LAB.script('../../../org.openbravo.client.kernel/OBUIAPP_MainLayout/View?viewId=_D586192D06C14EC182B44CAD34CA4295')
       .wait(function() {
 
         var viewName = OB.Layout.ViewManager.loadedWindowClassName,
-            suite = new Benchmark.Suite, summary = '', a = [],
-            s = document.getElementById('summary'), i = 0;
-
-        if(OB.User.roleName.indexOf('System Administrator') == -1) {
-          s.innerHTML = 'Test must be executed with System Administrator role';
-          return;
-        }
+            suite = new Benchmark.Suite, summary = '', a = [], i = 0;
 
         s.innerHTML = 'Executing...';
 
diff -r 83f81d4ac280 -r dd6dac0b5ec2 
modules/org.openbravo.client.myob/src-db/database/sourcedata/OBKMO_WIDGET_CLASS.xml
--- 
a/modules/org.openbravo.client.myob/src-db/database/sourcedata/OBKMO_WIDGET_CLASS.xml
       Fri Feb 11 17:41:28 2011 +0100
+++ 
b/modules/org.openbravo.client.myob/src-db/database/sourcedata/OBKMO_WIDGET_CLASS.xml
       Fri Feb 11 18:18:48 2011 +0100
@@ -62,4 +62,19 @@
 <!--C26A68FD8CF347EC9D1FB7E274622450-->  
<ACCESSLEVEL><![CDATA[4]]></ACCESSLEVEL>
 <!--C26A68FD8CF347EC9D1FB7E274622450--></OBKMO_WIDGET_CLASS>
 
+<!--FF8080812E144FAE012E1455F6020009--><OBKMO_WIDGET_CLASS>
+<!--FF8080812E144FAE012E1455F6020009-->  
<OBKMO_WIDGET_CLASS_ID><![CDATA[FF8080812E144FAE012E1455F6020009]]></OBKMO_WIDGET_CLASS_ID>
+<!--FF8080812E144FAE012E1455F6020009-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FF8080812E144FAE012E1455F6020009-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FF8080812E144FAE012E1455F6020009-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FF8080812E144FAE012E1455F6020009-->  
<AD_MODULE_ID><![CDATA[2758CD25B2704AF6BBAD10365FC82C06]]></AD_MODULE_ID>
+<!--FF8080812E144FAE012E1455F6020009-->  <TITLE><![CDATA[Getting 
Started]]></TITLE>
+<!--FF8080812E144FAE012E1455F6020009-->  
<JAVACLASS><![CDATA[org.openbravo.client.myob.GettingStartedWidgetProvider]]></JAVACLASS>
+<!--FF8080812E144FAE012E1455F6020009-->  <HEIGHT><![CDATA[280]]></HEIGHT>
+<!--FF8080812E144FAE012E1455F6020009-->  
<ALLOW_ANONYMOUS_ACCESS><![CDATA[Y]]></ALLOW_ANONYMOUS_ACCESS>
+<!--FF8080812E144FAE012E1455F6020009-->  
<ISSUPERCLASS><![CDATA[N]]></ISSUPERCLASS>
+<!--FF8080812E144FAE012E1455F6020009-->  
<CAN_MAXIMIZE><![CDATA[N]]></CAN_MAXIMIZE>
+<!--FF8080812E144FAE012E1455F6020009-->  
<ACCESSLEVEL><![CDATA[3]]></ACCESSLEVEL>
+<!--FF8080812E144FAE012E1455F6020009--></OBKMO_WIDGET_CLASS>
+
 </data>
diff -r 83f81d4ac280 -r dd6dac0b5ec2 
modules/org.openbravo.client.myob/src/org/openbravo/client/myob/CommunityBrandingWidgetProvider.java
--- 
a/modules/org.openbravo.client.myob/src/org/openbravo/client/myob/CommunityBrandingWidgetProvider.java
      Fri Feb 11 17:41:28 2011 +0100
+++ 
b/modules/org.openbravo.client.myob/src/org/openbravo/client/myob/CommunityBrandingWidgetProvider.java
      Fri Feb 11 18:18:48 2011 +0100
@@ -38,4 +38,5 @@
   public String getClientSideWidgetClassName() {
     return WIDGETCLIENTCLASS;
   }
+
 }
diff -r 83f81d4ac280 -r dd6dac0b5ec2 
modules/org.openbravo.client.myob/src/org/openbravo/client/myob/GettingStartedWidgetProvider.java
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ 
b/modules/org.openbravo.client.myob/src/org/openbravo/client/myob/GettingStartedWidgetProvider.java
 Fri Feb 11 18:18:48 2011 +0100
@@ -0,0 +1,47 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2011 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+package org.openbravo.client.myob;
+
+import java.util.Collections;
+import java.util.Map;
+
+/**
+ * Provides the Getting Started widget
+ * 
+ * @author iperdomo
+ */
+public class GettingStartedWidgetProvider extends WidgetProvider {
+  private static final String WIDGETCLIENTCLASS = "OBGettingStartedWidget";
+
+  @Override
+  public String generate() {
+    throw new UnsupportedOperationException(WIDGETCLIENTCLASS
+        + " definition should be pre-loaded on the client");
+  }
+
+  @Override
+  public String getClientSideWidgetClassName() {
+    return WIDGETCLIENTCLASS;
+  }
+
+  @Override
+  public Map<String, Object> getParameters() {
+    return Collections.emptyMap();
+  }
+}
diff -r 83f81d4ac280 -r dd6dac0b5ec2 
modules/org.openbravo.client.myob/src/org/openbravo/client/myob/MyOpenbravoComponentProvider.java
--- 
a/modules/org.openbravo.client.myob/src/org/openbravo/client/myob/MyOpenbravoComponentProvider.java
 Fri Feb 11 17:41:28 2011 +0100
+++ 
b/modules/org.openbravo.client.myob/src/org/openbravo/client/myob/MyOpenbravoComponentProvider.java
 Fri Feb 11 18:18:48 2011 +0100
@@ -58,8 +58,8 @@
     final List<ComponentResource> globalResources = new 
ArrayList<ComponentResource>();
     
globalResources.add(createStaticResource("web/org.openbravo.client.myob/js/ob-myopenbravo.js",
         false));
-    
globalResources.add(createStaticResource("web/org.openbravo.client.myob/js/ob-getting-started-view.js",
-        false));
+    globalResources.add(createStaticResource(
+        "web/org.openbravo.client.myob/js/ob-getting-started-view.js", false));
     globalResources.add(createStaticResource("org.openbravo.client.kernel/" + 
COMPONENT_TYPE + "/"
         + MyOpenbravoComponent.COMPONENT_ID, false));
     globalResources
@@ -73,6 +73,8 @@
     
globalResources.add(createStaticResource("web/org.openbravo.client.myob/js/ob-about-popup.js",
         false));
     globalResources.add(createStaticResource(
+        "web/org.openbravo.client.myob/js/ob-getting-started-widget.js", 
false));
+    globalResources.add(createStaticResource(
         "web/org.openbravo.userinterface.smartclient/openbravo/skins/"
             + KernelConstants.SKIN_VERSION_PARAMETER
             + "/org.openbravo.client.myob/ob-widget-styles.js", false));
diff -r 83f81d4ac280 -r dd6dac0b5ec2 
modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-getting-started-widget.js
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ 
b/modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-getting-started-widget.js
   Fri Feb 11 18:18:48 2011 +0100
@@ -0,0 +1,45 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2011 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
+// = OBGettingStartedWidget =
+//
+// Getting Started widget
+//
+isc.defineClass('OBGettingStartedWidget', isc.OBWidget).addProperties({
+  contentSource: null,
+  widgetContentUrl: document.location.protocol + 
'//butler.openbravo.com/web/static-content/en_US/gettingstarted/widget.html',
+  createWindowContents: function() {
+    var loc = document.location;
+
+    this.contentSource = this.widgetContentUrl + '?appurl=' +
+                          encodeURIComponent(loc.protocol + '//' + 
loc.hostname +
+                                            (loc.port ? ':' + loc.port : '') +
+                                            OB.Application.contextUrl);
+
+    return isc.HTMLFlow.create({
+      contentsType: 'page',
+      contentsURL: this.contentSource,
+      height: '100%',
+      width: '100%'
+    });
+  },
+  refresh: function(){
+    this.windowContents.setContentsURL(this.contentSource);
+  }
+});
\ No newline at end of file
diff -r 83f81d4ac280 -r dd6dac0b5ec2 
modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-url-widget.js
--- 
a/modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-url-widget.js
       Fri Feb 11 17:41:28 2011 +0100
+++ 
b/modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-url-widget.js
       Fri Feb 11 18:18:48 2011 +0100
@@ -23,10 +23,15 @@
 //
 isc.defineClass('OBUrlWidget', isc.OBWidget).addProperties({
   contentSource: null,
-  createWindowContents: function(){
+  createWindowContents: function() {
     if (!this.contentSource) {
       this.contentSource = this.evaluateContents(this.parameters.src);
     }
+
+    if(this.contentSource.indexOf('butler.openbravo.com') != -1) {
+      this.contentSource = document.location.protocol + 
this.contentSource.substring(this.contentSource.indexOf('//'));
+    }
+
     return isc.HTMLFlow.create({
       contentsType: 'page',
       contentsURL: this.contentSource,
diff -r 83f81d4ac280 -r dd6dac0b5ec2 
modules/org.openbravo.client.myob/web/org.openbravo.client.myob/proxy.html
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ 
b/modules/org.openbravo.client.myob/web/org.openbravo.client.myob/proxy.html    
    Fri Feb 11 18:18:48 2011 +0100
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+        "http://www.w3.org/TR/html4/loose.dtd";>
+<!--
+*************************************************************************
+* The contents of this file are subject to the Openbravo  Public  License
+* Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+* Version 1.1  with a permitted attribution clause; you may not  use this
+* file except in compliance with the License. You  may  obtain  a copy of
+* the License at http://www.openbravo.com/legal/license.html
+* Software distributed under the License  is  distributed  on  an "AS IS"
+* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+* License for the specific  language  governing  rights  and  limitations
+* under the License.
+* The Original Code is Openbravo ERP.
+* The Initial Developer of the Original Code is Openbravo SLU
+* All portions are Copyright (C) 2011 Openbravo SLU
+* All Rights Reserved.
+* Contributor(s):  ______________________________________.
+************************************************************************
+-->
+<html>
+<head>
+<script type="text/javascript" 
src="http://butler.openbravo.com/web/static-content/en_US/gettingstarted/action-proxy.js";></script>
+</head>
+<body>
+</body>
+</html>

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to