CN105095348A - Method for dynamically configuring website through XML (Extensive Markup Language) - Google Patents

Method for dynamically configuring website through XML (Extensive Markup Language) Download PDF

Info

Publication number
CN105095348A
CN105095348A CN201510312172.7A CN201510312172A CN105095348A CN 105095348 A CN105095348 A CN 105095348A CN 201510312172 A CN201510312172 A CN 201510312172A CN 105095348 A CN105095348 A CN 105095348A
Authority
CN
China
Prior art keywords
plug
unit
layout
xml
attribute
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.)
Granted
Application number
CN201510312172.7A
Other languages
Chinese (zh)
Other versions
CN105095348B (en
Inventor
谢不枯
柴文钢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zhixing Technology Co Ltd
Original Assignee
Beijing Zhixing Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Zhixing Technology Co Ltd filed Critical Beijing Zhixing Technology Co Ltd
Priority to CN201510312172.7A priority Critical patent/CN105095348B/en
Publication of CN105095348A publication Critical patent/CN105095348A/en
Application granted granted Critical
Publication of CN105095348B publication Critical patent/CN105095348B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, 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

The invention provides a method for dynamically configuring a website through an XML (Extensive Markup Language). A user can define a component in an XML file through an extension tag 1 <extension>, wherein the extension tag 1 comprises one extended target 2 attribute used for indicating a method class that loads components of this class in a page, and one extension point 3 attribute used for indicating an analyzer which analyzes an XML content of the component; the user can configure (such as setting the display contents of plug-ins) or assemble (such as inserting the plug-ins in the layout) the component in the extension tag 1; when a system is started, the analyzer which analyzes the component can be obtained through the extension point 3 and the XML content of the component can be mapped into a java object 4; when the page is called, the java object 4 is calculated through the extended target 2, (judging whether to display the component according to an operating environment and generating a foreground style according to the component attribute), and a page component 5 is generated, thus people without programming experience can be able to further customize the website only through the xml.

Description

A kind of method by XML dynamic-configuration website
Art
The present invention relates to a kind of method by XML dynamic-configuration website.
Background technology
XMAP is the class libraries that an energy is mapped to XML Java object, resolve by carrying out traversal to each label in XML, the value of parsing is put into the java object stated, so java object can be configured by XML, reach modular effect, but the process of resolving is pretty troublesome, complicated code is needed to realize, to the mapping of each java object, being unsuitable for new hand to operate.
Summary of the invention
In order to overcome the deficiency that existing XMAP class libraries is not easy to operate, the invention provides the resolver of complete set, cover a website each building block necessary (as layout, plug-in unit), user can navigate to rapidly the resolver of parts by the mode of expansion and configure these parts easily.
The technical solution adopted for the present invention to solve the technical problems is: in XML file, carry out definition component by extension tag <extension>, extension tag comprises an Extended target attribute for indicating the method class loading this base part in the page, and an extension point attribute is for indicating the resolver of resolving these parts XML content, user can be configured (as arranged the displaying contents of plug-in unit) or assembling (as inserted plug-in unit in layout) to parts in extension tag, can the resolver of these parts of parsing be obtained by extension point and the XML content map of these parts be become a java object when system starts, this java object (judging whether to show these parts and generate foreground pattern according to element attribute according to running environment) generating web page assembly can be calculated by Extended target during page invocation, thus make user can configure website easily by XML.
The invention has the beneficial effects as follows, can allow does not have the people of programming experience just can in depth tailor-made product by means of only xml, comprises data framework and Doctype, list, life cycle, audiomonitor, web user interface (button, tab, link, view, theme), workflow.
Accompanying drawing explanation
Fig. 1 is XML configuration data framework of the present invention, Doctype schematic diagram
Fig. 2 is XML config directory schematic diagram of the present invention
Fig. 3 is XML catalogue schematic diagram of the present invention
Fig. 4 is XML registered plug-ins type schematic diagram of the present invention
Fig. 5 is XML instantiation plug-in unit schematic diagram of the present invention
Fig. 6 is exposure plug-in unit variable schematic diagram of the present invention
Fig. 7 is that plug-in unit of the present invention calls foreground template schematic diagram
Fig. 8 is that catalogue of the present invention generates words tree schematic diagram
Fig. 9 is drop-down list of the present invention display words tree schematic diagram
Figure 10 is the extension framework schematic diagram in extraction XML of the present invention
Figure 11 is of the present invention according to the hang-up of dependence condition, loading extension framework schematic diagram
Extension framework is of the present inventionly filled complete diagram by XML configuration information by Figure 12
Figure 13 is of the present invention by XML configuration information operation plug-in unit schematic diagram
Figure 14 is registration schematic layout pattern of the present invention
Figure 15 is extraction schematic layout pattern of the present invention
Figure 16 of the present inventionly realizes schematic layout pattern
Figure 17 is of the present invention by attribute configuration layout rows schematic diagram
Figure 18 is of the present invention by variable mappings control plug-in unit pattern diagram
Figure 19 is of the present invention by functional mapping control plug-in unit pattern diagram
Figure 20 is of the present invention by plug-in unit pattern reuse schematic layout pattern
Figure 21 is of the present invention by mark function method of testing schematic diagram
Figure 22 is of the present invention by plug-in unit pattern reuse plug-in unit schematic diagram
Figure 23 is XML custom web site of the present invention summary schematic diagram
Embodiment
As shown in Figure 1, the xml markup language on the left of Fig. 1 can be translated into the data framework on the right side of Fig. 1 and Doctype when system starts, the code in the middle part of Fig. 1 can judge the expansion (extension) of reading:
When extension point (point) for Doctype (doctype) 1-1 and its label is Doctype (doctype) 1-2 time, Doctype descriptor (DocumentTypeDescriptor) 1-3 instantiation Doctype can be used, the Doctype that this example realizes is named as file (Folder), the document type further comprises common (common) data framework, Dublin (dublincore) data framework, file (Folderish) bin;
When extension point (point) for Doctype (doctype) 1-1 and its label is bin (facet) 1-4 time, this can be named as the bin of file (Folderish) with bin descriptor (FacetDescriptor) 1-5 instantiation;
When extension point (point) is for can according to its tag name framework (schema) this data framework of framework descriptor (SchemaBindDescriptor) 1-8 instantiation during framework (schema) 1-6, the dublincore by name of this framework, prefix (prefix) is dc, its reference address (src) is the dublicore.xsd file 1-9 under shcema file, list part Dublin (dublincore) data framework attribute in this embodiment, comprise the title (title) of string format, the theme (subjects) of (description) and character string listings format is described.
As shown in Figure 2, can generate according to the xml markup language on the left of Fig. 2 the catalogue that is connected to postgresql database when system starts:
System first uses SQL directory descriptor (SQLDirectoryDescriptor) that 110nsubjects catalogue 2-1 is instantiated as configuration information (config) 2-2, then by buffer memory max cap. (cacheMaxSize) 2-3 and buffer memory time-out duration (cacheTimeout) 2-4 stored in buffer memory.Find the server of its correspondence to configure according to data source label (<dataSource>) 2-5 and obtain connecting to Postgresql with acquisition method of attachment (getConnection) 2-6, can see that the connection of generation includes database location jdbc:postgresql: //localhost:5432/postg, user name postgr.In architecture management (schemaManager), extract framework name (schemaName) 2-7 is the framework of 110nxvocabulary, framework (schema) 2-8 illustrates attribute corresponding to 110nxvocabulary, comprise id, parent of string type, the appearance after this framework is instantiated is as shown in 2-9.Extract each field name (fieldName) 2-10 of this framework and filled in framework field list (schemaFieldMap) 2-11, when field name 2-12 (same to 2-10) is identical with content " id " 2-14 in idField label 2-13 in XML, sets critical field that this field is framework and specify that it mustn't for empty as shown in 2-15.The data type 2-16 of this field can be set to type (ColumnType) 2-17 on this hurdle, if the value automatically increased in label (autoincrementIdField) 2-18 of the Id in XML is true, AUTOINC can be set to by condition judgment 2-19 and by the type on this hurdle.If this hurdle comprises default value 2-20 in framework, this default value (defaultValue) 2-21 can be set to this hurdle.Finally will by connecting (sqlConnection) 2-22 (same to 2-6), table (table) 2-23 of firm establishment, Data Filename (dataFileName) 2-24, builds the table that table strategy (createTablePolicy) 2-25 carrys out to set up 110nsubjects by name in postgresql database.
As shown in Figure 3, system can be set up this catalogue according to build table strategy, framework and the data source in xml and imports data in postgresql database:
Setting is directly skipped for during never (never) 3-1 when building table strategy, when building table strategy for building table (on_missing_column) 3-2 during disappearance column, can check with hasMatchingColumns method 3-3 and whether go containing disappearance, the method can call getMissingColumns method 3-4 to find disappearance row, the method first can be searched already present same famous-brand clock (110nsubjects) in database and be obtained its each column name as shown in 3-5, obtain the new 110nsubjects be loaded into again and show 3-6, new column 3-7 non-existent in original column 3-5 is loaded into disappearance column (missingColumns) 3-8.If the size on disappearance hurdle is greater than 0 and means to there is disappearance hurdle, to be that 110nsubjects table adds new column label_new with addMissingColumns method 3-9, again table is built again with createTable method 3-10, establishment one is authorized statement (stmt) 3-11 by the method, this statement includes the link information 2-6 of postgresql database, first perform with this statement and delete old predicative sentence (dropSql) 3-12, perform according to new architecture again and build predicative sentence (createSql) 3-13, last perform again arrange id hurdle be major key such after set up predicative sentence (sql) 3-14.Having built table uses loadData method 3-15 to be that this table is loaded into data afterwards, directories/110nsubjects.csv is the address that this table is loaded into information to XML by data file label (<dataFile>) 3-16 reputation, system will import in input stream (InputStream) and csv plug-in reader (csvReader) the content in this address (dataFileName) 3-17, each column name (columnNames) 3-18 in 110nsubjects.csv is extracted by csv plug-in reader, and generate SQL insertion statement (insertSql) 3-19 accordingly, the content 3-20 often gone in 110nsubjects.csv is read column value (columnValues) 3-21, and according to Rule of judgment, this value is changed into data type 3-22 corresponding in framework, the SQL these values being inserted 3-19 composition band parameter inserts statement 3-23, the content of this row will be inserted in postgresql database as shown in 3-24 after performing this statement.
As shown in Figure 4, the drop-down final election package types (suggestManyDirectory) in XML can be registered in system the template changing drop-down final election plug-in unit as an example by system, is loaded into a package types and is divided into 4 steps:
Package types name (suggestManyDirectory) 4-1 is loaded into 4-2; Method (handler-class) 4-3 of process plug-in unit is loaded into; Template attributes (property) 4-5 of display plug-in unit is loaded into 4-6; Configuration information (configuration) 4-7 of package types is loaded into by method 4-8.Title (title) 4-9 will be loaded into 4-10 by 4-8 respectively, pattern (supportedModes) 4-11 supported is loaded into 4-12, field organizational form (list) 4-13 of plug-in unit is loaded into 4-14, type (supportedTypes) 4-15 field supported is loaded into 4-16, display position list (categories) 4-17 comprised by plug-in unit is loaded into 4-18, document wherein means and uses this plug-in unit at document management interface, the layout 4-19 (comprising parts such as " width suggestion_width ") that browses that plug-in unit is given tacit consent to is loaded into 4-20, the editor layout 4-21 (comprising the parts such as " the essential required " of parts and the editor browsing layout) given tacit consent to by plug-in unit is loaded into 4-22, can see that the component count [19] of editor layout 4-22 is far more than the component count [7] browsing layout 4-20, default value (defaultValues) 4-23 under editing mode is loaded into 4-24.Registered plug-ins type (registerWidgetType) method is finally used to be registered in jsf classification (category) 4-26 of acquiescence by package types descriptor (desc) 4-25 defined: from package types descriptor 4-29, to extract the package types 4-27 of beyond configuration information (configuration) a three compositions lightweight and to be loaded into classification be in type registration table (typeReg) 4-28 of jsf; Again package types descriptor (desc) 4-29 being loaded into classification is in package types definition information registration table (defReg) 4-30 of jsf.
As shown in Figure 5, system can according to the drop-down final election plug-in unit of drop-down final election package types (suggestManyDirectory) instantiation energy choosing a topic (subjects):
5-1 is the concrete xml configuration information of this theme (subjects) drop-down final election plug-in unit, and when the page that client loads comprises this plug-in unit, system can calculate generation plug-in unit according to the log-on message of this plug-in unit (registration step of plug-in unit is with the package types registration step in Fig. 4) and running environment temporarily.System first obtains pattern (wMode) 5-3 of this plug-in unit by pattern (layoutMode) 5-2 of current arrangements, if plug-in unit pattern equals hiding (HIDDEN), 5-4 returns null, does not namely generate this plug-in unit.System getRequired method 5-5 judges whether this plug-in unit is essential plug-in unit, it by first obtain this plug-in unit with getProperties method 5-6 current state under attribute, all properties (properties) 5-7 of this plug-in unit be one using any as the Hash table of key assignments, it is taken from attribute tags (properties) 5-8 in xml, system first extracts this plug-in unit attribute 5-9 of (any) under any state, this attribute is the content that in 5-7, any key-value pair is answered, extracting as the attribute 5-11 under anterior plug-in pattern (mode) 5-10, this attribute is empty, finally again 5-9 and 5-11 is loaded into 5-12 form the attribute under plug-in unit current state and return getRequired method 5-5, judge when whether anterior plug-in is essential plug-in unit as the attribute kit under current state then returns containing essential (required) attribute 5-13 the content (required=true just returns true) that essential key-value pair answers.System obtains type (wType) 5-14 of this plug-in unit, the classification of this plug-in unit is called by getStoreCategory method 5-15, the words not arranging classification can return the jsf classification 5-19 of acquiescence with getDefaultStoreCategory method 5-16, this value is performed as parameter 5-17 and obtains package types definition information getWidgetTypeDefinition method 5-18, the method can obtain the package types definition information registration table 5-20 of jsf classification according to plug-in unit classification 5-19, namely have registered registration table (defReg) 4-30 of package types in Fig. 4, again according to the type name 5-21 of this plug-in unit (with the suggestManyDirectory in 5-14, package types name 4-1) obtain in type definition information 5-22 and Fig. 4 of this plug-in unit the drop-down final election package types 4-29 registered.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 the attribute 5-25 under its arbitrary patterns and the attribute 5-27 under plug-in unit present mode 5-26 and form package types default property, package types default property 5-28 and plug-in unit attribute 5-29 is loaded into respectively total attribute (props) 5-30 generating plug-in unit.5-31 is the acquiescence editor layout (same to 4-21) of package types, it is that minimum character (minChars) attribute 5-32 gives default value, subjects plug-in unit inherits this attribute 5-33, package types provides selects directory name (directoryName) 5-34 attribute, subjects plug-in unit is the vocabulary under this attribute imparting 110nsubjects value 5-35 specifies this drop-down final election plug-in unit selection 110nsubjects catalogue, package types is that width (width) attribute 5-36 imparting default value 400, subjects plug-in unit covers this attribute 5-38 with 300.Like this, subjects plug-in unit for template with the drop-down list package types in Fig. 4, is quoted its acquiescence framework and with the addition of the drop-down list plug-in unit that new expansion generates choosing a topic.
As shown in Figure 6, the field of plug-in unit and attribute variable are exposed to foreground by system:
Take out the type name 6-1 of plug-in unit and the type classification 6-2 of plug-in unit, the processor of plug-in unit is obtained with getWidgetTypeHandler method 6-3, the method can take out package types with getWidgetType method 6-4, namely obtain by plug-in unit classification 6-5 the package types registration table that classification is jsf, this registration table is the lightweight package types registration table 4-28 only comprising disposal route and attribute templates in Fig. 4, package types 6-8 is taken out again by type name 6-7, namely the lightweight package types 4-27 in Fig. 4, the method class 6-10 (same to 4-3) of this package types 6-8 is taken out by getWidgetTypeClass method 6-9, with the method class instantiation processor 6-12, again the attribute templates 6-11 (same to 4-5) in package types 6-8 is inserted processor, plug-in unit variable is exposed by the getFaceletHandler method in this processor.Obtain template with getTemplateValue method 6-13, if the template of package types is not sky, obtain 6-14, otherwise obtain the template 6-15 of plug-in unit.Generate the presentation layer processor 6-16 that comprises environmental variance ctx and label information tagConfig, with its getTagAttributes method 6-17 establishing label attribute, bindFirstFieldDefinition Boolean 6-18 is that the words of true can be tied on the value attribute of label the value of first character section, 6-19 is the list of fields of plug-in unit, defined by the fields label 6-20 of plug-in unit xml information, get first value (field) 6-21 of list, with createExpressionString method 6-22, this value is made into expression statement again, the method can carry out different process to different field formats, here its is used: be divided into array 6-23 to be formed form in 6-24 again field, finally with #{}, 6-24 is bracketed the pattern become in 6-25, establishing label attribute is carried out as the parameter of createAttributes method 6-27 with field value 6-25 and key assignments value character string 6-26, the method will introduce the particular location 6-28 of current label, namely in layout_default_template template 73 row 77 arrange terminate <nxl:widget> label range within, the tag attributes generated is as shown in 6-29.The tag attributes of attribute is obtained with getAttributes method 6-30, it is by every bar attribute 6-31 of plug-in unit, namely the content in xml information in attribute property label 6-32, get its key assignments (key) 6-33, with pattern #{%s.properties.%s} attribute changed into three grades of nodes in 6-35, it is one and quotes and therefore can not preserve in the buffer, can not be refreshed by ajax, by key assignments 6-34 and quote 6-35 input method 6-27 can establishing label attribute 6-36.Be that label generates an id attribute according to (id) 6-37, then use template generation template attribute in 6-14 (these two attributes are all that use method 6-27 generates).The variable that following calculating will be played up, allow field_0 in template, the field value of field_1 form can be used, taking out key assignments in label is the attribute 6-38 of value, value namely in we first tag attributes 6-29 (itself localName and qName be value) created (value=#{value [' dc '] [' subjects '] } content on the right of middle equal sign), take out again and need variable name (field) 6-39 exposed (also will expose filed_0, fieldOrValue etc.), createValueExpression method 6-43 is finally used to be its parcel EL label, add functional mapping, 6-40 is the expression formula of encapsulation, 6-41 is the variable mappings of encapsulation, 6-42 is the Object object of expection.Extract every bar attribute 6-44 of plug-in unit again, variable name (widgetProperty_minChars) 6-46 that format conversion produces the exposure of this attribute needs is carried out according to its key assignments 6-45, value (content in value=#{widget.properties.minChars} on the right of equal sign) from minChars tag attributes 6-36, finally encapsulates every bar attribute successively with method 6-43.
As shown in Figure 7, system shows plug-in unit by suggest_many_directory_widget_template.xhtml file on foreground, this file defines in the attribute tags 4-5 of package types, plug-in unit generates a template tag attributes with 6-14 as value when exposing variable, and this attribute is the Template Information of the drop-down plug-in unit of display final election:
Xhtml first judges board state, herein when plug-in unit for browse or editing mode time plug-in unit is shown, first in help label 7-1, give Chinese information corresponding to label.suggestion.help.minChars.Display label frame (valueHolder) 7-2 again, value (value) 7-3 in label frame is the field_0 variable exposed in Fig. 6, the expression formula 6-40 of its correspondence is #{value [' dc '] [' subjects '], wherein dc is the prefix of Dublin framework (dublincore) 1-7, subjects correspond to the subjects attribute in framework 1-9, its type is a character string list, store theme (subjects) the attribute 7-3 in the Dublin framework of the document, whether 7-4 defines this label frame essential, owing to not containing essential (required) 5-13 in the property set 5-8 of this plug-in unit, therefore this plug-in unit optionally, namely red * is not had to indicate before frame.Label information 7-5 in last display label frame, obtained the tag entry of display by resolveMultipleDirectoryEntries method 7-6: first obtain directory service (directoryService) 7-7, this services package contains the catalogue of all registrations, concrete subject catalogue 7-9 is taken out by directory name 7-8 (catalogue defining this plug-in unit in 5-35 is called 110nsubjects), namely the 110nsubjects catalogue 2-1 defined in Fig. 2, session 7-10 is set up according to this catalogue, session also comprises framework 7-11 except comprising this catalogue (directory), table 7-12 (namely setting up table according to framework in 3-6), (it takes from the xml information 2-13 of catalogue to major key 7-13, the major key that statement 3-14 is set as this table is created) by rearmounted SQL, the field name 7-14 stored, mark (sid) 7-15 of session, string matching type 7-16 is (for carrying out fuzzy matching during search database, subinitial can carry out fuzzy matching to the beginning of searching character), whether certainly increase 7-17 (being defined in the id of catalogue from increasing label 2-18), sql connects 7-18 (the link information 2-6 to postgresql database according to catalogue data source label 2-5 produces), final generation session (session) 7-19, the operations such as additions and deletions change can be looked into database by this session.Framework 7-21 is taken out according to framework name 7-20 (same to 2-8), take out the region 7-22 of user again, these two parameters are filled in getLabelFieldName method 7-23 to obtain tag name, the words not arranging labelFieldName can be worth by default with the label in 7-24, if db10n (the Article 2 attribute in plug-in unit property set 5-8) 7-25 is true, add that " _ " and region 7-22 form 7-26 as the character string judging display properties (as " film ") after default value.From 7-27 (namely from the label variable 7-3 that foreground is transmitted), take out 7-28 and with resolveDirectoryEntry method 7-29 made foreground can JSONObject label object, the "/" 7-30 of the words acquiescence of separator is not set, part before the parameter 7-31 "/" transmitted is taken out as entry mark 7-32, in session 7-19, extract complete items for information according to entry mark (comprise id, label_fr, obslete etc.) 7-33.Extract each column 7-34 in framework 7-21 successively and take out its column name 7-35, the column value 7-36 corresponding to this column name is taken out in 7-33, generate an element be made up of column name 7-35 and column value 7-36 and it is added in label object, if column name equal with display field 7-38 (this display field is the label_en according to default value and areas combine in 7-26), if whether translate 7-39 (in Fig. 5 plug-in unit xml information <translated> label in content) be true, in total translated document 7-42, then extract this translation content (" film ") 7-41 corresponding to column value (label.directories.subtopic.cinema) 7-40, generating one by display field (displayLabel) 7-43 is that key assignments translation content (" film ") 7-41 is the element of content and is joined label object 7-44, if label comprises discarded (obslete) 7-45, (in framework 2-8, penultimate element is discarded exactly, its default value is 0) and discarded value is greater than 0, then warning message 7-46 is added to this label object, warning prompt 7-47 is had when being stamped the label display of warning message, regeneration one is that key assignments input parameter 7-49 is in this way the element of content and it is filled in label object to calculate ID (computedId) 7-48, finally return this label object 7-50, each label object to be added in the set of tags 7-51 using display and to return to the value of the 7-6 in xhtml as label information, its display result is as shown in 7-52.Finally carry out encoding so that the select2.js file on foreground can extract them with encodeParamtersForDirectory method 7-53 to plug-in unit attribute and parameter, take out the property set 7-54 of plug-in unit and extract its every bar attribute (such as width) 7-55 successively, its key assignments 7-56 and content 7-57 is write in JsonGenerator, during such foreground generation plug-in unit, select2.js file can extract this width attribute 7-58 also for plug-in unit loads this pattern, load anterior plug-in width as shown in 7-59 (the acquiescence width that a system provides), after loading, plug-in unit width is as shown in 7-60 (300px).Operation Id (operationId) 7-61 is being set, content is the parameter 7-63 of Directory.Suggestions7-62, and added JsonGenerator, this parameter by for plug-in unit generate about 110nsubjects drop-down list as shown in Figure 8.
As shown in Figure 8, system obtains operation mark symbol (ID) 8-1 and is the method class of Directory.Suggestions and has run the acquiescence manner of execution run of this operation, and it can obtain all entries of 110nsubjects catalogue and by the method for iteration, their be generated a JSONAdapter tree:
System first can be passed through directory name (110nsubjects) 8-2 in directory service, obtain concrete catalogue (directory), session is obtained by catalogue, obtain framework name 8-3 by catalogue and obtain concrete framework with it, the display field 8-4 under current environment is calculated with method 7-23, be key assignments " 0 " for content sets up filtrator 8-6 with discarded (obsolete) 8-5, with " id " for key assignments " asc " for content sets up ranking criteria 8-7, the session 8-8 (particular content is shown in 7-10) of 110nsubjects table in postgresql database is connected to finally by one, initiate the query manipulation 8-9 that is condition with filtrator 8-6 and ranking criteria 8-7: obtain filtrator 8-6 with filtrator mapping table (filterMap) 8-10 of a < character string/object > form, extract the every bar filtering item 8-11 in 8-10 successively, get its value 8-12, get its column 8-13, with the left side of the QuotedName attribute 8-14 (obosolete namely with double quotation marks) in column as restrictive condition, "? " as right side, "=" is as symbol, with left side diacritic composition 8-15, the restrictive condition 8-16 that additional right side composition one is complete again, combinatorial search condition Select, arranging search content (setWhat) is *, search address (setFrom) is set for table name 8-17, arranging restrictive condition (setWhere) is 8-16, the SQL an ordering statement 8-18 of one (" key assignments " content) is generated at the form transforming 8-7, the search condition obtained is as shown in 8-19, search statement 8-20 is produced with it, create a pre-service perform statement ps and bind parameter for it and obtain 8-21, execute this query statement can obtain the entry of all non-discarded (" obslete "=0) in 110nsubjects table by the order of id and be returned entries, this system is exactly automatically set up SQL statement by importing the parameters such as filtrator into like this.The JSONAdapter method 8-22 performing a band two parameters generates a root node, and be its assignment session, framework, generate the children variable of a Hash table structure, its root node Rule of judgment isRoot is true.Again according to entry collection (entries) 8-23 just searched, take out each entry (entry) 8-24 successively, a non-root node is generated: the key assignments and the content component that extract each column 8-26 in framework successively insert JSONObject object with the JSONAdapter method 8-25 of band 3 parameters, if key assignments equals " label_en " 8-27, set it as display field, if translatedLabels is true, translate field, if obsolete field 8-28 exists and is greater than 0 just add discarded prompting, last formation object 8-29 (detailed step of formation object is shown in 7-34 to 7-50).Judge whether the node generated is child node by isLeaf method 8-30: it forms a filtrator 8-33 as key assignments node Id (architecture) 8-32 as content with " parent " 8-31, inquire about with session setup, the SQL query statement generated by this filtrator is as shown in 8-34, during it will select 110nsubjects to show, all father nodes are the entry of " architecture ", if Search Results for empty Boolean isLeaf is exactly false, does not mean it is not child node.Be not child node JSONAdapter (if " art " in 8-35 is the father node of " building ") can isLeaf judge after skip program, be child node JSONAdapter (if " building " in 8-36 is child node) understand be inserted in root node by push method 8-37.Insertion process is the process of an iteration, first can get its father node Id " art " 8-39 when being inserted by " building " 8-38 and judge whether father node is empty, if non-NULL looks at that whether existing object (node be inserted into) is the father node of " building " 8-38, compare with Id (getId) 8-40 of present node with father node " art " 8-39, because present node is root node, there is not judgement failure certainly in its father node, since present node is not father node, that just creates a father node, next just get the entry 8-41 of the father node " art " of " building " and generate new " art " JSONAdapter object 8-42 with establishment non-root node method 8-25, with push method 8-44, " building " 8-43 is inserted in newly-built father node " art " 8-42, get father node " art " 8-45 of building, father node is not empty, judge with Id (getId) 8-46 of " art " and present node, due to current be exactly " art " by slotting node, its id is also that " art " is so judge to pass through, since present node is exactly father node, we just insert " building " at this, next " building " 8-47 is merged by mergeJsonAdapter method 8-48, current " art " 8-49 is sky owing to being its child newly-built, the display field of " building " 8-50 is got from child's (for empty), its result (found) 8-51 is also empty certainly, judgement is false, since do not have " building " just to insert " building " in child, insert in the child of current " art " node with display field " building " as key assignments is the element of content with " building " 8-47 node, its result is as shown in 8-53, current node " art " 8-54 that is inserted into is turned back to 8-42 and now inserts " art " that return with push method 8-56 in root node 8-55, insertion node is now " art " 8-57, father node 8-58 due to present node (root node) does not exist and judges unsuccessfully, since root node has not had father just to merge " art " in root node, " art " 8-59 is incorporated with mergeJSONAdapter method 8-60, the child of present node (root node) 8-61 is empty, judge unsuccessfully, in child, this " art " 8-62 is just inserted since root node does not have " art "." art history " 8-64 is inserted again in root node, first set up an empty node " art " and incorporate " art history " 8-65 wherein equally, generate an element with " art history " node 8-66 for content for key assignments with the display field of " art history " 8-66 and to insert in the child of new " art " as shown in 8-67, new " art " with " art history " is inserted again in root node, in the child of root node 8-68, look for display field to be the node of new " art ", owing to having inserted old " art " 8-69 that comprises " building " in root node, therefore have found and judge successfully, since root node is containing " art " node, only the child of new " art " need be incorporated just, so " art history " 8-71 in new " art " 8-70 is incorporated old " art " 8-72 just found.Program will obtain an entry tree be made up of JSONAdapter object after having run, and its root node 8-73 contains each one-level vocabulary (as art), comprises again several secondary vocabulary (as building) under each one-level vocabulary 8-74.
As shown in Figure 9, the words tree in Fig. 8 to be formed by (in the middle of figure) javascript the element-tree (the figure upper right corner) that a foreground can show by system, and be each element interpolation css pattern (the figure lower left corner):
9-1 is the words tree generated in Fig. 8, it includes 6 one-level vocabulary such as " art ", 9-2 is the foreground element (being alternatively root element) that will hold tree, 9-3 is the depth of one-level vocabulary, its value is 0, can be vocabulary sequence under current depth by the method for 9-4, each vocabulary 9-5 is taken out successively as " art " in 9-1, its forbidding (disabled) 9-6 variable is false, if non-forbidding and can selecting containing this element of id, can find out that " art " does not have id attribute so it can select (selectable) 9-7 variable to be false from 9-5, be true as it has the words of child (can find out that it has 10 children by 9-8) to set its composite variable.Set up the node 9-10 of a <li> label as " art " element, its depth pattern value 9-11 is 0, because it is that not optional 9-7 stamps select-result-unselectable pattern 9-12 for it, because it is that complex element 9-13 adds select2-result-with-children pattern for it, these patterns can be seen in the foreground element (a line that figure right side is very long) that 9-10 is corresponding.For " art " element adds a display label 9-14, take out the display field 9-15 through format analysis processing and it be added in display label 9-14, again display label 9-14 is added in " art " element 9-10, because this node is composite node, also to hold secondary vocabulary under " art " for it adds sub-container 9-16 thereafter, iteration uses populate method 9-17 the child 9-18 of " art " to be filled into the sub-container 9-19 (same to 9-16) of " art ", and its depth 9-20 is added 1.Take out a 9-21 " building " in the child of " art " successively, due to its non-forbidding and containing id attribute 9-22 thus its can choice variable 9-23 be true, due to " building " for leaf node does not have child so its composite variable 9-24 is false, set up a <li> label 9-25 as " building " element, its depth value 9-26 is 1, because it can select 9-23 to be that it adds select2-result-seleetable pattern 9-27, adding display label 9-28 for " building " element and on display label, adding displaying contents 9-29, because " building " is not that complex element 9-30 does not add sub-container, store when whole attribute information 9-31 of " building " entry being filled in element in order to choosing and use, finally newly-generated " building " element 9-32 is filled in the sub-container of " art ", after " art " fills full daughter element, again " art " element 9-33 of new life is filled in root element, the element-tree that foreground (drop-down list) shows after all one-level vocabulary is all filled into root element has just been carried out.System is that each element with the addition of select2-result pattern 9-34, for each display label with the addition of select2-result-label pattern 9-35, they are provided with the patterns such as basic inside and outside back gauge for element and label, those are had to the complex element of select2-result-with-children pattern 9-36, be set to runic as shown in 9-37, label 9-38 in sub-container select2-result-sub is included in for those, for its select2-result-label label pattern adds the indentation of 20px as shown in 9-39, and involved sub-container tree more (multilevel word) its try one's best larger, can come highlighted with method 9-40 when mouse moves on to a certain vocabulary in drop-down row list and choose it, the method only can return those can select 9-41 and the non-vocabulary having selected non-forbidding, select2-result-selectable pattern is comprised therefore can be highlighted and choose its 9-42 due to " building ", and " art " both cannot highlighted also cannot be selected.
As shown in Figure 10, system is extracted the XML information of plug-in unit and is generated the log-on message example that only comprises the most superior node of assembly:
First the btion-contrib.xml file address 10-1 in bareproject-1.0-SNAPSHOT.jar is extracted, this xml file contains the concrete xml information of drop-down list package types suggestManyDirectory and drop-down list plug-in unit subjects, by createRegistrationInfo method 10-2, the content transformation in this xml file is become a log-on message: first run getStream method 10-4 by file address 10-3 (same to 10-1), the method returns open one to the connection of 10-3 to an inlet flow read from this link as information source 10-5, expansion variable (expandVars) method is performed to information source 10-5 variable is wherein expanded to concrete numerical value in configuration information (normally .conf file) corresponding to this variable: all properties 10-7 in its extraction configuration information (is generally website, the system configuration informations such as database port), attribute 10-7 is assigned to global variable (vars) 10-8 of TextTemplate method, according to pattern 10-9, (this pattern means the character string of extraction one " $ { key assignments=content } " form, wherein key assignments can only be alphanumeric etc.) a composition adaptation m for data source, when adaptation 10-10 finds the content matched with 10-9, take out its key assignments 10-11, by getting variable getVariable method 10-12, the content 10-14 (5432) corresponding to key assignments 10-11 (db.port) is found in the global variable 10-13 (same to 10-8) comprising attribute, in data source 10-5, the variable of this specific format is replaced with its content corresponding in configuration file again and just complete variable expansion 10-15, this example is provided with database port variable { db.port} in display name (label) 10-16 of subjects plug-in unit, in expansion variable process, this variable is replaced the database port value 5432 in order to reality, and with 5432 as the actual displayed name 10-17 of plug-in unit.Then the data source after expansion be encoded to a series of byte and be stored into 10-18 in a new byte arrays.CreateRegistrationInfo method 10-19 being performed to byte arrays 10-18 and is created a log-on message: being processed the xml file obtained by inlet flow 10-18 by method 10-20: define one for obtaining the factory 10-21 of resolver, the resolver 10-22 that xml document is changed into dom document by one is defined again by factory, by the parse method 10-23 of 10-22 the inlet flow 10-18 Context resolution provided be an XML document and return a new DOM document object 10-24, the child nodes of the document object directly can be accessed easily by the getDocumentElement method 10-25 of DOM document object 10-24.The DOM element 10-24 given by the loadAll method 10-26 process with 3 parameters and return that row of this element are top can mapping object: the name of this DOM element 10-24 is assembly (component) 10-27, the example of this assembly is created by newInstance method 10-28, process this assembly member successively and collect each 10-30 in 10-29, service means the service that this assembly exposes, name means assembly name (biction.xml), require means other assemblies that this assembly relies on, extension member 10-31 wherein means all expansions that this assembly is contributed, subjects plug-in unit as previously defined in us.Be processed in method (process) 10-32 member, first get its value 10-33, take out the name 10-34 (extension) in its mapping path and find out all extension node 10-35 by name, searching nodal method is as follows: take out all nodes in biction.xml file successively, first the node 10-36 taken out is a null text node, because it is not node element 10-37, take out its lower adjacent node 10-38, because this node is node element 10-39, if its 10-40 is extension, the example of this extension expanding node 10-42 is then created with newInstance method 10-41.Process each member of 10-43 expanding node successively, comprise the concrete grammar class that namely Extended target (target) 10-44 realizes this expansion, and extension point (point) namely this expands to which parts in method class (target), Extended target (target) the 10-46 property value of this expanding node (extension) is obtained by obtaining value method 10-45, it will call and get nodal value method 10-47 to obtain relative path under given base node (extension) is the nodal value of target, base node is as shown in 10-48, can see that it comprises point and target two attributes, when attribute 10-49 in the relative path that will get is not for time empty, from base node, then extract this target attribute 10-50, if there is no attribute in relative path, extract the text message 10-51 (such as specification documents) of this base node.Finally by method 10-60, the target value just obtained is composed to the correspondence position 10-52 in example, namely the extension in biction.xml assembly 10-53 expands assignment 10-56 on the target attribute 10-55 in example 10-54, WebLayoutManager in 10-56 is the service interface of extended web layout content, according to the difference of extension point point, widgettype package types, widget plug-in unit, layout layout etc. can be expanded.After the complete expansion of assignment (extension) again by all expansion example 10-57 assignment in 10-58 assembly, finally obtain a log-on message example 10-59 generated from XML file, it contains assembly biction and most higher level's child node thereof, is how to be suspended according to dependence and to realize in Figure 11 by the expansion told about in this log-on message.
As shown in figure 11, jejune for dependence condition extension framework is put into the queue of wait specific dependency and is loaded this extension framework when relying on condition maturity by system:
11-1 is the log-on message generated in Figure 10, and it contains all highest node of bicion assembly, comprises assembly name 11-2 and expansion 11-3.This example is registered with method 11-4, this example 11-5 is added: in first assembly (components) 11-6 wherein, add the mapping that is content for key assignments with example (ri) 11-8 (same to 11-1) with Instance Name (name) 11-7 (same to 11-2) in component register table reg, this example of reactivation 11-9: take out all expansion 11-10 of this log-on message example and register each expansion 11-12 successively with registerExtension method 11-11: this expands to drop-down final election package types suggestManyDirectory, its Extended target (target) is WebLayoutManager, its extension point (point) is widgettypes, acquisition is used for realizing this extended target assembly name 11-13, and in assembly (components) 11-15 of component register table (reg) 11-14, find the target element log-on message of WebLayoutManager (being obtained by 11-13) by name, can see including in the list of assembly in 11-6, just add biction assembly 11-16, if the target element log-on message 11-17 obtained just does not realize this expansion with WebLayoutManager for empty, otherwise this expansion is added in the queue hung up and wait for WebLayoutManager in expansion (pendingExtensions): hanging up the waiting list finding WebLayoutManager by name in expansion 11-18, if result 11-19 is empty, create an empty superset 11-20, and add one and run after fame with WebLayoutManager in hang-up expansion, with the Hash table that empty superset 11-20 is content, drop-down final election package types 11-12 is added in empty superset 11-21.The next one expansion 11-22 of this log-on message example is registered again: this expands to drop-down final election plug-in unit subjects with method 11-11, assembly due to its Extended target is not also loaded in component register table reg, waiting list can only be added: hanging up the waiting list finding WebLayoutManager by name in expansion 11-18, find the superset 11-23 comprising drop-down final election package types just created, in superset 11-21, add hang-up expansion 11-24 (same to 11-22) of new wait WebLayoutManager.Finally obtain the expansion waiting for biction assembly, hanging up the wait superset 11-26 obtaining (biction) 11-25 by name in expansion pendingExtensions, because it is that empty (namely hanging up the expansion not waiting for bction in expansion) jumps out program, otherwise realize successively waiting for that the every bar in superset 11-26 is expanded with biction.As activation component WebLayoutManager, hanging up the hang-up extension queue 11-28 obtaining (WebLayoutManager) 11-27 by name in expansion pendingExtensions, queue is assigned to 11-28 delete queue in hang-up expansion while by remove method, the hang-up expansion seeing all wait WebLayoutManager can hung up in extension queue 11-28, comprise the expansion in the biction of earlier registration, extract the every bar expansion in 11-28 successively, the expansion 11-29 (same to 11-24) of such as drop-down final election plug-in unit subjects, the configuration parameter of this plug-in unit is taken out with acquisition collocation method (loadContributions) 11-30, the value " widgets " of first taking out in this plug-in extension point (point) 11-31 is obtained with obtaining extension point method (getExtensionPoint) 11-32 the extension point example being called " widgets " 11-33 by method 11-30 again in log-on message example 11-39 (WebLayoutManager), 11-34 is the extension point set of WebLayoutManager component register, comprise plug-in unit, package types, the extension points such as layout, the name of taking out each extension point successively sees whether it is " widgets " 11-35, 11-36 is the XML information of plug-in unit (widgets) extension point in WebLayoutManager assembly, it realizes class methods 11-37 with plug-in unit descriptor (WidgetDescriptor) as this object, finally find and taken out extension point example (xp) 11-38 being called " widgets " in WebLayoutManager.If extension point example 11-38 is not empty and its descriptor is not sky, then extract the configuration parameter 11-42 in drop-down final election plug-in extension (xt) 11-41 and the contributions item it is assigned in 11-41 by extension point example 11-40 (same to 11-38), the configuration parameter contributions item can seen in current expansion 11-41 as figure is null, this is because this expansion is a highest node in biction, it contains only target and the point attribute of expansion 11-43, to the concrete configuration parameter 11-44 how obtaining highest node 11-43 be told about and be registered in Figure 12.
As shown in figure 12, system takes out the specific configuration information of expansion in XML file by the descriptor of extension point, is complete expanding node with configuration information by highest code populates, and according to the difference of extension point by its classification registration:
Connect Figure 11, system is in order to activate the configuration parameter obtaining 12-1 plug-in extension xt in active method, it needs to find the extension point example corresponding to expansion and the configuration parameter being obtained 12-2 expansion by it, if the contributions in extension point example 11-38 is not empty 12-3 (wherein containing plug-in unit descriptor WidgetDescripter), then at xmap12-4, (xmap is by the factories comprising various fundamental type, the objects take descriptor as key assignments xmap object being content, the roots that key assignments xmap object is content is called with node) middle this descriptor of registration 12-5 12-6: first in objects12-7, find plug-in unit descriptor (WidgetDescripter) 12-6, because 12-7 is that sky can not find so need newly-built, whether detect in this WidgetDescripter descriptor 12-9 containing mark 12-8, if the words contained (even if 12-15 one mark) create xmap object (xao) 12-10 by this descriptor, can see in xao and comprise ctor (its value of constructor is identical with descriptor), klass (descriptor), and the members (member of plug-in unit, each mark i.e., be empty at present), in (objects) 12-11 with descriptor klass for key assignments xao for content creating mapping object in case repeat later create, scan method 12-12 is performed to xao, it will extract all marks in descriptor (at present for aClass) as sets of fields (fields) 12-13, again successively each field in 12-13 as name field 12-14 (name mark 12-15) namely in descriptor is created as member 12-16 by createFieldMember method, a member 12-16 comprises field address accessor (value is WidgetDescripter.name) herein, relative address path (value is name herein), type type (value is java.io.String herein) is formed.Each member is added to the member's collection forming this descriptor template in the members of (xao) 12-17.Again in (roots) 12-18 with node name widget for key assignments xao for content creating mapping object to find this widget node by relative path later.It is the specific configuration information of parameter loadAll method 12-21 acquisition expansion with environment 12-19 (which includes the actual physical address biction-contrib.xml of xml information in expansion) and extensible element 12-20 in the new xmap created: the name of first taking out element 12-20, be extension because it is its name 12-22 of extensible element, its content is searched in roots (same to 12-18), if its content 12-23 is empty, search its child nodes (p) 12-24, not element so get its adjacent node 12-25 until find node element (detailed step is shown in 10-36 to 10-39) because 12-24 is space text, get the node name 12-26 (value is " widget ") of this element 12-25, the content xob (" xao " 12-10 namely previously created) that key assignments is " widget " 12-26 is found in (roots) 12-27 (same to 12-18), if content 12-28 is not empty, then create a concrete descriptor examples 12-29 according to plug-in unit descriptor template xao: create an empty plug-in unit descriptor object 12-31 according to constructor (ctor) 12-30 (first node namely in 12-10), each member member 12-32 in members is collected (as name member to its member, namely the name in descriptor marks 12-15) use process method 12-33 to carry out assignment: the value 12-34 that the method obtains this name element from biction-contrib.xml file is subjects (concrete steps are shown in 10-45 to 10-51), again at the upper assignment subjects of the address field 12-36 (XFieldAccessor namely in 12-16) of member, its particular content corresponding in XML file (i.e. the XML information 5-1 of drop-down final election plug-in unit subjects) is all given blank members all in descriptor examples 12-29, the contribs returned it on the left of method 12-2 is the configuration parameter that will extract, for plug-in extension xt arranges this configuration parameter (contribs) 12-37, can see that current xt is as shown in 12-38, its contributions node 12-39 is no longer empty (before loading configuration parameter, the value of contributions node is as shown in 11-44), it comprises a plug-in unit descriptor (WidgetDescriptor) and has been just the member value 12-40 of its each member imparting, this expansion is registered: configuration parameter (contribs) i2-42 first taking out expansion with the registration extended method 12-41 in WebLayoutManager assembly (component), multiple plug-in unit can be added in a plug-in extension (i.e. contribs) in XML, final election plug-in unit as drop-down in theme (subjects), geographical drop-down final election plug-in unit etc., select each expansion (contrib) 12-43 and extension point 12-44 wherein, register this with registerContribution method 12-45 specifically to expand: if extension point 12-44 equals 12-46 (i.e. package types widgettypes), just also obtain package types definition information with the getWidgetTypeDefinition method 12-47 of descriptor with this expansion of package types descriptor examplesization 12-43, finally register this definition information (concrete steps are shown in Fig. 4) by registerWidgetType method.If extension point equals (WIDGETS_EP_NAME) 12-48 (i.e. plug-in unit widgets), obtain plug-in definition information with plug-in unit descriptor 12-49 this expansion of instantiation and by the getWidgetDefinition method (the method WidgetDefinitionImp method creates a plug-in definition information according to the configuration information of expansion) of this descriptor, finally register this definition information.
As shown in figure 13, plug-in unit can be customized with carrying out fast and flexible by the configuration information in amendment XML:
The original xml configuration information of drop-down list plug-in unit subjects is as shown in 13-1, the interface, foreground of its correspondence is as shown in 13-2, it is the plug-in definition information being extracted registration by the widget descriptor 13-4 in WebLayoutManager method 13-3, be endowed disposal route class and the foreground indicating template of drop-down final election package types 13-5, can by configuring drop-down final election plug-in unit in different poses and with different expressions to the different parts parameters of specified arrangement 5-31 in package types.13-6 is plug-in unit name, and it cans be compared to the Id of plug-in unit, adds plug-in unit of the same name and will override original subjects plug-in unit, add plug-in unit not of the same name and will add a new plug-in unit in the patch of rear loading.13-7 is the title of plug-in unit, the content in <label> label is changed into 13-8 (corresponding being translated as " geographic range " of label.dublincore.coverage field) and just the title of plug-in unit has been made into geographic range.13-9 is title prompting, content is wherein changed into 13-10 and has just also made title prompting into geographic range.Whether 13-11 is for translating, the words that it is true can search the translation content (details are shown in 7-39 to 7-44) corresponding to this field in total translated document of system, if be set to false all fields of plug-in unit all will be shown as untranslated apperance 13-12.13-13 is that plug-in unit is by what content of display the document, " dc:subjects " means that plug-in unit will show the character string list 1-9 of current document Dublin framework data (dc is the prefix 1-7 of dublincore) subjects by name, if changed into dc:zhishi attribute 13-14 (in the framework of Dublin self-defining character string table data framework " subject knowledge "), by label " data preparation method " 13-15 in " content topic " in display " subject knowledge ", the vocabulary corresponding to this path (zhishi_001_004) is can not find so only show its path and add warning notice due in the theme words tree (taking from 110nsubjects) that calls at subjects.13-16 is that plug-in unit arranges width (details are shown in 7-55 to 7-60), its value is made into 100 and obviously will shorten its width 13-17.The minimum number of characters of 13-18 needed for display drop-down list, be defaulted as 0 namely to click after input frame and directly show drop-down list, if change its value into 2, " please inputting 2 characters again " 13-19 will be shown, when all vocabulary (as " art history ") comprising input character being shown after input two characters (as " art ") 13-20 when clicking input frame.13-21 is for hiding drop-down list prompting, and usually do not need input character due to drop-down final election plug-in unit therefore be defaulted as true, its value being changed into false can see this prompting 13-22, is used for the parts of the prompting of hiding title and blank prompting in addition in addition.13-23 is the directory name of plug-in unit display, system is by all vocabulary of search directory 110nsubjects in a database and be shown to the drop-down list (details are shown in Fig. 8 Fig. 9) of plug-in unit in the form of a tree, if made into 110ncoverage (what store in this catalogue is geographical vocabulary), by generation one in order to select the drop-down list 13-24 of different continents country variant, owing to can not find the path of " film " this theme vocabulary in the words tree that generates at catalogue 110ncoverage, therefore only show its path " art/cinema " 13-25 (seeing 7-27 to 7-44 by the detailed step of path searching vocabulary display label).If add required parts 13-26 (this attribute can be seen in the first row of the editor layout 4-21 of drop-down final election package types) and its value is set to true in the property set of plug-in unit, then plug-in unit will become and must fill out plug-in unit, to a red * be had to indicate 13-28 after its title, and in input frame, content can be made mistakes for preserving document time empty.13-29 is the blank tip parts of plug-in unit input frame, and the words arranging label.security.search can replace blank prompting " please input " of acquiescence with " search subscriber or group " 13-30.13-31 is compartmentalization parts, value for the words of true can obtain browser region 7-22 and in order to show the translation content of this vocabulary under current region after being added to display field, as label_en can show the translator of English of this vocabulary, label_cn can show the translator of Chinese (Adding Area concrete steps are shown in 7-22 to 7-26) of this vocabulary, being set to " false " 13-32 would not be the region suffix of display field interpolation such as _ en and so on, 13-33 is display field parts, its default value " label " 7-24 can be got when not adding these parts or this component content is empty, if the value of these parts is set to id and db110n is set to false (otherwise can id_en be become), then by the id content 13-34 of display label in input frame.13-35 is whether optional father node parts, 13-43 is the method adding JSONObject vocabulary to words tree, if current vocabulary is child node 13-44 will directly return this vocabulary, as 9-21 " building " vocabulary, because it is that a complete node comprises id node 9-22, therefore selectable variable 9-23 be true it be optional.Non-leaf nodes is formed deciding its node according to the value of canSelectParent parts 13-45, under default situations, 13-45 is false, namely judgement is skipped, create one only comprise the node of display field 13-46 and adding its all child nodes thereafter, as 9-1 " art " vocabulary, can see that it only comprises displayLabel and children two nodes, be false so parent node acquiescence is not optional because it does not comprise id node selectable variable 9-7, if the value of canSelectParent parts is set to true will perform 13-45 judgement, return this complete node 13-47 and adding its all child nodes thereafter, because complete " art " lexical node comprises id node 13-48 event, it is optional 13-36, just determine whether to select parent vocabulary in drop-down list by the Boolean of the canSelectParent parts in amendment subjects plug-in unit XML configuration information thus.13-37 is that vocabulary parts are ignored in display, judge whether in drop-down list, show uncared-for vocabulary by displayObsleteEntries Boolean 13-49, under default situations, displayObsleteEntries value 13-50 is false, program in service condition being judged sets up a content as { the filtrator 13-51 of obsolete=0}, in the session 8-8 leading to database 110nsubjects table, with this filtrator 13-51 for parameter initiates query manipulation 8-9, the content of filtrator can be constructed as a conditional statement (8-10 to 8-16) in SQL during inquiry, the SQL query statement finally generated is as shown in 13-52 (same to 8-21), , it has filtered out the vocabulary of all go out of use (obsolete is not 0) with WHERE " obsolete "=0 conditional statement, as just cannot seen " film " vocabulary 13-37 in drop-down list again when discarding " film " vocabulary, if the value of displayObsleteEntries parts to be changed into " true " 13-38, now 13-53 is true, by the program in skip condition statement, content in filtrator 13-54 is empty { }, the SQL query statement of final generation is as shown in 13-55, can see that it does not have WHERE " obsolete "=0 this filtercondition, do not filter out " film " that gone out of use, therefore this " film " vocabulary gone out of use can be seen in 13-38, together with warning notice thereafter.Also can be this subjects plug-in card configuration special style by XML configuration file, if (containerCssClass) 13-39 is Graphicxtras Frames Collection parts, the words arranging select2-highlighted (i.e. highlighted pattern) wherein just can see that the bottom 13-40 of input frame becomes highlighted state, (dropdownCssClass) 13-41 is drop-down list pattern parts, if the whole drop-down list 13-42 of the words its value being set to select2-highlighted can become highlighted state.As above be exactly an object lesson by XML configuration plug-in, the employee even without any programming experience can be seen, certain parameter (as changed the false of parts into true) revised in XMl is only needed just to be equal to have done in a program and once to judge, and then have influence on the structure of display label, the factors such as the filtercondition in search statement, employee can optionally revise prompting text in xml, select the displaying contents of vocabulary, insert the Graphicxtras Frames Collection etc. liked, these operations all will be registered to the performance and the function that also in depth affect plug-in unit in system with the form of plug-in definition information.
As shown in figure 14, Dublin (dublincore) layout is registered in system by system:
14-1 is the XML extend information of this layout, can see that its Extended target be WebLayoutManager extension point is layouts, can see that this layout name 14-2 is dublincore by its configuration information, the foreground template 14-3 that it calls is /layouts/layout_default_template.xhtml, in its row-column list 14-4, contain this layout will at the plug-in unit of foreground display, can carry out by additions and deletions row (row) plug-in unit that additions and deletions will show on foreground, such as drop-down final election subjects plug-in unit is inserted layout at the second row 14-5 by it.This layout is registered by the registration expansion 14-6 method in WebLayoutManager, when the extension point 14-7 expanded equals " LAYOUT_EP_NAME " 14-8 (i.e. layouts), with regard to Layout Descriptor (LayoutDescriptor) 14-9 by the example: can see that the framework of a layout comprises name 14-10, foreground indicating template 14-11, line number group 14-12 in units of layout rows descriptor and column array 14-13, the plug-in unit Hash table 14-14 being content with multiple plug-in unit descriptor, with the attribute Hash table 14-15 that multiple attribute description symbol is content, and classification 14-16.Layout definition's information is obtained: if foreground template 14-18 (the same 14-3 of expansion by getLayoutDefinition method 14-17, mean that foreground template is layout_default_template.xhtml under any pattern) in Hash table ctemplates, just do not add this template for empty, its row-column list is taken out: the method first will set up an empty line number group 14-20 according to row-column list length (the row number in 14-4) by getRows method 14-19, use getLayoutRowDefinition method 14-21 to obtain its layout rows definition information successively to the every a line in expansion row-column list 14-4 again: in layout rows descriptor, to contain capable name name, plug-in unit widgets in row, whether always show multiple marks such as this row alwaysSelected, if plug-in unit 14-22 does not create an empty plug-in unit with reference to (cwidgets) 14-23 for empty according to the plug-in unit number in row in row, again the plug-in unit in row is inserted successively plug-in unit with reference to 14-24, can see that each element of plug-in unit reference only includes classification and plug-in unit name, with LayoutRowDefinitionImp instantiation layout rows definition information (clone) 14-25, it comprises alwaysSelected (always the choosing this journey) 14-26 that a value is false, selectedByDefault (acquiescence the chooses this journey) 14-27 that value is true, and the plug-in unit just created is with reference to 14-28.Layout rows definition information (clone) is returned to the element crows [i] of 4-21 as line number group, when after completing all row of line number group, it being turned back to by getRows method 14-19 in line number group (crows) 14-29 of Layout Descriptor, its content, as shown in 14-30, comprises multiple layout rows definition information example.If self-defined plug-in unit (widgets) 14-31 of expansion is not for sky is entered in Hash table cwidgets, <widgets> label event 14-31 in the configuration information due to 14-1 expansion, is not had to be empty { }.A layout definition information 14-32 is generated by LayoutDefinitionImpl method, can see that this layout name 14-33 cries " dublincore ", its row-column list 14-34 contains 5 row (only having drawn wherein two row to economize in space of a whole page 14-4), and its foreground template (templates) 14-35, layout definition's information of generation is turned back to 14-9, this layout is registered: because this layout does not arrange classification category by registerLayout method 14-36, therefore get classification " jsf " 14-37 of acquiescence, set up layout definition information registering table (reg) 14-38 that is classification with " jsf ", the layout definition information 14-39 just created (same to 14-32) is filled in layout definition information registering table reg.
As shown in figure 15, the editor's layout registered in its text will be called when clicking the editing options card of text document:
System is that the document of every type both defines the multiple layouts given tacit consent to and under AD HOC in XML file, 15-1 is document (Note) type, define the default layout under any (any) 15-2 pattern wherein, for editor (edit) the 15-3 layout of edit page, and show document content browse (view) 15-4 layout, its editor layout 15-3 is by the heading layout 15-5 for revising heading message, for the note layout 15-6 of Edit Text content and font style, and for editing the dublincore layout 15-7 of Dublin metadata.The XML definition information of this editing options card is as shown in 15-8, it is an operation (action), its id is TAB_EDIT, clicking this tab, will to jump to relative path under path, current server basis be /documents editing foreground template (document_edit.xbtml) 15-9 of incl/tabs/, its ranking value order be 20 and according to this large young pathbreaker its come second position in option hurdle, translation content corresponding to field " action.view.modification " in its display label (label) is " editor ".First reputation nxl label 15-10 in 15-9, it is the label that layout system uses, and can be used for defining the help class label showing layout and plug-in unit.The documentLayout tag processor 15-11 that one is used for showing layout is defined with nxl label, and for its add pattern (mode) for editor (edit) and value (value) be current document (#{currentDocument}) two attributes, this Facelet tag processor will play up all layouts be attached under current document edit pattern.By method 15-12 this processor of instantiation in background program: first import the tag parameter 15-13 that this processor defines in the xhtml file of foreground into, can see that this label comes from/incl/tabs/document_edit.xhtml by 15-13, it is the <nxl:documentLayout> label in the 2nd row, the 64th row ending.Obtaining local name localname15-15 in 15-13 by getRequiredAttribute method 15-14 is again the tag attributes of pattern (mode), 15-17 (this is returned by getAttribute method 15-16, i.e. current label processor 15-12) under 15-18 (tag, namely from the tag parameter 15-13 that foreground is imported into) 15-19 (getAttributes, obtain the attribute in 15-13) in (localname) 15-20 be the tag attributes 15-21 of " mode ", namely mode=" edit " attribute in the label of ending is arranged in 2 row 64 in document_edit.xhtml, 15-22 is returned it to by 15-14, as the pattern (mode) of tag processor, use the same method and extract other parameter of label, value attribute 15-23 in such as 15-11.Each current available layout in profile is carried out with apply method 15-24 after having obtained tag parameter, by the current document 15-25 of the reality of buffer memory in value (i.e. current document #{currentDocument}) acquisition system, i.e. " example text " text document, its UUID can be seen in 15-25, path and title, document type information 15-26 is obtained by 15-25, by 15-22 obtaining mode value 15-27, document mode value 15-28 is obtained by documentMode, owing to not setting documentMode attribute event 15-28 in label 15-11 as empty, obtain according to includeAnyMode and use default mode 15-29, it is defaulted as true not have the words of setting.Its layout (namely obtaining the layout defined in 15-1 text) is obtained according to Doctype typeInfo15-26 getLayouts method 15-30, first parameter imported in 15-30 is judged to produce by document mode value documentModeValue, import mode value into if document mode value is sky otherwise imports document mode value into, because document mode value 15-28 is empty, import mode value 15-31 into, its value is 15-32 " edit " (same to 15-27), the second parameter imported in 15-30 judges to produce by using default mode useAnyMode, if use default mode 15-29 to import (BuiltinModes.Any) 15-33 into for true, its value is 15-34 " any ", if the layout in Doctype (the <layouts> label namely in 15-1 text) is not empty, from its layout 15-35, then extract the layout 15-36 (it correspond to the 15-3 in 15-1) that pattern (mode) is " edit " 15-32, if extracted layout 15-36 for empty and default mode (defaultMode) is for empty, then from 15-35, extraction pattern is the layout 15-37 of default mode " any " 15-34, owing to extracting layout 15-36 not for empty, therefore skip the judgement of default mode, the layouts element 15-39 extracted in layout 15-38 (same to 15-36) is returned to 15-40 under present mode by the layout of application by method 15-30, 3 layouts in the 15-3 of 3 layouts difference correspondences in 15-40 can be seen, namely the layout under edit pattern.Extract each layout 15-41 " dublincore " in 15-40 successively, a name tags attribute 15-42 is produced according to its layout name, and add mode attribute 15-22, value attribute 15-23 forms the attribute 15-43 of dublincore layout, label information 15-44 is formed for it adds LeafFaceletHandler (namely next processor is empty) and tagId (identifier of dublincore layout tab), 15-44 is added in Facelet processor 15-45, again 15-45 is added in combined processor 15-46, apply method is performed for 15-46, namely each layout (as dublincore layout) in combined processor is applied.
As shown in figure 16, the current available layouts extracted in 15 figure realizes for dublincore by system one by one:
In upper figure, label information 16-1 (same to 15-44) adds in Facelet processor 16-2 (same to 15-45) by system, concrete steps are with the method 16-3 instantiation dublincore label information 16-4 of the same name under layout tab processor LayoutTagHandler method class and are joined by this LayoutTagHandler in Facelet processor 16-2, every strip label attribute (i.e. 15-43) that method 16-3 will extract in label information 16-4, comprise name tags attribute 16-5 (same to 15-42), its value is 16-6, mode tag attribute 16-7 (same to 15-22), value tag attributes 16-8 (same to 15-23), layout tab processor will utilize these attributes to produce layout: name is layout name registered in layout definition information registering table reg, category is the classification of layout, definition is layout definition's information, dynamically can produce layout with it, layout is used for specifically defining a layout example, mode means and will play up the page (concrete effect is shown in 15-2 to 15-7) by the layout under what pattern, value means the value that layout will use, and be namely exposed to the #{field} variable of foreground xhtml, concrete mapping encapsulation process is shown in (6-39 to 6-43), template means the foreground template will used for this layout, if arranged the template attribute (14-35) in overlapping layout definition information 14-32, its value is 14-18, the 14-3 place definition in XML file, selectedRows is selectable row name, if be not the empty row that will filter with it in layout, selectAllByDefault will specify the row whether given tacit consent to and choose (namely showing) all, resolveOnly means and only processes in the environment and expose the layout that will play up, and by its immediately display.This dublincore layout, owing to being produced by document layout tag processor 15-12 batch, contains only name, pattern, value 3 tag attributes.Last combined processor (composite) 16-9 (same to 15-46) of 15 figure applies each available layout of 16-10, it extracts each layout tab processor 16-12 successively by from the child 16-11 (namely adding the layout tab processor 16-3 list in Facelet processor 16-2 wherein to) of combined processor, and use the apply method 16-13 in layout tab processor method class to apply each concrete layout tab to it: first define a layout service with WebLayoutManager interface 16-14, can registered layout definition information be managed with it and create layout example, what from Framework, then obtain interface 16-14 realizes class (WebLayoutManagerImpl) 16-15, layout is configured according to the tag attributes in layout definition processor 16-3, such as selectedRows tag attributes 16-16 is not for empty words are just filtered the row in layout with it, if name is tag attributes 16-17 (same to 16-6) is not empty, just extract layout name 16-18 wherein, and generate layout example by acquisition layout (getLayout) method in layout service 16-19, namely the getLayout method realized in class 16-20 by it produces concrete dublincore layout: it first obtains the definition information of layout with getLayoutDefinition method 16-21: because this layout does not arrange class label attribute, get " jsf " the classification 16-22 of acquiescence and obtain layout definition information registering table (reg) 16-23 (same to 14-38) with it, layout definition's information that layout name 16-24 (same to 16-18) is " dublincore " 16-25 is searched in 16-23, namely the dublincore layout definition information 14-39 registered in reg in Figure 14, layout definition's information (layoutDef) 16-26 is returned it to by method 16-21, row definition information 16-27 (same to 14-34) is extracted from 16-26, define an empty layout rows list 16-28, the line pointer 16-29 that a value is-1 is set, extract each layout rows definition information 16-30 (same to 14-25) in 16-27 successively, line pointer 16-31 is from increasing, namely the pointer value of the first row is 0, the pointer value of the second row is 1, extract the name 16-32 of 16-30, due in row 14-5, name attribute is not set thus this name property value for empty, if row name 16-33 is empty, serially add line pointer value 16-31 with " layout_row_ " character and form new row name 16-34, because the line pointer of often going is different, row name can not repeat, can in foreground row name as the id often gone, Boolean (emptyRow) 16-35 is set to judge whether row is empty, and give tacit consent to it for true (sky), if (selectedRows) 16-36 is not for empty words are filtered row with it, extract the plug-in unit of row 16-30 with reference to 16-37 (same to 14-28, defined by 14-5 in xml), extract the name 16-38 of plug-in unit with reference to 16-37 again, the plug-in definition information 16-39 of " subjects " 16-38 by name is extracted in plug-in definition information registering table, and obtain according to the parameter getWidget method 16-40 of current dublincore layout the subjects plug-in unit example (details are shown in Fig. 5) that meets current operating environment, this plug-in unit example 16-41 is added plug-in unit list widgets (because multiple plug-in unit may be comprised in a line), be not the plug-in unit example 16-41 of sky if having in a line, then (emptyRow) 16-42 is set to false, mean that this is capable not for empty, if this is capable for sky LayoutRowImpl method 16-43 produces a layout rows example for this row, by row name 16-44, whether acquiescence selects this row 16-45 (same to 14-27), whether always select this row 16-46 (same to 14-26), the subjects plug-in unit example 16-47 of firm generation, the cryptographic hash of row attribute and row is all inserted in this layout rows example, and these layout rows examples are inserted in the layout rows list 16-48 of the sky previously created, this dublincore layout of instantiation is carried out with LayoutImpl method 16-49, insert the layout rows example 16-50 just obtained wherein, for it calculates cryptographic hash id information 16-51, (this cryptographic hash is calculated by every property parameters of layout to produce, therefore the corresponding same cryptographic hash of same layout), insert name again, this dublincore layout of the parameters such as pattern just achieves.The layout implementation of this system that Here it is, it defines the simple layout that only comprises each plug-in unit name in log-on message, extracts concrete plug-in unit example when display layout according to current environment, and fills complete by each row of layout.
As shown in figure 17, system configures the row in layout by foreground indicating template xhtml file and backstage layout architecture xml file:
The foreground xhtml file 17-1 that amendment the Edit button is corresponding, it will play up separately dublincore layout 17-3 (namely only playing up 15-7) by nxl:layout label 17-2 layout tab processor LayoutTagHandler, and the edit page that now example text is corresponding is as shown in 17-4.17-5 (same to 16-30) is by each layout rows definition information in the dublincore layout played up, 17-6 (same to 16-36) is the judgement filtercondition (just mention once in Figure 16 and describe in detail herein) of often going, whether it filters out this row by under selecting row selectedRows whether to be two kinds of situations of sky according to foreground (17-1) backstage (17-3) determined property of layout: the always selection alwaysSelected attribute of this row is set to true by 17-7, can give tacit consent to when system startup and the alwaysSelected attribute 14-26 in every row 14-25 is set to false, the 14-26 default property of this row can be replaced with true and is saved in the registration definition information of dublincore layout by 17-7, now because 17-8 is always true, whether selectedRows is that sky filtercondition all can be skipped.Under default situations, selectedRows attribute 17-9 is null (owing to not arranging selectedRows attribute in 17-1), selectAllRowsByDefault attribute 17-10 is false (words do not arranged in 17-1 are defaulted as false), isAlwaysSelected attribute 17-8 is defaulted as false (same to 14-26), filtercondition is all set up, because acquiescence selects selectedByDefault attribute 17-11 to be defaulted as true (same to 14-27), filtercondition is skipped so could see this row in front page layout, the selectedByDefault setup of attribute of the row containing subjects plug-in unit is false by 17-12, this the last item filtercondition of 17-13 is also set up, perform continue and skip the loading procedure of this row, in the layout example 17-14 finally generated, line number 17-15 is 4 (in relative placement example 16-49, line number 16-50 is 5), its display result is as shown in 17-16, can see that it has lacked content topic (subjects) a line relative to 17-4.If add acquiescence to choose whole selectAllByDefault attribute 17-17 in the foreground xhtml file 17-1 of display edit page, layout tab processor 17-2 will extract this attribute 17-18 (namely the 3rd row the 44th arranges selectAllByDefault=" true " attribute in the nxl:layout label terminated in document_edit.xhtml), last parameter of method 16-19 is it can be used as to import layout generation method 16-20 in WebLayoutManagerImpl into, in filtercondition 16-36, because 17-19 is true, when selectedRows is empty, filtercondition is always skipped, therefore edit page is as shown in 17-4, show all row (the theme subjects comprising acquiescence not selected is capable).If add in 17-1 list variable 17-20 (storage ' layout_row_1, the dynamic array variable of source '), and list is set to the value of selectedRows attribute 17-21, layout tab processor 17-2 can extract this attribute 17-22 from foreground, because the selectedRows attribute 16-16 in its application layout apply method 16-13 is not now empty, this Rule of judgment of carrying out practically 17-23, with selectedRowsValue variable 17-24 with the #{list} in the form of character string list extraction selectedRows attribute 17-22, the penultimate parameter of 16-19 method is it can be used as to import generation layout method into, in filtercondition 16-36, because now selectedRows attribute 17-25 is not empty, the isAlwaysSelected attribute of often going is defaulted as false, being about to of not comprising in SelectedRows attribute 17-27 performs filtercondition continue and there is no method and be shown to foreground, name under default situations in layout rows definition information 14-25 is null, automatically can be unknown row name according to line ordering during generation layout, row as subjects plug-in unit is called layout_row_1 (concrete steps are shown in 16-31 to 16-34), also can for row 17-26 be named as source to replace the system generation name of acquiescence in the xml file 17-3 of layout.Only have the row 17-29 of the layout_row_1 by name comprised in selectedRows attribute 17-27 and the row 17-30 of source by name to skip filtercondition in this example, its display result is as shown in 17-28.As above be namely the concrete grammar by the layout attributes configuration layout rows in the row attribute in the xml file of backstage and foreground xhtml file.
As shown in figure 18, system EL expression formula calculates the plug-in unit pattern of theme sujects plug-in unit, and whether the theme metadata according to document is that sky determines 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 adds mode m odes attribute by <widgetModes> label 18-2 in plug-in definition information, namely under general view view_summary pattern, judge whether the theme metadata layoutValue.dc.subjects of document is sky empty, for sky just sets this plug-in unit as hiding hidden pattern, just do not set this plug-in unit as browsing view pattern for sky.When system generates layout 16-20, this plug-in unit example can be obtained according to the plug-in unit name 16-38 getWidget method 16-40 in every row 16-31, namely calculated by running environment and generate this subjects plug-in unit (details are shown in Fig. 5), the pattern 5-3 of pattern 5-2 as this plug-in unit of use current arrangements can be given tacit consent to when not arranging plug-in unit pattern, specifically can calculate the pattern of this plug-in unit according to the EL expression formula in pattern after plug-in unit pattern is set.18-3 is for obtaining plug-in unit getWidget method, it can obtain the pattern of this plug-in unit by current general view layout pattern 18-5 with getModeFromLayoutMode method 18-4, 18-4 first uses getMode method 18-6 from plug-in unit set of patterns 18-7 (i.e. 18-2), obtain the pattern 18-8 that key assignments is general view (view_summary), the pattern of a character string forms is obtained (as " hidden " by the EL expression formula that getStringValue method 18-9 calculates in 18-8, " view "): calculate the EL expression formula under given environment with evaluateExpression method 18-10 wherein: find out with resolveElExpression method 18-11 wherein and all EL expression formulas in computation schema 18-8: it first judges whether contain EL expression formula in 18-8 with isValueReference method 18-12, namely see in 18-8 and whether contain " #{ " and have " } thereafter " 18-13 (or contain " # $ " and have " } thereafter "), just directly do not return containing EL expression formula otherwise EL expression formula is processed, environment (elContext) 18-15 obtaining expression formula factory (eFactory) 18-14 under this facelet environment and bind with request, value expression is created: it wraps up basic EL environment 18-15 by decorateELContext method by 18-14 createValueExpression method 18-16, for it adds functional mapping 18-18 and variable mappings 18-19, the value expression (expr) finally generated is as shown in 18-20, can see that it comprises a value for Object desired type 18-21, an el expression formula 18-22 (the same 18-8 of content), a functional mapping 18-23 (not quoting any functional label in 18-8) for null, a variable mappings 18-24, its to be the value transmitted by metadata_dc_widget_template.xhtml (the foreground template in order to process metadata plug-in unit) be " #{currentDocument} " variable, 18-25 is the node generated by 18-8, it is that an AstChoice selects node, three nodes are comprised in its child 18-26, be respectively " hidden " that judge whether metadata is empty AstEmpty node 18-27 and when whether metadata is empty returns, " view " pattern, AstValue value node 18-28 is contained again in 18-27, list the layout value layoutValue that will get successively from top to bottom, the prefix dc of Dublin framework, subject attribute subjects in the framework of Dublin, this subjects is and will be used for determining whether empty variable.GetValue method 18-29 is used to this value expression (expr) 18-20, the getValue method 18-30 called in value expression example ValueExpressionImpl method class is carried out acquired value expression formula 18-20 value corresponding in current environment by it: it first uses ElContext, functional mapping, variable mappings generates computing environment (ctx) 18-31, obtain this (the acquisition methods 18-30 initiated by value expression 18-20 again, this is exactly 18-20) node 18-32, namely AstChoice selects node, getValue method 18-33 in AstChoice method class is used to it, it will take out the 0th child 18-34 in 18-32, the i.e. empty node of AstEmpty, whether the subjects attribute of document is empty to use the getValue method in AstEmpty method class to judge to this node: take out the 0th child 18-35 in 18-34, i.e. AstValue value node, getValue method 18-36 in this node AstValue method class is obtained to the subjects attribute of document: obtain the 0th child 18-37 in 18-35, AstIdentifier node, getValue method 18-38 in AstIdentifier method class is used to it, it obtains variable mappings 18-39 (i.e. the variable mappings 18-24 of 18-20) by first calculating 18-31 from environment, if it is not the empty value 18-41 taken out in this object 18-40 (i.e. AstIdentifier node 18-37), and to take out key assignments in 18-39 be that the content of 18-41 (layoutValue) is as new value expression 18-42, its value is under the present circumstances obtained to the getValue method 18-43 in this value expression use value expression formula example ValueExpressionImpl method class, in getValue method 18-44 (same to 18-43) at this moment, because the varMapper in its computing environment 18-45 of variable mappings of not transmitting is null, take out the node 18-46 in this (namely new value expression 18-42), value is the AstIdentifier node of currentDocument, getValue method 18-47 in AstIdentifier method class is used to it, because the variable mappings 18-48 in now environment 18-45 is empty, the not variable mappings of reprocessing under it, EL processor is obtained and the direct value currentDocument taking-up by this (i.e. 18-46) turns back to 18-50 with getELResolver method 18-49, can see that it has taken out the document model example of current document (i.e. example text), 18-50 turned back to the relative position 18-51 of AstValue method class and find the subjects attribute of the document: child's number (propCount) 18-52 taking out this (i.e. AstValue node 18-35) also obtains the property value of each child according to this, initial setting up i=" 1 " 18-53, take out dc (the 1st child 18-54 in the 18-35) attribute results of the document 18-51 as shown in 18-55, it is the dublincore data framework of example text, i is Zi increasing to " 2 " 18-56, subjects (the 2nd child 18-57 in 18-35) attribute results in taking-up Dublin data framework 18-55 is as shown in 18-58, can see that it contains cinema (film), comics (caricature) two children, 18-58 is turned back to the relative position 18-59 of AstEmpty method class in order to judge whether this value is empty, because 18-59 is not for sky returns the relative position 18-61 of " FALSE " 18-60 to AstChoice method class, condition 18-61 due to ternary operator is false, the relative position 18-63 returning its second value " view " 18-62 to ValueExpressionImpl method class as method 18-29 under the present circumstances to the result of calculation of value expression 18-20, return it to the relative position 18-64 of method 18-10 to check wherein whether also containing EL expression formula, by resolveExpression method 18-65 process 18-64, the symbol (18-12 returns false) not comprising el expression formula due to the expression formula 18-66 transmitted directly returns this expression formula, finally " view " is turned back to the pattern of 18-67 as this plug-in unit, it by the view layout 4-19 that calls in package types " suggestManyDirectory " 4-1 of subjects plug-in unit to show plug-in unit, therefore this theme subjeets plug-in unit 18-68 can be seen at the general view page.If be not the theme in example text, subjects plug-in unit arranges metadata, the subjects property value taken out in AstValue method class is empty 18-69, turn back to the correspondence position 18-70 of AstEmpty method class, because 18-70 is the correspondence position 18-72 that sky returns " TRUE " 18-71 to AstChoice method class, condition 18-72 value due to ternary operator is true, return its 1st value " hidden " 18-73, finally " hidden " is turned back to the pattern wMode of 18-74 as plug-in unit, can see from 5-4 and directly will return null when plug-in unit pattern wMode equals " hidden ", do not rerun ensuing plug-in unit loading procedure, so time the general view page in can't see theme subjects plug-in unit 18-75.As above be exactly the concrete grammar by plug-in unit Schema control plug-in unit.
As shown in figure 19, system specifies to only have by the mark function nxd:hasPermission in plug-in unit pattern has the user of write permission just can see and edit the document to current document:
The plug-in unit pattern of subjects is arranged to shown in 19-1, it means that the hasPermission method called under nxd label judges whether user writes (Write) authority to current document (currentDocument), plug-in unit is just arranged to edit ' edit ' pattern by some words, otherwise is arranged to by plug-in unit hide ' hidden ' pattern.Authority is arranged as shown in 19-2 to " example text ", to the authority of Writer user's " write ", to the authority that Reader user " reads ".The general view tab of " example text " is now clicked with Writer user, the step of plug-in unit obtaining mode is originally the same with Figure 18 (18-3 to 18-15), when running to the createValueExpression in resolveElExpression method 19-3 (same to 18-11) and creating value expression method 19-4 (same to 18-16), it will wrap up EL environment by method 18-17, for it adds functional mapping, therefore any expression formula with nxd:hasPermission must be passed through Facelets (because they be defined within tag library) and calculates, system will find the method 19-9 of hasPermission by name in NameSpace https://nxweb/document19-6 (its prefix is nxd) in <facelet-taglib> label, the hasPermission method 19-9 that it will be mapped in DocumentModelFunctions method class 19-8 that ecm.platform.ui.web.tag.fn wraps in 19-7, its interface parameters is 19-10, comprise the variable of a document model and string format.The value expression expr that 19-4 creates is as shown in 19-11, it comprises the Object Class1 9-12 of expection, El expression formula 19-13 (same to 19-1), AstChoice wherein selects node 19-14 to contain AstFunction functional node 19-15 (in order to check authority by hasPermission method) and for two AstString character string nodes ' edit ' selecting and ' hidden ', its functional node 19-16 contains again AstIdentifier mark node 19-17 for obtaining particular document and AstString node 19-18 in order to point out the authority needing to judge, 19-17 and 19-18 is two parameters of hasPermission method.Function Hash table " functions " 19-20 in functional mapping " fnMapper " 19-19 in 19-11 contains the function that all mappings are come, such as this key assignments is the functional mapping example 19-22 of " nxd:hasPermission " 19-21, its prefix is " nxd " 19-23, local " hasPermission " 19-24 by name, its method 19-25 is a public method returning Boolean, for ecm.platform.ui.web.tag.fn wraps the hasPermission method 19-9 in 19-7 in DocumentModelFunctions method class 19-8, the parameter comprised is as shown in 19-10.19-26 is the variable mappings of 19-11, is null owing to not calling its value of any variable event in 19-1.GetValue method 19-27 in value expression example ValueExpressionImpl method class is performed to 19-11, it is according to function variable mappings composition computing environment (ctx) 19-28 in el environment and 19-11, its functional mapping can be seen not for empty and variable mappings is empty (just in time contrary with 18-31), get the node 19-29 (AstChoice selects node) of this (i.e. 19-11), and initiate the getValue method 19-31 in AstChoice method class 19-30 according to it, in order to select plug-in unit pattern, get the 0th child 19-32 (i.e. AstFunction node) in this (i.e. AstChoice node 19-29) and judge whether user has write permission to current document according to the getValue method 19-34 that it is initiated in AstFunction method class 19-33 in order to perform hasPermission method, it obtains functional mapping (fnMapper) 19-35 from environment (ctx) 19-28, and according to the resolveFunction method 19-37 in this functional mapping initiation functional mapping example FunctionMapperImpl method class 19-36 to obtain concrete hasPermission method, and import ' prefix ' 19-39 in this object 19-38 (the AstFunction functional node with in 19-16) and ' localName ' 19-40 into method 19-37 as parameter.Find the functional mapping example 19-43 that key assignments is " 19-39+ ': '+19-40 " (i.e. ' nxd:hasPermission ' 19-21) in function mapping table (functions) 19-42 of method 19-37 in this object 19-41 (namely initiating its functional mapping ' fnMapper ' 19-35), and return method (Method) 19-44 in 19-43.Creating a content according to child's number of this object 19-16 is empty parameter object (params) 19-45, successively the calculated value of each child 19-46 in 19-16 is filled in 19-45, as taken out the document model example (concrete steps are shown in 18-47 to 18-50) of current document currentDocument according to the getValue method in 19-17 AstIdentifier method class, take out the character string forms ' Write ' of ' Write ' again by the getValue method in AstString method class according to 19-18, the new argument object generated is as shown in 19-47, finally use call method ' invokeMethod ' 19-48 with 19-44 and 19-47 for parameter initiates hasPermission method 19-49, method 19-49 can obtain the session of a document management " documentManager ", perform the hasPermission method 19-51 in this session method class, 19-51 can initiate to check authority checkPermission method 19-52 by security service, in method 19-52, system can obtain access control policy ' acp ' 19-54 in document 19-53 (i.e. current document ' example text '), the local authority that keeper is arranged for the document is specifically listed in Access Control List (ACL) ' acl ' in 19-54, it includes the write ReadWrite authority 19-56 (ReadWrite represents read and write) of user (Writer) 19-55, and user (Reader) 19-57 read (Read) authority 19-58, initiate checkPermission method 19-59 by security policy service and check that whether user (Writer) 19-61 is containing writing (Write) 19-62 authority in access control policy ' acp ' 19-60 (same to 19-54), can see that user Writer has write permission to the document by 19-55 and 19-56, this check result is turned back to 19-63 with the form of Boolean, turn back to the relative position 19-64 that AstChoice selects node further, condition 19-65 due to ternary operator is true, to ' wMode ' 19-68 (same to 18-67) returned in the 1st option ' edit ' 19-66 to getWidget method 19-67 (same to 18-3) be selected as plug-in unit pattern.If user Reader clicks the general view tab of ' example text ', to check in access control policy ' acp ' 19-60 (same to 19-54) whether user (Reader) 19-69 writes (Write) 19-62 authority, can see in 19-54 that user Reader does not have write permission, check that failed 19-63 returns the relative position 19-64 that false to AstChoice selects node, and selecting the 2nd option ' hidden ' of ternary operator, last plug-in unit pattern (wMode) 19-70 is for hiding ' hidden '.As above be exactly the concrete grammar being controlled plug-in unit by the mark function in plug-in unit pattern.
As shown in figure 20, have in system and create user, compiles user, check the page of user, multiple associated subscriber such as amendment user cipher etc., but they are derived from same user layout in fact, just mask part plug-in unit according to the difference of layout pattern and make user layout be shown as different appearance:
20-1 is the layout of user by name (user), and it is made up of 13 capable 20-2 of plug-in unit such as user name, password, and due to the impact of the plug-in unit pattern of each plug-in unit, layout can present distinct appearance in different modes.In 20-1, the plug-in unit pattern <widgetModes> of most of plug-in unit is as mail " email " 20-3, for hiding " hidden " 20-5 pattern under the state that Edit Password " editPassword " 20-4 etc. is special, the pattern identical with layout is presented, all the same with the mail plug-in unit 20-9 browse state 20-10 presenting this plug-in unit under the browse mode of layout of such as user name plug-in unit 20-6, name plug-in unit 20-7, unit one belongs to plug-in unit 20-8 under all the other usual states (as browse, edit), under " editor " 20-11 pattern of layout, present the editing mode 20-12 of this plug-in unit, in attribute (properties) 20-13 of wherein mail plug-in unit 20-3, to state that under " editor " 20-14 pattern this plug-in unit is essential " required " 20-15 and its pattern " styleClass " 20-16 is data input text pattern dataInputText, the hidden state 20-18 of this plug-in unit is presented under " change password " 20-17 pattern of layout, can see when layout for a change cipher mode time the overwhelming majority plug-in unit all disappear, now can only see that several plug-in units special under this AD HOC are as password (first time inputs password) 20-19 and original password 20-20, define except creating " create " 20-21 in 20-19, under changing password " editPassword " 20-22 pattern, this plug-in unit is in editor's " edit " state, under all the other any " any " 20-23 patterns, this plug-in unit is all in hiding " hidden " state, define except when changing password " editPassword " 20-24 pattern and current main options card " isOnMainTab " 20-25 is my homepage ' home ' 20-26, this plug-in unit is editor " edit " 20-27 state in 20-20, under all the other any " any " 20-28 states, this plug-in unit is all hiding.Next just illustrating plug-in unit pattern by the plug-in unit pattern 20-29 of " mail " and the plug-in unit pattern 20-30 of " original password " is how to judge to come into force under the different mode of layout.Obtain plug-in unit getWidget20-31 method by layout pattern obtaining mode getModeFromLayoutMode method 20-32, the plug-in unit pattern of non-el expression formula is all directly obtained by getMode method 20-33, when layout pattern is for browsing " view " 20-34, can find key value from its plug-in unit pattern 20-35 as the content of layout pattern " view " 20-36 when loading mail plug-in unit, be the key-value pair of " view " owing to there is no key assignments in 20-35, its lookup result is empty (null) 20-37, when lookup result is the content that space-time system can be attempted finding key value as any " any " 20-38, be the key-value pair of " any " owing to also there is no key assignments in 20-35, its Query Result is empty (null) 20-39, this result is turned back to plug-in unit pattern 20-40, the pattern of pattern as this plug-in unit of current arrangements can be obtained with getWidgetModeFromLayoutMode method 20-41 when plug-in unit pattern is sky, can see in 20-41, browse " VIEW " when layout pattern originates in, general view " SUMMARY ", list " LISTING ", to return time title " HEADER " and browse the pattern 20-43 of " VIEW " 20-42 as this 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 (as to browse in usual state, editor) under present the pattern identical with layout, when layout pattern is for browsing " view " 20-34, can find key value as the content of " view " 20-36 from its plug-in unit pattern 20-44 when loading original password plug-in unit, be that the key-value pair lookup result 20-37 of " view " is for empty owing to there is no key assignments in 20-44, system default finds key value as the content 20-45 of " any " 20-38 from 20-44, its result " hidden " is turned back in plug-in unit pattern 20-47, therefore original password is can't see under the browse mode 20-10 of layout, all in hidden state under any " any " 20-45 pattern of this plug-in unit beyond " editPassword " pattern, when layout pattern for a change password " editPassWord " 20-48 time, can find key value as the content of " editPassword " 20-49 from its plug-in unit pattern 20-35 when loading mail plug-in unit, the content corresponding due to key assignments in 20-35 " editPassword " is " hidden ", lookup result 20-46 is turned back to plug-in unit pattern 20-47, therefore mail plug-in unit is can't see under change password " editPassWord " pattern " 20-18 " of layout, this is also why under layout " editPassword " pattern, most of plug-in unit is hidden state, when layout pattern for a change password " editPassword " time, can find key value as the content of " editPassword " 20-49 from its plug-in unit pattern 20-44 when loading original password plug-in unit, can see in 20-44 that the content that key assignments " editPassword " is corresponding is an el expression formula, because Query Result 20-50 have passed the el expression formula format verification of method 18-13, method 19-3 will be used before returning plug-in unit pattern to calculate this el expression formula, by test method in nxu NameSpace judge ' in main options card mainTabActions ' method class ' whether current main options card isOnMainTab ' is ' my homepage home ', and select " edit " or " hidden " pattern according to judged result, so when keeper wants to need when revising the password of oneself in " my homepage " 20-26 first to input original password 20-20 to ensure safety, when keeper wants in " system management " 20-52 for not needing input original password during others (as user BBB) " change password " 20-53 thus being easy to operate.As above be exactly layout reuse principle, just by judging to make same user layout present the user profile page in different poses and with different expressions of different appearance and function in different modes to the variation of plug-in unit pattern.
As shown in figure 21, system demonstration how by method in this mark function test macro any means class of nxu:test or the logical expression that is made up of multiple condition, and is that corresponding pattern selected by plug-in unit according to result logical value:
The el expression formula in plug-in unit pattern 20-30 is calculated with method 21-1, first it create value expression " expr " 21-2, its concrete el expression formula 21-3 can be seen from 21-2, its node is an AstFunction functional node 21-4, comprise one for AstValue value node 21-5 and two of judging for the AstString node selected as alternative plug-in unit pattern, an AstIdentifier flag node 21-6 is included for finding concrete method class mainTabsActions in value node 21-5, and an AstMethodSuffix method node 21-7 is used for calling isOnMainTab method, and (the mark function nxd:hasPermission in Figure 19 is in order to judge the authority of current document, its parameter is current document, the variablees such as write permission, and mark function nxu:test in this figure is in order to the result of calculation of determination methods isOnMainTab, its parameter is method class and method).Containing a functional mapping 21-8 in 21-2, it is the NameSpace defined in <facelet-taglib> label 21-9 is the mark function that " https://nxweb/util " 21-10 (being abbreviated as nxu) method is called " test " 21-11, what it was quoted is the test method that ecm.platform.ui.web.tag.fn wraps in 21-12 in Functions method class 21-13, the parameter type of nxu:test is as shown in 21-14, comprise the result of a Boolean as method call, comprise two Object as plug-in unit pattern to be selected.The package types calculated in 21-2 is obtained: it first takes out the AstFunction functional node 21-17 of 21-2 with the getValue method 21-16 in value expression example ValueExpressionImpl method class 21-15, the getValue method 21-19 run in AstFunction method class 21-18 obtains the result of calculation of mark function nxu:test: the functional mapping 21-20 taking out 21-2 from computing environment, from functional mapping 21-20, concrete method 21-57 (concrete steps are shown in 19-39 to 19-44) is obtained according to prefix (prefix) 21-21 in functional node 21-17 and local name (localname) 21-22, empty parameter array (params) 21-23 is created according to the child's number in functional node 21-17, the value of the child nodes in 21-17 is filled in 21-23 successively, first get the 0th the child 21-24 (i.e. AstValue node 21-5) of 21-17, its value is calculated: it will first take out the 0th the child 21-26 of AstValue value node 21-5 with the getValue method 21-25 in AstValue method class, MainTabsActions method class 21-27 is taken out according to the AstIdentifier mark node that this content is mainTabsActions, i is from increasing ' 1 ' 21-28 and continuing the 1st child getting 21-5, content is the AstMethodSuffix method node 21-29 of isOnMainTab, the result of calculation of the method is taken out: first take out parameter by getParameters method 21-31 by the getValue method in 21-30 in AstMethodSuffix method class, an empty object array 21-32 is created according to child's number of AstMethodSuffix method node 21-29, the value of all children (such as content is the AstString node 21-34 of home) of this AstMethodSuffix node 21-33 is filled in 21-32, finally populated object array 21-35 is returned 21-31 as parameter, calling this with " MainTabsActions " 21-37 with invokeMethod method 21-36 is method class, be method name with the mirror value of 21-29 (isOnMainTab) 21-38, isOnMainTab method 21-39 so that (home) 21-35 is parameter: the method will judge whether current main options card is 21-40 (home), it first takes out the value " MAIN_TABS " (this value is a constant variables) of leading option card classification (MAIN_TABS_CATEGORY) 21-41 from WebActions method class, the Id that current class is the tab of " MAIN_TABS " 21-43 is taken out again with getCurrentTabId method 21-42, it needs first to take out concrete current tab action-item by getCurrentTabAction method 21-44, can see in current tab action-item set (currentTabActions) 21-45: that choose in current leading option card MAIN_TABS (being alternatively header tab) 21-46 is my homepage (home) tab 21-47, that choose in current user's sidebar (USER_CENTER) 21-48 is my card information (Profile) tab 21-49, the tab action-item 21-51 that key assignments is " MAIN_TABS " 21-50 is taken out from 21-45, and get its Id (home) 21-52, compare with the parameter 21-53 transmitted with (Id) 21-52 of current main options card, if want, true is turned back to the result of calculation of 21-54 as AstValue value node by the words waited, this result " true " will be tucked in the parameter array 21-55 of AstFunetion node by 21-24, and then successively two other child (content is two AstString nodes of edit and hidden) of node 21-17 is filled in 21-55, by invokeMethod method 21-56, to initiate this take 21-57 as method take 21-58 as the test method 21-59 of parameter, it selects to return " edit " 21-61 or " hidden " 21-62 by using its first parameter 21-60 (first child with in 21-55) as the condition of ternary operator, because 21-60 is the correspondence position 21-63 that the second parameter " edit " of test method 21-59 to be turned back in value expression method class 21-15 by true, should " edit " result of calculation namely this plug-in unit pattern that will use of being value expression 21-2, therefore under change cipher mode 20-17, original password 20-20 can be edited when leading option card is my homepage 20-30.When leading option card is system management, the tab action-item of now getCurrentTabAction method 21-44 acquisition is as shown in 21-64, its Id is " admin " 21-65, unequal therefore return " false " 21-66 with 21-53, now participate in the parameter array (its first child is false) as shown in 21-67 of test method, ternary operator condition due to test method 21-59 is " false " 21-68, the pattern 21-69 of its 3rd child " hidden " as plug-in unit will be returned, therefore under change password 20-53 pattern, original password is can't see when leading option card is system management 20-52.As above be exactly the using method of nxu:test, any rreturn value can be that the method for Boolean is as parameter by it, and select corresponding plug-in unit pattern according to its judged result, so just can using nux:test mark function as interface, to allow in system rreturn value arbitrarily be the evaluation work that the method for Boolean participates in plug-in unit pattern.Nxu:test not luminous energy is parameter in method, it can also using logical expression as parameter, as shown in 21-70, nxu:test selects to return " edit " or " view " pattern with the condition that the member of power user's group ' powerusers ' " the active user currentUser to be keeper administrator or active user currentUser be " this logical expression is ternary operator: the logical consequence of being taken out this or logical expression by the getValue method in AstOr method class 21-71: whether it is for true: the 0th the child 21-76 first taking out current AstValue value node first to use the getValue method 21-75 in AstValue method class 21-74 to judge to the 0th the child 21-73 (i.e. currentUser.administrator) of AstOr or node 21-72, be the information 21-77 (supposing that active user is BBB) of the AstIdentifier mark node acquisition active user of " currentUser " according to this value, take out the next child 21-78 of current AstValue value node again, take out when using the isAdministrator attribute 21-79 in user profile 21-77 according to the AstPropertySuffix node that this value is administrator, its result " false " is turned back to the result of calculation of correspondence position 21-80 first expression formula in logical OR of AstOr node, if 21-81 (same to 21-80) directly will return true for true, due to now 21-81 be false continue decision logic or in next expression formula, take out the first child 21-82 (i.e. currentUser.isMemberOf (' powerusers ') in AstOr or node 21-72), the value of this expression formula is calculated: the value 21-77 first taking out the 0th child " currentUser " 21-83 of this AstValue node by the getValue method of AstValue method class, take out the 1st child 21-84 of this node again, isMemberOf method 21-85 is initiated according to the AstMethodSuffix method node that this value is isMemberOf, judge whether comprise power user's group (powerusers) 21-87 in all groups of (allGroups) 21-86 of current user information 21-77, can see in 21-86 and contain member's group " members " and B district member group " tenant-B district _ tenantMembers " but do not comprise powerusers, therefore the value of second expression formula of AstOr node or logic is also " false " 21-88,21-88 is turned back to the condition of 21-70 as ternary operator, due to it for false selects the 3rd parameter " view " 21-89, namely user BBB can browse this plug-in unit, when user is total keeper Administrator, because the isAdministrator attribute 21-90 in its user profile is true, in AstOr node, first transition formula evaluation of logical OR is " true " 21-91, " true " is turned back to the condition of 21-70 as ternary operator, now by selection the 2nd parameter " edit " 21-92, therefore total keeper Administrator can edit this plug-in unit.As implied above, can judge the logical expression that is made up of different variable/method condition to this greatly enhances the further flexibility of plug-in unit pattern by nxu:test.
As described in Figure 22, same plug-in unit is made to show different effects to different user by the setting of plug-in unit pattern, or several intimate plug-in unit is set at the ad-hoc location of layout, make user can only see the plug-in version meeting oneself authority by the filtration of plug-in unit pattern, thus reach reusing of plug-in unit:
22-1 (same to 20-1) is user layout, 22-2 is group's plug-in unit belonging to the user in layout, its plug-in unit pattern only has system manager or power user could edit this plug-in unit by nxu:test mark function 22-4 reputation under editor's 22-3 pattern, other people can only browse this plug-in unit (concrete steps are shown in 21-70 to 21-92), therefore system manager Administrator22-5 can see the editing mode 22-6 of group belonging to user when revising personal information, can be allowed by click fork and oneself exit certain group, also can search for by inputting 3 characters and enter certain group, and domestic consumer (BBB) 22-7 can only see the browse mode 22-8 of group belonging to user, any operation cannot be carried out to the group of oneself.As above be exactly the concrete grammar that plug-in unit is reused, a same plug-in unit can allow different users see different effects by arranging of plug-in unit pattern.22-9 is regional choice plug-in unit, it is made creating 22-11 by nxu:test mark function 22-10, and (the plug-in unit pattern of editor is the same with creating with editor, owing to eliminating in the inadequate figure in place) only have system manager can edit this plug-in unit under pattern, other users cannot see this plug-in unit, by the checkFilter method 22-12 of webActions method class, it checks whether active user led to the verification of filtrator only_for_manager: it first uses all filtrators in filtrator registration table (filterReg) 22-13 extraction system, filtrator (filter) 22-16 that key assignments is 22-14 (namely to the parameter only_for_manager character string 22-15 that the method is imported into) is taken out again in 22-13, this filtrator defines in 22-17, its id is only_for_manager, its regulation is authorized (grant) 22-19 and is checked by (true) when #{userSession.administrator} (namely active user is system manager) condition 22-18 sets up, now plug-in unit pattern is editor 22-20, other users (can't pass the nonsystematic administrator that only_for_manager filtrator checks) cannot see this plug-in unit of 22-21.Plug-in unit preserves the option in drop-down list by a <selectOptions> label 22-22, it is by regions all in the getTenants method 22-23 acquisition system in multiTenant method class: it first obtains directory service 22-24, open one by directory service and lead to the session that in database, " tenants " 22-25 shows, and by all entry 22-26 in this session taking-up tenants table, (detailed step getting entry from session is shown in 8-8 to 8-23, it is empty query manipulation that getEntries () method is equivalent to initiation filtrator, namely all entries in filtercondition acquisition table are not had), be the empty option of " None " 22-27 by a display label and form the drop-down list option of this plug-in unit with the label attribute 22-28 of entry each in 22-26 as multiple region option of display label, its display effect is as shown in 22-29, this plug-in unit means that he can be assigned to arbitrary region when creating (or editor) user by system manager.22-30 is another regional choice plug-in unit, it and 22-9 have the same package types, display label and foreground pattern, just just like next slightly little difference: its name is than many after the name of 22-9 one 1 (can not have the plug-in unit of two same name) under a layout, it only has Regional Admin can edit this plug-in unit with nxu:test mark function 22-31 statement under creation mode, other people cannot see this plug-in unit, it defines in 22-32 for the filtrator tenantPowerusers checked, its regulation as condition #{currentUser.isMemberOf (' powerusers ') 22-33 (namely active user is power user/Regional Admin) authorize when setting up inspection by " true ", now plug-in unit is " edit " state, inspection is authorized not by " false " when condition #{currentUser.administrator}22-34 (namely active user is system manager) sets up, now board state is hidden, so only have the power user beyond system manager (i.e. Regional Admin) that this plug-in unit can be edited.The option in its drop-down list is saved in the <selectOptions> label 22-35 of this plug-in unit, it first obtains data (currentUserProfile) 22-37 of active user with the getUserProfile method 22-36 in userPreferencesActions method class, tenantId attribute 22-39 in user framework 22-38 is found out again and with this property value display label alternatively from 22-37, its display effect is as shown in 22-40, this means that he can only create the user belonging to this region when Regional Admin creates user, 22-41 defines and hide this plug-in unit under edit pattern, this due to this plug-in unit be that Regional Admin is special, also an option is altogether only had in its zone drop down list, therefore the region (can only make B district again into from B district) of compiles user is also insignificant.As above be exactly the another kind of method for reusing of plug-in unit, same position in a layout arranges the similar plug-in unit of several appearance identical function continuously, optionally filtered by plug-in unit pattern, all can see that this plug-in unit meets that version of active user's authority when making different user call this plug-in unit, the regional choice plug-in unit seen as system manager 22-42 can select all regions, and the regional choice plug-in unit that Regional Admin 22-43 sees can only select the region at this keeper place.

Claims (10)

1. an XML configures web site method, by the content map in XML to website, it is characterized in that: in XML file, carry out definition component by extension tag <extension>, extension tag comprises an Extended target attribute for indicating the method class loading this base part in the page, and an extension point attribute is for indicating the resolver of resolving these parts XML content, user can be configured (as arranged the displaying contents of plug-in unit) or assembling (as inserted plug-in unit in layout) to parts in extension tag, can the resolver of these parts of parsing be obtained by extension point and the XML content map of these parts be become a java object when system starts, this java object (judging whether to show these parts and generate foreground pattern according to element attribute according to running environment) generating web page assembly can be calculated by Extended target during page invocation, thus make user can configure website easily by XML.
2. XML according to claim 1 configures web site method, one sets up directory scheme, it is characterized in that: according to directories extension point config directory, according to its data source property setting data storehouse connected mode, according to each column name of its framework setup of attribute and type thereof, be loaded into each entry information according to its data file attribute, build according to it data refresh mode that table policy attribute arranges catalogue.
3. XML according to claim 1 configures web site method, a kind of configuration plug-in method, it is characterized in that: according to widgettypes extension point configuration plug-in type, according to widgets extension point configuration plug-in, plug-in unit is bound package types, foreground template, background process method, layout and attribute that plug-in unit will be inherited in package types.
4. plug-in card configuration method according to claim 3, a kind of plug-in display method, it is characterized in that: become the form of label to be shown to foreground the data assembling preserved in plug-in unit, the attribute that plug-in unit is defined in XML file as spooler Rule of judgment or be packaged into tag attributes and be exposed to foreground template, thus in depth affect performance and the function of plug-in unit by amendment XML.
5. according to claim 2ly set up directory scheme, a kind of Display directory method, it is characterized in that: obtain all entries of catalogue and by the mode of iteration, they generated a JSONAdapter tree, being generated words tree available in a drop-down list by javascript again, is that it adds corresponding css pattern according to the attribute of each vocabulary.
6. XML according to claim 1 configures web site method, a kind of XML extracting method, it is characterized in that: system is extracted the XML information of plug-in unit and generated one and only comprise Extended target, the log-on message of extension point and former XML file address, when Extended target does not load, this log-on message is put into the queue waiting for this Extended target, the descriptor corresponding to the extension point in log-on message is therefrom found out after Extended target loads, from the former XML file address log-on message, the concrete configuration information of this plug-in unit is taken out by this descriptor, and registered the java object of the same type with extension point.
7. XML according to claim 1 configures web site method, a kind of layout call method, it is characterized in that: the document of every type all contains the layout collection shown in different modes, each layout collection is made up of one or more layout, by loading these layouts for the facelet processor of layout collection or layout.
8. XML according to claim 1 configures web site method, a kind of layout method for building up, it is characterized in that: according to layout extension point configuration layout, often row in layout contains only the name of plug-in unit, plug-in definition information is taken out according to the name of each plug-in unit when calling layout, concrete plug-in unit example is calculated again according to running environment, with plug-in unit example, each row of layout is filled complete, XML configuration information by layout always to define in this layout, acquiescence and the row never chosen, the a few row selected in this layout of display can be called in the foreground facelet label of this layout any.
9. XML according to claim 1 configures web site method, a kind of plug-in unit mode computation method, it is characterized in that: in the XML information of each plug-in unit, have a <widgetModes> label in order to preserve the plug-in unit mode computation method of this plug-in unit under different layout pattern, these computing method directly can return a kind of specific pattern, also can judge to select certain pattern according to system variable, can also judge to select certain pattern according to the result of calculation of mark function, the any Rule of judgment of method as preference pattern returning Boolean in system can be allowed by nxu:test mark function, if <widgetModes> content will inherit the pattern of layout belonging to it for blank card.
10. plug-in unit mode computation method according to claim 9, a kind of layout method for reusing, it is characterized in that: judge to make same layout present different performances and function in different modes by the variation of plug-in unit pattern, make same plug-in unit that different user can be allowed to see different-effect by adding in plug-in unit pattern to the scope check of active user, the similar plug-in unit of several appearance identical function can be set same position in layout continuously, that meets the plug-in version of oneself authority by the selective filter of plug-in unit pattern, the user of different rights can only to be seen.
CN201510312172.7A 2015-06-09 2015-06-09 A method of passing through XML dynamic configuration website Active CN105095348B (en)

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 true CN105095348A (en) 2015-11-25
CN105095348B 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)

Cited By (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104978196A (en) * 2015-06-26 2015-10-14 深圳Tcl数字技术有限公司 Setting function item display method and apparatus
CN105700925A (en) * 2016-01-13 2016-06-22 深圳市华讯方舟软件信息科技有限公司 APP interface implementation method and apparatus
CN107273138A (en) * 2017-07-04 2017-10-20 杭州铜板街互联网金融信息服务有限公司 Decoupling method and system based on interaction between Android business modules
CN107329745A (en) * 2017-06-16 2017-11-07 贵州广思信息网络有限公司 A kind of method of enhancing WORD document operability
CN108287713A (en) * 2017-12-22 2018-07-17 深圳康得新智能显示科技有限公司 Adding method and device, terminal, storage medium, the electronic device of document function
CN109445890A (en) * 2018-10-09 2019-03-08 北京达佳互联信息技术有限公司 A kind of method for showing interface, device, terminal device and storage medium
CN109614085A (en) * 2018-10-23 2019-04-12 深圳微迅信息科技有限公司 Function realizing method, device, computer equipment and storage medium
CN109977670A (en) * 2019-03-12 2019-07-05 福建天晴数码有限公司 Android application safety monitoring method, storage medium based on plug-in unit load
CN110232173A (en) * 2018-03-06 2019-09-13 福建天泉教育科技有限公司 List configuration method and its system based on configurableization list engine
CN110263279A (en) * 2019-05-08 2019-09-20 北京字节跳动网络技术有限公司 Page generation method, device, electronic equipment and computer readable storage medium
CN110442419A (en) * 2019-08-15 2019-11-12 北京字节跳动网络技术有限公司 The quick interface arrangement method and device of Android application
CN110750248A (en) * 2018-07-23 2020-02-04 贵州白山云科技股份有限公司 Method and device for transmitting extension information of existing component
CN111459570A (en) * 2020-03-30 2020-07-28 掌阅科技股份有限公司 PDF plug-in loading method, electronic equipment and computer storage medium
CN111813385A (en) * 2020-07-07 2020-10-23 赞同科技股份有限公司 Web application-based page plug-in method, device and equipment
CN111897469A (en) * 2020-07-06 2020-11-06 上海泛微网络科技股份有限公司 Real-time data processing method, device, equipment and storage medium
CN112632920A (en) * 2020-11-16 2021-04-09 腾讯科技(深圳)有限公司 Link processing method, link processing device, terminal equipment and storage medium
CN113065314A (en) * 2021-03-26 2021-07-02 山东英信计算机技术有限公司 BIOS hardware adaptation method and device based on XML file format
CN113076462A (en) * 2021-03-25 2021-07-06 恒安嘉新(北京)科技股份公司 Network session data query method, device, equipment and medium
CN113342417A (en) * 2021-06-15 2021-09-03 京东数科海益信息科技有限公司 Plug-in configuration method, device and equipment
CN114064662A (en) * 2022-01-13 2022-02-18 北京中交兴路信息科技有限公司 Method, device, electronic equipment and medium for querying data
CN114090523A (en) * 2022-01-19 2022-02-25 荣耀终端有限公司 Electronic device, and node parsing method and medium for XML file thereof
CN114595199A (en) * 2022-05-10 2022-06-07 太平金融科技服务(上海)有限公司 File analysis method and device, computer equipment and storage medium
US20230130527A1 (en) * 2021-01-04 2023-04-27 Capital One Services, Llc Dynamic review of software updates after pull requests
CN116302076A (en) * 2023-05-18 2023-06-23 云账户技术(天津)有限公司 Method and device for configuring configuration items based on analysis configuration item table structure
CN116301831A (en) * 2023-03-20 2023-06-23 中国华能集团有限公司北京招标分公司 DP plug-in and application method thereof

Citations (2)

* Cited by examiner, † Cited by third party
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

Patent Citations (2)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
Title
刘升平 等: "一种XML的模型论语义", 《软件学报》 *
刘淑梅: "XML技术在动态网站中的应用", 《邢台职业技术学院学报》 *
王雅光 等: "基于XML实时动态模型界面的研究与应用", 《计算机应用与软件》 *

Cited By (35)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104978196A (en) * 2015-06-26 2015-10-14 深圳Tcl数字技术有限公司 Setting function item display method and apparatus
CN105700925A (en) * 2016-01-13 2016-06-22 深圳市华讯方舟软件信息科技有限公司 APP interface implementation 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
CN110750248A (en) * 2018-07-23 2020-02-04 贵州白山云科技股份有限公司 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
CN109614085A (en) * 2018-10-23 2019-04-12 深圳微迅信息科技有限公司 Function realizing method, device, computer equipment and storage medium
CN109977670A (en) * 2019-03-12 2019-07-05 福建天晴数码有限公司 Android application safety monitoring method, storage medium based on plug-in unit load
CN110263279B (en) * 2019-05-08 2021-08-10 北京字节跳动网络技术有限公司 Page generation method and device, electronic equipment and computer readable storage medium
CN110263279A (en) * 2019-05-08 2019-09-20 北京字节跳动网络技术有限公司 Page generation method, device, electronic equipment and computer readable storage medium
CN110442419B (en) * 2019-08-15 2022-11-29 北京字节跳动网络技术有限公司 Interface layout method and device for Android application
CN110442419A (en) * 2019-08-15 2019-11-12 北京字节跳动网络技术有限公司 The quick interface arrangement method and device of Android application
CN111459570A (en) * 2020-03-30 2020-07-28 掌阅科技股份有限公司 PDF plug-in loading method, electronic equipment and computer storage medium
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
CN111813385A (en) * 2020-07-07 2020-10-23 赞同科技股份有限公司 Web application-based page plug-in method, device and equipment
CN111813385B (en) * 2020-07-07 2023-09-22 赞同科技股份有限公司 Page plug-in method, device and equipment based on Web application
CN112632920A (en) * 2020-11-16 2021-04-09 腾讯科技(深圳)有限公司 Link processing method, link processing device, terminal equipment and storage medium
US20230130527A1 (en) * 2021-01-04 2023-04-27 Capital One Services, Llc Dynamic review of software updates after pull requests
US12026509B2 (en) * 2021-01-04 2024-07-02 Capital One Services, Llc Dynamic review of software updates after pull requests
CN113076462A (en) * 2021-03-25 2021-07-06 恒安嘉新(北京)科技股份公司 Network session data query method, device, equipment and medium
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
CN113065314A (en) * 2021-03-26 2021-07-02 山东英信计算机技术有限公司 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
CN114064662A (en) * 2022-01-13 2022-02-18 北京中交兴路信息科技有限公司 Method, device, electronic equipment and medium for querying data
CN114090523A (en) * 2022-01-19 2022-02-25 荣耀终端有限公司 Electronic device, and node parsing method and medium for XML file thereof
CN114595199A (en) * 2022-05-10 2022-06-07 太平金融科技服务(上海)有限公司 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
CN116301831A (en) * 2023-03-20 2023-06-23 中国华能集团有限公司北京招标分公司 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
CN116302076A (en) * 2023-05-18 2023-06-23 云账户技术(天津)有限公司 Method and device for configuring configuration items based on analysis configuration item table structure

Also Published As

Publication number Publication date
CN105095348B (en) 2019-03-26

Similar Documents

Publication Publication Date Title
CN105095348B (en) A method of passing through XML dynamic configuration website
Huck et al. Jedi: Extracting and synthesizing information from the web
US7505985B2 (en) System and method of generating string-based search expressions using templates
US6513010B1 (en) Method and apparatus for separating processing for language-understanding from an application and its functionality
US5630120A (en) Method to help in optimizing a query from a relational data base management system
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
US8826142B2 (en) Document handling in a web application
NL1028923C2 (en) Method, device and software for extracting chemical data.
US5630114A (en) Database management system embedded in an operating system command
CN110147544A (en) A kind of instruction generation method, device and relevant device based on natural language
Ramchand Lexical items in complex predications: Selection as underassociation
CN111125439A (en) XML data processing method, system and storage medium
WO2001024003A1 (en) A software component-container framework for dynamic deployment of business logic components in a distributed object environment
CN110311819A (en) Automatic production of HTML page and MIBs table generating method, management method, equipment end and management system based on page configuration file
Haidou On the syntax and pragmatics interface: left-peripheral, medial and right-peripheral focus in Greek
CN114089960B (en) Object processing method and device
JP3995186B2 (en) Parser
US20050267909A1 (en) Storing multipart XML documents
WO2002095616A1 (en) Parsing system
Zeng et al. Information retrieval based on conceptual network
Ward et al. Oracle Call Interface Programmer's Guide, 11g Release 2 (11.2) E10646-12
CN117874167A (en) Method, system, equipment and storage medium for searching object
Ward et al. Oracle Call Interface Programmer's Guide, 11g Release 2 (11.2) E10646-15
CN103827860B (en) Structured document management device and method

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