Opened 14 years ago

Closed 14 years ago

#125 closed enhancement (fixed)

New 'Config' proxy

Reported by: adube Owned by: adube
Priority: major Milestone:
Component: server Version:
Keywords: Cc:

Description

The only point of entry to geoprisma core is through the proxy. Currently, there is one proxy per service to access it and one of type 'widget' to access specific methods inside widgets.

What if we want to access config specific methods ? For example, the new PGSQLMapContextConfig has a 'getAuthorizedResources' method that returns the list of authorized resources the currently connected role has. That method can't be accessed by any of the current proxy.

To resolve that, we could have a new "Global" proxy that would access the config methods directly. Each config would need to have a "getMethods" defined to list the possible method the proxy can access. It would then call the method and return the result in JSON.

Comments would be welcomed.

Change History (4)

comment:1 by adube, 14 years ago

Owner: set to adube
Status: newassigned

comment:2 by adube, 14 years ago

Here's some more details about the JSON response.

The main idea is 'as short as possible'. So, the JSON response should look like this in case of success :

{"result": {/* content of the result*/}}

and in case of failure :

{"error": "An error occured..."}

No need for a "status" parameter. Having "error" is enough to tell that something went wrong.


In the client-side, there should appear a Util.js file loaded by the Globals.xslt where the "readJSON" method will be available.

comment:3 by adube, 14 years ago

Summary: New 'Global' proxyNew 'Config' proxy

Instead of "GlobalProxy", we should call this new proxy "ConfigProxy" since it's directly designed to access the config methods directly.

comment:4 by adube, 14 years ago

Resolution: fixed
Status: assignedclosed

r859, featuring :

  • a new 'ConfigProxy' proxy.
  • proxy factory mechanism adjustment : When the proxy is accessed with osmservice=blank, it must have a osmprocess defined. Then, if it has a osmwidgettype defined, that means the proxy created is going to be a WidgetProxy, else it's a ConfigProxy. If osmservice!=blank, proceed as normal (with osmresouce to get a ServiceProxy).
  • Config.php now as "$m_objArrayProcessList = array()" property defining the list of processes (methods) the proxy has access to. An empty array (no process authorized) is the default value.
  • PGSQLMapContextConfig has one entry for this list : getAuthorizedResources.
  • Proxy.php now has json encoding method for 'result' and 'error' responses. See an example of use in ConfigProxy.php
  • Util.js was added in ./src/client/core/js. It should contain .js util methods, such as the new readJsonResponse (used to parse the json responses returned by the GeoPrisma proxy).
  • A sample of use of a 'config proxy call' was added to the ./samples/geoexttoolbar/pgsqlconfig sample. See the button on the upper right of the toolbar.

Work remaining to do :

  • documentation. Task moved to this ticket #127 which should includes all doc of all proxy.
Note: See TracTickets for help on using tickets.