Do It The jAPS Way
Copyright © 2011 Tzente s.r.l.
Legal Notice
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the Appendix entitled "GNU Free Documentation License".
2011-03-03
| Diario delle Revisioni | ||
|---|---|---|
| Revisione 0.2 | 2011-03-11 | MEM |
|
Revision for the jAPS 2.2.0 release | ||
| Revisione 0.1 | 2011-03-03 | DN |
First draft | ||
Estratto
The Contents in jAPS differ in structure and are organized in Content Types, each of which expresses wich and how information will be.
In order to made the Types of Content is necessary to have different types of information managed by the system in their basic forms.
Come into play the Attributes Types for Content, each with the task of representing information in a precise form.
Sommario
Lista degli Esempi
- 2.1. attribute, the example of basic syntax
- 2.2. name, the example of basic syntax
- 2.3. attributetype, the example of basic syntax
- 2.4. required, the example of basic syntax
- 2.5. searcheable, the example of basic syntax
- 2.6. indexingtype, the example of basic syntax
- 2.7. roles, the example of basic syntax
- 2.8. Cross-Validation, the example of basic syntax
- 2.9. OGNL validation, the example of basic syntax
- 3.1. Attach Type
- 3.2. Boolean Type
- 3.3. Checkbox Type
- 3.4. Date Type
- 3.5. Enumerator type, base
- 3.6. Enumerator type, customizated separator
- 3.7. Enumerator type, with extractorBean
- 3.8. Hypertext Types
- 3.9. Image Type
- 3.10. Link Type
- 3.11. Longtext Type
- 3.12. Monotext Type
- 3.13. Number Type
- 3.14. Text Type
- 3.15. Tipo Text, con minLength e maxLength
- 3.16. Tipo Text, con regexp
- 3.17. ThreeState Type
- 4.1. List Type, list of simple attributes
- 4.2. List Type, sintax Monolist
- 4.3. Composite, sintax base
- 4.4. Monolist of Composite, card person with father
This document will describe the Attributes Types for Contents the characteristics and
the setup wizard for use.
The reading is recommended to anyone who is doing the study of information
for a new portal and is preparing to define the Content Types.
In addition it may be desirable to modify the existing configuration.
Additional informations may be obtained through the official mailing-lists:
<japs-platform@googlegroups.com>, "japs-platform" Google Group, the jAPS 2.0 entando official Mailing List
Is it also possible to refer to the documentation found in the:
The study of the organization of the information and of the content is an important part of developing a web portal and it is important to understand that a website works if its contents are well arranged.
To organize contents in jAPS means putting together the types of information needed to build the structure of Content Types.
The Attributes Types for Contents represent the information in its minimal; putting them together structured information in the portal.
After having carried out the study on information and thought about what Types and what will be, we proceed to translate these needs in XML jAPS.
The Attributes Types for Contents are elements contained in the XML of the configuration of the Content Types in the database Port,
mapped in the "config" the record with item "contenttypes" table "sysconfig".
Here we will refer to this XML.
The configuration of each Attribute Type requires the explicit attributes that determine its properties.
The common attributes are:
-
name -
required -
searcheable -
indexingtype
Esempio 2.1. attribute, the example of basic syntax
<attribute name="" required="" searcheable="" indexingtype="">
It's the name of the attribute, is used to identify the information.
The name must always start with the first letter capitalized and can not contain spaces and special characters.
Its length must be less than 10 characters.
Name is mandatory and its value is arbitrary
Esempio 2.2. name, the example of basic syntax
<attribute name="Title".......... <attribute name="Author".......... <attribute name="PublicationDate"..........
It declares the nature of the attribute
Its value must be one chosen from among Attributes Types for Contents in the system.
Esempio 2.3. attributetype, the example of basic syntax
<attribute name="Title" attributetype="Text" /> <attribute name="Author" attributetype="Monotext" /> <attribute name="Date" attributetype="Date" />
It declares if the attribute is required, or is a field that must always be filled.
Is used for features information, without which the Type of content would not make sense.
Prevents you from having incomplete and fragmentary contents.
It has two values: true o false. When required is not present in the configuration the attribute is considered as not mandatory by taking the value of false by default.
Esempio 2.4. required, the example of basic syntax
If we decide that the necessary informations to make a News are the title, the date and the text should declare them as mandatory.
<!-- attributo obbligatorio --> <attribute name="Title" attributetype="Text" required="true" /> <!-- attributo non obbligatorio --> <attribute name="Author" attributetype="Monotext" /> <!-- attributo obbligatorio --> <attribute name="Date" attributetype="Date" required="true" />
It declares if the attribute can be used to sort or filter content lists.
This property allows you to add filters based on that Attribute Type when publishing lists of Content, or for use with the tag wp:contentList.
Possible value are: true or false. The default is false.
Esempio 2.5. searcheable, the example of basic syntax
The creation of the filters can be and have meaning only when the value of information can be ordered.
<attribute name="Title" attributetype="Text" searcheable="true" <attribute name="Date" attributetype="Date" searcheable="true" <attribute name="photo" attributetype="Image"
Is useful to sort in ascending order the titles, for create an alphabetically ordered set of strings, the same applies to the information sorted in numerical ascending order and descending order.
It declares whether the information should be indexed by search engine.
The attributes indexed by the search engine will be used as search keys to find contents.
Possible value are: text and unstored. The default is unstored.
Other values depend on the implementation of indexation. Currently, the search engine indexes only the types of text.
Esempio 2.6. indexingtype, the example of basic syntax
<attribute name="Title" attributetype="Text" indixingtype="text" ... <attribute name="Date" attributetype="Date" indixingtype="text" ... <attribute name="Photo" attributetype="Image" ...
Title and Date will be indexed, Photo will be excluded from indexing.
A Role is a tag of the attribute that allows a particular use within the application functionality.
For example you can use to assign function to a particular attribute of Title for the system.
For example the jacms:title defines the attribute, in the page where you place the check
on SEO: When available, use extra titles, that will used as Page title.
Utile nei casi in cui il valore di un Attributo deve essere validato rispetto ad un altro. Useful in cases where the value of an attribute must be validated respect to another.
It can be used for attributes of type Number and Date. You can choose to set a range (From or To) or a value (equal to).
Esempio 2.8. Cross-Validation, the example of basic syntax
<attribute name="StartDate" attributetype="Date" searcheable="true" /> <attribute name="EndDate" attributetype="Date" searcheable="true"> <validations> <rangestart attribute="StartDate" /> </validations> </attribute>
In the example we see a typical case where is useful a cross-validation, have an attribute EndDate that must be higher than attribute StartDate.
You can put different types of validation, from simple to complex.
The OGNL expression must return a Boolean value (true or false). In the construction of expressions, the object 'root' is the same attribute (you can access the methods of the attribute without specifying or using the prefix #attribute).
Are available: the map of the languages of the system (#langs) and the entity to which it is attached (#entities).
In addition, for the elements of a list or for a Composite you can access to the parentof the attribute (#parent) and for a list items you have available the index (#index).
You can enter a message for help or for error, or choose a key to be associated with a label system
Esempio 2.9. OGNL validation, the example of basic syntax
<attribute name="StartDate" attributetype="Date" searcheable="true"> <validations> <required>true</required> <expression evalOnValuedAttribute="true"> <ognlexpression> <![CDATA[#attribute.date.after(new java.util.Date())]]></ognlexpression> <errormessage><![CDATA[The start date has to be after than today]]></errormessage> <helpmessage><![CDATA[The start date has to be after than today]]></helpmessage> </expression> </validations> </attribute>
The example here is a validation used for a date, namely the obligation to include a date higher than today.
Sommario
Represents the information in the form of files, which will be attached to the Content.
consists of a URL corresponding to the desired file and a text which can indicate the title or description.
During the editing, you can select an attachment already present in the Resources or enter a new one.
Represents the information in Boolean form, expresses the concept of true or false.
In the interface for the compilation of the Content will see two radio buttons that allow the selection of the values "yes / no "
Esempio 3.2. Boolean Type
<attribute name="Importante" attributetype="Boolean" /> <attribute name="EventoPermanente" attributetype="Boolean" />
Represents the information in the form of boolean, true or false.
It can be used alternately Boolean.
In the interface for the compilation of the Content you will see a checkbox that will to "activate" and to "disable".
Esempio 3.3. Checkbox Type
<attribute name="Important" attributetype="Checkbox" /> <attribute name="Event" attributetype="Checkbox" />
Is the information in form of Date.
Is used when want to collocate information in the time.
Often used to specify the date of end publication useful for filtering content in automatic lists.
Esempio 3.4. Date Type
<attribute name="EventDate" attributetype="Date" searcheable="true" />
<attribute name="EndPublicationDate" attributetype="Date" searcheable="true" />
Represents a textual information that have a predefined set of choices.
In the CMS the selection is done by a select.
There is a unique value for all languages of the system.
Supports standard attributes, and has two additional attributes:
-
separator The values listed are separated from each other by a separator. The default is the comma
",".-
extractorBean When specified is the name of the bean puller of items that will be added to the list specified statically. The extractor is defined in the configuration of Spring Framework.
A case of using a list of nations.
Esempio 3.5. Enumerator type, base
<attribute name="Country" attributetype="Enumerator"> <![CDATA[Italy,France,Germany,U.K.,Switzerland,Belgium,Netherland]]> </attribute>
Esempio 3.6. Enumerator type, customizated separator
<attribute name="Country" separator="-" attributetype="Enumerator"> <![CDATA[Italy-France-Germany-U.K.-Switzerland-Belgium-Netherland]]> </attribute>
Esempio 3.7. Enumerator type, with extractorBean
<attribute name="Country" extractorBean="MyItems" attributetype="Enumerator"> <![CDATA[Italy,France,Germany,U.K.,Switzerland,Belgium,Netherland]]> </attribute>
Represents the information in the form of hypertext can contain html tags
To put them to good use, we recommend the use of only the tag is to provide meaning and are not graphics. For example: p, b, em and a simply add semantics to the text.
In their content will display a textarea for the inclusion of hypertext for each language present. When the FCKEditor is active, you can quickly insert external links, links to pages or links to existing content.
Represents the information in the form of image.
During the compilation of the Content will be possible to access to the Image Archive and choose the image desired.
You will need to specify the description accompanying the image.
Usually the attributes of type Image are not indexed and are not made available to the filters for automatic lists.
It is a connection between pages, content or other.
It is used when you want specify a link, while editing the content, you can insert three types of links: external, page and to content.
With external indicates a URL that is outside of the portal jAPS.
The link to page refers a portal page.
While the link to content refers to specific content.
Esempio 3.10. Link Type
<attribute name="CompanyWebAddress" attributetype="Link" /> <attribute name="Homepage" attributetype="Link" />
Represents the information in the form of simple text.
It is multilingual and is used for small descriptions or texts that are longer than a title.
Support maxLength, minLength and regexp. See the attribute Text (la sezione chiamata «Text»)
Represents the information in textual form.
It is similar with Text but it is monolingual.
It is used for information that have a unique value in all languages.
Again, this supports maxLength, minLength and regexp. See Text (la sezione chiamata «Text»).
Represents the information in numerical form.
It has a single value for all languages.
It is used when the information must be expressed in a single number. Consider the case of number of practice, the user code or the number of miles away.
Esempio 3.13. Number Type
<attribute name="PracticeNumber" attributetype="Number" required="true" /> <attribute name="UserCode" attributetype="Number" /> <attribute name="MilesNumber" attributetype="Number" />
Represents the information in the form of multilingual text.
You can enter a value in each language set.
It is used for various purposes such as titles, names and places.
Esempio 3.14. Text Type
<attribute name="Title" attributetype="Text" /> <attribute name="EventPlace" attributetype="Text" />
In addition to supporting required, indexingtype and searcheable, properties common to all types of attributes, it has three possible configurations:
- Minimum Length
- Expresses the minimum length of the text (in characters). It is an attribute of
<attribute>. - Maximum Length
- Expresses the maximum length of the text (in characters). It is an attribute of
<attribute> - Regular Expression Validation
- Expresses a model to which the text must to join. This configuration is inserted as a child of
<attribute>.
Esempio 3.15. Tipo Text, con minLength e maxLength
<attribute name="Abstract" attributetype="Text" minLength="10" maxLength="100" />
Esempio 3.16. Tipo Text, con regexp
<attribute name="EMail" attributetype="Text"> <regexp><![CDATA[[.+@\w.*]]></regexp> </attribute>
Information that can take values yes,no and unspecified / none.
Is used as the Boolean the only difference being that the third value is also contemplated unspecified / none.
In a compilation of the kind of content you can not choose when you don't have the correct information.
A practical example is the ability to bring animals in a given place, as in a hotel
Esempio 3.17. ThreeState Type
<attribute name="AnimalAllowed" attributetype="ThreeState" required="true" />
Until now we have those Attributes Types who could represent only one type of information at a time.
But what is the procedure when it is necessary to have information which makes sense since it is made more simple types?
It might be acceptable from a functional standpoint enter the Simple Attribute Types one after the other.
You still be able to complete the content with the information and use it for display in the portal.
However it is not correct from the formal point of view, the parts that make up that kind of information would remain disconnected and not in context.
To meet this need are the Composed Attribute Types, that bring together more Simple Attribute Types.
This Attribute Type represents a set of independent lists of homogeneous elementary Attributes, each associated with one of the languages defined system.
La conseguenza immediata di questa caratteristica è che questo tipo di lista può gestire solo Attributi elementari di tipo Monolingua. The immediate consequence of this is that this type of list can handle only monolingual basic Attributes.
In each element of the List, you can define a variable number of elements;
dopo aver definito il Tipo di Attributo elemento che la lista gestirà, sarà possibile decidere arbitrariamente per ciascun
Contenuto quanti elementi saranno presenti in ciascuna lista associata a ognina delle lingue di sistema.
after defining the Attribute Type element that will manage the list, you can decide arbitrarily to each
Content how many items in each list associated with each language of the system.
To carry out the configuration using the XML element <list>.
<list> supports the standard properties name and required and attributetype.
For attributetype you must specify List.
Not supported instead the property indexingtype and searcheable.
You have a property to specify the type of list elements called nestedtype.
For nestedtype must put an attribute type monolingual.
Esempio 4.1. List Type, list of simple attributes
<list name="Attach" attributetype="List" nestedtype="Monotext" />
This attribute represents a common list for all system languages.
This type of list can handle both basic attributes of type monolingual and multilingual.
It is used in all cases that required a single list for all languages.
Supports the same properties of List, refer la sezione chiamata «List»
Esempio 4.2. List Type, sintax Monolist
<list name="Documents" attributetype="Monolist" nestedtype="Attach" /> <list name="Link" attributetype="Monolist" nestedtype="Link" />
It is a set of simple attributes.
Its task is to describe a list of information, each composed of several simple attributes.
As with other lists to create the configuration using the XML element <list>.
It is noticeable that in <list> you have to place the child elements of type <attribute>.
The properties of Attribute Types children remain unchanged.
Esempio 4.3. Composite, sintax base
<list name="" attributetype="Monolist" nestedtype="Composite"> <attribute name="" attributetype="" required="" indexingtype="" /> [...] <attribute /> </list>
Esempio 4.4. Monolist of Composite, card person with father
If we have to describe some information of the "father" of a person. The person is described in the content type "Person" that will have an attribute "Father"
consists of two simple attributes: Name and Age. Respectively of type Monotext and Number.
We proceed declaring Father as Composite Attribute and adding attributes Name and Age.
<list name="Father" attributetype="Monolist" nestedtype="Composite"> <attribute name="Name" attributetype="Monotext" required="true" /> <attribute name="Age" attributetype="Number" required="true" /> </list>
Declared Name and Age required the system will interpreted the information Father as correct when both will be, more than that when the child elements will be expressed correctly (in the Number type can not enter letters).
