操作Domino数据库的设计元素

在Domino的数据库中有数据文档和设计文档两种文档。设计文档包括单,视图,代理等,这些组成了
一个数据库设计。标准的Notes类库能够很容易的访问数据文档,但是却没有提供任何方法来访问设计
文档。下面的这个DatabaseDesign类可以让我们使用LotusScript来访问设计文档,返回的是NotesDocument
对象。

要使用这个类,我们把DBDesign这个script库拷贝到数据库中。
下面是这个类的代码:

ContractedBlock.gif ExpandedBlockStart.gif DatabaseDesign类代码
<!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>-->None.gif%REM
None.gif
****************************************************************************************************************
None.gifThis library was originally created by Damien Katz 
of Iris Associates, Aug. 1999
None.gif
None.gifThis library may be freely distributed, modified 
and used only if this header is kept intact, 
None.gifunchanged 
and is distributed with the contents of the library.
None.gif
None.gifPlease share any fixes 
or enhancements and send them to Damien_katz@iris.com so I can add
None.gifit the library.
None.gif
None.gif
If you find this library useful, send me a mail message and let me know what you're using it for.
None.gif

None.gifThanks.
None.gif
None.gif
****************************************************************************************************************
None.gif
None.gifNOTE: 
None.gif
To instantiate a new DatabaseDesign objectdo not attempt to instantiate it directly,
None.gifinstead 
call the createDatabaseDesign method, it will return a new instantiated object.
None.gif
None.gif%
END REM
None.gif

None.gif
'Set this flag to true to always use the platform independent method
None.gif
Const FLAG_NEVER_USE_NATIVE_API_CALLS =False
None.gif
None.gif
Const DESIGN_NOTE_NAME_ITEM = "$TITLE"
None.gif
None.gif
Const NOTE_CLASS_DOCUMENT = &H0001        ' document note 
None.gif
Const NOTE_CLASS_DATA = NOTE_CLASS_DOCUMENT    ' old name for document note 
None.gif
Const NOTE_CLASS_INFO = &H0002        ' notefile info (help-about) note 
None.gif
Const NOTE_CLASS_FORM = &H0004        ' form note 
None.gif
Const NOTE_CLASS_VIEW = &H0008        ' view note 
None.gif
Const NOTE_CLASS_ICON = &H0010        ' icon note 
None.gif
Const NOTE_CLASS_DESIGN = &H0020        ' design note collection 
None.gif
Const NOTE_CLASS_ACL = &H0040        ' acl note 
None.gif
Const NOTE_CLASS_HELP_INDEX = &H0080        ' Notes product help index note 
None.gif
Const NOTE_CLASS_HELP = &H0100        ' designer's help note 
None.gif
Const NOTE_CLASS_FILTER = &H0200        ' filter note 
None.gif
Const NOTE_CLASS_FIELD = &H0400        ' field note 
None.gif
Const NOTE_CLASS_REPLFORMULA = &H0800        ' replication formula 
None.gif
Const NOTE_CLASS_PRIVATE = &H1000        
None.gif
None.gif
Const NOTE_CLASS_ALLNONDATA = &H7FFE
None.gif
None.gif
Const DESIGN_FLAG_ADD =    "A"
None.gif
Const DESIGN_FLAG_ANTIFOLDER        =    "a"    '    VIEW: Indicates that a view is an antifolder view 
None.gif
Const DESIGN_FLAG_BACKGROUND_FILTER = "B"    '    FILTER: Indicates FILTER_TYPE_BACKGROUND is asserted 
None.gif
Const DESIGN_FLAG_INITBYDESIGNONLY="b"    '    VIEW: Indicates view can be initially built only by designer and above 
None.gif
Const DESIGN_FLAG_NO_COMPOSE = "C"    '    FORM: Indicates a form that is used only for 
None.gif
                                            '        query by form (not on compose menu). 
