Configuration proxies are a beautiful thing

Don't ask me what that means, I have no idea. I just came up with it. Proxy seemed like a good term, but I'll explain how it works, and why they were necessary.

I wanted to have filters on "dumbweb" (Read about dumbweb here). You know, the software running over at stringed.org... Well, filters are a configurable item. Just read this to learn all about them. "dumbweb" is a completely separate project, and you can't go writing very specific filter configuration parsing code in there. But, you would want dumbweb to be able to use filters in such a way that it's easy to configure, in the same config file where you define dumbweb. Hence the need for "configuration proxies".

Basically, now, in my dumbweb configuration xml, I can just write what would be in the filter configuration file but into the dumbweb configuration for the data item (i.e. "Picture") and a filter will show up for that item on the list page. Here's the xml

  <form className="jtccom.domain.data.pictures.Picture" name="Picture" listed="true">
    <filter helpIcon="https://storage.googleapis.com/jtc-public/static/images/helpicon.jpg">
      <fields>
        <field label="Album" name="PictureAlbumId" helpText="This is LONG overdue!!" />
        <field label="Labels" name="Labels" helpText="Search Labels" />
        <field label="# of Labels" name="Count(PictureId):PictureLabel" helpText="Find pictures with or without labels." />
      </fields>
    </filter>
    <operations>
      <operation name="edit" />
      <operation name="delete" />
      <operation name="add" />
      <operation name="view" />
    </operations>
  </form>


And basically what you see is the same as the filters on the Pictures, News and Downloads pages, only as a part of dumbweb. And those are configuration proxies. Configuration specifications that are used in the system but not in the current system, but the current system can... not load, but support or use the system that the proxy defines. So, dumb web configurations don't read the filter xml at all! It's read by the dumb filter system! It's neat. We can call this Configuration version 3. Read more about Configuration version 2 here, and that article links to version 1 if you're that interested.

blog comments powered by Disqus