美文网首页
第六十三章 CSP的常见问题 - 什么是标志和限定符?

第六十三章 CSP的常见问题 - 什么是标志和限定符?

作者: Cache技术分享 | 来源:发表于2022-11-30 08:46 被阅读0次

第六十三章 CSP的常见问题 - 什么是标志和限定符?

什么是标志和限定符?

要查看标志列表,请在终端中运行以下命令:

 Do $System.OBJ.ShowFlags()
IMP>Do $System.OBJ.ShowFlags()
    b - Include sub classes.
    c - Compile. Compile the class definition(s) after loading.
    d - Display. This flag is set by default.
    e - Delete extent.
    h - Generate help.
    i - Validate XML export format against schema on Load.
    k - Keep source.  When this flag is set, source code of
        generated routines will be kept.
    l - Lock classes while compiling.  This flag is set by default.
    p - Percent.  Include classes with names of the form %*.
    r - Recursive.  Compile all the classes that are dependency predecessors.
    s - Process system messages or application messages.
    u - Update only.  Skip compilation of classes that are already up-to-date.
    y - Include classes that are related to the current class in the way that
        they either reference to or are referenced by the current class in SQL usage.
 
These flags are deprecated a, f, g, o, q, v
Default flags for this namespace =dil
You may change the default flags with the SetFlags(flags,system) classmethod.

要查看限定符列表,请在终端中运行以下命令:

 Do $System.OBJ.ShowQualifiers()  
