Topic
3 replies Latest Post - ‏2013-10-18T18:33:00Z by damorris
MGamboa
MGamboa
83 Posts
ACCEPTED ANSWER

Pinned topic Choice List and Validation

‏2013-10-18T14:27:00Z |

After reviewing the "Customizing and Extending
IBM Content Navigator" document along with sampleEDSService and samplePlugin, I was able to find information on the server side for creating the json data to support choice list and validation.

However, I was not able to find examples or information on how the client side attribute inputs associate with the server side methods that produce the json data the inputs require.

Can some information be given here?

Thanks,

Martin

  • BJOwings
    BJOwings
    185 Posts
    ACCEPTED ANSWER

    Re: Choice List and Validation

    ‏2013-10-18T17:15:27Z  in response to MGamboa

    Martin,

    Hopefully I understand your question right in that you want a general description of the flow.  I can explain add document and property editing.  Workflow is similar but if you need more detail on that myself or Bob can provide it.

    Probably the easiest way to understand it is with the requests that are sent from the browser client.  (You can watch these using firebug with firefox or google chromes developer with the net tab.)  The sequence goes like this:

    • On the first selection of a unique content class in add document or edit properties, a /navigator/p8/openClass.do request will be sent.  The response of this request will have initial choice lists for the properties.  By default these are from the content server, but if an EDS is handling that class it will be invoked to supply the choices lists (and other overrides).   The UI will take that response and build drop-downs and other widgets to provide the right interface.
    • Another piece of information returned on the openClass.do for each property is a flag indicating if that property has dependent properties.  This corresponds to the "hasDependentProperties" flag on the EDS response and is what causes the UI to make a request to the server to update choice lists after the property changes value.   A /navigator/p8/getDependentAttributeInfo.do  request will be made, which will be handled in the server by making an EDS request.  The EDS response will then be processed on the midtier and an updated definition, similar to what would be returned from openClass, is returned to the client.   The client then updates the UI for property editing, in particular the dropdowns for choice lists.
    • When the user presses Add or Save, the server is sent a /p8/addItem.do or /p8/editAttributes.do request.  EDS is again invoked and it can perform validation on the values and return field-level errors.  If it does not, the normal handling of these requests will add or save the document properties.

    - Brian

    • MGamboa
      MGamboa
      83 Posts
      ACCEPTED ANSWER

      Re: Choice List and Validation

      ‏2013-10-18T18:29:14Z  in response to BJOwings

      Hi Brian,

      Thanks for the information.  As you said that gives a good workflow of the interaction because the client and server.  However, there is still some confusion I have with setting up the client side code.  Do I use the AttributeDefinition JS object to load choicelist and validation data obtained from the EDS service method created.  How do I associate a specific service method that will generate specific attribute choice list and/or validation json for that attribute?

      Thanks,

      Martin

      • damorris
        damorris
        656 Posts
        ACCEPTED ANSWER

        Re: Choice List and Validation

        ‏2013-10-18T18:33:00Z  in response to MGamboa

        If you are specifically using EDS, then you shouldn't need 'client side' code - that's what the out-of-the-box edsPlugin.jar provides.  That is the EDS client side that the Content Navigator team implemented and supports.  Basically, the point of EDS in Content Navigator is that you only have to write the 'server-side' REST service code - i.e. the business logic.  We (IBM Content Navigator team) take care of the client side logic.