|
Open SiteSearch 4.1.1 Final |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ORG.oclc.fmts.RuleSpec
The RuleSpec class defines a formatting rule including the class to execute for the rule, the data field to format, and the displayname for the rule.
The data fields to format are defined in units in the field*= variable in the formatting configuration file. Each unit can be comprised of multiple fields and multiple instructions for formatting the unit.
The syntax for describing the fields in a formatting unit is as follows:
Note: For purposes of clarity the continuation characters
'\'+newline is used, but is not part of the syntax.
field* =
where:
;
Example Rule Specifications:
[Title]
class = ORG.oclc.fmts.rules.AddRecordData
field* = 245|a
displayname = Title
[Subject]
class = ORG.oclc.fmts.rules.AddRecordData
displayname = Subject
field* = 650,651,652(sep='BREAK',repeatsfld='a',ind1='0',ind2='2',idx='sh=')| \
a-b(combine,dataordered); \
c-w(sep=' ',dataordered); \
x,y,z(sep=' -- ',dataordered)
field* = 690(sep='BREAK',repeatsfld='a')| \
a,b(idx='sh=',combine);x,y,z(idx='sh=',sep=' -- ',formatordered)
Results in:
sh=
indexsh=
index.
When subfield 'a' occurs, a line break is inserted.sh=
index. The anchors are separated by a ' -- '.
The default values for each field definition are defined in the FieldData class.
RulesBasedDisplayGenerator
,
FieldData
Field Summary | |
FieldData[] |
data
FieldData array object containing the fields and instructions for formatting the fields. |
String |
label
String data type containing the display label for the unit. |
String |
name
String data type containing the named label for the unit. |
DataPairs |
ruleParameters
DataPairs object containing any additional parameters needed for the rule. |
Method Summary | |
DisplayRule |
getRule()
Retrieves the DisplayRule object. |
String |
getRuleParm(String parmName)
Retrieves the rule parameter value for the input parameter name and returns an empty string if not found. |
String |
getRuleParm(String parmName,
String defaultVal)
Retrieves the rule parameter value for the input parameter name and returns the input defaultVal String if not located. |
String |
toString()
Generates a String representation of the object. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public String name
public String label
public FieldData[] data
public DataPairs ruleParameters
Method Detail |
public final String getRuleParm(String parmName)
parmName
- the name of the rule parameterpublic final String getRuleParm(String parmName, String defaultVal)
parmName
- the name of the rule parameterdefaultVal
- the default value if the parm is not foundpublic String toString()
public DisplayRule getRule()
|
Open SiteSearch 4.1.1 Final |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |