IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Read externalized property file in portlet web application

  • 1.  Read externalized property file in portlet web application

    Posted Thu August 30, 2012 07:41 AM

    Hi All,

    Is it possible to read externalized property files in portlet application by using relative path? If not, could you please advise the best way to read externalized property files in portlet web application?

    Per my observation, with relative path - system is loading property file only if the file is present inside web application but not able to access it if the file is externalized.

    Kind regards,
    Raj


    #webMethods-BPMS
    #MWS-CAF-Task-Engine
    #webMethods


  • 2.  RE: Read externalized property file in portlet web application

    Posted Thu August 30, 2012 04:20 PM

    What is your file relative to?


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS


  • 3.  RE: Read externalized property file in portlet web application

    Posted Thu August 30, 2012 08:33 PM

    Hi Eric,
    CAF pacakge got deployed at <wm_home>/MWS/server/default/deploy/

    External file is present at

    <wm_home>/MWS/server/default/deploy/portal.war/foldername/filename.xml

    regards,
    Raj


    #webMethods-BPMS
    #webMethods
    #MWS-CAF-Task-Engine


  • 4.  RE: Read externalized property file in portlet web application

    Posted Thu August 30, 2012 09:02 PM

    MWS has some file locators to resolve the real file location for paths:

    For example:

    //get the real file location
    String realFileLocation = com.webmethods.rtl.util.FileUtil.getRealLocation("webroot:/foldername/filename.xml");
    
    //or get an input stream for the file content
    InputStream fileInputStream = com.webmethods.rtl.util.FileUtil.getInputStream("webroot:/foldername/filename.xml");

    The webroot:/ prefix resolves from MWS/server/default/deploy/portal.war/

    …and there are other resolvers for other roots:
    The dist:/ prefix resolves from MWS/
    The root:/ prefix resolves from MWS/server/default/
    The deploy:/ prefix resolves from MWS/server/default/deploy/


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods


  • 5.  RE: Read externalized property file in portlet web application

    Posted Fri August 31, 2012 02:50 AM

    Thanks Eric for your inputs. It worked.

    regards,
    Raj


    #webMethods-BPMS
    #webMethods
    #MWS-CAF-Task-Engine