None.gif
Const DESIGN_FLAG_CALENDAR_VIEW = "c"    '    VIEW: Indicates a form is a calendar style view. 
None.gif
Const DESIGN_FLAG_NO_QUERY  = "D"    '     FORM: Indicates a form that should not be used in query by form 
None.gif
Const DESIGN_FLAG_DEFAULT_DESIGN = "d"    '     ALL: Indicates the default design note for it"s class (used for VIEW) 
None.gif
Const DESIGN_FLAG_MAIL_FILTER = "E"    '    FILTER: Indicates FILTER_TYPE_MAIL is asserted 
None.gif
Const DESIGN_FLAG_PUBLICANTIFOLDER = "e"    '    VIEW: Indicates that a view is a public antifolder view 
None.gif
Const DESIGN_FLAG_FOLDER_VIEW = "F"    '    VIEW: This is a V4 folder view. 
None.gif
Const DESIGN_FLAG_V4AGENT = "f"    '    FILTER: This is a V4 agent 
None.gif
Const DESIGN_FLAG_VIEWMAP = "G"    '    VIEW: This is ViewMap/GraphicView/Navigator 
None.gif
Const DESIGN_FLAG_OTHER_DLG = "H"    '    ALL: Indicates a form that is placed in Otherdot.gif dialog 
None.gif
Const DESIGN_FLAG_V4PASTE_AGENT = "I"    '    FILTER: This is a V4 paste agent 
None.gif
Const DESIGN_FLAG_IMAGE_RESOURCE = "i"    '    FORM: Note is a shared image resource 
None.gif
Const DESIGN_FLAG_JAVA_AGENT = "J" '  FILTER: If its Java 
None.gif
Const DESIGN_FLAG_JAVA_AGENT_WITH_SOURCE = "j" ' FILTER: If it is a java agent with java source code. 
None.gif
Const DESIGN_FLAG_LOTUSSCRIPT_AGENT = "L" '  FILTER: If its LOTUSSCRIPT 
None.gif
Const DESIGN_FLAG_DELETED_DOCS = "l" '  VIEW: Indicates that a view is a deleted documents view 
None.gif
Const DESIGN_FLAG_QUERY_MACRO_FILTER = "M"    '    FILTER: Stored FT query AND macro 
None.gif
Const DESIGN_FLAG_SITEMAP = "m" '  FILTER: This is a site(m)ap. 
None.gif
Const DESIGN_FLAG_NEW = "N"    '  FORM: Indicates that a subform is listed when making a new form.
None.gif
Const DESIGN_FLAG_HIDE_FROM_NOTES = "n" '  ALL: notes stamped with this flag 
None.gif
                                                    'will be hidden from Notes clients 
None.gif
                                                    'We need a separate value here 
None.gif
                                                    'because it Is possible To be
None.gif
                                                    'hidden from V4 AND to be hidden
None.gif
                                                    'from Notes, and clearing one 
None.gif
                                                    'should not clear the other 
None.gif
Const DESIGN_FLAG_QUERY_V4_OBJECT = "O"    '    FILTER: Indicates V4 search bar query object - used in addition to "Q" 
None.gif
Const DESIGN_FLAG_PRIVATE_STOREDESK = "o" '  VIEW: If Private_1stUse, store the private view in desktop 
None.gif
Const DESIGN_FLAG_PRESERVE = "P"    '    ALL: related to data dictionary 
None.gif
Const DESIGN_FLAG_PRIVATE_1STUSE = "p"    '     VIEW: This is a private copy of a private on first use view. 
None.gif
Const DESIGN_FLAG_QUERY_FILTER = "Q"    '    FILTER: Indicates full text query ONLY, no filter macro 
None.gif
Const DESIGN_FLAG_AGENT_SHOWINSEARCH = "q"    '    FILTER: Search part of this agent should be shown in search bar 
None.gif
Const DESIGN_FLAG_REPLACE_SPECIAL = "R"    '    SPECIAL: this flag is the opposite of DESIGN_FLAG_PRESERVE, used
None.gif
                                                'only for the "About" and "Using" notes + the icon bitmap in the icon note 
None.gif
Const DESIGN_FLAG_PROPAGATE_NOCHANGE = "r" '  DESIGN: this flag is used to propagate the prohibition of design change 
None.gif
Const DESIGN_FLAG_V4BACKGROUND_MACRO = "S"    '    FILTER: This is a V4 background agent 
None.gif
Const DESIGN_FLAG_SCRIPTLIB = "s"    '    FILTER: A database global script library note 
None.gif
Const DESIGN_FLAG_VIEW_CATEGORIZED = "T"    '     VIEW: Indicates a view that is categorized on the categories field 
None.gif
Const DESIGN_FLAG_DATABASESCRIPT = "t"    '    FILTER: A database script note 
None.gif
Const DESIGN_FLAG_SUBFORM = "U"    '    FORM: Indicates that a form is a subform.
None.gif
Const DESIGN_FLAG_AGENT_RUNASWEBUSER = "u"    '    FILTER: Indicates agent should run as effective user on web 
None.gif

None.gif
Const DESIGN_FLAG_PRIVATE_IN_DB = "V"    '     ALL: This is a private element stored in the database 
None.gif
Const DESIGN_FLAG_WEBPAGE = "W"    '    FORM: Note is a WEBPAGE    
None.gif
Const DESIGN_FLAG_HIDE_FROM_WEB = "w" '  ALL: notes stamped with this flag 
None.gif
                                                    'will be hidden from WEB clients 
None.gif'
 WARNING: A formula that build Design Collecion relies on the fact that Agent Data"s
None.gif
            '$Flags is the only Desing Collection element whose $Flags="X" 
