...
The Database Properties are available via the getDatabaseProperties
and setDatabaseProperties
methods. The getter returns a List<DatabaseProperties>
List<DbProperties>
object and the setter takes a Map<DatabasePropertiesMap<DbProperties, boolean>Boolean>
. However, some Database Properties cannot be set because they have specific setter methods (template name) or need to be enabled via server commands (e.g. DAOS). Below are the details of all the Database Properties available, where they appear on the Database Properties infobox and setter information.
On Infobox | Label | Database Property | Stored As | Value | Notes | ||
---|---|---|---|---|---|---|---|
Basics Tab | Use JS when generating pages | USE_JS | usejavascriptinpages attribute | false | Missing in DXL if checked | ||
Basics Tab | Require SSL | REQUIRE_SSL | requiressl attribute | true | Missing in DXL if not checked | ||
Basics Tab | Don't Allow URL Open | NO_URL_OPEN | nourlopen attribute | true | Missing in DXL if not checked | ||
Basics Tab | Enable Enhanced HTML Generation | ENHANCED_HTML | $AllowPost8HTML item in Icon | 1 | Missing if not checked | ||
Basics Tab | Don't Allow ICAA | BLOCK_ICAA | $DisallowOpenInNBP item in Icon | 1 | Missing if not checked | ||
Basics Tab | Disable Background Agents | DISABLE_BACKGROUND_AGENTS | allowbackgroundagents attribute | false | Missing if not checked | ||
Basics Tab | Allow Stored Forms | ALLOW_STORED_FORMS | allowstoredforms attribute | false | Missing if checked | ||
Basics Tab | Display Images After Loading | DEFER_IMAGE_LOADING | imageloadsdeferred attribute | true | Missing in DXL if not checked | ||
Basics Tab | Allow Document Locking | ALLOW_DOC_LOCKING | allowdocumentlocking attribute | true | Missing in DXL if not checked | ||
Basics Tab | Inherit OS Theme | INHERIT_OS_THEME | inheritostheme attribute | true | Missing in DXL if not checked | ||
Cache Expiry Days (DDE) | CSS files | $CSSExpires in Icon | 2 | setCssExpiry(int), use Integer.MIN_VALUE to remove it. Added in ODA 4.3.0 | |||
Cache Expiry Days (DDE) | Files | $FileExpires in Icon | 2 | setFileExpiry(int), use Integer.MIN_VALUE to remove it. Added in ODA 4.3.0 | |||
Cache Expiry Days (DDE) | Image Files | $ImageExpires in icon | 2 | setImageExpiry(int), use Integer.MIN_VALUE to remove it. Added in ODA 4.3.0 | |||
Cache Expiry Days (DDE) | JavaScript Files | $JSExpires in Icon | 2 | setJsExpiry(int), use Integer.MIN_VALUE to remove it. Added in ODA 4.3.0 | |||
Design Tab | Allow Design Locking | ALLOW_DESIGN_LOCKING | allowdesignlocking attribute | true | Missing in DXL if not checked | ||
Design Tab | Show in Open Dialog | SHOW_IN_OPEN_DIALOG | showinopendialog attribute | false | Missing in DXL if checked | ||
Design Tab | Include in Multi-Db Indexing | MULTI_DB_INDEXING | multidbindexed attribute | true | Missing in DXL if not checked | ||
Design Tab | Don't Mark Modified Unread | MODIFIED_NOT_UNREAD | markmodifiedunread attribute | false | Missing in DXL if not checked | ||
Design Tab | Mark Parent on Reply / Forward | MARK_PARENT_REPLY_FORWARD | trackreplyforward attribute | true | Missing in DXL if not checked | ||
Design Tab | Inherit Design from Master Template | INHERIT_FROM_TEMPLATE | fromtemplate attribute | demoDatabase | Database Property determines if the database is set to inherit from a template. Use getTemplateName() to get the name of the template it inherits from. setTemplateName(String) must be used to set / clear the property. | ||
Design Tab | Database File is a Master Template | DB_IS_TEMPLATE | templatename attribute | demoDatabase | Database Property determines if the database is a template. Use getNameIfTemplate() to get the template name. setNameIfTemplate(String) must be used to set / clear the property. | ||
Design Tab | List as Advanced Template in 'New Application' Dialog | ADVANCED_TEMPLATE | advancedtemplate attribute | true | Missing in DXL if not checked | ||
Design Tab | Multilingual | MULTILINGUAL | multilingual attribute | true | Missing in DXL if not checked | ||
Launch Tab | Run server-based XPages apps directly on Server | LAUNCH_XPAGE_ON_SERVER | $LaunchXPageRunOnServer on Icon | 1 | Missing if not checked | ||
Advanced Tab | Don't Maintain Unread | DONT_MAINTAIN_UNREAD | maintainunread attribute | false | Missing in DXL if checked | ||
Advanced Tab | Replicate Unread Marks | REPLICATE_UNREAD | replicateunread attribute | all | Use specific setter, setReplicateUnreadSetting(UnreadReplicationSetting) , to set or unset. | ||
Advanced Tab | Optimize Document Table Map | OPTIMIZE_DOC_MAP | optimizetablebitmap attribute | true | Missing in DXL if not checked | ||
Advanced Tab | Don't Overwrite Free Space | DONT_OVERWRITE_FREE_SPACE | overwritefreespace attribute | false | Missing in DXL if checked | ||
Advanced Tab | Maintain Last Accessed | MAINTAIN_LAST_ACCESSED | savelastaccessed attribute | true | Missing in DXL if not checked | ||
Advanced Tab | Disable Transaction Logging | DISABLE_TRANSACTION_LOGGING | logtransactions attribute | false | Missing in DXL if checked | ||
Advanced Tab | Don't Support Special Response Hierarchy | NO_SPECIAL_RESPONSE_HIERARCHY | allowspecialhierarchy attribute | false | Missing in DXL if not checked | ||
Advanced Tab | Use LZ1 Compression | USE_LZ1 | uselz1 attribute | true | Missing in DXL if not checked | ||
Advanced Tab | Don't Allow Headline Monitoring | NO_HEADLINE_MONITORING | allowheadlinemonitoring attribute | false | Missing in DXL if not checked | ||
Advanced Tab | Allow More Fields | ALLOW_MORE_FIELDS | increasemaxfields attribute | true | Missing in DXL if not checked | ||
Advanced Tab | Support Response Thread Hierarchy | SUPPORT_RESPONSE_THREADS | supportrespthread attribute | true | Missing in DXL if not checked | ||
Advanced Tab | Don't Allow Simple Search | NO_SIMPLE_SEARCH | nosimplesearch attribute | true | Missing in DXL if not checked | ||
Advanced Tab | Compress Design | COMPRESS_DESIGN | compressdesign attribute | true | Missing in DXL if not checked | ||
Advanced Tab | Compress Data | COMPRESS_DATA | compressdata attribute | true | Missing in DXL if not checked | ||
Advanced Tab | Disable Auto-Update Views | NO_AUTO_VIEW_UPDATE | noautoviewupdate attribute | true | Missing in DXL if not checked | ||
Advanced Tab | Disable Export of View Data | NO_EXPORT_VIEW | $DisableExport in Icon | 1 | Missing if not checked | ||
Advanced Tab | Allow Soft Deletions | ALLOW_SOFT_DELETE | allowsoftdeletion attribute | true | Missing in DXL if not checked | ||
Advanced Tab | Permanently Delete Documents After | SOFT_DELETE_EXPIRY | softdeletionsexpirein attribute | 48 | Use setSoftDeletionsExpireIn(int) to set. If integer.MIN_VALUE is passed, soft deletions are disabled and this attribute reset to 48. | ||
Advanced Tab | Limit $UpdatedBy | MAX_UPDATED_BY | maxupdatedbyentries attribute | 32 | Use setMaxUpdatedBy(int) with a value greater than 0. If 0 or less, the attribute is removed. | ||
Advanced Tab | Limit $Revisions | MAX_REVISIONS | maxrevisionentries attribute | 32 | Use setMaxRevisions(int) with a value greater than 0. If 0 or less, the attribute is removed. | ||
Advanced Tab | Allow DAS | ALLOW_DAS | $AllowRESTDbAPI | in Icon | 1 | 0 = NONE, 1 = VIEWS, 2 = VIEWSANDDOCUMENTS Database Property identifies if it's 1 or 2. Use | |
Not Exposed | DAOS | DAOS_ENABLED | $Daos in Icon | ||||
Launch | Run server-based XPages apps directly on Server | LAUNCH_XPAGE_ON_SERVER | $LaunchXPageRunOnServer | ||||
Not Exposed | 1 | Must be set via server console command | |||||
Not Exposed | 16Mb Summary Fields | DOCUMENT_SUMMARY_16MB | $LargeSummary in Icon | 1 | FP8+, must be set via server console command |
Setting Database Properties
To set database properties that only take a boolean value, create a DbProperties Map and pass it into setDatabaseProperties()
method. Properties that cannot be set or properties that have a specific setter will throw a runtime error with the relevant message. After setting any database properties you need to call DatabaseDesign.save()
. If items in the Icon note have been updated, that will automatically get saved.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
Session s = Factory.getSession();
Database db = s.getDatabase("", "yourdb.nsf");
DatabaseDesign dbDesign = db.getDesign();
Map<DbProperties, Boolean> settings = new HashMap<DbProperties, Boolean>();
settings.put(DbProperties.DONT_MAINTAIN_UNREAD, false); // note: will 'check' the property
settings.put(DbProperties.ALLOW_STORED_FORMS, false); // note: will 'uncheck' the property
dbDesign.setDatabaseProperties(settings);
dbDesign.save(); |
The Icon note appears to get cached by the session. So there is no point calling the relevant getters to check if a database property like $AllowRESTDbAPIhas been updated - you'll get the value from the start of the request. If you want to check, run a separate subsequent request to the server.
Missing in DXL if not checked