IMP> Do $System.OBJ.ShowQualifiers()
 
           Name: /autoinclude
    Description: Automatically include any classes that are not up to date required to compile this class
           Type: logical
  Default Value: 1
 
           Name: /autoload
    Description: In UnitTest, specifies the directory to be auto-loaded.
           Type: string
 
           Name: /checkschema
    Description: Validate imported XML files against the schema definition.
           Type: logical
           Flag: i
  Default Value: 1
 
           Name: /checksysutd
    Description: Check system classes for up-to-dateness
           Type: logical
  Default Value: 0
 
           Name: /checkuptodate
    Description: Skip classes or expanded classes that are up-to-date.
           Type: enum
      Enum List: none,all,expandedonly,0,1
  Default Value: expandedonly
  Present Value: all
  Negated Value: none
 
           Name: /cleanup
    Description: In UnitTest, if true the unit test will cleanup new globals when it finishes.
           Type: logical
  Default Value: 0
 
           Name: /compile
    Description: Causes classes loaded to be compiled as well.
           Type: logical
           Flag: c
  Default Value: 0
 
           Name: /createdirs
    Description: In Export, determines if to create directories if they do not exist
           Type: logical
  Default Value: 0
 
           Name: /cspcompileclass
    Description: Causes classes created by CSP or CSR load to be compiled. Only effects the CSP/CSR load and not subsequent class compiles.
           Type: logical
  Default Value: 1
 
           Name: /cspdeployclass
    Description: When CSP page loaded deploy the class generated
           Type: logical
  Default Value: 0
 
           Name: /csphidden
    Description: Classes generated from CSP and CSR compilation are marked as hidden.
           Type: logical
  Default Value: 1
 
           Name: /debug
    Description: In UnitTest, /debug causes the Asserts to BREAK if they fail.
           Type: logical
  Default Value: 0
 
           Name: /defaultowner
    Description: When loading classes if the class owner keyword is not defined set the owner to this user, if $username then set it to the current user
           Type: string
 
           Name: /defines
    Description: Comma separated list of macros to define and optionally their values.
           Type: string
 
           Name: /delete
    Description: In UnitTest, determines if loaded classes should be deleted.
           Type: logical
  Default Value: 1
 
           Name: /deleteextent
    Description: Delete extent.
           Type: logical
           Flag: e
  Default Value: 0
 
           Name: /detail
    Description: Show detailed information.
           Type: logical
  Default Value: 0
 
           Name: /diffexport
    Description: Do not include time modified or platform information in export so the files can be run through diff/merge tools.
           Type: logical
  Default Value: 0
 
           Name: /display
    Description: Alias qualifier for /displaylog and displayerror.
           Type: alias
      Enum List: error,log
     Alias List: displayerror,displaylog
  Present Value: all
  Negated Value: none
      All Value: all
     None Value: none
 
           Name: /displayerror
    Description: Display error information.
           Type: logical
           Flag: d
  Default Value: 1
 
           Name: /displaylog
    Description: Display log information
           Type: logical
           Flag: d
  Default Value: 1
 
           Name: /documatichost
    Description: In Export, determines if host that is used in JavaDoc generation
           Type: string
 
           Name: /documaticnamespace
    Description: In Export, determines if namespace that is used in JavaDoc generation
           Type: string
 
           Name: /documaticport
    Description: In Export, determines if port that is used in JavaDoc generation
           Type: string
 
           Name: /expand
    Description: Alias qualifier for /predecessorclasses, /subclasses and /relatedclasses.
           Type: alias
      Enum List: predecessorclasses,subclasses,relatedclasses
     Alias List: predecessorclasses,subclasses,relatedclasses
  Present Value: all
  Negated Value: none
      All Value: all
     None Value: none
 
           Name: /exportgenerated
    Description: When exporting classes also export generated classes where the class generating them is also included
           Type: logical
  Default Value: 0
 
           Name: /exportselectivity
    Description: Export the selectivity values stored in the storage definition for this class
           Type: logical
  Default Value: 1
 
           Name: /exportversion
    Description: In XML export of class the version of Cache the class will be imported into.
           Type: string
 
           Name: /filterin
    Description: Alias qualifier for /application, /system and /percent.
           Type: alias
      Enum List: system,percent,application
     Alias List: system,percent,application
  Present Value: (none)
  Negated Value: (none)
      All Value: all
     None Value: none
 
 
 
           Name: /generated
    Description: When expanding wild cards include generated items (routines/classes/etc)
           Type: logical
  Default Value: 1
 
           Name: /generatemap
    Description: Generate the map file.
           Type: logical
  Default Value: 1
 
           Name: /generationtype
    Description: In Export, determines generation mode
           Type: string
 
           Name: /genserialuid
    Description: In Export, determines if to generate serialVersionUID.
           Type: logical
  Default Value: 1
 
           Name: /hidden
    Description: Show hidden classes.
           Type: logical
           Flag: h
  Default Value: 0
 
           Name: /importselectivity
    Description: If 0 then do not import selectivity values from the XML file. If 1 then import the selectivity values stored in the storage definition when importing XML file. If 2 keep any existing selectivity values but if a property does not have an existing value then use the selectivity from the XML file.
           Type: enum
      Enum List: 0,1,2
  Default Value: 2
  Present Value: 2
  Negated Value: 0
 
           Name: /includesubpackages
    Description: Include sub-packages.
           Type: logical
           Flag: r
  Default Value: 1
 
 
           Name: /javadoc
    Description: In Export, determines if to create javadoc.
           Type: logical
  Default Value: 1
 
           Name: /journal
    Description: Enable journaling of a class compiler
           Type: logical
  Default Value: 1
 
 
           Name: /keepsource
    Description: Keep the source code of generated routines.
           Type: logical
           Flag: k
  Default Value: 0
 
           Name: /load
    Description: In UnitTest, determines if classes should be loaded. If not, then only classnames are obtained from the directories.
           Type: logical
  Default Value: 1
 
           Name: /lock
    Description: Use LOCK command while compiling classes.
           Type: logical
           Flag: l
  Default Value: 1
 
           Name: /make
    Description: In Export, determines if to only generate dependency or class if timestamp of last compilation is greater than timestamp of last generation
           Type: logical
  Default Value: 0
 
           Name: /mapped
    Description: Include classes mapped from another database
           Type: logical
  Default Value: 0
 
           Name: /mergeglobal
    Description: If importing a global from XML file merge the global with existing data
           Type: logical
  Default Value: 0
 
           Name: /multicompile
    Description: Enable use of work queue manager (optionally specify the number of workers if value >1)
           Type: string
 
           Name: /newcollections
    Description: In Export, determines if to use native Java collections.
           Type: logical
  Default Value: 1
 
 
           Name: /percent
    Description: Include percent classes.
           Type: logical
           Flag: p
  Default Value: 0
 
           Name: /pojo
    Description: In Export, determines if POJO generation mode
           Type: logical
  Default Value: 0
 
           Name: /predecessorclasses
    Description: Recursively include dependency predecessor classes.
           Type: logical
           Flag: r
  Default Value: 0
 
           Name: /primitivedatatypes
    Description: In Export, determines if to use Java primitives for %Integer, %Boolean, %BigInt, %Float .
           Type: logical
  Default Value: 0
 
           Name: /projectabstractstream
    Description: In Export, determines if to project classes that contain methods whose arguments are abstract streams or whose return type is an abstract stream.
           Type: logical
  Default Value: 0
 
           Name: /projectbyrefmethodstopojo
    Description: In Export, determines if to project byref methods to pojo implementation.
           Type: logical
  Default Value: 0
 
           Name: /recursive
    Description: Determines if Export classes recursively, or if UnitTest tests in subdirectories should run recursively.
           Type: logical
           Flag: r
  Default Value: 1
 
           Name: /relatedclasses
    Description: Recursively include related classes.
           Type: logical
           Flag: y
  Default Value: 0
 
           Name: /run
    Description: In UnitTest, determines if tests should run
           Type: logical
  Default Value: 1
 
           Name: /skipstorage
    Description: In class Export, if true do not export storage definition.
           Type: logical
  Default Value: 0
 
 
           Name: /subclasses
    Description: Recursively include sub-classes.
           Type: logical
           Flag: b
  Default Value: 0
 
           Name: /system
    Description: Process system messages or application messages.
           Type: logical
           Flag: s
  Default Value: 0
 
           Name: /unconditionallyproject
    Description: In Export, determines if to project regardless of problems that may prevent code from compiling or working correctly.
           Type: logical
  Default Value: 0
 
           Name: /unicode
    Description: Export UNICODE files.
           Type: logical
           Flag: n
  Default Value: 0
 
           Name: /usedeepestbase
    Description: In Export, determines if to use deepest base in which method or property is defined for method or property definition.  If P is defined in A,B, and C and A extends B extends C then C is a deeper base for P.
           Type: logical
  Default Value: 0
 
