Skip to Content
author's profile photo Former Member
Former Member

Accessing systems.xml in Java Custom iView

Hello,

Is there a way to access the systems.xml file within a Java Custom iView ?. If so would appreciate any tips.

Basically I need to read the name of an sap server (example BW system) that is in the systems.xml file in the java file.

Thanks,

Sunil

Add comment
10|10000 characters needed characters exceeded

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 18, 2004 at 06:32 PM

    Hello...

    test with this:

    // get the system landscape service

    ILandscapeService landscapeService = (ILandscapeService) request.getService(ILandscapeService.KEY);

    // get the system specified in the property File in property "SystemIdentifier"

    String systemName = myProfile.getProperty(PROPERTY_SYSTEM);

    // get the system information from landscape service

    IEPSystem system = landscapeService.getEPSystem(systemName);

    // check if system is maintained in systems.xml

    if (system != null) {

    // get all attribute of system defined in systems.xml

    Iterator it = system.getAttributeKeys().iterator();

    while (it.hasNext()) {

    String key = (String) it.next();

    //you can look for the attribute that you want

    String str = system.getAttribute(key); // value of atribute

    }

    }

    I hope helps you...

    Thanks

    Luis..

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      Thanks. Looks like i need to include a .jar file in the library to accomodate ILandscapeService. Not sure which one to include. Let me know. Many thanks.

      Sunil

  • author's profile photo Former Member
    Former Member
    Posted on May 19, 2004 at 01:24 PM

    Hello...

    Landscape is a service that you must add in the file properties.

    ServicesReference=htmlb, usermanagement, landscape

    To do import in your file java:

    com.sapportals.portal.prt.service.landscape.ILandscapeService;

    Luis...

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 20, 2004 at 02:43 PM

    Thanks. It works. Now i can access attributes within system.xml.

    However is there a way to access attributes of any custom xml file (as opposed to systems.xml) I choose to implement in Java iView. If so, using the code above how would i be able to reference this custom xml file in my java code.

    Many thanks for your help

    Sunil

    Add comment
    10|10000 characters needed characters exceeded