• Dynamically Creating Bookmarks

    By Trevor J Denner 1 decade ago

    Christian - I have just downloaded the latest code .. great project .. THANK YOU .. Question .. is there a way to dynamically create bookmarks .. or if I have 30 different documents types do I have to create 30 different XPages?

    • A Part of the API is exposed

      By Christian Güdemann 1 decade ago

      Hello Trevor

      I think, we have exposed a part of the API, but let me double check. Your user story is: Based on a specific criteria, you want to generate the bookmarks "by hand/ code" and generate then the resulting document? Also the Template Resource is selected by these criteria?

      I will talk with our team, if we have already a code snipped for this user story.

      Best regards

      Christian

      • Use Case

        By Trevor J Denner 1 decade ago

        Christian - Many thanks for the quick response. The use case is that all of the data is stored in the database (there is actually no data input) .. the application is a case management system where there are a number of actors (Patient - the person who is having a service performed on them, Doctor - who is performing the service, Client - who is paying for the service, Patient Attorney, Client Attorney, Nurse, etc) .. there are a number of events such as an appointment is made, the patient did not show etc that require letters to be generated in the case of an appointment being made a letter to the patient confirming, a letter to the doctor, a letter to the client attorney etc. From looking at the example of the POIBean (code snippet below) , I thought this might be the answer .. but the example is currently failing and I have not been able to debug/ test (I will start another thread about this) .. and was also not sure why this was wrapped in a REST service .I have attached a sample of a letter ..

        var lstBM = new java.util.ArrayList();

        lstBM.add(poiBean.buildDocumentBookmark("name", sessionScope.name));

        lstBM.add(poiBean.buildDocumentBookmark("address", sessionScope.address));

        lstBM.add(poiBean.buildDocumentBookmark("zip", sessionScope.zip));

        lstBM.add(poiBean.buildDocumentBookmark("location", sessionScope.location));

        lstBM.add(poiBean.buildDocumentBookmark("e-mail", sessionScope.email));

        var result = poiBean.processDocument2Stream(template, lstBM);

         

        • Nice usecase. I love it :)

          By Christian Güdemann 1 decade ago

          Hi Trevor

          You are on the right path with using the PoiBean, please try version 1.2.5. We have fixed a backwards compatibilty problem in the API. You can use the PoiBean also direct in the Java Classes with PoiBean bean = PoiBean.get();

          We have implemented the testcase with a REST Service, because a REST Service is asynchronusly called and not the whole Page has to be refresehd. Otherwise all your calculation has to be done during the JSF Lifecycle and thats not a cool user experience (we think).

          Hope that you have success. Let us know. It would be cool, if you could blog about.

          Best regards

          Christian

          • Thanks - I will be working on it today

            By Trevor J Denner 1 decade ago

            Christian

            Thanks for the quick response - I will certainly let you know how I get on.

            btw .. the current implementation (not XPages) that I developed and have been using for a while is LotusScript and OLE and extends the Tag to include a symbolical for the document (there are a number of related documents) and format information for dates and numbers <> would take the field dteRefDate in the REF(ferral) document and format it as dd-mmm-yyyy.  This can also allows basic formatting of multivalued fields by allowing separator to be defined <>