CN105095348B - A method of passing through XML dynamic configuration website - Google Patents
A method of passing through XML dynamic configuration website Download PDFInfo
- Publication number
- CN105095348B CN105095348B CN201510312172.7A CN201510312172A CN105095348B CN 105095348 B CN105095348 B CN 105095348B CN 201510312172 A CN201510312172 A CN 201510312172A CN 105095348 B CN105095348 B CN 105095348B
- Authority
- CN
- China
- Prior art keywords
- plug
- unit
- layout
- extension
- xml
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
A method of passing through XML dynamic configuration website.User can be in XML file through 1 < extension of extension tag > come definition component, extension tag 1 includes extension 2 attribute of target for indicating the method class for loading the base part in the page, and extension 3 attributes of point are used to indicate the resolver for parsing the component XML content, user can be configured (the display content as plug-in unit is arranged) or assembling (plug-in unit is such as inserted into layout) to component in extension tag 1, system can be obtained by extension point 3 when starting and parse the resolver of the component and the XML content of the component is mapped to a java object 4, the java object 4 (judge whether to show the component according to running environment and foreground pattern is generated according to element attribute) can be calculated when page invocation by extension target 2 and generates web pages component 5, to make Not no programming experience people only pass through xml can in depth custom web site.
Description
Technical field
The present invention relates to a kind of methods by XML dynamic configuration website.
Background technique
XMAP is the class libraries that XML can be mapped to Java object, by carrying out ergodic solutions to each label in XML
Analysis, the value of parsing is put into the java object stated, so can be configured java object by XML, be reached module
The effect of change, but the process parsed is pretty troublesome, and complicated code is needed to realize the mapping to each java object, is unsuitable for new
Hand operates.
Summary of the invention
In order to overcome the shortcomings of that existing XMAP class libraries is not easy to operation, the present invention provides the resolver of complete set,
Each building block (such as layout, plug-in unit) necessary to a website is covered, user can be fixed rapidly by way of extension
Position to a component resolver and easily configure the component.
The technical solution adopted by the present invention to solve the technical problems is: in XML file by extension tag <
Extension > carry out definition component, extension tag loads the base part for indicating comprising an extension objective attribute target attribute in the page
Method class and one extension point attribute be used for indicate parse the component XML content resolver, user can extension mark
(the display content as plug-in unit is arranged) or assembling (plug-in unit is such as inserted into layout) are configured to component in label, when system starts
It can be obtained by extension point and parse the resolver of the component and the XML content of the component is mapped to a java object, the page
The java object can be calculated by extension target when calling (to be judged whether to show the component and according to component according to running environment
Attribute generates foreground pattern) web pages component is generated, so that user can easily configure website by XML.
The invention has the advantages that can allow the people of not no programming experience only pass through xml can in depth customed product,
Including data framework and Doctype, list, life cycle, monitor, web user interface (button, tabs, link, view
Figure, theme), workflow.
Detailed description of the invention
Fig. 1 is XML configuration data framework of the invention, Doctype schematic diagram
Fig. 2 is XML config directory schematic diagram of the invention
Fig. 3 is XML catalogue schematic diagram of the invention
Fig. 4 is XML registered plug-ins type schematic diagram of the invention
Fig. 5 is XML instance plug-in unit schematic diagram of the invention
Fig. 6 is exposure plug-in unit variable schematic diagram of the invention
Fig. 7 is that plug-in unit of the invention calls foreground template schematic diagram
Fig. 8 is that catalogue of the invention generates words tree schematic diagram
Fig. 9 is that drop-down list of the invention shows words tree schematic diagram
Figure 10 is the extension framework schematic diagram extracted in XML of the invention
Figure 11 is of the invention according to the hang-up of dependence condition, load extension framework schematic diagram
Figure 12 is of the invention extension framework to be filled complete diagram by XML configuration information
Figure 13 is of the invention by XML configuration information operation plug-in unit schematic diagram
Figure 14 is registration schematic layout pattern of the invention
Figure 15 is extraction schematic layout pattern of the invention
Figure 16 is realization schematic layout pattern of the invention
Figure 17 is of the invention by attribute configuration layout rows schematic diagram
Figure 18 is of the invention by variable mappings control plug-in unit pattern diagram
Figure 19 is that of the invention mapped by function controls plug-in unit pattern diagram
Figure 20 is of the invention by plug-in unit pattern reuse schematic layout pattern
Figure 21 is of the invention by mark function test method schematic diagram
Figure 22 is of the invention by plug-in unit pattern reuse plug-in unit schematic diagram
Figure 23 is XML custom web site summary schematic diagram of the invention
Specific embodiment
As shown in Figure 1, system the xml markup language on the left of Fig. 1 can be translated into when starting data framework on the right side of Fig. 1 and
Doctype, the code in the middle part of Fig. 1 can judge the extension (extension) of reading:
When extension point (point) is Doctype (doctype) 1-1 and its label is Doctype (doctype) 1-2
When, a Doctype can be instantiated with Doctype descriptor (DocumentTypeDescriptor) 1-3, what this realized
Doctype is named as file (Folder), and the document type further comprises common (common) data framework, Dublin
(dublincore) data framework, file (Folderish) face element;
When extension point (point) is Doctype (doctype) 1-1 and its label is face element (facet) 1-4, can use
Face element descriptor (FacetDescriptor) 1-5 instantiates the face element for being named as file (Folderish);
It can be retouched according to its tag name framework (schema) with framework when extending point (point) and being framework (schema) 1-6
It states symbol (SchemaBindDescriptor) 1-8 and instantiates the data framework, the entitled dublincore of the framework, prefix
It (prefix) is dc, reference address (src) is the dublicore.xsd file 1-9 under shcema file, is arranged in this embodiment
Part Dublin (dublincore) data framework attribute is gone out, title (title), description including string format
(description) and the theme of character string listings format (subjects).
As shown in Fig. 2, system start when can according to fig. 2 left side xml markup language generate one be connected to
The catalogue of postgresql database:
System first uses SQL directory descriptor (SQLDirectoryDescriptor) that 110nsubjects catalogue 2-1 is real
Example turns to configuration information (config) 2-2, then will caching maximum capacity (cacheMaxSize) 2-3 and the overtime duration of caching
(cacheTimeout) 2-4 deposit caching.Its corresponding server is found according to data source label (<dataSource>) 2-5 to match
It sets and uses and obtain the connection that Postgresql is arrived in connection method (getConnection) 2-6 acquisition one, it can be seen that generation
Connection includes database location jdbc:postgresql: //localhost:5432/postg, user name postgr.In frame
The framework that framework name (schemaName) 2-7 is 110nxvocabulary, framework are extracted in structure management (schemaManager)
(schema) 2-8 illustrates the corresponding attribute of 110nxvocabulary, id, parent including string type, the framework quilt
Appearance after instantiation is as shown in 2-9.It extracts each field name (fieldName) 2-10 of the framework and is plunged into framework word
Segment table (schemaFieldMap) 2-11, when the content in field name 2-12 (same to 2-10) and XML in idField label 2-13
When " id " 2-14 is identical, the field is set as the critical field of framework and provides that it mustn't be sky as shown in 2-15.The field
Data type 2-16 can be arranged to type (ColumnType) 2-17 on the column, if the Id in XML increases label automatically
(autoincrementIdField) value in 2-18 is false, and 2-19 can be judged by condition and the type on the column is arranged
For AUTOINC.If the column includes default value 2-20 in framework, the default value (defaultValue) 2-21 can be arranged and arrive
The column.Finally will be by connection (sqlConnection) 2-22 (same to 2-6), table (table) 2-23 just set up, data file
Name (dataFileName) 2-24, builds table strategy (createTablePolicy) 2-25 to build in postgresql database
Found the table of entitled 110nsubjects.
As shown in figure 3, system can build table strategy, framework and data source in postgresql database according in xml
It establishes the catalogue and imports data:
Setting is directly skipped when building table strategy and being never (never) 3-1, is missing column Shi Jianbiao when building table strategy
(on_missing_column) it when 3-2, can be checked whether to go containing missing with hasMatchingColumns method 3-3, the party
Method can call getMissingColumns method 3-4 to find missing row, and this method can first search already present same in database
Famous-brand clock (110nsubjects) simultaneously obtains its each column name as shown in 3-5, then obtains the 110nsubjects table 3-6 being newly loaded into,
The new column 3-7 being not present in original column 3-5 is loaded into missing column (missingColumns) 3-8.If lacking column
Size, which is greater than 0, means there is missing column, will be that the addition of 110nsubjects table is new with addMissingColumns method 3-9
Column label_new, then table is built again with createTable method 3-10, this method will create an authorization statement (stmt)
3-11, the statement include the link information 2-6 to postgresql database, are first carried out with the statement and delete old table statement
(dropSql) 3-12 builds table statement (createSql) 3-13 further according to new architecture execution, finally executes again based on the setting column id
Table statement (sql) 3-14 is set up after key is such.It has built after table and has been loaded into data with loadData method 3-15 for the table, XML is logical
Cross data file label (<dataFile>) 3-16 state directories/110nsubjects.csv be the table be loaded into letter
Content in address (dataFileName) 3-17 will be imported input stream (InputStream) by the address of breath, system
And in csv plug-in reader (csvReader), each column name in 110nsubjects.csv is extracted by csv plug-in reader
(columnNames) 3-18, and SQL insertion sentence (insertSql) 3-19 is accordingly generated, by 110nsubjects.csv
In the content 3-20 of every row read column value (columnValues) 3-21, and the value is converted to according to Rule of judgment by framework
In corresponding data type 3-22, SQL of these values insertion 3-19 composition with parameter is inserted into sentence 3-23, after executing the sentence
The content of the row will be inserted into postgresql database as shown in 3-24.
As shown in figure 4, the drop-down final election package types (suggestManyDirectory) in XML can be registered to by system
Template in system as instantiation drop-down final election plug-in unit, is loaded into a package types and is divided into 4 steps:
Package types name (suggestManyDirectory) 4-1 is loaded into 4-2;The method that plug-in unit will be handled
(handler-class) 4-3 is loaded into;It will show that template attributes (property) 4-5 of plug-in unit is loaded into 4-6;By package types
Configuration information (configuration) 4-7 is loaded by method 4-8.Title (title) 4-9 will be loaded into 4-10 respectively by 4-8,
Mode (supportedModes) 4-11 of support is loaded into 4-12, field organizational form (list) 4-13 of plug-in unit is loaded into 4-
14, type (supportedTypes) 4-15 that field is supported is loaded into 4-16, the display position list for including by plug-in unit
(categories) 4-17 is loaded into 4-18, and document therein means at document management interface using the plug-in unit, by plug-in unit
The browsing layout 4-19 (including components such as " width suggestion_width ") of default is loaded into 4-20, the editor that plug-in unit is defaulted
It is laid out 4-21 (components such as " the essential required " of component and editor comprising browsing layout) and is loaded into 4-22, it can be seen that compile
The component count [19] of layout 4-22 is collected far more than the component count [7] of browsing layout 4-20, by the default value under editing mode
(defaultValues) 4-23 is loaded into 4-24.It will finally be defined with registered plug-ins type (registerWidgetType) method
Good package types descriptor (dese) 4-25 is registered in jsf classification (category) 4-26 of default: being retouched from package types
It states three extracted other than configuration information (configuration) in symbol 4-29 and forms the package types 4-27 of a lightweight simultaneously
It is loaded into type registration table (typeReg) 4-28 that classification is jsf;Package types descriptor (desc) 4-29 is loaded into again
Classification is that the package types of jsf define in information registering table (defReg) 4-30.
As shown in figure 5, system can instantiate one according to drop-down final election package types (suggestManyDirectory)
It can select the drop-down final election plug-in unit of theme (subjects):
5-1 is that the theme (subjects) pulls down the specific xml configuration information of final election plug-in unit, when the page packet of client's load
System can be according to the registration information of the plug-in unit when containing the plug-in unit (registration step of plug-in unit is with the package types registration step in Fig. 4)
It is temporarily calculated with running environment and generates a plug-in unit.Mode (layoutMode) 5-2 that system first passes through current arrangements is obtained should
Mode (wMode) 5-3 of plug-in unit returns to null if plug-in unit mode is equal to and hides (HIDDEN) 5-4, i.e., does not generate this and insert
Part.System getRequired method 5-5 judges whether the plug-in unit is essential plug-in unit, it will first use getProperties method
5-6 obtains the attribute under the current state of the plug-in unit, and all properties (properties) 5-7 of the plug-in unit is one and is made with any
For the Hash table of key assignments, it is taken from attribute tags (properties) 5-8 in xml, and system first extracts the plug-in unit any
The attribute 5-9 of (any) under state, the attribute are the corresponding content of any key assignments in 5-7, work as anterior plug-in mode (mode) extracting
Attribute 5-11 under 5-10, the attribute are sky, the attribute being finally again loaded into 5-9 and 5-11 under 5-12 composition plug-in unit current state
And getRequired method 5-5 is returned, returning if the attribute under current state includes essential (required) attribute 5-13 must
The corresponding content of key assignments (required=true is returned to true) is selected to judge whether when anterior plug-in be essential plug-in unit.System takes
Type (wType) 5-14 for obtaining the plug-in unit, the classification of the plug-in unit is called by getStoreCategory method 5-15, is not set
Set the jsf classification 5-19 that can return to default if classification with getDefaultStoreCategory method 5-16, using the value as
Parameter 5-17 defines information getWidgetTypeDefinition method 5-18 to execute acquisition package types, and this method can root
The package types that jsf classification is obtained according to plug-in unit classification 5-19 define information registering table 5-20, i.e. have registered package types in Fig. 4
Registration table (defReg) 4-30, further according to the plug-in unit type name 5-21 (with the suggestManyDirectory in 5-14,
Package types name 4-1) obtain the drop-down final election package types 4-29 registered in type definition information 5-22 i.e. Fig. 4 of the plug-in unit.
Default property is obtained by getDefaultPropertyValues method 5-23,5-24 is the default property of package types,
It is defined by default value label (defaultValues) 4-23 in xml, extract attribute 5-25 under its arbitrary patterns and
Attribute 5-27 under plug-in unit present mode 5-26 forms package types default property, by package types default property 5-28 and plug-in unit
Attribute 5-29 is loaded into total attribute (props) 5-30 for generating plug-in unit respectively.5-31 is that the default editor of package types is laid out (same to 4-
21), it assigns default value for minimum character (minChars) attribute 5-32, and subjects plug-in unit inherits attribute 5-33, inserts
Part type provides selection directory name (directoryName) 5-34 attribute, and subjects plug-in unit is attribute imparting
110nsubjects value 5-35 provides the vocabulary under drop-down final election plug-in unit selection 110nsubjects catalogue, and package types are width
It spends (width) attribute 5-36 and assigns default value 400, subjects plug-in unit covers attribute 5-38 with 300.Like this,
Subjects plug-in unit quotes it and defaults framework and be added to new extension life using the drop-down list package types in Fig. 4 as template
At the drop-down list plug-in unit of selection theme.
As shown in fig. 6, the field of plug-in unit and attribute variable are exposed to foreground by system:
The type name 6-1 of plug-in unit and the type classification 6-2 of plug-in unit are taken out, with getWidgetTypeHandler method 6-3
Obtain the processor of plug-in unit, this method can take out package types with getWidgetType method 6-4, that is, pass through plug-in unit classification
6-5 obtains the package types registration table that classification is jsf, which is only light comprising processing method and attribute templates in Fig. 4
Magnitude package types registration table 6-6 (same to 4-28), then package types 6-8 is taken out by type name 6-7, i.e. lightweight in Fig. 4
Package types 4-27 takes out method class 6-10 (the same 4- of package types 6-8 by getWidgetTypeClass method 6-9
3) a processor 6-12, is instantiated with this method class, then the attribute templates 6-11 (same to 4-5) in package types 6-8 is inserted into
Processor exposes plug-in unit variable with the getFaceletHandler method in the processor.With the side getTemplateValue
Method 6-13 obtains template, obtains 6-14 if not being sky if the template of package types, otherwise obtains the template 6-15 of plug-in unit.Generate one
A presentation layer processor 6-16 comprising environmental variance ctx and label information tagConfig, with its getTagAttributes
Method 6-17 establishing label attribute, bindFirstFieldDefinition Boolean 6-18 can be first characters if being true
The value of section is tied on the value attribute of label, and 6-19 is the list of fields of plug-in unit, by the felds label 6- of plug-in unit xml information
20 definition, take first value (field) 6-21 of list, then the value is changed with createExpressionString method 6-22
At expression sentence, this method can carry out different processing to different field formats, here it with: field is divided into
Array 6-23 is formed the format in 6-24 again, and 6-24 is finally bracketed to the pattern become in 6-25 with # { }, uses field value
6-25 and key assignments value character string 6-26 carrys out establishing label attribute as the parameter of createAttributes method 6-27, should
Method will introduce the specific location 6-28 of current label, i.e., arranges and tie in 73 rows 77 in layout_default_template template
Within<nxl:widget>label range of beam, tag attributes generated are as shown in 6-29.With getAttributes method 6-
30 obtain the tag attributes of attribute, it is by every attribute 6-31 of plug-in unit, i.e., in xml information in attribute property label 6-32
Content, take its key assignments (key) 6-33, three-level attribute being converted to pattern # { %s.properties.%s } in 6-35
Node, it is therefore a reference will not save in the buffer, will not be refreshed by ajax, by key assignments 6-34 and reference 6-35 input
Method 6-27 will create tag attributes 6-36.According to (id) 6-37 it is that label generates an id attribute, then with the template in 6-14
Generate a template attribute (the two attributes are generated with method 6-27).Next the variable to be rendered is calculated,
Make the field value of field_0, field_1 format in template available, take out the attribute 6-38 that key assignments in label is value, i.e., I
Value (value=# in the tag attributes 6-29 (its localName be all value with qName) of first creation
{ value [' dc '] [' subjects '] in right side of the equal sign content), further take out variable name (field) 6-39 for needing exposure
(also to expose filed_0, fieldOrValue etc.) is finally wrapped up with createValueExpression method 6-43 for it
EL label, addition function mapping, 6-40 is the expression formula of encapsulation, and 6-41 is the variable mappings of encapsulation, and 6-42 is expected
Object object.Every attribute 6-44 for extracting plug-in unit again carries out format conversion according to its key assignments 6-45 and generates attribute needs cruelly
Variable name (widgetProperty_minChars) 6-46 of dew, the value (value=# from minChars tag attributes 6-36
The content of right side of the equal sign in { widget.properties.minChars }), finally every attribute is successively encapsulated with method 6-43.
As shown in fig. 7, system is existed by suggest_many_directory_widget_template.xhtml file
Foreground shows that plug-in unit, this document define in the attribute tags 4-5 of package types, and plug-in unit uses 6-14 to give birth to as value when exposing variable
At a template tag attributes, which is the Template Information for showing final election drop-down plug-in unit:
Xhtml first judges board state, shows herein when plug-in unit is browsing or editing mode to plug-in unit,
First assign label.suggestion.help.minChars corresponding Chinese information in helping label 7-1.Display label again
Frame (valueHolder) 7-2, value (value) 7-3 in label frame are the field_0 variable of exposure in Fig. 6, its corresponding table
It is # { value [' dc ' up to formula 6-40] [' subjects '], wherein dc is the prefix of Dublin framework (dublincore) 1-7,
Subjects corresponds to the subjects attribute in framework 1-9, and type is a character string list, stores the document all
Theme (subjects) attribute 7-3 in the framework of Berlin, 7-4 defines whether this label frame is essential, due to the attribute of the plug-in unit
Collect and do not contain essential (required) 5-13 in 5-8, therefore the plug-in unit is optionally, i.e., indicates before frame without red *.Finally show
Label information 7-5 in label frame is obtained by resolveMultipleDirectoryEntries method 7-6 by display
Tag entry: first obtaining directory service (directoryService) 7-7, which contains the catalogue of all registrations, pass through
Directory name 7-8 (the entitled 110nsubjects of catalogue of the plug-in unit is defined in 5-35) takes out specific subject catalogue 7-9, that is, schemes
110nsubjects catalogue 2-1 defined in 2 establishes session 7-10 according to the catalogue, and session is in addition to including the catalogue
It (directory) further include framework 7-11 outside, table 7-12 (i.e. establishes table according to framework in 3-6), and (it is derived from catalogue to major key 7-13
Xml information 2-13, the major key of the table is set as by postposition SQL creation sentence 3-14), the field name 7-14 of storage, session
Indicate that (sid) 7-15, string matching type 7-16 (carry out fuzzy matching, subinitial can be right when for searching for database
The beginning of searching character carries out fuzzy matching), if from increasing 7-17 (id for being defined in catalogue increases label 2-18 certainly), sql connection
7-18 (the link information 2-6 to postgresql database generated according to catalogue data source label 2-5), finally generates session
(session) 7-19 look into additions and deletions to database by the session and the operation such as change.According to framework name 7-20 (same to 2-8)
Framework 7-21 is taken out, the region 7-22 of user is further taken out, the two parameters are filled in getLabelFieldName method 7-23
Tag name is obtained, can use the label in 7-24 as default value if labelFieldName is not set, if db10n (plug-in unit category
Property integrate Article 2 attribute in 5-8) 7-25 be true then after default value plus " _ " and region 7-22 composition 7-26 as judging
The character string of display properties (such as " film ").A 7-28 is taken out simultaneously from 7-27 (the tag variable 7-3 transmitted from foreground)
It is made into the available JSONObject label object in foreground with resolveDirectoryEntry method 7-29, is not arranged point
With the "/" 7-30 of default if symbol, the part before the parameter 7-31 "/" transmitted is taken out and is used as entry mark 7-32, in meeting
Complete entry information (including id, label_fr, obslete etc.) 7-33 is gone out according to entry marker extraction in words 7-19.Successively
It extracts each column 7-34 in framework 7-21 and takes out its column name 7-35, column corresponding to the column name is taken out in 7-33
Mesh value 7-36 generates one by column name 7-35 and column value the 7-36 element formed and adds it in label object, if
Column name is equal with display field 7-38 (display field is the label_en combined in 7-26 according to default value and region), such as
It is true that whether fruit, which translates 7-39 (content in Fig. 5 in<translated>label of plug-in unit xml information), then in total translation text
Translation content corresponding to column value (label.directories.subtopic.cinema) 7-40 is extracted in part 7-42
(" film ") 7-41, generating one by display field (displayLabel) 7-43 is that key assignments translation content (" film ") 7-41 is
The element of content simultaneously adds it to label object 7-44, if label includes discarded (obslete) 7-45 (reciprocal in framework 2-8
Second element is exactly to discard, and default value is 0) and discarded value is greater than 0, then adds warning message 7- to the label object
46, warning prompt 7-47 is had when being labeled with the label display of warning message, regenerates one to calculate ID (computedId)
7-48 is that the input parameter 7-49 of key assignments in this way is the element of content and it is filled in label object, finally returns to the label
Object 7-50, each label object, which is added, in the set of tags 7-51 of display and to return to the 7-6 in xhtml as label
The value of information shows result as shown in 7-52.Finally with encodeParamtersForDirectory method 7-53 to plug-in unit
Attribute and parameter carry out coding so that the select2.js file on foreground can extract them, take out the property set 7-54 of plug-in unit
And its every attribute (such as width) 7-55 is successively extracted, its key assignments 7-56 and content 7-57 is written in JsonGenerator,
Select2.js file can extract width attribute 7-58 and load the pattern for plug-in unit when foreground generates plug-in unit in this way, load
Shown in anterior plug-in width such as 7-59 (the default width that a system provides), after load shown in plug-in unit width such as 7-60 (300px).
One operation Id (operationId) 7-61 is being set, content is the parameter 7-63 of Directory.Suggestions7-62,
And it is added into JsonGenerator, which will generate drop-down list such as Fig. 8 institute about 110nsubjects for plug-in unit
Show.
As shown in figure 8, system obtains the method class that action identifier (ID) 8-1 is Directory.Suggestions
And the default for having run the operation executes method run, it can obtain all entries of 110nsubjects catalogue and pass through iteration
Method by they generate a JSONAdapter tree:
System can first pass through directory name (110nsubjects) 8-2 and obtain specific catalogue in directory service
(directory), session is obtained by catalogue, framework name 8-3 is obtained by catalogue and obtains specific framework with it, use method
7-23 calculates the display field 8-4 under current environment, is that content establishes filtering using discarded (obsolete) 8-5 as key assignments " 0 "
It is that content establishes ranking criteria 8-7 that device 8-6, which is key assignments " asc " with " id ", is connected to postgresql data finally by one
The session 8-8 (particular content is shown in 7-10) of 110nsubjects table in library initiates one with filter 8-6 and ranking criteria 8-7
For the inquiry operation 8-9 of condition: being obtained with one<character string/object>format filter mapping table (filterMap) 8-10
Filter 8-6 successively extracts every filtering item 8-11 in 8-10, takes its value 8-12, its column 8-13 is taken, in column
Left side of the QuotedName attribute 8-14 (i.e. with the obosolete of double quotation marks) as restrictive condition, "? " as right side, "="
As symbol, 8-15 is formed with left side diacritic, then additional right side forms a complete restrictive condition 8-16, combinatorial search
Condition Select, setting search content (setWhat) are *, and setting search address (setFrom) is table name 8-17, setting limitation
Condition (setWhere) is 8-16, generates the SQL an ordering statement 8-18 of one (" key assignments " content) in the format of conversion 8-7, obtains
The search condition arrived generates search statement 8-20 as shown in 8-19, with it, creates a pretreatment and executes sentence ps and tie up for it
Determine parameter and obtain 8-21, having executed the query statement can be by all non-discarded in the sequence of id acquisition 110nsubjects table
The entry of (" obslete "=0) simultaneously returns it into entries, which is exactly automatic by parameters such as incoming filters in this way
Set up SQL statement.The JSONAdapter method 8-22 for executing two parameters of a band generates a root node, is its assignment
Session, framework, generate the children variable of a Hash table structure, and root node Rule of judgment isRoot is true.Root again
According to entry collection (entries) 8-23 just searched, each entry (entry) 8-24 is successively taken out, with 3 parameters of band
JSONAdapter method 8-25 generates a non-root node: successively extracting the key assignments and content group of each column 8-26 in framework
It is inserted into JSONObject object at element, sets it as display field if key assignments is equal to " label_en " 8-27, if
TranslatedLabels is that true then translates field, if obsolete field 8-28, which exists and is greater than 0, just adds discarded prompt, finally
Generate object 8-29 (detailed step for generating object is shown in 7-34 to 7-50).The node generated by isLeaf method 8-30 judgement
Whether is child node: it uses " parent " 8-31 to form one as key assignments node Id (architecture) 8-32 as content
A filter 8-33, is inquired with session setup, and for the SQL query statement generated as the filter as shown in 8-34, it will selection
All father nodes are the entry of " architecture ", the Boolean if search result is not sky in 110nsubjects table
IsLeaf is exactly false, it is meant that is not child node.It is not that (" art " in such as 8-35 be by the JSONAdapter of child node
The father node of " building ") program can be skipped after isLeaf judgement, it is JSONAdapter (" the building in such as 8-36 of child node
Build " be child node) can be inserted into root node by push method 8-37.Insertion process is the process of an iteration, by " building "
8-38 insertion Shi Huixian takes its father node Id " art " 8-39 and judges whether father node is sky, looks at if non-empty current
Object (node being inserted into) whether the father node for being " building " 8-38, with the Id of father node " art " 8-39 and present node
(getId) 8-40 compares, and since present node is root node, there is no judgements to fail certainly for father node, since present node
As soon as be not that father node is created that a father node, next take the entry 8-41 of the father node " art " of " building " and with creation
Non-root node method 8-25 generates new " art " JSONAdapter object 8-42, with push method 8-44 " building "
In newly-built father node " art " 8-42 of 8-43 insertion, father node " art " 8-45 of building is taken, father node is not sky, with " skill
Id (getId) 8-46 of art " and present node judgement, due to by slotting node being exactly currently " art ", id is also " art " institute
With judgement pass through since present node be exactly father node we just this insertion " building ", followed by
MergeJsonAdapter method 8-48 merges " building " 8-47, current " art " 8-49 due to be create its child be it is empty, from
Take the display field of " building " 8-50 in child's (for sky), result (found) 8-51 be also certainly it is empty, judge it is invalid,
Since not having " building " to be inserted into " building " in child, insertion is in the child of current " art " node with display field " building "
It is key assignments using " building " 8-47 node as the element of content, result will be currently inserted into node " art " 8- as shown in 8-53
54 " art " returned in root node 8-55 with push method 8-56 insertion at this time back to 8-42, insertion node at this time are
" art " 8-57, the father node 8-58 due to present node (root node) is there is no failure is judged, since root node has not had
Father just merges " art " in root node, with mergeJSONAdapter method 8-60 involvement " art " 8-59, works as prosthomere
The child of point (root node) 8-61 is sky, judges to fail, since root node does not have " art " to be just inserted into this " skill in child
Art " 8-62." art history " 8-64 is inserted into root node again, is equally first to establish an empty node " art " and incorporate wherein
" art history " 8-65 generates a member as key assignments by content of " art history " node 8-66 using the display field of " art history " 8-66
Element is simultaneously inserted into the child of new " art " as shown in 8-67, then insertion has new " art " of " art history " in root node,
It is the node of new " art " that display field is looked in the child of root node 8-68, includes " building " due to being inserted into one in root node
Old " art " 8-69, therefore have found and judge successfully, only need to will new " art " since root node has contained " art " node
Child incorporates just, so " art history " 8-71 in new " art " 8-70 is incorporated old " art " 8-72 just found.Journey
The entry tree being made of JSONAdapter object will be obtained after sort run is complete, root node 8-73 contains each level-one
Vocabulary (as art), again comprising several second level vocabulary under each level-one vocabulary 8-74 (as built).
As shown in figure 9, system the words tree in Fig. 8 is formed by a foreground by (figure is intermediate) javascript can be with
The element-tree (the figure upper right corner) of display, and css pattern (the figure lower left corner) is added for each element:
9-1 is the words tree generated in Fig. 8, it includes 6 level-one vocabulary such as " art ", and 9-2 will accommodate tree
Foreground element (could also say that root element), and 9-3 is the depth of level-one vocabulary, and value 0 can be to work as by the method for 9-4
Vocabulary sequence under preceding depth, successively takes out each vocabulary 9-5 such as " art " in 9-1, disables (disabled) 9-6 variable
For false, if non-disabling and the element be may be selected containing id, from 9-5 can be seen that " art " there is no id attribute thus its
It is false that (selectable) 9-7 variable, which may be selected, (can find out that it has 10 children by 9-8) if it has child
Its composite variable is set as true.The node 9-10 for establishing<li>label is used as " art " element, depth pattern value 9-
11 be 0, since it is that not optional 9-7 for it stamps select-result-unselectable pattern 9-12, since it is multiple
It closes element 9-13 and adds select2-result-with-children pattern for it, it can be in the corresponding foreground element of 9-10
These patterns are seen in (the very long a line in figure right side).A display label 9-14 is added for " art " element, takes out and passes through lattice
The display field 9-15 of formula processing is simultaneously added it in display label 9-14, then display label 9-14 is added to " art " element 9-
In 10, since the node is composite node, also a sub- container 9-16 is added for it behind to accommodate two under " art "
Grade vocabulary, iteration are (same using the sub- container 9-19 that the child 9-18 of " art " is filled into " art " by populate method 9-17
9-16), and by its depth 9-20 add 1.Successively take out " art " child in a 9-21 " building ", due to it is non-disable and
Containing id attribute 9-22 therefore variable 9-23 may be selected for true, since " building " is that leaf node does not have child so its is compound in it
Variable 9-24 is false, establishes<li>label 9-25 and is used as " building " element, depth value 9-26 is 1, since it is optional
Selecting 9-23 is it plus select2-result-seleetable pattern 9-27, is adding display label 9- for " building " element
The 28 and addition display content 9-29 on display label, since " building " is not that complex element 9-30 does not add sub- container, then incites somebody to action
Whole attribute information 9-31 of " building " entry fill in element in case storage is used when choosing, finally by newly-generated " building " element
9-32 fills in the sub- container of " art ", again fills in newborn " art " element 9-33 after " art " has filled whole daughter elements
Root element, when the element-tree that all level-one vocabulary are all filled into latter foreground (drop-down list) display of root element is just carried out
?.System is that each element is added to select2-result pattern 9-34, is added to for each display label
Select2-result-label pattern 9-35, they are provided with the patterns such as basic inside and outside back gauge for element and label, for
Those have the complex element of select2-result-with-children pattern 9-36, are set to runic such as 9-37 institute
Show, include the label 9-38 in sub- container select2-result-sub for those, is its select2-result-
Label tab style add 20px retraction as shown in 9-39, and by comprising sub- container tree more (multilevel words) its use up
Measure it is bigger, when a certain vocabulary Shi Huiyong method 9-40 that mouse moves on in drop-down column list is highlighted and is chosen it, this method
Those, which can only be returned, may be selected 9-41 and the non-vocabulary for having selected non-disabling, since " building " includes select2-result-
Selectable pattern thus can highlight and choose its 9-42, and " art " both can not be highlighted or can not be selected.
As shown in Figure 10, it only includes component most superior node that system, which extracts the XML information of plug-in unit and generated one,
Registration information example:
The file address the btion-contrib.xml 10- in bareproject-1.0-SNAPSHOT.jar is extracted first
1, which contains drop-down list package types suggestManyDirectory's and drop-down list plug-in unit subjects
Specific xml information is infused the content transformation in the xml document at one by createRegistrationInfo method 10-2
Volume information: first passing through file address 10-3 (same to 10-1) operation getStream method 10-4, and this method will open one and arrive 10-3
Connection and return an inlet flow read from the link be used as information source 10-5, to information source 10-5 execution expansion variable
(expandVars) method is extended to variable therein in configuration information (usually .conf file) corresponding to the variable
Specific value: it extracts all properties 10-7 in configuration information, and (usually the system configurations such as website, database port are believed
Breath), attribute 10-7 is assigned to global variable (vars) 10-8 of TextTemplate method, (pattern is anticipated according to pattern 10-9
Taste extract " $ { key assignments=content } " form character string, wherein key assignments is only alphanumeric etc.) composition one be directed to
The adaptation m of data source takes out its key assignments 10-11, by taking when adaptation 10-10 finds the content to match with 10-9
Variable getVariable method 10-12 finds key assignments 10-11 in the global variable 10-13 (same to 10-8) comprising attribute
(db.port) the content 10-14 (5432) corresponding to, then in data source 10-5 the variable replacement of the specific format be its
Corresponding content just completes variable extension 10-15, display name (label) of the example in subjects plug-in unit in configuration file
It is provided with database port variable { db.port } in 10-16, by the variable replacement in order to actual during expansion variable
Database port value 5432, and use 5432 as plug-in unit actual displayed name 10-17.Then the data source after extension is encoded to
A series of bytes simultaneously store the 10-18 into a new byte arrays.Byte arrays 10-18 is executed
CreateRegistrationInfo method 10-19 is created into a registration information: being handled by method 10-20 by defeated
The xml document that the 10-18 that becomes a mandarin is obtained: the factory 10-21 for being used to obtain resolver is defined, then defining one by factory will
Xml document is converted to the resolver 10-22 of dom document, the inlet flow 10- that will be provided by the parse method 10-23 of 10-22
18 Context resolutions are an XML document and return to a new DOM document object 10-24, can pass through DOM document object
The getDocumentElement method 10-25 of 10-24 easily directly accesses the child nodes of the document object.Pass through band 3
The loadAll method 10-26 of a parameter arranges top map to handle given DOM element 10-24 and return to the one of the element
Object: the name of DOM element 10-24 is component (component) 10-27, is created by newInstance method 10-28
The example of the component, successively handling each 10-30, service that component member collects in 10-29 means component exposure
Service, name means component name (biction.xml), and require means the other assemblies that the component relies on, therein
Extension member 10-31 means all extensions of component contribution, such as our previously defined subjects plug-in units.?
Member is processed into method (process) 10-32, first takes its value 10-33, takes out the name 10-34 in its mapping path
(extension) and all entitled extension node 10-35 are found out, it is as follows finds nodal method: successively taking out
All nodes in biction.xml file, first node 10-36 of taking-up are a null text node, not due to it
It is node element 10-37, takes out node 10-38 adjacent under it, since the node is node element 10-39, such as its 10-40
For extension, then the example for creating extension expanding node 10-42 with newInstance method 10-41.Successively locate
The each member for managing 10-43 expanding node is the specific method class for realizing the extension including extension target (target) 10-44,
And extension point (point) is that this is extended to which of method class (target) component, being obtained by obtaining value method 10-45 should
Extension target (target) 10-46 attribute value of expanding node (extension), calling is taken nodal value method 10-47 to come by it
The nodal value that relative path under given base node (extension) is target is obtained, base node, can as shown in 10-48
To see that it includes two attributes of point and target, when attribute 10-49 is not sky in the relative path to be taken, then from base
The target attribute 10-50 is extracted in plinth node, and the text information of the base node is extracted if not having attribute in relative path
10-51 (such as expository writing shelves).The target value just obtained is assigned the corresponding position into example finally by method 10-60
10-52, i.e., on the target attribute 10-55 in the extension extension example 10-54 in biction.xml component 10-53
WebLayoutManager in assignment 10-56,10-56 is the service interface that extended web is laid out content, according to extension point
The difference of point can extend widgettype package types, widget plug-in unit, layout layout etc..The complete extension of assignment
(extension) again by all extension example 10-57 assignment into 10-58 component after, one is finally obtained from XML file life
At registration information example 10-59, it contains component biction and its most higher level's child node, will tell about the registration in Figure 11
Extension in information is how to be suspended and realize according to dependence.
As shown in figure 11, system by the jejune extension framework of the condition that relies on be put into wait specific dependency queue in and
The extension framework is loaded when relying on condition maturity:
11-1 is the registration information generated in Figure 10, it contains all highest nodes of biction component, including group
Part name 11-2 and extension 11-3.The example is registered with method 11-4, example 11-5 is added in component register table reg: first being existed
It is key assignments with example that one is added in component (components) 11-6 therein with Instance Name (name) 11-7 (same to 11-2)
(ri) 11-8 (same to 11-1) is the mapping of content, the reactivation 11-9 example: takes out all extension 11- of the registration information example
10 and successively register each extension 11-12 with registerExtension method 11-11: this is extended to drop-down final election plug-in unit class
Type suggestManyDirectory, extension target (target) are WebLayoutManager, and extension point (point) is
Widgettypes is obtained and is used to realize extended target component name 11-13, and in the group of component register table (reg) 11-14
The target element registration information of entitled WebLayoutManager (being obtained by 11-13) is found in part (components) 11-15,
It can be seen that including just adding biction component 11-16 in 11-6 in the list of component, if the target group obtained
Part registration information 11-17 realizes the extension with WebLayoutManager without being sky, and the extension is otherwise added to hang-up
In the queue for waiting WebLayoutManager in extension (pendingExtensions): finding name in hanging up extension 11-18
For the waiting list of WebLayoutManager, an empty superset 11-20 is created if result 11-19 is sky, and is hung
It plays addition one in extension to run after fame with WebLayoutManager, using empty superset 11-20 as the Hash table of content, be extended in sky
Collect and drop-down final election package types 11-12 is added in 11-21.Next expansion of the registration information example is registered with method 11-11 again
Exhibition 11-22: this is extended to drop-down final election plug-in unit subjects, since its component for extending target is not loaded into component register also
In table reg, waiting list can only be added into: find the waiting of entitled WebLayoutManager in hanging up extension 11-18
Queue is found the superset 11-23 comprising drop-down final election package types just created, is added newly in superset 11-21
The hang-up of WebLayoutManager is waited to extend 11-24 (same to 11-22).The extension for waiting biction component is finally obtained,
The waiting superset 11-26 that entitled (biction) 11-25 is obtained in extension pendingExtensions is hung up, since it is sky
(hanging up the extension in extension without waiting for bction) jumps out program, is otherwise successively realized with biction and waits superset 11-
Every extension in 26.As activation component WebLayoutManager, obtained in hanging up extension pendingExtensions
Hang-up extension queue 11-28, the remove method of entitled (WebLayoutManager) 11-27 deletes queue in hanging up extension
While queue is assigned to 11-28, can see in hanging up extension queue 11-28 and all wait WebLayoutManager's
Extension is hung up, every extension in 11-28, such as drop-down final election are successively extracted in the extension in the biction including earlier registration
The extension 11-29 (same to 11-24) of plug-in unit subjects, should with configuration method (loadContributions) 11-30 taking-up is obtained
The configuration parameter of plug-in unit, method 11-30 are infusing the value " widgets " first taken out in plug-in extension point (point) 11-31 again
It is obtained in volume information instances 11-39 (WebLayoutManager) with acquisition extension point methods (getExtensionPoint) 11-32
It is named as the extension point example of " widgets " 11-33,11-34 is the extension point set of WebLayoutManager component register,
Point is extended including plug-in unit, package types, layout etc., the name for successively taking out each extension point sees whether it is " widgets " 11-
35,11-36 extend the XML information of point for plug-in unit (widgets) in WebLayoutManager component, it uses plug-in unit descriptor
(WidgetDescriptor) it as the realization class method 11-37 of the object, is eventually found and takes out
Extension point example (xp) 11-38 of " widgets " entitled in WebLayoutManager.If extension point example 11-38 is not empty
And its descriptor is not sky, then is extracted by extension point example 11-40 (same to 11-38) and pull down final election plug-in extension (xt) 11-41
In configuration parameter 11-42 and it is assigned to the item of the contributions in 11-41, such as figure is it can be seen that current extension 11-41
In configuration parameter contributions be null, this is because the extension is one in biction highest section
Point, it contains only target the and point attribute of extension 11-43, will teach how to obtain highest node 11-43 in Figure 12
Concrete configuration parameter 11-44 and registered.
As shown in figure 12, system takes out specific configuration information of the extension in XML file by the descriptor of extension point, uses
Highest node is filled with complete expanding node by configuration information, and according to the different by its classification registration of extension point:
Figure 11 is connected, for the configuration parameter of the acquisition 12-1 plug-in extension xt in activation active method, it is needed system
It finds the corresponding extension point example of extension and obtains the configuration parameter of 12-2 extension by it, if extension point example 11-38
In contributions be not empty 12-3 (wherein containing plug-in unit descriptor WidgetDescripter), then in xmap12-
4 (xmap is key assignments xmap object as the objects of content using descriptor by the factories comprising various fundamental types, with
The entitled key assignments xmap object of node be content roots) in register 12-5 descriptor 12-6: first sought in objects12-7
Plug-in unit descriptor (WidgetDescripter) 12-6 is looked for, since 12-7 is that sky can not find so needing to create, detection should
Whether containing mark 12-8 in WidgetDescripter descriptor 12-9, if (even if 12-15 one mark) is logical if containing
It crosses the descriptor and creates xmap object (xao) 12-10, it can be seen that include ctor (its value of constructor and descriptor in xao
It is identical), klass (descriptor) and members (member of plug-in unit, i.e., each mark are at present sky), in (objects) 12-
It is one mapping object of content creating by key assignments xao of descriptor klass in 11 in order to avoid repeat to create later, xao is executed
Scan method 12-12, it (is at present all marks in aClass) as sets of fields (fields) 12- that it, which will extract descriptor,
13, then successively in 12-13 each field such as name field 12-14 (name mark 12-15) i.e. in descriptor pass through
CreateFieldMember method is created as member 12-16, include in a member 12-16 field address accessor (herein
Value is WidgetDescripter.name), relative address path (value is name herein), (value is type type herein
Java.io.String it) constitutes.Each member is added to constituted in the members of (xao) 12-17 the descriptor template at
Member's collection.It is again one mapping object of content creating by key assignments xao of node name widget in (roots) 12-18 so as to after
The widget node is found by relative path.With environment 12-19, (which includes xml in extension in newly created xmap
The actual physical address biction-contrib.xml of information) and extensible element 12-20 be parameter loadAll method 12-21
It obtains the specific configuration information of extension: the name of element 12-20 is first taken out, since it is that its name of extensible element 12-22 is
Extension searches its content in roots (same to 12-18), its child nodes (p) are searched if its content 12-23 is sky
12-24 is not element so taking its adjacent node 12-25 until finding node element (step in detail since 12-24 is space text
See 10-36 to 10-39 suddenly), the node name 12-26 (value is " widget ") of element 12-25 is taken, it is (same in (roots) 12-27
The content xob (" xao " 12-10 being previously created) that key assignments is " widget " 12-26 is found in 12-18), if content 12-28
It is not sky, then a specific descriptor examples 12-29 is created according to plug-in unit descriptor template xao: according to constructor (ctor)
12-30 (i.e. first node in 12-10) creates an empty plug-in unit descriptor object 12-31, collects members to its member
In each member member 12-32 (such as name member, i.e., name in descriptor mark 12-15) use process method
12-33 carrys out assignment: the value 12-34 that this method obtains the name element from biction-contrib.xml file is
Subjects (specific steps are shown in 10-45 to 10-51), then the address field 12-36 (i.e. in 12-16 in member
XFieldAccessor assignment subjects on) assigns it in XML blank member all in descriptor examples 12-29
Corresponding particular content in file (pulling down the XML information 5-1 of final election plug-in unit subjects), it is left to return it to method 12-2
The contribs of side is the configuration parameter to be extracted, and configuration parameter (contribs) 12-37 is arranged for plug-in extension xt, can
To see current xt as shown in 12-38, contributions node 12-39 is no longer empty (before load configuration parameter
The value of contributions node is as shown in 11-44), it is comprising a plug-in unit descriptor (WidgetDescriptor) and just
For the member value 12-40 that its each member assigns, with the registration extension side in WebLayoutManager component (component)
Method 12-41 registers the extension: being taken out in configuration parameter (contribs) 12-42, XML of extension first can expand in a plug-in unit
It opens up and multiple plug-in units is added in (i.e. contribs), such as theme (subjects) drop-down final election plug-in unit, geographical drop-down final election plug-in unit,
Each of these extension (contrib) 12-43 and extension point 12-44 is selected, with registerContribution method 12-
45 register the specific extension: if extension point 12-44 is equal to 12-46 (i.e. package types widgettypes), just being retouched with package types
It states symbol instantiation extension 12-43 and obtains package types with the getWidgetTypeDefinition method 12-47 of descriptor
It defines information, finally registers this definition information with registerWidgetType method (specific steps are shown in Fig. 4).If extension point etc.
In (WIDGETS_EP_NAME) 12-48 (i.e. plug-in unit widgets), the extension is instantiated with plug-in unit descriptor 12-49 and is retouched with this
Stating the getWidgetDefinition method of symbol, (this method WidgetDefinitionImp method is according to extension with confidence
One plug-in definition information of breath creation) plug-in definition information is obtained, finally register this definition information.
As shown in figure 13, plug-in unit can come fast and flexible be customized by the configuration information in modification XML:
Drop-down list plug-in unit subjects original xml configuration information is as shown in 13-1, corresponding foreground interface such as 13-
Shown in 2, it is the plug-in definition that registration is extracted by the widget descriptor 13-4 in WebLayoutManager method 13-3
Information has been assigned the processing method class and foreground indicating template of drop-down final election package types 13-5, can be by plug-in unit class
The different components of specified arrangement 5-31 set the parameters to configure drop-down final election plug-in unit in different poses and with different expressions in type.13-6 is plug-in unit
Name, it cans be compared to the Id of plug-in unit, and plug-in unit of the same name is added in the patch of rear load will override original subjects plug-in unit, add
A new plug-in unit will be added by entering plug-in unit not of the same name.13-7 is the title of plug-in unit, changes the content in<label>label into 13-8
The title of plug-in unit has just been changed to geography by (label.dublincore.coverage field is corresponding to be translated as " geographic range ")
Range.13-9 is title prompt, changes content therein into 13-10 and title prompt has also just been changed to geographic range.13-11 is
Whether translate, it can search translation content corresponding to the field if being true in total translated document of system, and (details are shown in
7-39 to 7-44), if untranslated apperance 13-12 will be all shown as all fields of plug-in unit by being set to false.13-
13 will show what content of the document for plug-in unit, and " dc:subjects " means that plug-in unit will show current document Dublin frame
The character string list 1-9 of structure data (the prefix 1-7 that dc is dublincore) entitled subjects, if being changed into dc:
Zhishi attribute 13-14 (the customized character string table data framework " subject knowledge " in the framework of Dublin), will be in " content
Label " data preparation method " 13-15 in theme " in display " subject knowledge ", due to the theme vocabulary called in subjects
It can not find vocabulary corresponding to the path (zhishi_001_004) so only showing its road in tree (being derived from 110nsubjects)
Diameter and it added caution sign.13-16 is that width (details are shown in 7-55 to 7-60) is arranged in plug-in unit, its value is changed to 100 will be obvious
Shorten its width 13-17.13-18 is minimum number of characters needed for display drop-down list, is defaulted as after 0 i.e. click input frame directly
Display drop-down list will show " please inputting 2 characters again " 13-19 when clicking input frame, and work as input if its value is changed to 2
All vocabulary comprising input character will be shown after two character (such as " art ") 13-20 (such as " art history ").13-21 is hiding
Drop-down list prompt, since drop-down final election plug-in unit is usually not required to input character therefore is defaulted as true, its value, which is changed to false, to be seen
To prompt 13-22, there are also the components for being used to hide title prompt and blank prompt in addition to this.13-23 is what plug-in unit was shown
Directory name, system will be searched in the database all vocabulary of catalogue 110nsubjects and displayed it in the form of a tree slotting
The drop-down list (details are shown in Fig. 8 Fig. 9) of part, if being changed to 110ncoverage (what is stored in the catalogue is geographical vocabulary)
The drop-down list 13-24 to select different continent country variants is opened into generation one, due to what is generated in catalogue 110ncoverage
It can not find the path of " film " this theme vocabulary in words tree, therefore only show that its path " art/cinema " 13-25 (passes through road
The detailed step that diameter searches vocabulary display label is shown in 7-27 to 7-44).If required component is added in the property set of plug-in unit
Its value is simultaneously set as by 13-26 (can see the attribute in the first row of editor's layout 4-21 of drop-down final election package types)
True, then plug-in unit, which will become, must fill out plug-in unit, will have a red * to indicate 13-28 after title, and content is sky in input frame
Shi Baocun document can malfunction.13-29 is the blank tip parts of plug-in unit input frame, is arranged label.security.search's
Words can replace the blank of default to prompt " please input " with " search user or group " 13-30.13-31 is compartmentalization component,
Value can obtain the region 7-22 of browser if being true and be added to after display field to show the vocabulary current
Translation content under region, if label_en can show the translator of English of the vocabulary, label_cn can show the Chinese of the vocabulary
It translates (Adding Area specific steps are shown in 7-22 to 7-26), being set to " false " 13-32 would not be all for display field addition
The region suffix of such as _ en etc, 13-33 are display field component, can be taken when not adding the component or the component content and being empty
Its default value " label " 7-24, if being set as id by the value of the component and db110n being set as false (otherwise to will become id_
En), then by the id content 13-34 of the display label in input frame.13-35 be whether optional father node component, 13-43 is to word
The method that JSONObject vocabulary is added in the tree that converges, if current vocabulary is that child node 13-44 will directly return to the vocabulary, such as 9-21
" building " vocabulary, due to it be a complete node include id node 9-22, selectable variable 9-23 be true it
It is optional.Its node, which is constituted, to be determined according to the value of canSelectParent component 13-45 for non-leaf nodes, is write from memory
13-45 is false in the case of recognizing, that is, skips judgement, and creation one only includes the node of display field 13-46 and is added behind
Its all child nodes, such as 9-1 " art " vocabulary, it can be seen that it only includes displayLabel and children two sections
Point is false so parent node default is not optional, if will since it does not include id node selectable variable 9-7
The value of canSelectParent component, which is set as true, will execute 13-45 judgement, return to the complete node 13-47 and behind
Its all child nodes is added, since complete " art " lexical node is comprising id node 13-48 therefore it is optional 13-36,
Thus can by modification subjects plug-in unit XML configuration information in canSelectParent component Boolean come
Decide whether that parent vocabulary can be selected in drop-down list.13-37 is that vocabulary component is ignored in display, is passed through
DisplayObsleteEntries Boolean 13-49 judges whether to show ignored vocabulary in drop-down list, defaults feelings
DisplayObsleteEntries value 13-50 is false under condition, by service condition judge in program establish a content and be
The filter 13-51 of { obsolete=0 }, in the session 8-8 for leading to database 110nsubjects table, with the filter
13-51 is that parameter initiates inquiry operation 8-9, and the content of filter can be constructed as a conditional statement (8- in SQL by when inquiry
10 to 8-16) shown in the SQL query statement, ultimately produced such as 13-52 (same to 8-21), it uses WHERE " obsolete "=0
Part sentence has filtered out all vocabulary for being discarded (obsolete is not 0), can not if when having discarded " film " vocabulary
" film " vocabulary 13-37 is seen again in drop-down list, if the value of displayObsleteEntries component is changed to " true "
13-38,13-53 is true at this time, and by the program in skip condition sentence, the content in filter 13-54 is empty { }, most throughout one's life
At SQL query statement as shown in 13-55, it can be seen that it does not have WHERE " obsolete "=0 this filter condition, does not have
" film " discarded is filtered out, therefore can see " film " vocabulary discarded in 13-38, together with warning thereafter
Mark.It can also be the subjects plug-in card configuration special style by XML configuration file, such as (containerCssClass)
13-39 is Graphicxtras Frames Collection component, wherein it is seen that defeated if setting select2-highlighted (i.e. highlighted pattern)
Enter the bottom 13-40 of frame into highlighted state, (dropdownCssClass) 13-41 is drop-down list pattern component, if by its value
Entire drop-down list 13-42 can be at highlighted state if being set as select2-highlighted.As above it is exactly one to pass through
The specific example of XML configuration plug-in, it can be seen that even if without the employee of any programming experience, it is only necessary to modify certain in XMl
A parameter (false of a component is such as changed to true) is equivalent to do primary judgement in a program, and then influences aobvious
The factors such as the filter condition in the structures of indicating label, search statement, employee can optionally modify prompt text in xml
Originally, the Graphicxtras Frames Collection etc. that the display content of selection vocabulary, insertion are liked, these operations are all by the quilt in the form of plug-in definition information
It is registered in system and in depth influences the performance and function of plug-in unit.
As shown in figure 14, Dublin (dublincore) layout is registered in system by system:
14-1 is that the XML of the layout extends information, it can be seen that its extension target is WebLayoutManager extension
Point is layouts, and it is dublincore, the foreground template 14-3 that it is called that the layout name 14-2, which can be seen, by its configuration information
For/layouts/layout_default_template.xhtml, containing the layout in its row-column list 14-4 will be preceding
The plug-in unit that platform is shown, the plug-in unit that can will be shown on foreground by additions and deletions row (row) come additions and deletions, such as it the second row 14-5 will
Drop-down final election subjects plug-in unit inserts layout.The layout is to extend the side 14-6 by the registration in WebLayoutManager
Method registration, when the extension of extension point 14-7 is equal to " LAYOUT_EP_NAME " 14-8 (i.e. layouts), just with layout description
Symbol (LayoutDescriptor) 14-9 is by the example: it can be seen that the framework of a layout includes that name 14-10, foreground are aobvious
Show template 14-11, the line number group 14-12 as unit of being laid out line descriptor and column array 14-13, with multiple plug-in unit descriptors
For the plug-in unit Hash table 14-14 of content, using multiple attribute descriptors as the attribute Hash table 14-15 of content and classification 14-
16.Layout definition's information is obtained by getLayoutDefinition method 14-17: if the foreground template 14-18 of extension is (same
14-3, it is meant that foreground template is layout_default_template.xhtml under any mode) not be it is empty in Hash
The template is added in table ctemplates, take out its row-column list by getRows method 14-19: this method will be first according to ranks
Table length (the row number in 14-4) establishes an empty line number group 14-20, then successively to every a line in extension row-column list 14-4
Its layout rows is obtained using getLayoutRowDefinition method 14-21 and defines information: including in layout line descriptor
Plug-in unit widgets in capable name name, row, multiple marks such as row alwaysSelected whether are always shown, if inserting in row
Part 14-22 is not that the empty plug-in unit number according in row creates an empty plug-in unit with reference to (cwidgets) 14-23, then will insert in row
Part is sequentially inserted into plug-in unit with reference to 14-24, it can be seen that each element of plug-in unit reference only includes classification and plug-in unit name, uses
LayoutRowDefinitionImp instantiates a layout rows and defines information (clone) 14-25, it includes that a value is
AlwaysSelected (always choosing this journey) 14-26 of false, the selectedByDefault for being worth for true (choose by default
This journey) 14-27, and the plug-in unit just created is with reference to 14-28.Layout rows are defined into information (clone) and return to 4-21 as row
The element crows [i] of array, after completing all rows of line number group by it by getRows method 14-19 back to layout description
In line number group (crows) 14-29 of symbol, content is as shown in 14-30, including multiple layout rows define information instances.If extension
Customized plug-in unit (widgets) 14-31 be not that sky is entered into Hash table cwidgets, due to 14-1 extension configuration
There is no<widgets>label therefore 14-31 for empty { } in information.A layout is generated by LayoutDefinitionImpl method
Define information 14-32, it can be seen that layout name 14-33 is cried " dublincore ", row-column list 14-34 contain 5 rows (in order to
Save in space of a whole page 14-4 and only drawn wherein two row) and its foreground template (templates) 14-35, by the layout definition of generation
Information returns to 14-9, registers the layout by registerLayout method 14-36: since the layout is not provided with classification
Category, therefore classification " jsf " 14-37 of default is taken, establish layout definition's information registering table with " jsf " for classification
(reg) the layout definition information 14-39 (same to 14-32) just created is filled into layout definition information registering table reg by 14-38.
As shown in figure 15, the editor's cloth registered in its text type will be called when clicking the editing options card of text document
Office:
System is that each type of document both defines multiple layouts under default and AD HOC in XML file,
15-1 is document (Note) type, the default layout under any (any) 15-2 mode is defined wherein, for edit page
(edit) 15-3 layout is edited, and shows browsing (view) the 15-4 layout of document content, 15-3 is by being used for for editor's layout
The heading for modifying heading message is laid out 15-5, and the note for editing content of text and font style is laid out 15-6, Yi Jiyong
15-7 is laid out in the dublincore of editor's Dublin metadata.The XML definition information of the editing options card as shown in 15-8, it
It is an operation (action), id TAB_EDIT, clicking the tabs will jump to phase under the path of current server basis
It is /documents editing foreground template (document_edit.xbtml) 15-9, ranking value order of incl/tabs/ to path
Second position in option column is come for 20 and according to this size, the field in display label (1abel)
" action.view.modification " corresponding translation content is " editor ".A nxl label 15- is first stated in 15-9
10, it is the label that layout system uses, and can be used to define the help class label for showing layout and plug-in unit.It is fixed with nxl label
Justice one is used to show the documentLayout tag processor 15-11 of layout, and is editor plus mode (mode) for it
(edit) and value (value) is current document (# { currentDocument }) two attributes, which will
Render all layouts being attached under current document edit pattern.The processing is instantiated in background program by method 15-12
Device: it is first passed to processor tag parameter 15-13 defined in the xhtml file of foreground, the label can be seen by 15-13
Derived from/incl/tabs/document_edit.xhtml, it is in the 2nd row, the 64th column ending < nxl:
DocumentLayout > label.Local name in 15-13 is obtained by getRequiredAttribute method 15-14 again
Localname15-15 be mode (mode) tag attributes, by getAttribute method 15-16 return 15-17 (this,
That is current label processor 15-12) under 15-18 (tag, i.e., from foreground be passed to tag parameter 15-13) under 15-19
(localname) 15-20 is the tag attributes 15-21 of " mode " in (getAttributes obtains the attribute in 15-13), i.e.,
Mode=" edit " attribute in document_edit.xhtml in the label of 2 rows 64 column ending, is returned by 15-14
15-22 is returned to, as the mode (mode) of tag processor, the other parameters of label, such as 15-11 are extracted with same method
In value attribute 15-23.It has obtained currently available come each in profile with apply method 15-24 after tag parameter
Layout, pass through the actual current document cached in value (i.e. current document # { currentDocument }) acquisition system
15-25, i.e. " example text " text document, can see its UUID, path and title in 15-25, obtain text by 15-25
Shelves type information 15-26 obtains document mode value 15-28 by documentMode by 15-22 obtaining mode value 15-27,
Due to, without setting documentMode attribute event 15-28 as sky, being obtained and being used according to includeAnyMode in label 15-11
Default mode 15-29, it is defaulted as true if not being arranged.According to the side getLayouts Doctype typeInfo15-26
Method 15-30 obtains its layout (being laid out defined in acquisition 15-1 text type), and first parameter being passed in 15-30 is by text
Shelves mode value documentModeValue judgement generates, if document mode value is otherwise empty incoming mode value is passed to document mode
Value is passed to mode value 15-31, value is 15-32 " edit " (same to 15-27), in 15-30 since document mode value 15-28 is sky
Incoming second parameter is by using default mode useAnyMode judgement to generate, if the use of default mode 15-29 being true biography
Enter (BuiltinModes.Any) 15-33, value is 15-34 " any ", if layout (the i.e. 15-1 text type in Doctype
In<layouts>label) for sky, then from its be laid out 15-35 in extract mode (mode) be " edit " 15-32 layout
15-36 (it corresponds to the 15-3 in 15-1), if having extracted layout 15-36 is that empty and default mode (defaultMode) is not
Sky then extracts the layout 15-37 that mode is default mode " any " 15-34 from 15-35, is not due to having extracted layout 15-36
Sky, therefore the judgement of default mode is skipped, the side of passing through layouts element 15-39 in layout 15-38 (same to 15-36) will have been extracted
Method 15-30 return to 15-40 as under present mode by the layout of application, it can be seen that 3 layouts in 15-40 respectively correspond
3 layouts in 15-3, i.e. layout under edit pattern.Successively extract each layout 15-41 in 15-40
" dublincore " is laid out name according to it and generates a name tags attribute 15-42, and mode attribute 15-22, value attribute is added
15-23 forms the attribute 15-43 of dublincore layout, adds LeafFaceletHandler (i.e. next processor for it
For sky) and tagId (identifier of dublincore layout tab) composition label information 15-44,15-44 is added to
In Facelet processor 15-45, then 15-45 is added in combined processor 15-46, executes apply method for 15-46,
(such as dublincore layout) is laid out using each of combined processor.
As shown in figure 16, system realizes the currently available layout extracted in 15 figures one by one by taking dublincore as an example:
Label information 16-1 (same to 15-44) is added in Facelet processor 16-2 (same to 15-45) by system in upper figure,
It comprises the concrete steps that with the method 16-3 of the same name instantiation under layout tab processor LayoutTagHandler method class
The LayoutTagHandler is simultaneously added in Facelet processor 16-2, method 16- by dublincore label information 16-4
3 will extract every strip label attribute (i.e. 15-43) in label information 16-4, including name tags attribute 16-5 (same to 15-42),
Value is 16-6, mode tag attribute 16-7 (same to 15-22), is worth tag attributes 16-8 (same to 15-23), layout tab processor will be sharp
Layout is generated with these attributes: name is the layout name registered in layout definition information registering table reg;Category is
The classification of layout;Definition is layout definition's information, can dynamically generate layout with it;Layout is used to specific fixed
An adopted layout example;Mode means that the page will be rendered with the layout under what mode (specific effect is shown in 15-2 to 15-7);
Value means to be laid out the value that will be used, that is, is exposed to # { field } variable of foreground xhtml, specifically maps encapsulation process
See (6-39 to 6-43);Template means to be the foreground template that the layout uses, if set by overlapping layout
The template attribute (14-35) in information 14-32 is defined, is defined at value 14-18, the 14-3 in XML file;
SelectedRows is selectable row name, it will be used to filter the row in layout if being not sky;
SelectAllByDefault will designate whether that all rows are chosen and (shown) to default;ResolveOnly means only in ring
It is handled in border and exposure is by the layout of rendering, without immediately showing it.The dublincore is laid out due to being by document layout
Tag processor 15-12 batch generates, and contains only 3 name, mode, value tag attributes.15 figures finally with compound place
Each available layout of device (composite) 16-9 (same to 15-46) Lai Yingyong 16-10 is managed, it will be from the child of combined processor
It is successively extracted in sub- 16-11 (the layout tab processor 16-3 list being added in Facelet processor 16-2 therein)
Each layout tab processor 16-12, and the apply method 16-13 in layout tab processor method class is used for answer
With each specific layout tab: first defining a placement Service with WebLayoutManager interface 16-14, it can be used
It is laid out example to manage registered layout definition's information and creation, the realization of interface 16-14 is then obtained from Framework
Class (WebLayoutManagerImpl) 16-15 configures layout, example according to the tag attributes in layout definition processor 16-3
If selectedRows tag attributes 16-16 is filtered the row in layout with it not for sky, if name is marked
Signing attribute 16-17 (same to 16-6) is sky, just extracts layout name 16-18 therein, and with the acquisition cloth in placement Service 16-19
Office's (getLayout) method generates layout example, i.e., it is specific to realize that the getLayout method in class 16-20 generates by it
Dublincore layout: it first uses getLayoutDefinition method 16-21 to obtain the definition information being laid out: due to the cloth
Office is not provided with class label attribute, takes " jsf " the classification 16-22 of default and obtains layout definition's information registering table with it
(reg) 16-23 (same to 14-38) searches the cloth that layout name 16-24 (same to 16-18) is " dublincore " 16-25 in 16-23
Office defines information, i.e. the dublincore layout definition information 14-39 registered in Figure 14 in reg, by method 16-21 by its
Back to layout definition's information (layoutDef) 16-26, row is extracted from 16-26 and defines information 16-27 (same to 14-34), definition
One empty layout row-column list 16-28, is arranged the line pointer 16-29 that a value is -1, successively extracts each layout in 16-27
Row defines information 16-30 (same to 14-25), and line pointer 16-31 is from increasing, i.e., the pointer value of the first row is 0, and the pointer value of the second row is
1, the name 16-32 of 16-30 is extracted, since name attribute therefore the name attribute value not being arranged in row 14-5 for sky, if row name
16-33 is sky, serially adds line pointer value 16-31 with " layout_row_ " character and forms new row name 16-34, due to every row
Line pointer is different, and row name will not repeat, and row name can be used as the id of every row on foreground, is arranged Boolean (emptyRow)
16-35 defaults it to judge whether row is empty for true (sky), if (selectedRows) 16-36 is not to use it if sky
Row is filtered, the plug-in unit for extracting row 16-30 refers to 16-37 (same to 14-28, defined in xml by 14-5), then extracts plug-in unit
With reference to the name 16-38 of 16-37, the plug-in definition of entitled " subjects " 16-38 is extracted in plug-in definition information registering table
Information 16-39, and obtain one according to the parameter of current dublincore layout getWidget method 16-40 and meet currently
The subjects plug-in unit example (details are shown in Fig. 5) of running environment, by the plug-in unit example 16-41 be added plug-in unit list widgets (because
May to include multiple plug-in units in a line), if having in a line not for empty plug-in unit example 16-41, by (emptyRow) 16-42
It is set to false, it is meant that it is not sky that this is capable, if it be empty with LayoutRowImpl method 16-43 is row generation one that this is capable
Layout rows example, by row name 16-44, if default choice row 16-45 (same to 14-27), if always select row 16-46
The cryptographic Hash of (same to 14-26), the subjects plug-in unit example 16-47 just generated, row attribute and row is all inserted into layout rows reality
In example, and these layout rows examples are inserted into the empty layout row-column list 16-48 being previously created, with LayoutImpl method
16-49 is laid out to instantiate the dublincore, is wherein being inserted into the layout rows example 16-50 just obtained, calculates and breathes out for it
(cryptographic Hash is to be calculated to generate by the every property parameters being laid out, therefore same layout correspondence is same to uncommon value id information 16-51
A cryptographic Hash), it is inserted into the parameters such as name, mode dublincore layout and is achieved that.Here it is the layout of system realities
Existing mode, it define in registration information one only include each plug-in unit name simple layout, when display is laid out according to working as front ring
Specific plug-in unit example is extracted in border, and each row of layout is filled completely.
As shown in figure 17, system configures cloth by foreground indicating template xhtml file and backstage layout architecture xml document
Row in office:
The corresponding foreground xhtml file 17-1 of the Edit button is modified, it will pass through nxl:layout label 17-2 cloth
Office tag processor LayoutTagHandler individually renders dublincore layout 17-3 (only rendering 15-7), at this time example
The corresponding edit page of text is as shown in 17-4.17-5 (same to 16-30) is each cloth in the dublincore layout that will be rendered
Office's row defines information, and 17-6 (same to 16-36) is that the judgement filter condition of every row (is only mentioned once herein specifically in Figure 16
It is bright), it is by foreground (17-1) backstage (17- when whether select row selectedRows is empty two kinds according to layout
3) whether determined property filters out the row: the always selection alwaysSelected attribute of the row is set to true by 17-7, when being
System starting, which can be defaulted, is set to false for the alwaysSelected attribute 14-26 in every row 14-25, and 17-7 can be by the 14- of the row
26 default properties replace with true and are saved into the registration that dublincore is laid out and define in information, at this time since 17-8 is total
It is for true, no matter whether selectedRows is that sky filter condition can be all skipped.SelectedRows belongs under default situations
Property 17-9 be null (due in 17-1 no setting selectedRows attribute), selectAllRowsByDefault attribute 17-
10 be false (being defaulted as false if not being arranged in 17-1), and it is (same that isAlwaysSelected attribute 17-8 is defaulted as false
14-26), filter condition is set up, since default choice selectedByDefault attribute 17-11 is defaulted as true (same to 14-
27), filter condition is skipped so could see the row in front page layout, and 17-12 is by the row containing subjects plug-in unit
SelectedByDefault attribute is set as false, so that this last item filter condition of 17-13 is also set up, executes
Continue and the loading procedure for skipping the row, line number 17-15 is that 4 (relative placement is real in the layout example 17-14 ultimately produced
Line number 16-50 is 5), to show result as shown in 17-16, it can be seen that it has lacked content topic relative to 17-4 in example 16-49
(subjects) a line.If default is added in the foreground xhtml file 17-1 of display edit page chooses whole
SelectAllByDefault attribute 17-17, layout tab processor 17-2 will extract attribute 17-18 (i.e. in document_
The selectAllByDefault=" true " in nxl:layout label that the 3rd row the 44th column terminate in edit.xhtml belongs to
Property), the layout generation method in WebLayoutManagerImpl is passed to as the last one parameter of method 16-19
16-20, in filter condition 16-36, since 17-19 is true, filter condition is always skipped when selectedRows is empty,
Therefore edit page shows all rows as shown in 17-4 (including defaulting not selected theme subjects row).If in 17-1
Middle addition list variable 17-20 (a storage ' layout_row_1, the dynamic array variable of source '), and list is arranged
For the value of selectedRows attribute 17-21, layout tab processor 17-2 can extract attribute 17-22 from foreground, due to it
SelectedRows attribute 16-16 in application layout apply method 16-13 is not at this time sky, the carrying out practically Rule of judgment
17-23 extracts selectedRows attribute 17-22 with selectedRowsValue variable 17-24 in the form of character string list
In # { list }, as 16-19 method penultimate parameter be passed to generate layout method, in filter condition 16-36
In, since selectedRows attribute 17-25 is not sky at this time, the isAlwaysSelected attribute of every row is defaulted as false,
What is do not included in SelectedRows attribute 17-27 is about to execute filter condition continue and can not be shown to foreground, defaults
In the case of layout rows define the name in information 14-25 be null, generate layout when can according to row sequence automatically be unknown row
Name, can also be in layout such as the entitled layout_row_1 of the row of subjects plug-in unit (specific steps are shown in 16-31 to 16-34)
The system for being named as source by row 17-26 in xml document 17-3 to replace default generates name.In this example only
The row 17-30 of the row 17-29 and entitled source of the entitled layout_row_1 for including in selectedRows attribute 17-27 are jumped
Filter condition has been crossed, has shown result as shown in 17-28.It as above is by row attribute in the xml document of backstage and foreground
The specific method of layout attributes configuration layout rows in xhtml file.
As shown in figure 18, system calculates the plug-in unit mode of theme sujects plug-in unit with EL expression formula, according to the theme of document
Whether metadata is sky to decide whether the plug-in unit that shows topics:
18-1 (same to 5-1) is the theme subjects plug-in unit in XML file, it passes through<widgetModes>label 18-2
It joined mode m odes attribute in plug-in definition information, i.e., judge the theme of document under general view view_summary mode
Whether metadata layoutValue.dc.subjects is sky empty, is the empty plug-in unit that just sets to hide hidden mode,
The plug-in unit is set without being sky to browse view mode.It, can be according to inserting in every row 16-31 when system generates layout 16-20
Part name 16-38 obtains the plug-in unit example with getWidget method 16-40, i.e., is calculated by running environment and generate the subjects
Plug-in unit (details are shown in Fig. 5) can be defaulted in the case where plug-in unit mode is not arranged and use the mode 5-2 of current arrangements as the plug-in unit
Mode 5-3 can specifically calculate the mode of the plug-in unit after plug-in unit mode is arranged according to the EL expression formula in mode.18-3 is to obtain
Plug-in unit getWidget method, it can pass through current general view layout pattern with getModeFromLayoutMode method 18-4
18-5 obtains the mode of the plug-in unit, and 18-4 first uses getMode method 18-6 to obtain key from plug-in unit set of patterns 18-7 (i.e. 18-2)
Value is the mode 18-8 of general view (view_summary), calculates the EL expression formula in 18-8 with getStringValue method 18-9
To obtain the mode (such as " hidden ", " view ") of a character string forms: with evaluateExpression method therein
18-10 calculates the EL expression formula under given environment: being found out and is counted with resolveElExpression method 18-11 therein
All EL expression formulas in calculation mode 18-8: it first uses isValueReference method 18-12 to judge whether contain in 18-8
EL expression formula, that is, see in 18-8 whether containing " # { " and followed by " " 18-13 (or containing " # $ " and followed by " "), be free of EL
Otherwise expression formula is handled EL expression formula with regard to directly return, obtain the expression formula factory under the facelet environment
(eFactory) 18-14 and environment (elContext) 18-15 with request binding, is used by 18-14
CreateValueExpression method 18-16 creates value expression: it is wrapped up by decorateELContext method
Basic EL environment 18-15 adds function for it and maps 18-18 and variable mappings 18-19, the value expression ultimately produced
(expr) as shown in 18-20, it can be seen that it includes that a value is Object desired type 18-21, an el expression formula 18-22
(the same 18-8 of content), a function for null map 18-23 (any functional label is not quoted in 18-8), a variable mappings
18-24, it is passed by metadata_dc_widget_template.xhtml (to handle the foreground template of metadata plug-in unit)
The value come is the variable of " # { currentDocument } ", and 18-25 is the node generated by 18-8, it is an AstChoice
Node is selected, includes three nodes in child 18-26, respectively judges whether metadata is empty AstEmpty node 18-
AstValue is contained again in 27 and " hidden ", " view " mode for returning in the case where whether metadata is sky, 18-27
Value node 18-28 lists the layout value layoutValue successively to be taken from top to bottom, the prefix dc of Dublin framework, cypress
Subject attribute subjects in woods framework, the subjects are to be used to judge whether it is empty variable.The value is expressed
Formula (expr) 18-20 uses getValue method 18-29, it will call the value expression example side ValueExpressionImpl
GetValue method 18-30 in method class obtains value expression 18-20 corresponding value in current environment: it is first used
ElContext, function mapping, variable mappings generate calculating environment (ctx) 18-31, then obtain this (by value expression
18-20 initiate acquisition methods 18-30, this be exactly 18-20) node 18-32, i.e. AstChoice select node, it is made
With the getValue method 18-33 in AstChoice method class, it will take out the 0th child 18-34 in 18-32, i.e.,
AstEmpty sky node judges using the getValue method in AstEmpty method class the node subjects of document
Whether attribute is empty: the 0th child 18-35 in 18-34, i.e. AstValue value node is taken out, to the node side AstValue
GetValue method 18-36 in method class obtains the subjects attribute of document: obtaining the 0th child 18- in 18-35
37, AstIdentifier nodes, to it using the getValue method 18-38 in AstIdentifier method class, it will be first
It is calculated in 18-31 from environment and obtains variable mappings 18-39 (i.e. the variable mappings 18-24 of 18-20), if it is not empty taking-up this
Value 18-41 in object 18-40 (i.e. AstIdentifier node 18-37), and taking out key assignments in 18-39 is 18-41
(layoutValue) content uses value expression example as new value expression 18-42, to the value expression
GetValue method 18-43 in ValueExpressionImpl method class obtains its value under the present circumstances, at this moment
GetValue method 18-44 (same to 18-43) in, due to the variable mappings that do not transmit, it is calculated in environment 18-45
VarMapper is null, takes out the node 18-46 in this (i.e. new value expression 18-42), is worth and is
The AstIdentifier node of currentDocument is used for the side getValue in AstIdentifier method class
Method 18-47 does not reprocess the variable mappings it under since the variable mappings 18-48 in environment 18-45 at this time is sky, use
GetELResolver method 18-49 obtains EL processor and directly by the value currentDocument in this (i.e. 18-46)
It takes out and returns to 18-50, it can be seen that it has taken out the document model example of current document (i.e. example text), and 18-50 is returned
It returns to the relative position 18-51 of AstValue method class and finds the subjects attribute of the document: taking out this (i.e.
AstValue node 18-35) child's number (propCount) 18-52 and obtain the attribute value of each child according to this, initial setting up
I=" 1 " 18-53 takes out dc (the 1st child 18-54 in 18-35) attribute results of the document 18-51 as shown in 18-55,
It is the dublincore data framework of example text, and i takes out in Dublin data framework 18-55 Zi increasing to " 2 " 18-56
Subjects (the 2nd child 18-57 in 18-35) attribute results as shown in 18-58, it can be seen that it contains cinema
18-58 is returned to the relative position 18-59 of AstEmpty method class to sentence by (film), two children of comics (caricature)
Whether the value of breaking is sky, since 18-59 is not the empty relative position 18- for returning to " FALSE " 18-60 to AstChoice method class
61, since the condition 18-61 of ternary operator is false, returns to its second value " view " 18-62 and arrive
The relative position 18-63 of ValueExpressionImpl method class is as method 18-29 under the present circumstances to value expression
Whether the calculated result of 18-20 returns it to the relative position 18-64 of method 18-10 and is wherein also expressed containing EL with checking
Formula handles 18-64 by resolveExpression method 18-65, since the expression formula 18-66 transmitted does not include el table
Symbol (18-12 returns to false) up to formula directly returns to the expression formula, and " view " is finally returned to 18-67 as the plug-in unit
Mode, it by call subjects plug-in unit package types " suggestManyDirectory " 4-1 in view be laid out 4-
19 show plug-in unit, therefore can see theme subjeets plug-in unit 18-68 in Overview page.If based on not having in example text
It inscribes subjects plug-in unit and metadata is set, the subjects attribute value taken out in AstValue method class is sky 18-69, is returned
To the corresponding position 18-70 of AstEmpty method class, since 18-70 is empty return " TRUE " 18-71 to AstChoice method class
Corresponding position 18-72, due to ternary operator condition 18-72 value be true, return to its 1st value " hidden " 18-73,
" hidden " is finally returned into 18-74 as the mode wMode of plug-in unit, can be seen from 5-4 when plug-in unit mode wMode is equal to
Null will be directly returned when " hidden ", do not rerun next plug-in unit loading procedure, so when Overview page in see not
To theme subjects plug-in unit 18-75.It as above is exactly the specific method by plug-in unit scheme control plug-in unit.
As shown in figure 19, system is by the mark function nxd:hasPermission regulation in plug-in unit mode only to working as
Preceding document has the user of write permission just can see and edit the document:
By the plug-in unit mode setting of subjects at shown in 19-1, it means to call under nxd label
HasPermission method judges whether user writes (Write) permission to current document (currentDocument), has
Plug-in unit is just arranged to edit ' edit ' mode by words, is otherwise arranged to plug-in unit to hide ' hidden ' mode.To " example text "
Permission is set as shown in 19-2, gives the permission of Writer user " write-in ", gives the permission of Reader user " reading ".It uses at this time
Writer user clicks the general view tabs of " example text ", the step of plug-in unit obtaining mode originally with Figure 18 (18-3 to 18-
15) equally, as the createValueExpression run in resolveElExpression method 19-3 (same to 18-11)
When creating value expression method 19-4 (same to 18-16), it will wrap up EL environment by method 18-17, add function mapping for it,
Therefore any expression formula with nxd:hasPermission must be by Facelets (because they are defined within tag library
In) calculated, system will find NameSpace http://nxweb/ in<facelet-taglib>label
The method 19-9 of entitled hasPermission in document19-6 (its prefix is nxd), it will be mapped to
In DocumentModelFunctions method class 19-8 in ecm.platform.ui.web.tag.fn packet 19-7
HasPermission method 19-9, interface parameters 19-10, the variable comprising a document model and string format.
For the value expression expr of 19-4 creation as shown in 19-11, it includes expected Object Class1 9-12, El expression formula 19-13
(same to 19-1), AstChoice selection node 19-14 therein contain AstFunction functional node 19-15 (to pass through
HasPermission method check permission) and for selection two AstString character string nodes ' edit ' and
' hidden ', functional node 19-16 contain again AstIdentifier mark node 19-17 for obtain particular document and
For AstString node 19-18 to the permission for pointing out to need to judge, 19-17 and 19-18 are hasPermission method
Two parameters.Function Hash table " functions " 19-20 in function mapping " fnMapper " 19-19 in 19-11 is contained
It is all to reflect incoming function, for example this key assignments is the function map example 19-22 of " nxd:hasPermission " 19-21,
Its prefix is " nxd " 19-23, and local entitled " hasPermission " 19-24, its method 19-25 is a return boolean
The public method of value is DocumentModelFunctions method class in ecm.platform.ui.web.tag.fn packet 19-7
HasPermission method 19-9 in 19-8, the parameter for including is as shown in 19-10.19-26 is the variable mappings of 19-11, by
Do not call any variable therefore its value for null in 19-1.Value expression example ValueExpressionImpl is executed to 19-11
GetValue method 19-27 in method class, it calculates environment according to the function variable mappings composition in el environment and 19-11
(ctx) 19-28, it can be seen that the mapping of its function is not sky and variable mappings are empty (exactly the opposite with 18-31), takes this (i.e.
Node 19-29 (AstChoice selects node) 19-11), and initiated in AstChoice method class 19-30 according to it
GetValue method 19-31 takes the 0th child in this (i.e. AstChoice node 19-29) to select plug-in unit mode
19-32 (i.e. AstFunction node) simultaneously initiates the getValue method 19- in AstFunction method class 19-33 according to it
34 judge whether user has write permission to current document to execute hasPermission method, it is from environment (ctx) 19-28
Middle acquisition function maps (fnMapper) 19-35, and is mapped according to the function and initiate function map example
ResolveFunction method 19-37 in FunctionMapperImpl method class 19-36 is specific to obtain
HasPermission method, and will be in this object 19-38 (with the AstFunction functional node in 19-16)
' prefix ' 19-39 and ' localName ' 19-40 is passed to method 19-37 as parameter.Method 19-37 is in this object 19-41
Finding key assignments in function mapping table (functions) 19-42 in (initiating its function mapping ' fnMapper ' 19-35) is
The function map example 19-43 of " 19-39+ ': '+19-40 " (i.e. ' nxd:hasPermission ' 19-21), and return to 19-43
In method (Method) 19-44.Creating a content according to child's number of this object 19-16 is empty parameter object
(params) calculated value of each child 19-46 in 19-16 is successively filled in 19-45, is such as used according to 19-17 by 19-45
GetValue method in AstIdentifier method class takes out the document model example of current document currentDocument
(specific steps are shown in 18-47 to 18-50) takes out further according to getValue method of the 19-18 in AstString method class
The character string forms ' Write ' of ' Write ', the new parameter object of generation finally use call method as shown in 19-47
' invokeMethod ' 19-48 initiates hasPermission method 19-49, method 19-49 meeting by parameter of 19-44 and 19-47
Document management " documentManager " session is obtained, the hasPermission method in the session method class is executed
19-51,19-51 can initiate to check permission checkPermission method 19-52 by security service, be in method 19-52
System can obtain the visit in access control policy ' acp ' 19-54,19-54 in document 19-53 (i.e. current document ' example text ')
Ask the local permission for specifically listing that administrator is the document setting in control list ' acl ', it includes user (Writer)
The write-in ReadWrite permission 19-56 (ReadWrite, which is represented, to be read and write) of 19-55 and the reading of user (Reader) 19-57
(Read) permission 19-58 initiates checkPermission method 19-59 by security policy service and checks in access control plan
Whether user (Writer) 19-61, which contains, slightly in ' acp ' 19-60 (same to 19-54) is write (Write) 19-62 permission, can be passed through
19-55 and 19-56 sees that user Writer has write permission to the document, which is returned in the form of Boolean
19-63 is further returned to the relative position 19-64 of AstChoice selection node, due to the condition 19-65 of ternary operator
For true, selection is returned into the 1st option ' ' wMode ' in edit ' 19-66 to getWidget method 19-67 (same to 18-3)
19-68 (same to 18-67) is used as plug-in unit mode.The general view tabs that ' example text ' is clicked if it is user Reader, will visit
It asks and checks whether user (Reader) 19-69 writes (Write) 19-62 permission in control strategy ' acp ' 19-60 (same to 19-54),
It can see that user Reader does not have write permission in 19-54, check that failure 19-63 returns to false to AstChoice selection section
The relative position 19-64 of point, and the 2nd option ' hidden ' of ternary operator is selected, last plug-in unit mode (wMode)
19-70 is to hide ' hidden '.It as above is exactly the specific method that plug-in unit is controlled by the mark function in plug-in unit mode.
As shown in figure 20, there is creation user, editor user in system, check that user, modification user password etc. are multiple related
The page of user, but they are derived from the same user layout in fact, only mask portion according to the difference of layout pattern
Divide plug-in unit that user layout is made to be shown as different appearance:
20-1 is the layout of entitled user (user), it is made of 13 plug-in unit row 20-2 such as user name, password, due to each
The influence of the plug-in unit mode of a plug-in unit, layout can show completely different appearance in different modes.It is most of in 20-1
The plug-in unit mode<widgetModes>of plug-in unit is all as mail " email " 20-3, at Edit Password " editPassword "
Be hiding " hidden " 20-5 mode in the state that 20-4 etc. is special, presented under remaining usual state (such as browsing, editor) and
Be laid out identical mode, for example, user name plug-in unit 20-6, name plug-in unit 20-7, unit one belongs to plug-in unit 20-8 all with mail plug-in unit
The same browse state 20-10 that the plug-in unit is presented under the browse mode of layout of 20-9;Under " editor " 20-11 mode of layout
The editing mode 20-12 of the plug-in unit is presented, wherein statement " is being compiled in attribute (properties) 20-13 of mail plug-in unit 20-3
Volume " plug-in unit is essential " required " 20-15 and its pattern " styleClass " 20-16 under 20-14 mode is that data are defeated
Enter text style dataInputText;The hidden state 20- of the plug-in unit is presented under " changing password " 20-17 mode of layout
18, it can be seen that when layout is changes cipher mode, overwhelming majority plug-in unit all disappears, and is can only see at this time in the specific mould
It defines and removes in (the input password for the first time) 20-19 of dedicated several plug-in units such as password under formula and original password 20-20,20-19
In creation " create " 20-21, change password " editPassword " 20-22 mode under the plug-in unit in editor's " edit " shape
State, the plug-in unit is in hiding " hidden " state under remaining any " any " 20-23 mode, is defined in 20-20 in addition to changing
Become password " editPassword " 20-24 mode and current main tab " isOnMainTab " 20-25 as my homepage ' home '
The plug-in unit is editor's " edit " 20-27 state when 20-26, and the plug-in unit is hidden under remaining any " any " 20-28 state.It connects
Get off with regard to the plug-in unit mode 20-30 of plug-in unit mode 20-29 and " original password " by " mail " and illustrates plug-in unit mode
It is how to judge to come into force under the different mode of layout.Pass through layout pattern in acquisition plug-in unit getWidget20-31 method
In obtaining mode getModeFromLayoutMode method 20-32, the plug-in unit mode of non-el expression formula is all to pass through getMode
Method 20-33 is directly acquired, can be from its plug-in unit mould when loading mail plug-in unit when layout pattern is browsing " view " 20-34
It is found key value in formula 20-35 as the content of layout pattern " view " 20-36, is the key of " view " due to there is no key assignments in 20-35
Value pair, lookup result is sky (null) 20-37, when lookup result is that space-time system can be attempted to find key value as any " any "
The content of 20-38, due to being also the key-value pair of " any " without key assignments in 20-35, query result is sky (null) 20-39, will
The result returns to plug-in unit mode 20-40, can use getWidgetModeFromLayoutMode method when plug-in unit mode is empty
20-41 obtains mode of the mode as the plug-in unit of current arrangements, can see in 20-41, when layout pattern originate in it is clear
Look at " VIEW ", general view " SUMMARY ", list " LISTING ", title " HEADER " when will return browsing " VIEW " 20-42 as
The mode 20-43 of the plug-in unit, therefore the browse state of mail 20-9 can be seen in the browse mode 20-10 of layout, here it is
Why plug-in unit is presented and is laid out identical mode under usual state (such as browsing, editor);When layout pattern is browsing
When " view " 20-34, it can find key value from its plug-in unit mode 20-44 when loading original password plug-in unit as " view " 20-36
Content is sky due to not having key assignments to be the key-value pair lookup result 20-37 of " view " in 20-44, and system default is looked into from 20-44
Looking for key assignments is the content 20-45 of " any " 20-38, its result " hidden " is returned in plug-in unit mode 20-47, therefore is being laid out
Browse mode 20-10 under can't see original password, any " any " 20- of the plug-in unit other than " editPassword " mode
It is in hidden state under 45 modes;When layout pattern is to change password " editPassWord " 20-48, when loading mail plug-in unit
It can find key value from its plug-in unit mode 20-35 for the content of " editPassword " 20-49, due to key assignments in 20-35
" editPassword " corresponding content is " hidden ", and lookup result 20-46 is returned to plug-in unit mode 20-47, therefore in cloth
It can't see mail plug-in unit under change password " editPassWord " mode " 20-18 " of office, why this is also in layout
Most of plug-in unit is in hidden state under " editPassword " mode;When layout pattern is to change password " editPassword "
When, it can find key value from its plug-in unit mode 20-44 when loading original password plug-in unit as the interior of " editPassword " 20-49
Hold, can see that the corresponding content of key assignments " editPassword " is an el expression formula in 20-44, due to query result
20-50 has passed through the el expression formula format verification of method 18-13, it will be calculated this with method 19-3 before returning to plug-in unit mode
A el expression formula is judged ' in main tab mainTabActions ' method class by the test method in nxu NameSpace
' current main tab isOnMainTab ' whether be ' my homepage home ', and according to judging result select " edit " or
" hidden " mode, so when administrator wants to need first to input when modifying the password of oneself in " my homepage " 20-26
Original password 20-20 is to guarantee safety, when administrator wants " to change close in " system administration " 20-52 for others (such as user BBB)
Input original password is not required to when code " 20-53 to be easy to operate.As above it is exactly the reuse principle being laid out, is exactly based on to slotting
The diversification judgement of part mode is so that same user layout has presented different appearance and function in different modes
The user information page in different poses and with different expressions.
As shown in figure 21, how system demonstration is by nxu:test this mark function test macro any means class
Method or the logical expression that is made of multiple conditions, and be that plug-in unit selects corresponding mode according to result logical value:
The el expression formula in plug-in unit mode 20-30 is calculated with method 21-1, it creates value expression " expr " 21- first
2, it can see that its specific el expression formula 21-3, node are an AstFunction functional node 21-4, packet from 21-2
Include one for judgement AstValue value node 21-5 and two AstString node plug-in units alternately for being used for selection
Mode includes an AstIdentifier flag node 21-6 in value node 21-5 for finding specific method class
MainTabsActions and AstMethodSuffix method node 21-7 is for calling isOnMainTab method (figure
Permission of the mark function nxd:hasPermission to judge current document in 19, parameter are current document, write permission
Equal variables;And calculated result of the mark function nxu:test to judgment method isOnMainTab in this figure, parameter are side
Method class and method).21-8 is mapped containing function in 21-2, it is defined in<facelet-taglib>the label 21-9
NameSpace is the mark function of entitled " test " 21-11 of " http://nxweb/util " 21-10 (being abbreviated as nxu) method, it
What is quoted is the test method in ecm.platform.ui.web.tag.fn packet 21-12 in Functions method class 21-13,
The parameter type of nxu:test is as shown in 21-14, comprising a Boolean as method call as a result, including two
Object is as plug-in unit mode to be selected.With in value expression example ValueExpressionImpl method class 21-15
GetValue method 21-16 obtains the package types calculated in 21-2: it first takes out the AstFunction functional node of 21-2
21-17 runs the getValue method 21-19 in AstFunction method class 21-18 to obtain mark function nxu:test's
Calculated result: 21-20 is mapped from the function of taking out 21-2 in environment is calculated, according to the prefix in functional node 21-17
(prefix) 21-21 and local name (localname) 21-22 obtains specific method 21-57 (tool from function mapping 21-20
Body step is shown in 19-39 to 19-44), an empty parameter array (params) is created according to child's number in functional node 21-17
The value of child nodes in 21-17 is successively filled in 21-23 by 21-23, first takes the 0th child 21-24 of 21-17 (i.e.
AstValue node 21-5), calculate its value with the getValue method 21-25 in AstValue method class: it will first take out
The 0th child 21-26 of AstValue value node 21-5 is mainTabsActions's according to this content
AstIdentifier mark node takes out MainTabsActions method class 21-27, i from ' 1 ' 21-28 of increasing and continues to take 21-5
The 1st child, content be isOnMainTab AstMethodSuffix method node 21-29, pass through
GetValue method in AstMethodSuffix method class in 21-30 takes out the calculated result of this method: passing through first
GetParameters method 21-31 takes out parameter, according to child's number of AstMethodSuffix method node 21-29 creation one
The object array 21-32 of a sky, by all children of AstMethodSuffix node 21-33, (for example content is home's
AstString node 21-34) value fill in 21-32, finally using filled object array 21-35 return 21-31 as join
Number, calls this using " MainTabsActions " 21-37 as method class, with 21-29's with invokeMethod method 21-36
Mirror value (isOnMainTab) 21-38 is method name, using (home) 21-35 as the isOnMainTab method 21-39 of parameter: should
Method will judge whether current main tab is 21-40 (home), it first takes out leading option from WebActions method class
The value " MAIN_TABS " (value is a constant variables) of card classification (MAIN_TABS_CATEGORY) 21-41, then use
GetCurrentTabId method 21-42 takes out the Id for the tabs that current class is " MAIN_TABS " 21-43, it needs first to lead to
It crosses getCurrentTabAction method 21-44 and takes out specific current tab action-item, operate item collection in current tab
Closing in (currentTabActions) 21-45 can be seen that current leading option card MAIN_TABS (could also say that header
Tabs) what is chosen in 21-46 is my homepage (home) tabs 21-47, current user's sidebar (USER_CENTER)
That choose in 21-48 is my card information (Profile) tabs 21-49, and it is " MAIN_ that key assignments is taken out from 21-45
The tabs action-item 21-51 of TABS " 21-50, and take its Id (home) 21-52, with (Id) 21-52 of current main tab and
The parameter 21-53 transmitted is compared, if wanting that true is returned to 21-54 as the calculating knot of AstValue value node if waiting
Fruit, the result " true " will be tucked into the parameter array 21-55 of AstFunetion node by 21-24, then again successively
Other two child's (two AstString nodes that content is edit and hidden) of node 21-17 is filled in into 21-55, is led to
Crossing invokeMethod method 21-56 and initiating this using 21-57 is method using 21-58 as the test method 21-59 of parameter, it will
It selects to return to " edit " as the condition of ternary operator using its first parameter 21-60 (with the first child in 21-55)
21-61 or " hidden " 21-62, since the second parameter " edit " of test method 21-59 is returned to value for true by 21-60
Corresponding position 21-63 in expression formula method class 21-15 is somebody's turn to do the calculated result that " edit " is value expression 21-2 and namely should
The mode that plug-in unit will use, therefore in the case where changing cipher mode 20-17, it can be compiled as homepage 20-30 of the leading option card for me
Collect original password 20-20.When leading option card is system administration, getCurrentTabAction method 21-44 is obtained at this time
Tabs action-item as shown in 21-64, Id be " admin " 21-65, it is unequal with 21-53 thus return " false " 21-66,
The parameter array (its first child is false) as shown in 21-67 for participating in test method at this time, due to test method 21-59
Ternary operator condition be " false " 21-68, mode 21-69 of its 3rd child " hidden " as plug-in unit will be returned,
Therefore in the case where changing password 20-53 mode, it can't see original password when leading option card is system administration 20-52.As above
It is the application method of nxu:test, it can be using the method that any return value is Boolean as parameter, and is tied according to its judgement
Fruit selects corresponding plug-in unit mode, so can be allowed in system and arbitrarily be returned using nux:test mark function as interface
Value is that the method for Boolean participates in the calculating work of plug-in unit mode.For luminous energy in method as parameter, it can also be not patrol by nxu:test
Expression formula is collected as parameter, as shown in 21-70, nxu:test is with " active user currentUser is administrator
Administrator or active user currentUser is the member of power user's group ' powerusers ' " this logical expression
Formula is that the condition selection of ternary operator returns to " edit " or " view " mode: by AstOr method class 21-71
GetValue method takes out the logical consequence of this or logical expression: first to the 0th child 21- of AstOr or node 21-72
73 (i.e. currentUser.administrator) are sentenced using the getValue method 21-75 in AstValue method class 21-74
Breaking, whether it is true: first taking out the 0th child 21-76 of current AstValue value node, is according to this value
The AstIdentifier mark node of " currentUser " obtains the information 21-77 of active user (assuming that active user is
BBB), the next child 21-78 for further taking out current AstValue value node is administrator's according to this value
AstPropertySuffix node takes out when using the isAdministrator attribute 21-79 in user information 21-77, is tied
Fruit " false " back to AstOr node corresponding position 21-80 as logic or in first expression formula calculated result, if
21-81 (same to 21-80) is that true will directly return to true, due to 21-81 at this time be false continue decision logic or in it is next
A expression formula takes out the first child 21-82 (i.e. currentUser.isMemberOf (' in AstOr or node 21-72
Powerusers ')), the value of the expression formula is calculated with the getValue method of AstValue method class: first taking out the AstValue
The value 21-77 of 0th child " currentUser " 21-83 of node further takes out the 1st child 21-84 of the node, according to
The AstMethodSuffix method node that the value is isMemberOf initiates isMemberOf method 21-85, judges active user
Whether include power user's group (powerusers) 21-87 in all groups of (allGroups) 21-86 of information 21-77, can see
Member's group " members " and the area B member's group " area tenant-B _ tenantMembers " are contained into 21-86 but are not included
Powerusers, therefore the value of second expression formula of AstOr node or logic is also " false " 21-88, and 21-88 is returned to
Condition of the 21-70 as ternary operator, since it selects the 3rd parameter " view " 21-89, i.e. user BBB can be clear for false
Look at the plug-in unit;When user is total administrator Administrator, since the isAdministrator in its user information belongs to
Property 21-90 be true, in AstOr node logic or first transition formula evaluation be " true " 21-91, " true " is returned to
Condition of the 21-70 as ternary operator will select the 2nd parameter " edit " 21-92, therefore total administrator at this time
Administrator can edit the plug-in unit.As it appears from the above, can be judged by nxu:test by different variables/method condition
The logical expression of composition, this greatly enhances the further flexibilities of plug-in unit mode.
As described in Figure 22, the same plug-in unit is made to show different effects to different user by the setting of plug-in unit mode, or
Several intimate plug-in units are set in the specific position of layout, by the filtering of plug-in unit mode so that user can only see meets
The plug-in version of oneself permission, to reach the reuse of plug-in unit:
22-1 (same to 20-1) is user layout, and 22-2 is the affiliated group's plug-in unit of user in layout, and plug-in unit mode is being compiled
This could be edited and insert by stating only system manager or power user with nxu:test mark function 22-4 under volume 22-3 mode
Part, other people can only browse the plug-in unit (specific steps are shown in 21-70 to 21-92), therefore system manager
Administrator22-5 can see the editing mode 22-6 of the affiliated group of user when modifying personal information, can pass through a little
Fork is hit to allow and oneself exit some group, can also be searched for by 3 characters of input and enter some group;And it commonly uses
Family (BBB) 22-7 can only see the browse mode 22-8 of the affiliated group of user, can not carry out any operation to the group of oneself.Such as
Upper is exactly the specific method that plug-in unit reuses, and a same plug-in unit can allow different users to see not by the setting of plug-in unit mode
Same effect.22-9 is regional choice plug-in unit, it is made by nxu:test mark function 22-10 in creation 22-11 and editor
Only system manager can edit this under (the same creation of the plug-in unit mode of editor, due to being omitted in local not enough figure) mode
Plug-in unit, other users can not see the plug-in unit, it is examined by the checkFilter method 22-12 of webActions method class
Look into the verification whether active user leads to cross filter only_for_manager: it first uses filter registration table
(filterReg) all filters in 22-13 extraction system, then taking out key assignments in 22-13 is 22-14 (i.e. to this method
Incoming parameter only_for_manager character string 22-15) filter (filter) 22-16, which is in 22-17
Defined in, id only_for_manager, it is provided when # { userSession.administrator } is (i.e. current to use
Family is system manager) condition 22-18 authorizes (grant) 22-19 when setting up and checks through (true), and plug-in unit mode is to compile at this time
22-20 is collected, other users (the nonsystematic administrator that can't pass only_for_manager filter inspection) can not be seen
The 22-21 plug-in unit.Plug-in unit saves the option in drop-down list by<selectOptions>label 22-22, it passes through
All regions in getTenants method 22-23 acquisition system in multiTenant method class: it first obtains directory service
22-24 opens one by directory service and leads in database the session of " tenants " 22-25 table, and taken out by the session
All entry 22-26 in tenants table (take the detailed step of entry to see 8-8 to 8-23, getEntries () from session
It is empty inquiry operation that method, which is equivalent to and initiates a filter, i.e., no filter condition obtains all entries in table), pass through
One display label is the empty option of " None " 22-27 and uses the label attribute 22-28 of each entry in 22-26 as display
The multiple regions option of label forms the drop-down list option of the plug-in unit, and as shown in 22-29, which means display effect
He can be assigned to arbitrary region in creation (or editor) user by system manager.22-30 inserts for another regional choice
Part, it have with 22-9 as package types, display label and foreground pattern, only just like next slightly small difference: its
(layouts lower cannot there are two the plug-in units of same name) one 1 more behind the name of name ratio 22-9;It is in creation mould
State that only Regional Admin can edit the plug-in unit with nxu:test mark function 22-31 under formula, other people can not see that this is inserted
Part, the filter tenantPowerusers for being used to examine are defined in the 22-32, it provides to work as condition #
{ currentUser.isMemberOf (' powerusers ') } 22-33 (i.e. active user is power user/Regional Admin)
Inspection is authorized when establishment by " true ", plug-in unit is " edit " state at this time, as condition #
{ currentUser.administrator } 22-34 (i.e. active user is system manager) authorizes inspection and does not pass through when setting up
" false ", board state is hidden at this time, so power user's (i.e. district management only other than system manager
Member) plug-in unit can be edited.The option in its drop-down list is saved in<selectOptions>the label 22-35 of the plug-in unit,
It first uses the money of the acquisition active user of the getUserProfile method 22-36 in userPreferencesActions method class
Expect (currentUserProfile) 22-37, then from the tenantId attribute 22-39 found out in user framework 22-38 in 22-37
And the display label with the attribute value alternatively, display effect is as shown in 22-40, it means that when Regional Admin creates
He can only create the user for belonging to the region when user, and 22-41 is defined hides the plug-in unit under edit pattern, this is because should
Plug-in unit is that Regional Admin is dedicated, also only one option, therefore the region of editor user in total in zone drop down list
(can only be changed to again the area B from the area B) is also meaningless.It as above is exactly another method for reusing of plug-in unit, in a layout
The similar plug-in unit of several appearance identical functions is continuously arranged in same position, is selectively filtered by plug-in unit mode, so that
Different user calls plug-in unit Shi Douhui to see that the plug-in unit meets that version of active user's permission, such as system manager 22-
The 42 regional choice plug-in units seen can select all areas, and the regional choice plug-in unit that Regional Admin 22-43 sees can only select
Select the region where the administrator.
Claims (1)
1. a kind of XML configures web site method, it is characterized in that:
It specifically includes: by the content map in XML to website;Establish catalogue;Configuration plug-in;Plug-in unit is shown;Display directory;XML
It extracts;Layout is called;Layout is established;Plug-in unit mode computation;Layout reuses;
Wherein the content map by XML is specifically included to website:
By extension tag<extension>come definition component in XML file, extension tag includes an extension objective attribute target attribute
For indicating the method class for loading the base part in the page and an extension point attribute for indicating parsing component XML
The resolver of content, user configure or assemble to component in extension tag, can be obtained by extension point when system starts
It parses the resolver of the component and the XML content of the component is mapped to a java object, when page invocation can pass through extension
Target calculates the java object and generates web pages component, so that user can easily configure website by XML;
It is described to establish directory scheme, it specifically includes:
Point config directory is extended according to directories, database connection type is set according to its data source property, according to its framework category
Property each column name of setting and its type, be loaded into each entry information according to its data file attribute, build table policy attribute setting mesh according to it
The data refresh mode of record;
The configuration plug-in method, specifically includes:
Point configuration plug-in type is extended according to widgettypes, point configuration plug-in is extended according to widgets, plug-in unit is bound and is inserted
Part type, plug-in unit will inherit foreground template, background process method, layout and attribute in package types;
The plug-in display method, specifically includes:
The data assembling saved in plug-in unit is shown to foreground at the form of label, by plug-in unit attribute defined in XML file
As spooler Rule of judgment or be packaged into tag attributes and be exposed to foreground template, to be influenced by modification XML
The performance and function of plug-in unit;
The Display directory method, specifically includes:
It obtains all entries of catalogue and they is generated into a JSONAdapter tree by way of iteration, then pass through
Javascript is generated available words tree in a drop-down list, corresponding for its addition according to the attribute of each vocabulary
Css pattern;
The XML extracting method, specifically includes:
The XML information that system extracts plug-in unit is simultaneously generated one only comprising extension target, extension point and original XML file address
The registration information is put into the queue for waiting the extension target when extending target and not loading by registration information, when extension target adds
The corresponding descriptor of extension point in registration information is therefrom found out after load, by the descriptor from the former XML in registration information
The specific configuration information of the plug-in unit is taken out in file address, and is registered the java object with extension point same type;
The layout call method, specifically includes:
Each type of document all contains the layout collection to show in different modes, and each layout collection is by one or more
A layout composition, by loading these layouts for the facelet processor of layout collection or layout;
The layout method for building up, specifically includes:
Extend point configuration layout according to layout, every row in layout contains only the name of plug-in unit, when calling layout according to
The name of each plug-in unit takes out plug-in definition information, specific plug-in unit example is calculated further according to running environment, with plug-in unit example
The filling of each row of layout is complete, by the XML configuration information of layout define in the layout always, default and never choose
Row, selection shows a few rows in the layout in any foreground facelet label for calling the layout;
The plug-in unit mode computation method, specifically includes:
There is<widgetModes>label to save the plug-in unit in different layout moulds in the XML information of each plug-in unit
The selection of these calculation methods: plug-in unit mode computation method under formula directly returns to a kind of specific mode;Sentenced according to system variable
It is disconnected to select certain mode;Judged to select certain mode according to the calculated result of mark function, be allowed by nxu:test mark function
The Rule of judgment of any method alternatively mode for returning to Boolean in system, if<widgetModes>content is blank card
The mode of layout belonging to it will be inherited;
The layout method for reusing, specifically includes:
By the diversification judgement of plug-in unit mode so that same layout shows different performance and function in different modes,
The same plug-in unit is made to see different-effect by different user the scope check of active user by being added in plug-in unit mode,
The similar plug-in unit of several appearance identical functions is continuously arranged in same position in layout, passes through the selective filter of plug-in unit mode
So that the user of different rights can only see that plug-in version for meeting oneself permission.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510312172.7A CN105095348B (en) | 2015-06-09 | 2015-06-09 | A method of passing through XML dynamic configuration website |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510312172.7A CN105095348B (en) | 2015-06-09 | 2015-06-09 | A method of passing through XML dynamic configuration website |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105095348A CN105095348A (en) | 2015-11-25 |
CN105095348B true CN105095348B (en) | 2019-03-26 |
Family
ID=54575785
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510312172.7A Active CN105095348B (en) | 2015-06-09 | 2015-06-09 | A method of passing through XML dynamic configuration website |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105095348B (en) |
Families Citing this family (25)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104978196A (en) * | 2015-06-26 | 2015-10-14 | 深圳Tcl数字技术有限公司 | Setting function item display method and apparatus |
CN105700925B (en) * | 2016-01-13 | 2019-02-19 | 深圳市华讯方舟软件信息有限公司 | A kind of interface implementing method and device of APP |
CN107329745A (en) * | 2017-06-16 | 2017-11-07 | 贵州广思信息网络有限公司 | A kind of method of enhancing WORD document operability |
CN107273138A (en) * | 2017-07-04 | 2017-10-20 | 杭州铜板街互联网金融信息服务有限公司 | Decoupling method and system based on interaction between Android business modules |
CN108287713A (en) * | 2017-12-22 | 2018-07-17 | 深圳康得新智能显示科技有限公司 | Adding method and device, terminal, storage medium, the electronic device of document function |
CN110232173A (en) * | 2018-03-06 | 2019-09-13 | 福建天泉教育科技有限公司 | List configuration method and its system based on configurableization list engine |
CN110750248B (en) * | 2018-07-23 | 2023-06-02 | 贵州白山云科技股份有限公司 | Method and device for transmitting extension information of existing component |
CN109445890A (en) * | 2018-10-09 | 2019-03-08 | 北京达佳互联信息技术有限公司 | A kind of method for showing interface, device, terminal device and storage medium |
CN109614085B (en) * | 2018-10-23 | 2019-11-29 | 深圳微迅信息科技有限公司 | Function realizing method, device, computer equipment and storage medium |
CN109977670B (en) * | 2019-03-12 | 2021-06-29 | 福建天晴数码有限公司 | Android application security monitoring method based on plug-in loading and storage medium |
CN110263279B (en) * | 2019-05-08 | 2021-08-10 | 北京字节跳动网络技术有限公司 | Page generation method and device, electronic equipment and computer readable storage medium |
CN110442419B (en) * | 2019-08-15 | 2022-11-29 | 北京字节跳动网络技术有限公司 | Interface layout method and device for Android application |
CN111459570B (en) * | 2020-03-30 | 2023-03-17 | 掌阅科技股份有限公司 | PDF plug-in loading method, electronic equipment and computer storage medium |
CN111897469A (en) * | 2020-07-06 | 2020-11-06 | 上海泛微网络科技股份有限公司 | Real-time data processing method, device, equipment and storage medium |
CN111813385B (en) * | 2020-07-07 | 2023-09-22 | 赞同科技股份有限公司 | Page plug-in method, device and equipment based on Web application |
CN112632920B (en) * | 2020-11-16 | 2021-11-23 | 腾讯科技(深圳)有限公司 | Link processing method, link processing device, terminal equipment and storage medium |
US11537392B2 (en) * | 2021-01-04 | 2022-12-27 | Capital One Services, Llc | Dynamic review of software updates after pull requests |
CN113076462B (en) * | 2021-03-25 | 2024-04-30 | 恒安嘉新(北京)科技股份公司 | Network session data query method, device, equipment and medium |
CN113065314B (en) * | 2021-03-26 | 2023-02-28 | 山东英信计算机技术有限公司 | BIOS hardware adaptation method and device based on XML file format |
CN113342417A (en) * | 2021-06-15 | 2021-09-03 | 京东数科海益信息科技有限公司 | Plug-in configuration method, device and equipment |
CN114064662B (en) * | 2022-01-13 | 2022-05-03 | 北京中交兴路信息科技有限公司 | Method, device, electronic equipment and medium for querying data |
CN114090523B (en) * | 2022-01-19 | 2022-06-07 | 荣耀终端有限公司 | Electronic device, and node parsing method and medium for XML file thereof |
CN114595199B (en) * | 2022-05-10 | 2022-09-02 | 太平金融科技服务(上海)有限公司 | File analysis method and device, computer equipment and storage medium |
CN116301831B (en) * | 2023-03-20 | 2024-02-27 | 中国华能集团有限公司北京招标分公司 | DP plug-in and application method thereof |
CN116302076B (en) * | 2023-05-18 | 2023-08-15 | 云账户技术(天津)有限公司 | Method and device for configuring configuration items based on analysis configuration item table structure |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1993694A (en) * | 2004-07-30 | 2007-07-04 | 西门子公司 | Method programme and system for the dynamic template-based generation of internet pages |
CN102646102A (en) * | 2011-02-22 | 2012-08-22 | 青岛海信电器股份有限公司 | XML (Extensible Markup Language) file generating method and device as well as terminal equipment |
-
2015
- 2015-06-09 CN CN201510312172.7A patent/CN105095348B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1993694A (en) * | 2004-07-30 | 2007-07-04 | 西门子公司 | Method programme and system for the dynamic template-based generation of internet pages |
CN102646102A (en) * | 2011-02-22 | 2012-08-22 | 青岛海信电器股份有限公司 | XML (Extensible Markup Language) file generating method and device as well as terminal equipment |
Non-Patent Citations (3)
Title |
---|
XML技术在动态网站中的应用;刘淑梅;《邢台职业技术学院学报》;20061031;第23卷(第5期);第62-63页 |
一种XML的模型论语义;刘升平 等;《软件学报》;20060530;第17卷(第5期);第1089-1097页 |
基于XML实时动态模型界面的研究与应用;王雅光 等;《计算机应用与软件》;20130930;第30卷(第9期);第245-249页 |
Also Published As
Publication number | Publication date |
---|---|
CN105095348A (en) | 2015-11-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105095348B (en) | A method of passing through XML dynamic configuration website | |
US10372739B2 (en) | Corpus search systems and methods | |
NL1028923C2 (en) | Method, device and software for extracting chemical data. | |
US7409401B2 (en) | Method and system for supporting multivalue attributes in a database system | |
US7890507B2 (en) | System and method of joining data obtained from horizontally and vertically partitioned heterogeneous data stores using string-based location transparent search expressions | |
US7523125B2 (en) | Parsing system | |
JPH10240588A (en) | Database processing method | |
NZ529332A (en) | Method and system for interfacing with a multi-level data structure | |
JPH02121030A (en) | Editing of hierarchical data | |
CN110297880A (en) | Recommended method, device, equipment and the storage medium of corpus product | |
CN110147544A (en) | A kind of instruction generation method, device and relevant device based on natural language | |
Chang et al. | A methodology and interactive environment for iconic language design | |
JP2000348038A (en) | Device and method for storing data for semi-structured database | |
Özsu et al. | An object-oriented sgml/hytime compliant multimedia database management system | |
Corver | Comparative deletion and subdeletion | |
US20040024741A1 (en) | Database processing method | |
CN102043849B (en) | Realization method for electronic dictionary system with ideographic components as elements | |
Cussens et al. | Using inductive logic programming for natural language processing | |
Spertus | ParaSite: mining the structural information on the World-Wide Web | |
Hazman et al. | Ontology learning from textual web documents | |
Seligman | Generating discourses from networks using an inheritance-based grammar | |
Ward et al. | Oracle Call Interface Programmer's Guide, 11g Release 2 (11.2) E10646-12 | |
Haidou | On the syntax and pragmatics interface: left-peripheral, medial and right-peripheral focus in Greek | |
Besemer et al. | FLUSH: a flexible lexicon design | |
Hong | Grammatical Inference for Information Extraction and Visualisation on the Web |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |