<PREFERENCE> : Display preference

Java class : leon.info.LyPreference

ROLE

This tag is used to specify a display preference for an action view. Preferences are usually created dynamically by the end-user of the application, they represent the current display options of a view. A preference may contain a filter, a sort, a list of fields displayed in the view and the reference to a field for which its column was fixed (in a table view). Preferences may have a name, in this case the user can apply a display preference by choosing one with its name. A preference can be associated to a user by its id. In this case, only the corresponding user will have access to this preference.

ATTRIBUTES

<!ATTLIST PREFERENCE
	  id ID #REQUIRED
	  idref IDREF #REQUIRED
	  name CDATA #REQUIRED
	  fixedColumn IDREF #IMPLIED
	  nbObjects NMTOKEN #IMPLIED
	  user CDATA #IMPLIED
	  default ( true | false) "false"
	  defaultForMobile ( true | false) "false"
	  forPortlet ( true | false) "false"
	  readOnly ( true | false) "false"
	  lastFileName CDATA #IMPLIED
	  columnSizes CDATA #IMPLIED
	  showAs ( TABLE | LIST) #IMPLIED>
Attribute Mand. Description Default
id yes Id of the preference.  
idref yes Id of the action for which this preference was created.  
name yes Name of the preference.  
fixedColumn no Id of a field which associated column was fixed if the view is a table.  
nbObjects no Number of displayed objects in the current view  
user no Id of the end-user who the preference is associated to.  
default no Specifies that the preference is the default one : the preference used for display when opening a view. false
defaultForMobile no PREFERENCE.defaultForMobile false
forPortlet no PREFERENCE.forPortlet false
readOnly no Indicates that the preference is read-only (cant' be changed) when set to true. false
lastFileName no Last file name used for this preference (only used when saving import/export parameters).  
columnSizes no PREFERENCE.columnSizes  
showAs no Display mode set for this preference.  

ELEMENTS

<!ELEMENT PREFERENCE 
	  ((FILTER | FILTER_REF)?,
	   (SORT | SORT_REF)?,
	   (FIELD_REF)*,
	   EXTERN*)>
Element Mand. Mult. Description
FILTER yes no Filter of the preference.
FILTER_REF yes no Reference to a filter of the preference.
SORT yes no Sort of the preference.
SORT_REF yes no Reference to a sort of the preference.
FIELD_REF yes no Ordered list of fields displayed to the end-user.
EXTERN no yes Declaration of external entities used in the preference definition or in the filter or in the sort.

SAMPLE

<?xml version='1.0' encoding='ISO-8859-1'?>
<!DOCTYPE PREFERENCE SYSTEM 'leon/conf/dtd/leon.dtd'>

<PREFERENCE id='pref1' idref='projectTable'
	name='Projet en cours' fixedColumn='projectClient'>

	<FILTER id='_filterPref1' type='OR'>
		<EXP idref='projectState' value='prjstate1'/>
	</FILTER>

	<SORT id='_sortPref1'>
		<SORT_CRITERIA idref='projectAmount'/>
		<SORT_CRITERIA idref='projectClient'/>
	</SORT>

	<FIELD_REF idref='projectClient'/>
	<FIELD_REF idref="projectName"/>
	<FIELD_REF idref="projectDate"/>
	<FIELD_REF idref="projectAmount"/>
	<FIELD_REF idref="projectState"/>

	<EXTERN id='projectTable'/>
	<EXTERN id="projectName"/>
	<EXTERN id="projectDate"/>
	<EXTERN id='projectState'/>
	<EXTERN id='projectAmount'/>
	<EXTERN id='projectClient'/>
</PREFERENCE>