No Default Qualifiers at system level are set.
No Default Qualifiers for namespaces are set
 

我一直在调用一些实用方法。如何避免使用##class(Package.Class).method()

将这些方法放在一个特定的类中,并使CSP页面继承自该类。然后,CSP页面可以通过使用点语法来访问这些方法。为此,请使用 <csp:class>标记,如下所示:

<csp:class super="%CSP.Page,App.Utils">

什么是私有主页?

仅当使用适当的令牌从另一个CSP页面调用时,才能查看私有页面。私人页面不能被添加书签,也不能通过简单地在浏览器中键入URL来访问。要将页面设置为私有,请使用<csp:class> 标记,如下所示:

<csp:class private=1>

我有一组JavaScript函数和一个标题,我想在我的所有页面上使用它们。我应该如何包括这一点?

使用新的#include语法:

<!--#include file="mystuff.inc"-->

这是一个文本包含,在Caché 5中是新的。在编译页面之前,文件的文本会自动包含在页面中。因此,可以包含需要编译的代码,例如#()#变量、<csp:query>查询的结果和runat="server "代码。

相关文章

网友评论

      本文标题:第六十三章 CSP的常见问题 - 什么是标志和限定符?

      本文链接:https://www.haomeiwen.com/subject/hjijfdtx.html