2
votes

I'm creating a new Database from some SSJS code then copying selected design elements into it, setting the ACL and a few other things. I would like to set the the launch for the Notes and Web clients to open a specific XPage, rather than making the user open it in Designer and manually setting it (they may not have designer rights). I can locate them in the App Properties/database properties but I don't see a way in SSJS to be able to set them. I looked through the Notes Database methods and functions but don't see one that looks like it will do that.

2

2 Answers

4
votes

I found this in a forum: all flags explained:

Flag = Meaning / Action
4 = Allow Soft Deletes 
Z = Enable LZ1 Compression
f = Do Not Allow Stored Forms
z = Do Not Maintain Unread Marks
h = Mark Parent Document on Reply or Forward
J = Use JavaScript when generating Web Pages
F = Launch Designated Frameset
n = Never Show Policy (ie. Never show About Database when first opened)
7 = Large UNK Table (ie. allow more fields in database)
6 = Allow Design Locking
K = Restore as lasted viewed by user
c = Show About Database if Modified
Q = Replicate Unread Marks to Clustered Servers Only
U = Replicate Unread Marks to All Servers (appears with Q set)
2 = Optimise Document Table Bitmap
3 = Maintain LastAccessed Property
1 = Don't Support Specialised Response Hierarchy
M = Multilingual Database
X = Web Access Requires SSL Connection
8 = Web Access Don't Allow URL Open
i = Display Images After Loading
5 = Allow Document Locking
g = Database Type = Library
j = Database Type = Personal Journal
b = Database Type = Domino Directory
B = Database Type = Directory Catalog
m = Database Type = Multi DB Search
u = Database Type = Portfolio
A = Database Type = Mailbox
r = Database Type = Mailfile
p = Always Show About Database Document (ie. When Opened in the Client Property)
l = Launch Designated Navigator
s = Launch Designated Navigator in Own Window (used in conjuction with l above)
a = Launch First Attachment in About Database Document
d = Launch First DocLink in About Database Document
P = Web Launch = Show About Database Document
S = Web Launch = Open Designated Frameset
E = Web Launch = Open Designated Page
L = Web Launch = Open Designated Navigator in its Own Window
D = Web Launch = Open First DocLink in About Database Document
T = Web Launch = Open Designated DocLink
V = Web Launch = Open First Document in Designated View

The "new" launch options for XPages are missing though

EDIT (Sven Hasselbach):

e = Refresh on Admin Server 
G = Copy profile documents
H = Support response thread history
I = Inherit OS theme 
k = Launch composite application
N = Compress data docs
o = Launch outline
O = OOS Enabled
q = Compress design
t = -> marked as obsolete
v = No show view
W = Launch Webpage
9 = Is a web application
Y = DAOS enabled
w = Preview Pane Big Folder
x = Preview Pane Small View
y = Preview Pane Maximized
0 = Disable Automatic view update

Additional Fields

$TITLE: Array: 1. Title of the Database, an entry for every Category,  "#1Name of the inheriting Template", "#2Master template name".
$DefaultLanguage: Default DB language
$DefaultCollation: Default sort order
$AllowPost8HTML: "1" = Enabled enhanced HTML generation
$CollationType: "@UCA" = Unicode sorting
$LaunchXPageRunOnServer: "1"  = yes / "0" = no
$AllowRESTDbAPI: "0" = disabled / "1" = views / "2" = Views and documents
$DefaultClientXPage: Name of the XPage to open in the client
$DisableExport: "1" = disables export of view data 
$Daos: "0" = disabled / "1" = enabled
$UpdatedByLimit: Limit of updated by entries
$RevisionsLimit: Limit of revision entries
$DefaultXPage: Name of the XPage when opened in browser
7
votes

To my knowledge, this isn't something that you're "supposed" to do - there's not really an entry point in the API.

However, I expect that it would be possible to do this by modifying the icon note of the database, which stores this sort of information. You can get the icon note in any database by getting the document by ID of "FFFF0010" (it is consistent across databases). Once there, you can investigate tweaking the flags and fields to accomplish this.

From my poking around just now, it appears that the "launch designated XPage" for the web adds "!" to the $Flags field of the icon note, while the XPinC variant is (fittingly) "?". The XPage names are then stored in "$DefaultXPage" and "$DefaultClientXPage", respectively. So you could try (and I haven't done this, so I don't know whether it actually works):

var iconNote = someDB.getDocumentByID("FFFF0010");
iconNote.replaceItemValue("$Flags", iconNote.getItemValueString("$Flags") + "?!");
iconNote.replaceItemValue("$DefaultXPage", "SomePage.xsp");
iconNote.replaceItemValue("$DefaultClientXPage", "SomeOtherPage.xsp");
iconNote.save();

You may need an "iconNote.sign()" in there; I'm honestly not sure if that's required or does anything at all, but it's a habit I picked up for use when editing design notes a while ago.