cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Finding root directory of xMII.

Former Member
0 Kudos
1,029

Hi,

I need to find out the directory structure of xMII either through JavaScript or through xMII.

The example of the structure : e:/inetpub/wwwroot/...

When we say location.pathname in HTML or window.location in JavaScript it gives back the URL not the directory structure.

Could anyone please guide me through this?

Thanks,

Lavanya

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Lavanya,

Consider creating a global property in BLS which contains the default file structure unique to that system. The global property would be named the same on all systems. Now when you create a transaction, referencing the file structure is as simple as calling the global property.

Does this make sense?

Former Member
0 Kudos

Michael,

Sure it does.

Thats what I am doing right now.

The problem is I need to change the global property value every time I install the application on a different server.

So if I can find the directory structure and pass it to the global property this could be resolved.

Thanks,

Lavanya

Answers (4)

Answers (4)

Former Member
0 Kudos

Lavanya,

The closest solution to your answer would be to do call the following URL:

http://localhost/Lighthammer/Illuminator?Service=FileSystemBrowser&Base=WebRoot&Mode=DirectoryList&c...

The URL above will display the folder hierarchy in the WebRoot. However, it will not return the actual file path for the WebRoot. Here's why...

xMII is a web application which is hosted and managed via the ServletExec Web Application Server. ServletExec takes care of resolving the OS file hierarchy and allows xMII to use only relative paths for both the File Paths and URLs. This is built-in security for the Java Servlet Model.

To best tackle your scenario, I would recommend that you create a unique Global Property call "WebRoot" on each of your xMII Servers and set its value to the file path of your system: "C:\Inetpub\wwwroot". In your transactions, you only need to reference "Global.WebRoot" to access this property.

Former Member
0 Kudos

For xMII version 12. Use:

Web content is published to the file system

\sap\F48\JC30\j2ee\cluster\server0\apps\sap.com\xappsxmiiear\servlet_jsp\XMII\root\CM\R3

Three ways to save content to the database within the workbench

1) db://project/folder or db://project/WEB/folder

This method does not automatically publish content to the file system

The following URL can be used to force a publish

http://<server>:<port>/XMII/Catalog?mode=blowout&folder=project/folder

2 ) web://project/folder

Content is automatically publish

3 ) server://XMII/CM/project/folder/file.txt

Can be used in the same fashion as localhost is used in IIS

regards,

Federico

sufw
Active Participant
0 Kudos

Hi Lavanya,

Assuming you are running xMII on a Windows box, you can use an NTFS hardlink to create a virtual directory (e.g. C:\xMIILogs) which points to the "actual" directory in the file system tree (e.g. D:\Lighthammer\logs), which can be different between systems. You can create hardlinks via the command line or by using a tool called HardlinkShellExt; and since they are a function of the underlying file system, they are completely transparent to the operating system or any application (such as xMII).

If you create these hardlinks in the root of the C: drive (e.g. C:\xMIILogs), then you can reference them in the file/XML I/O actions in BLS using either Windows or UNIX-style file paths. Both "C:\xMIILogs" and "/xMIILogs" will correctly reference the hardlink, and writing to them will create files in D:\Lighthammer\logs (continuing the above example).

Hope this helps,

Sascha

Former Member
0 Kudos

Lavanya,

I understand that you are interested in exposing the xMII File Directory structure via Javascript but can you tell me what you are attempting to accomplish?

Thanks,

Michael Teti

Senior Solutions Architect

Infodat International, Inc.

mobile 713.598.8352

email michael.teti@infodatinc.com

web www.infodatinc.com

Former Member
0 Kudos

Hi Michael,

What I wanted is to pass that directory structure to XMLSaver action block in the BLS. XMLSaver needs the whole directory structure to save the XML file on the server.

XMII Directory structure might not be the same in every system on which my application is to be deployed. So I need to find out the directory structure and pass it to BLS.

Thanks,

Lavanya

Former Member
0 Kudos

Hi Lavanya,

Can you elaborate the scenario with one more example.....?what directory structure do you like to know actually. is it to web pages in xmii or any other.....?

regards,

Ravi Kumar

Former Member
0 Kudos

Actually I need this to save an xml file on the server using XmlSaver action block.

To do that URL is not sufficient. We need to give a path with directory

Ex. e:/inetpub/wwwroot/Application/MyDir/File.xml.

Here e:/inetpub/wwwroot/.. may not be the same for different systems on which the application is deployed.

Rest of my files web pages, queries etc.. are also in that path. So if I can retrieve that path name using either xMII or JavaScript I can use it in XmlSaver block.

Former Member
0 Kudos

Hi Lavanya,

In XmlSaver action block cofiguration give path as like

c:\Lighthammer\Your Dir\xmlfile.xml

Regards

Vijaya