details: https://code.openbravo.com/erp/devel/pi/rev/50656a45e834 changeset: 13505:50656a45e834 user: Martin Taal <martin.taal <at> openbravo.com> date: Thu Aug 11 14:38:23 2011 +0200 summary: Added OBBaseView to reflect the View api
details: https://code.openbravo.com/erp/devel/pi/rev/b4cea573f46c changeset: 13506:b4cea573f46c user: Martin Taal <martin.taal <at> openbravo.com> date: Thu Aug 11 14:39:41 2011 +0200 summary: Prevent NPE when having a non-window view details: https://code.openbravo.com/erp/devel/pi/rev/3f480d2257f5 changeset: 13507:3f480d2257f5 user: Martin Taal <martin.taal <at> openbravo.com> date: Thu Aug 11 14:40:11 2011 +0200 summary: Solved issues which prevented passing of menu parameters to viewY details: https://code.openbravo.com/erp/devel/pi/rev/01e4fbd5a96b changeset: 13508:01e4fbd5a96b user: Martin Taal <martin.taal <at> openbravo.com> date: Thu Aug 11 14:40:31 2011 +0200 summary: Small change in sequence number of menu item diffstat: modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationComponentProvider.java | 2 + modules/org.openbravo.client.application/src/org/openbravo/client/application/ViewComponent.java | 5 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-base-view.js | 81 ++++++++++ modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-application-menu.js | 5 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-quick-launch.js | 4 +- modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_TREENODE.xml | 2 +- 6 files changed, 95 insertions(+), 4 deletions(-) diffs (174 lines): diff -r 34be4ea6c46f -r 01e4fbd5a96b modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationComponentProvider.java --- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationComponentProvider.java Thu Aug 11 14:37:18 2011 +0200 +++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationComponentProvider.java Thu Aug 11 14:40:31 2011 +0200 @@ -182,6 +182,8 @@ globalResources.add(createStaticResource( "web/org.openbravo.client.application/js/main/ob-standard-view.js", false)); globalResources.add(createStaticResource( + "web/org.openbravo.client.application/js/main/ob-base-view.js", false)); + globalResources.add(createStaticResource( "web/org.openbravo.client.application/js/form/ob-view-form-linked-items.js", false)); globalResources.add(createStaticResource( "web/org.openbravo.client.application/js/form/ob-view-form-notes.js", false)); diff -r 34be4ea6c46f -r 01e4fbd5a96b modules/org.openbravo.client.application/src/org/openbravo/client/application/ViewComponent.java --- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/ViewComponent.java Thu Aug 11 14:37:18 2011 +0200 +++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/ViewComponent.java Thu Aug 11 14:40:31 2011 +0200 @@ -169,13 +169,16 @@ return etag + "_" + getViewVersionHash(); } - synchronized private String getViewVersionHash() { + private synchronized String getViewVersionHash() { String viewVersionHash = ""; String viewVersions = ""; final String viewId = getParameter("viewId"); OBContext.setAdminMode(); try { Window window = OBDal.getInstance().get(Window.class, correctViewId(viewId)); + if (window == null) { + return viewVersionHash; + } for (Tab t : window.getADTabList()) { viewVersions += t.getTable().isFullyAudited() + "|"; } diff -r 34be4ea6c46f -r 01e4fbd5a96b modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-base-view.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-base-view.js Thu Aug 11 14:40:31 2011 +0200 @@ -0,0 +1,81 @@ +/* + ************************************************************************* + * 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): ______________________________________. + ************************************************************************ + */ + +// = OBBaseView = +// +// A class which implements the view api. +isc.ClassFactory.defineClass('OBBaseView', isc.Layout); + +isc.OBBaseView.addProperties({ + + // ** {{{ OBBaseView.showsItself }}} ** + // If this boolean property is set to true then the Openbravo view manager + // will not place the view instance in a tab in the main Multi-Document-Interface. + // Instead it will call the show method on the instance. This makes + // it for example possible to define views which are implemented as + // popups instead of opened in the main MDI. + showsItself: false, + + // ** {{{ OBBaseView.isSameTab() }}} ** + // Is called by the view manager when opening a view. The view manager + // will first check if there is already a tab open by calling the + // isSameTab method on each opened view. If one of the views returns + // true then the requested view is opened in that tab (effectively + // replacing the current open view there). This is needed for cases + // when a certain view may only be opened once. + isSameTab: function(viewId, params){ + // a common implementation does this, this allows only + // one instance of certain view class to be open at one point + // in time. + // return viewId === this.getClassName(); + // this will allow multiple tabs to be opened: + return false; + }, + + // ** {{{ OBBaseView.getBookMarkParams() }}} ** + // Is used to create a bookmarkable url in the browser's address bar. + // For each opened view this method is called and the result is added + // to the address bar. This makes it possible for the user to do + // back in the browser, to bookmark the url and to build history in the + // browser itself. + getBookMarkParams: function() { + var result = {}; + result.viewId = this.getClassName(); + return result; + }, + + // ** {{{ OBBaseView.getHelpView() }}} ** + // This method can return an object containing a view definition. + // If this method returns an object then a link is activated in the + // help pull-down in the top. + getHelpView: function(){ + return; + // an example of returning a view definition, the viewId contains + // the help view classname, the tabTitle denotes the tab title of the + // help view +// return { +// viewId: 'ClassicOBHelp', +// tabTitle: this.tabTitle + ' - ' + OB.I18N.getLabel('UINAVBA_Help'), +// windowId: this.windowId, +// windowType: 'W', +// windowName: this.tabTitle +// }; + } + +}); \ No newline at end of file diff -r 34be4ea6c46f -r 01e4fbd5a96b modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-application-menu.js --- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-application-menu.js Thu Aug 11 14:37:18 2011 +0200 +++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-application-menu.js Thu Aug 11 14:40:31 2011 +0200 @@ -114,7 +114,7 @@ itemClick: function(item, colNum) { var isClassicEnvironment = OB.Utilities.useClassicMode(item.windowId); - var selectedView = null; + var selectedView = isc.addProperties({}, item); if (item.tabId) { selectedView = OB.Utilities.openView(item.windowId, item.tabId, item.title, null, null, item.icon); selectedView.type = item.type; @@ -147,6 +147,9 @@ selectedView.icon = item.icon; selectedView.type = item.type; + + selectedView = isc.addProperties({}, item, selectedView); + OB.RecentUtilities.addRecent('UINAVBA_MenuRecentList', selectedView); OB.Layout.ViewManager.openView(selectedView.viewId, selectedView); } diff -r 34be4ea6c46f -r 01e4fbd5a96b modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-quick-launch.js --- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-quick-launch.js Thu Aug 11 14:37:18 2011 +0200 +++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-quick-launch.js Thu Aug 11 14:40:31 2011 +0200 @@ -201,7 +201,7 @@ var record = this.getSelectedRecord(); var viewValue = record.viewValue; isc.OBQuickRun.currentQuickRun.doHide(); - var openObject = null; + var openObject = isc.addProperties({}, record); if (record.optionType && record.optionType === 'tab') { openObject = OB.Utilities.openView(record.windowId, viewValue, record[OB.Constants.IDENTIFIER], null, this.command, record.icon); if (openObject) { @@ -260,6 +260,8 @@ openObject.icon = record.icon; + openObject = isc.addProperties({}, record, openObject); + OB.Layout.ViewManager.openView(openObject.viewId, openObject); OB.RecentUtilities.addRecent(this.recentPropertyName, openObject); diff -r 34be4ea6c46f -r 01e4fbd5a96b modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_TREENODE.xml --- a/modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_TREENODE.xml Thu Aug 11 14:37:18 2011 +0200 +++ b/modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_TREENODE.xml Thu Aug 11 14:40:31 2011 +0200 @@ -8,7 +8,7 @@ <!--3E38D7EEF9CF48E5B223D6D71DF7EA05--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> <!--3E38D7EEF9CF48E5B223D6D71DF7EA05--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> <!--3E38D7EEF9CF48E5B223D6D71DF7EA05--> <PARENT_ID><![CDATA[153]]></PARENT_ID> -<!--3E38D7EEF9CF48E5B223D6D71DF7EA05--> <SEQNO><![CDATA[135]]></SEQNO> +<!--3E38D7EEF9CF48E5B223D6D71DF7EA05--> <SEQNO><![CDATA[140]]></SEQNO> <!--3E38D7EEF9CF48E5B223D6D71DF7EA05--></AD_TREENODE> <!--EEDE9E704B114114BB8AF2A5453F3D77--><AD_TREENODE> ------------------------------------------------------------------------------ Get a FREE DOWNLOAD! and learn more about uberSVN rich system, user administration capabilities and model configuration. Take the hassle out of deploying and managing Subversion and the tools developers use with it. http://p.sf.net/sfu/wandisco-dev2dev _______________________________________________ Openbravo-commits mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openbravo-commits
