Home > Domino Tips > Developer > LotusScript > Access Lotus Notes shared resources with a dynamic Domino URL command
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

LOTUSSCRIPT

Access Lotus Notes shared resources with a dynamic Domino URL command


deepali S
07.31.2007
Rating: -4.22- (out of 5) Hall of fame tip of the month winner


Lotus Notes and Domino tips, tutorials and how-to articles
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


VIEW MEMBER FEEDACK TO THIS TIP
There is a dynamic Lotus Domino R6 URL command called "?OpenFileResource" that can be used to access any shared resource in a Lotus Notes database. The code in this tip can also be used with all Domino URLs that relate to the same Lotus Notes database.
Related information from SearchDomino.com:
Opening a Word doc from a shared resource file in LotusScript

LotusScript advice

LotusScript Learning Guide

LotusScript Reference Center

In fact, if you need to access other Lotus Notes databases on the same host, you can still omit the host argument and simply use the file name or the replica ID preceded by two underscores.

If you need to access a Lotus Notes database on a different Domino server, you need to provide that Domino server's hostname or IP address.

The formula in the given code dynamically obtains the name of the Lotus Notes database in this line:

cDBName := @ReplaceSubstring
(@Subset(@DbName;-1);"\";"/") 

In the above code, @DbName returns a text list that contains the Domino server name and the Lotus Notes database.

@Subset(@DbName; -1) produces the name of the Domino server. However, the name of the Domino server and the hostname are not the same. The hostname is the name associated with the server's IP address in Domain Name System (DNS), or the IP address.

You can find the name of a Domino server in the HTTP section of the server document under "Internet Protocols." If the entry is blank, it uses the name of the machine on which the Domino server runs.

The @ReplaceSubstring command flips the backslash to a forward slash to support Web addressing if the Lotus Notes database contains a long path, such as DDriveMyapp.nsf.

 
REM "/host/database/style.css?OpenFileResource";
cLink := 
"<LINK REL=STYLESHEET HREF=" ;
cDBName := @ReplaceSubstring
(@Subset(@DbName;-1);"\";"/");
cFileName := "style.css";
cLink + "/" + cDBName + "/" + 
cFileName + "?OpenFileResource" +">"

MEMBER FEEDBACK TO THIS TIP

In my opinion, it's more efficient to retrieve the "URL ready" database file path using the @WebDbName command:

cDBName := @WebDbName; 

It's much simpler than using the "old fashioned":

cDBName := @ReplaceSubstring
(@Subset(@DbName;-1);"\";"/"); 

—Tomas Z.

******************************************

I agree with Tomas Z. in that the newer @WebDbName formula is easier. Also,
"?OpenFileResource" is not new to Lotus Notes Domino R6; this has been around since R5.
—Mike M.

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip library by member Deepali S. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes, Domino, Workplace or WebSphere tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.

Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



RELATED CONTENT
LotusScript
LotusScript agent parses ACL to Microsoft Notepad
LotusScript finds the first occurrence of a string from the right
Clear Recent Contacts view and prevent repopulation in Lotus Notes 8.x
Search Microsoft Active Directory with LotusScript
Three steps to trap and handle save conflicts with LotusScript
Troubleshoot agents by displaying LotusScript variables online
LotusScript sorts lists alphabetically
Run or restart Notes/Domino agents via text messages
LotusScript code rebuilds corrupted busytime.nsf file
Soft-code item names to facilitate LotusScript management

LotusScript
LotusScript agent parses ACL to Microsoft Notepad
LotusScript finds the first occurrence of a string from the right
Clear Recent Contacts view and prevent repopulation in Lotus Notes 8.x
Search Microsoft Active Directory with LotusScript
Three steps to trap and handle save conflicts with LotusScript
Troubleshoot agents by displaying LotusScript variables online
LotusScript sorts lists alphabetically
LotusScript code rebuilds corrupted busytime.nsf file
Soft-code item names to facilitate LotusScript management
LotusScript agent automates selective mail file replication

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts