ERP 2.50:Developers Guide/Concepts/Deep linking
Contents |
Overview
According to Wikipedia "Deep linking, on the World Wide Web, is making a hyperlink that points to a specific page or image on a website, instead of that website's main or home page. Such links are called deep links"[1], in the case of Openbravo ERP is the way to link with a URL directly to an specific functionality, e.g. a Window/Tab, a Manual Form, etc. This link can be built and attach it in a email, or copy/paste it in a IM window, etc.
Important Notes:
- Deep linking functionality was introduced in 2.50MP10
- Deep linking for manual forms was introduced in 2.50MP17
- Deep linking to child tabs with DIRECT command using manual forms approach, command was introduced in 2.50MP19
Building a link
Structure of the URL
http://server:port/obcontext/security/Menu.html?params
- http:// The protocol to access the application (can be https if is an SSL enabled instance)
- server The name or IP address of the server
- port The port to access (If configured with Apache Httpd in front of tomcat is not necessary)
- /obcontext The name of the Openbravo context (required)
- /security/Menu.html The mapping of the servlet handling the requests (required)
- ?params The list of parameters to access an specific window or form.
More information of the structure of an URL[2]
Linking to Generated Windows
Structure of a link to a generated window
http://localhost/openbravo/security/Menu.html?Command=SomeCommand&tabId=220[&recordId=SomeUUID]
The URL structure remains the same, the parameters are the following:
- Command: required, one of the following commands: DEFAULT, GRID, EDIT NEW
- tabId: required, the ID of the tab you want to navigate to, e.g. 220 is the tab ID of the 'Business Partner' tab of the 'Business Partner' window, you can check the ID of the tabs in the AD_Tab table
- recordId: required only when using EDIT command, you need to specify the record id of the you want to edit
Example of a link to Business Partner tab, to edit an specific record:
http://localhost/openbravo/security/Menu.html?Command=EDIT&tabId=220&recordId=DACA01A101E6461C8CD7D0F9C61A97D9
Notes about available commands
- NEW: Opens the tab in 'NEW' mode, ready to enter a new record
- DEFAULT: Opens the tab in the default mode
- GRID: Opens the tab in grid mode
- EDIT: Opens the tab in form mode, with the specified record ready to be edited
Linking to Manual Form
With a link to a manual URL, you can link to a manual form, a process, or any manual code. Structure of a link to a manual form
http://localhost/openbravo/security/Menu.html?url=/someMappingUrl.html[&more-params]
- url: Is the mapping URL of your manual code (form, process, etc)
- more-params: If you need to pass parameters to the manual code, you append them with an ampersand (&)
Example (link to a report parameter window):
http://localhost/openbravo/security/Menu.html?url=/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJREdition.html
Linking to child tabs (advanced)
This way of accessing child tabs should only be used if you have deep understanding of Openbravo architecture. As stated in a previous section, you can access only top level tabs using the generated windows approach. You can workaround this limitation using the Manual Form approach for child tabs.
Example of accessing a child tab (Lines) of the Sales Order window:
http://localhost/openbravo/security/Menu.html?url=/SalesOrder/Lines_Edition.html&Command=DIRECT&inpcOrderlineId=1C9A00630E7E4ED7B5922E1A0404409B
- url the parameter to use the manual form approach
- /SalesOrder/Lines_Edition.html the mapping of the Lines tab of the Sales Order window
- Command DIRECT is the command to use when accessing directly child tabs, it allows to define all session values of parent tabs
- inpcOrderlineId You need to specify the record id to link to. In this case is not specified by recordId but by: inp + the camel cased column key
Notes
- ↑ http://en.wikipedia.org/wiki/Deep_linking
- ↑ http://www.skorks.com/2010/05/what-every-developer-should-know-about-urls/
Languages: |
ERP 2.50:Developers Guide/Concepts/Model Object Mapping | ERP 2.50:Developers Guide/Concepts/Application Dictionary Components