« - »

Look-up Tables: LookupTableJsonServlet revisited

17 March 2009

I know that I said that we would work on the client-side modifications to the look-up table definitions edit next, but after looking over the changes that were going to be needed, I came across a little something that will need to be addressed first.

One of the features of the Look-up Table service is that you can define a property in a look-up table that another look-up table defined as its source. You can read more about this concept here. Now that we have introduced the idea of the context, though, we have a little issue that needs to be resolved regarding the possible sources for a look-up table property.

In the current system, the drop-down list of choices for a property’s source comes from the list of all look-up tables. Now that look-up tables have been separated into specific contexts, we need to decide if the list of potential sources comes from all tables (in which case the “source” will have to be expressed as <context>/<tableName>), or if the potential sources should be limited to just those look-up tables in the specific context of which this particular table is a member.

On top of the philosophical decision, is of course, the technical ramifications. When we modified the LookupTableJsonServlet to accomodate the new context, we assumed that the context would be passed as a parameter, limiting the servlet’s output to just those tables in the specified context. If we elect to allow sourcing from outside the current context, this will obviously need to change. On the other hand, the current design of the example table definition edit page does not include the context as a parameter in the existing script tag that pulls in the JSON object produced by this servlet. Since the context is now passed to this page via a query string parameter, the query string will first have to be parsed and the context value extracted before this JSON object can be retrieved using the context. This will require a change to the way in which this script is brought into the page.

At this point, I think the safest thing to do would be to expand the output of the LookupTableJsonServlet to potentially include all tables from all concepts, with the option of limiting the results by passing in a specific context. This way, this servlet will support both approaches, and we can then elect to go either way on the client side.

We better do that first, before we take on the actual edit page changes.


Leave a reply

You must be logged in to post a comment.