Topic
  • 4 replies
  • Latest Post - ‏2014-08-16T16:15:39Z by DanieleVistalli
DanieleVistalli
DanieleVistalli
11 Posts

Pinned topic How to generate artifacts in a WEF project in a builder

‏2014-08-14T17:38:33Z |

Hi, I'm succesfully creating new builders to automate some of our development tasks and I'm really happy with the builder system / extension points.

 

Now I need to extend my builders in a couple of ways:

  • To generate "files" in the WEF project (at design time) to persist configuration items that don't need to be generated at runtime
  • To create .java classes in the project that are then used in the project as LJO (think my builder creates the class and then uses it as LJO in the model)

The question is.. 

What's the correct API to use inside a doBuilderCall method to identify the filesystem of the WEF designer project and the related paths (the WEF source code path, the Web Content directory) and so on.

Can somebody provide sample code about this ?

Thanks a lot.

Updated on 2014-08-14T17:38:57Z at 2014-08-14T17:38:57Z by DanieleVistalli
  • mburati
    mburati
    2570 Posts

    Re: How to generate artifacts in a WEF project in a builder

    ‏2014-08-14T17:53:35Z  

    The answer to how to determine the project WebContent root and serve-able content root should be answered here in the product javadoc:

    http://infolib.lotus.com/resources/portletfactory/8.5.0/WEFABD002/en_us/api/com/bowstreet/util/SystemProperties.html#getDocumentRoot()

     

    As to creating files in the project only at design time, that's a slightly different question, as builders run on every regen (every time you add another builder to the model, when the model's run on the server etc), rather than a one-time task.   A couple of core builders do write files from their coordinators at design time (coordinators run only at design time as a result of initialiizing the builder's UI, changing inputs in a builder call etc).

    I hope that info helps,
    ..Mike Burati 
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
  • gsager
    gsager
    135 Posts

    Re: How to generate artifacts in a WEF project in a builder

    ‏2014-08-15T13:09:38Z  
    • mburati
    • ‏2014-08-14T17:53:35Z

    The answer to how to determine the project WebContent root and serve-able content root should be answered here in the product javadoc:

    http://infolib.lotus.com/resources/portletfactory/8.5.0/WEFABD002/en_us/api/com/bowstreet/util/SystemProperties.html#getDocumentRoot()

     

    As to creating files in the project only at design time, that's a slightly different question, as builders run on every regen (every time you add another builder to the model, when the model's run on the server etc), rather than a one-time task.   A couple of core builders do write files from their coordinators at design time (coordinators run only at design time as a result of initialiizing the builder's UI, changing inputs in a builder call etc).

    I hope that info helps,
    ..Mike Burati 
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.

    The builders that do create files generally use BSConfig.getHtmlRootDir() to get the relative path to create their files from. Also after creating the file there is a call in the coordination context that lets you get the IDesigner interface that has a method that allows you to refresh a folder or the workspace so that eclipse knows of this file and will display it in the Project Explorer.

  • mburati
    mburati
    2570 Posts

    Re: How to generate artifacts in a WEF project in a builder

    ‏2014-08-15T20:45:54Z  
    • gsager
    • ‏2014-08-15T13:09:38Z

    The builders that do create files generally use BSConfig.getHtmlRootDir() to get the relative path to create their files from. Also after creating the file there is a call in the coordination context that lets you get the IDesigner interface that has a method that allows you to refresh a folder or the workspace so that eclipse knows of this file and will display it in the Project Explorer.

    That BSConfig.getHtmlRootDir API Garry refers to is an internal API subject to change, as the javadoc states.   The SystemProperties getDocumentRoot method is documented for public use afaik, as seen in the above javadoc link.

     

    I hope that info helps,
    ..Mike Burati 
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
  • DanieleVistalli
    DanieleVistalli
    11 Posts

    Re: How to generate artifacts in a WEF project in a builder

    ‏2014-08-16T16:15:39Z  
    • mburati
    • ‏2014-08-15T20:45:54Z

    That BSConfig.getHtmlRootDir API Garry refers to is an internal API subject to change, as the javadoc states.   The SystemProperties getDocumentRoot method is documented for public use afaik, as seen in the above javadoc link.

     

    I hope that info helps,
    ..Mike Burati 
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.

    Thanks everybody for the answers and clarifications. I'll do sone test and will report about my experiences.

    Thanks again.