None.gif
Const DESIGN_FLAG_V4AGENT_DATA = "X" '  FILTER: This is a V4 agent data note 
None.gif
Const DESIGN_FLAG_SUBFORM_NORENDER = "x"    '    SUBFORM: indicates whether
None.gif
                                                'we should render a subform in
None.gif
                                                'the parent form                    
None.gif
Const DESIGN_FLAG_NO_MENU = "Y"    '    ALL: Indicates that folder/view/etc. should be hidden from menu. 
None.gif
Const DESIGN_FLAG_SACTIONS = "y"    '    Shared actions note    
None.gif
Const DESIGN_FLAG_MULTILINGUAL_PRESERVE_HIDDEN = "Z" ' ALL: Used to indicate design element was hidden 
None.gif
                                            '    before the "Notes Global Designer" modified it. 
None.gif
                                            '    (used with the "!" flag) 
None.gif
Const DESIGN_FLAG_FRAMESET = "#"    '    FORM: Indicates that this is a frameset note  
None.gif
Const DESIGN_FLAG_MULTILINGUAL_ELEMENT = "!"'    ALL: Indicates this design element supports the 
None.gif
                                            '    "Notes Global Designer" multilingual addin 
None.gif
Const DESIGN_FLAG_JAVA_RESOURCE = "@"    '    FORM: Note is a shared Java resource 
None.gif
Const DESIGN_FLAG_HIDE_FROM_V3 = "3"    '    ALL: notes stamped with this flag 
None.gif
                                            '        will be hidden from V3 client 
None.gif
Const DESIGN_FLAG_HIDE_FROM_V4 = "4"    '    ALL: notes stamped with this flag 
None.gif
                                                '    will be hidden from V4 client 
None.gif
Const DESIGN_FLAG_HIDE_FROM_V5 = "5"    '     FILTER: "Q5"= hide from V4.5 search list 
None.gif
                                            '    ALL OTHER: notes stamped with this flag 
None.gif
                                            '        will be hidden from V5 client 
None.gif
Const DESIGN_FLAG_HIDE_FROM_V6 = "6"    '    ALL: notes stamped with this flag 
None.gif
                                                    'will be hidden from V6 client 
None.gif
Const DESIGN_FLAG_HIDE_FROM_V7 = "7"    '    ALL: notes stamped with this flag 
None.gif
                                                    'will be hidden from V7 client 
None.gif
Const DESIGN_FLAG_HIDE_FROM_V8 = "8"    '    ALL: notes stamped with this flag 
None.gif
                                                    'will be hidden from V8 client 
None.gif
Const DESIGN_FLAG_HIDE_FROM_V9 = "9"    '    ALL: notes stamped with this flag 
None.gif
                                                    'will be hidden from V9 client 
None.gif
Const DESIGN_FLAG_MUTILINGUAL_HIDE = "0"    '    ALL: notes stamped with this flag 
None.gif
                                                    'will be hidden from the client 
None.gif
                                                    'usage is for different language
None.gif
                                                    'versions of the design list to be
None.gif
                                                    'hidden completely                
None.gif

None.gif
None.gif
'    These are the flags that help determine the type of a design element.
None.gif'
    These flags are used to sub-class the note classes, and cannot be
None.gif'
    changed once they are created (for example, there is no way to change
None.gif'
    a form into a subform). 
None.gif

None.gif
Const DESIGN_FLAGS_SUBCLASS = "UW#yi@GFXstm"
None.gif
None.gif
'    These are the flags that can be used to distinguish between two
None.gif'
    design elements that have the same class, subclass (see DESIGN_FLAGS_SUBCLASS),
None.gif'
    and name. 
None.gif

None.gif
Const DESIGN_FLAGS_DISTINGUISH = "nw3456789"
None.gif
None.gif
Const ERR_BASE_CLASS_INSTANTIATED = 10452
None.gif
Const ERR_BASE_CLASS_INSTANTIATED_MESSAGE = "You cannot instantiate this class directly"
None.gif
ExpandedBlockStart.gifContractedBlock.gif
Public Class DatabaseDesignClass DatabaseDesign
InBlock.gif    
'PUBLIC MEMBERS
InBlock.gif
    Public cacheDocuments As Integer
InBlock.gif    
InBlock.gif    
'PRIVATE MEMBERS    
InBlock.gif
    Private db As NotesDatabase
InBlock.gif    
Private forms As Variant
InBlock.gif    
Private views As Variant
InBlock.gif    
Private filters As Variant
InBlock.gif    
Private fields As Variant
InBlock.gif    
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Sub new()Sub new( database As NotesDatabase)
InBlock.gif        
If isAbstractClass Then
InBlock.gif            
'this prevents the base class from being instantiated directly
InBlock.gif
            Error ERR_BASE_CLASS_INSTANTIATED, ERR_BASE_CLASS_INSTANTIATED_MESSAGE
InBlock.gif        
End If
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值