9 Replies Latest reply on Apr 12, 2012 1:00 PM by NickBannister

    Invoking a DMS action from the applet

    Ricardo Av-Oracle
      My scenario:
      Have a button in the applet window (I know how to do this part)
      This button be clicked and it invoke our DMS servlet to perform an action. Example: ‘Show Amount of Invoices for part’. We want to invoke a servlet side action like AutoVue does.
      The applet talks to the VueServlet which in turns talks to our DMS servlet to perform actions.
      What I want to know is how to pass a request to the VueServlet that will get passed on to the DMS Servlet.
      So maybe have a class in our servlet called ‘GetPropCSI_CadCapture_GetCustomInformation’ passing all the normal expected objects.
      In our DMS Servlet we implement a class called GetPropCSI_DocDateLastModified which has the following code:
      public DMSProperty execute(DMSContext context, DMSSession session,
      DMSQuery query, DMSArgument[] args, Property property)
      throws VuelinkException {

      We want to be able to create GetPropCSI_CadCapture_GetCustomInformation and be able to invoke this via the applet button and return XML. We want to do it via the VueServlet and want to know how to create URLConnections to the servlet and pass what it needs to know to in turn hit the DMS Servlet.

      Any help on this would be appreciated as the documentation doesn’t explain how to create custom servlet side actions.

        • 1. Re: Invoking a DMS action from the applet
          Ricardo Av-Oracle
          The only way you have to invoke an action from the applet is to use the getproperties call
          inside the button, you will need to invoke the action through
          Vuebean.getProperty() method
          say you want to implement the action related to Invoices

          Property value = vueBean.getProperty("Invoices")
          the return value is a Properly object than has a hierarchy (ie children)
          it is a representation of the XML you filled on the DMS servlet side
          We do not recommend you send XML per se, but if it is required, your data needs to be enclosed properly (cdata escape sequence) and you need to make sure
          it will not be parsed during the decode of the info in the server (so watch out of parsing errors in the ISDK servlet and the server)
          If you need an example of how to implement such an action on the servlet (isdk) you can take a look at the GetPropCSI_IntelliStamp.java class
          to see how you can return complex data (or even a file)
          once that class is implemented it need to be registered with the VueLink
          by default it tries package.GetProp+name (in the example it would be GetPropInvoices)
          it can be customized to load any class through
          this is done through the connector servlet deployment descriptor file
          add the dms.getprops.Invoices=mypackagename.myclassname

          Hope this helped
          • 2. Re: Invoking a DMS action from the applet
            Thanks Ricardo,

            That makes most sense, I need to put the knowledge into practice now though.
            The example sounds perfect for obtaining information but lets say I wanted the DMS Servlet to perform an actual action.
            Lets says I wanted to store markup notes that have been created in another database, is it possible to apply the same knowledge to implement a class that does something like ActionSave and call this from the applet button?

            The thing I think I am missing here is how do I pass information back to the GetProp**** or Action**** class?

            Thanks in advance!

            • 3. Re: Invoking a DMS action from the applet
              I think I did something like that when customizing the Save Markup dialog. And it was a little nightmare to find the proper calls, but they are there.

              In my case, I inherited the VueFrame to generate a dialog, and through its methods I could access the calls this way:


              +// Update the frame's markup properties (redundant for an existing markup, yet harmless)+
              mkProps = thisMarkup.getProperty();

              +// Save the markup+
              check = vueFrame.getVueController().saveMarkup(vueFrame.getActiveVueBean(), markupBean.getActiveMarkup());*
              +// Close the dialog; if any error shows, the pop-up dialog emerges from elsewhere+


              So in my case, the save markup action was invoked through the frame -> VueController -> Its methods. By using that method in the applet, ActionSave was called with the proper parameters. My guess is, for any existing action in the applet, the method will be similar. For custom actions, though, you will probably need to extend the frame or the controller on both ends, but have no idea about how to do that.

              I hope this helps.

              Edited by: Jordi Bosch on Apr 11, 2012 12:50 PM
              • 4. Re: Invoking a DMS action from the applet
                Thanks Jordi,

                I have done what you have suggested before but not really what I was after.
                I wonder if we could use a URLConnection and post the write data to the request in order to get the VueServlet to behave how we want?

                When the VueServlet is hit for a save or more specifically in my case I want to save markup entity data to another database so I want to be able to post my own data back to the DMS servlet.
                Doing this from the applet has security implications which I want to avoid.

                So take the following and say change <Save></Save> to <SaveEntityData></SaveEntityData> and this be mapped to a dms action called ActionSaveEntityData.
                It seems a waste that the VueServlet can pass data to the DMS servlet to perform actions like save when it needs but not be used to invoke other custom actions when requested to save other 'stuff'

                Thanks in advance for any help.

                <Property name="CSI_DocName"><![CDATA[NB1]]>]]&gt;<![CDATA[</Property>
                <Property name="CSI_MarkupType"><![CDATA[normal]]>]]&gt;<![CDATA[</Property>
                <Property name="CSI_BaseDocID"><![CDATA[17514;1;2355;2000]]>]]&gt;<![CDATA[</Property>
                <Property name="CSI_Compression"><![CDATA[true]]>]]&gt;<![CDATA[</Property>
                <Property name="DMS_HOSTNAME"><![CDATA[WIN2008LL971]]>]]&gt;<![CDATA[</Property>
                <Property name="DMS_SOCKETPORT"><![CDATA[2099]]>]]&gt;<![CDATA[</Property>
                <Property name="DMS_LL_VER"><![CDATA[9.7.1]]>]]&gt;<![CDATA[</Property>
                <Property name="DMS_SERVERPORT"><![CDATA[80]]>]]&gt;<![CDATA[</Property>
                <Property name="DMS_REMOTEADDRESS"><![CDATA[fe80::8dbf:4209:9e2c:8970%11]]>]]&gt;<![CDATA[</Property>
                <Property name="DMS_SERVERADDRESS"><![CDATA[http://WIN2008LL971/livelink/llisapi.dll]]>]]&gt;<![CDATA[</Property>
                <Property name="DMS_USERNAME"><![CDATA[Admin]]>]]&gt;<![CDATA[</Property>
                <Property name="DMS_CSI_PSW"><![CDATA[]]>]]&gt;<![CDATA[</Property>
                <Property name="DMS_CONNECTIONNAME"><![CDATA[livelink]]>]]&gt;<![CDATA[</Property>
                <Property name="DMS_DSDOMAIN"><![CDATA[]]>]]&gt;<![CDATA[</Property>
                <Property name="DMS_DSSTATUS"><![CDATA[OFF]]>]]&gt;<![CDATA[</Property>
                <Property name="DMS_ENABLELISTRENDITION"><![CDATA[true]]>]]&gt;<![CDATA[</Property>
                <Property name="GUIFILE"><![CDATA[CCMarkup.gui]]>]]&gt;<![CDATA[</Property>
                <Property name="COMMENTSWEBSERVICE"><![CDATA[]]>]]&gt;<![CDATA[</Property>
                • 5. Re: Invoking a DMS action from the applet
                  I had a similar issue. Save markup with its properties, or just save the properties? To separate custom actions or to use only the already existing ones?

                  In the end, my solution was to "use what I have been given": I generated a special property that discriminates the final back end action. So, in my system, "Save" will route all save actions, be it markups or properties, and an internal property acts as its selector. This way, both "save markup" and "save markup properties" in my system are passed from the applet as the same standard action, but on the ISDK back end I discriminate both through a custom property.

                  So this way, all database interaction ends being done in the back end of the ISDK, using Properties to pass data or conditions. Of course, you can add more custom properties if you need to pass connection details.

                  Edited by: Jordi Bosch on Apr 11, 2012 2:53 PM
                  • 6. Re: Invoking a DMS action from the applet
                    Thanks Jordi,

                    So how did you pass your information back to the back end? From Ricardo's original post I can see how to invoke a custom action but it doesn't really show how to pass additional information with the request?

                    • 7. Re: Invoking a DMS action from the applet
                      I am not sure about this one. In my case, for the dialog I used as carriers elements already present on the original dialog, which were GUIElements in private DMSProperty buildMarkupDefaultGuiEdit(DMSBackendImp be).

                      To get back data from the back end to the applet, I guess you have to get again the bean:

                      bean = getActiveVueBean();

                      or its derived properties:

                      Property masterMarkup = bean.getMarkupProperty();
                      Property[] listMarkups = masterMarkup.getChildrenWithName(Property.PROP_MARKUP);

                      In my case, the second one appears to be enough to update the properties from the applet side.
                      • 8. Re: Invoking a DMS action from the applet
                        Ricardo Av-Oracle
                        Same strategy applies to the save markup
                        when there is a markup save query, the VueLink servlet gets invoked with the save command
                        that command has properties in them (describe the markup ie name, type, etc)
                        nothing prevents you from intercepting this call (or implementing the way you want) and
                        execute an extra step if you wish to do so
                        This markup save, will only be invoked for code relative to your integration
                        If you need to pass extra info (by that I mean values not files), you can use the Property associated to a markup
                        You could even customize your code to append extra data if that is not dome by the integration servlet (not recommended though)
                        Not all of the parameters on the property are shown, visibility of the various elements is controlled by the GUI section inside the CSI_Markups request

                        So you can have custom actions implemented as part of the markup save operations for markups files
                        that have an special property defined
                        when your file has an associated document property defined on the backend

                        The first approach will need to either hardcode a value or to query the backend for it when replying to the CSI_MArkup query
                        the latter will invoke the backend when the save operation is invoked. Not a big difference.
                        • 9. Re: Invoking a DMS action from the applet
                          Thanks Jordi,

                          Do you have a code example you do not mind sending me to see how you did things?
                          I really would prefer a way to pass information back rather than get information.

                          Ricardo/Jordi: Do you think one of you could help me with another question on post - GUI files - using japplet.setGUI() security risk
                          All the questions I have ask are to do with a project we are working on mostly and the fast responses are very much appreciated, so thanks in advance.



                          Edited by: NickBannister on Apr 12, 2012 5:57 AM