Guide for RESOURCE statement

RESOURCE statement is used for reading attachments of topic.

Note:For Custom topics, it will return a empty list always.

RESOURCE grammar

<res id=(id:STRING) topic=(topic:STRING) type=(type:STRING) where=(where:string) orderby=(orderby:string) from=(from:int) rows=(rows:int) page=(page:int) style=(style:String)>
    --Input your text content here
</res>

Topic parameter must be placed after id parameter and before other parameters.



How to customize pagination style

Please use JAVA statement to set all fields showed below before RS statement.
ATTENTION PLS:
1.please re-set all fields but not one of them only.
2.If you only want to customize your CSS style, please just do it with /css/pagebreak.css
3.Format String Syntax, please see java Formatter class for more detail:
The format specifiers for general, character, and numeric types have the following syntax:
%[argument_index$][flags][width][.precision]conversion

The optional argument_index is a decimal integer indicating the position of the argument in the argument list. The first argument is referenced by "1$", the second by "2$", etc.

The optional flags is a set of characters that modify the output format. The set of valid flags depends on the conversion.

The optional width is a non-negative decimal integer indicating the minimum number of characters to be written to the output.

The optional precision is a non-negative decimal integer usually used to restrict the number of characters. The specific behavior depends on the conversion.

The required conversion is a character indicating how the argument should be formatted. The set of valid conversions for a given argument depends on the argument's data type.

Conversion Argument Category Description
'b', 'B' general If the argument arg is null, then the result is "false". If arg is a boolean or Boolean, then the result is the string returned by String.valueOf(arg). Otherwise, the result is "true".
'h', 'H' general If the argument arg is null, then the result is "null". Otherwise, the result is obtained by invoking Integer.toHexString(arg.hashCode()).
's', 'S' general If the argument arg is null, then the result is "null". If arg implements Formattable, then arg.formatTo is invoked. Otherwise, the result is obtained by invoking arg.toString().
'c', 'C' character The result is a Unicode character
'd' integral The result is formatted as a decimal integer
'o' integral The result is formatted as an octal integer
'x', 'X' integral The result is formatted as a hexadecimal integer
'e', 'E' floating point The result is formatted as a decimal number in computerized scientific notation
'f' floating point The result is formatted as a decimal number
'g', 'G' floating point The result is formatted using computerized scientific notation or decimal format, depending on the precision and the value after rounding.
'a', 'A' floating point The result is formatted as a hexadecimal floating-point number with a significand and an exponent
't', 'T' date/time Prefix for date and time conversion characters. See Date/Time Conversions.
'%' percent The result is a literal '%' ('\u0025')
'n' line separator The result is the platform-specific line separator

For example, below shows how to get a pagination without summary bar and select box.
<%
    PAGEBREAK_HEADER = "<div class='pagebreak_modern'>";
    PAGEBREAK_PREVPAGE = "<span class='prevpage'><a href='%1$s'>Previous</a></span>";
    PAGEBREAK_NEXTPAGE = "<span class='nextpage'><a href='%1$s'>Next</a></span>";
    PAGEBREAK_SKIP = "<span class='omit'>...</span>";
    PAGEBREAK_PAGE = "<span class='page'><a href='%1$s'>%2$s</a></span>";
    PAGEBREAK_CURRENTPAGE = "<span class='currentpage'><a href='%1$s'>%2$s</a></span>";
    PAGEBREAK_TOTAL = null;
    PAGEBREAK_SELECTBOX = null;
    PAGEBREAK_FOOTER = "</div>";
%>

Default field settings for modern style



Default field settings for onebyone style



Sample Coding

Get all attachments in current topic.
<res id="r1">
     <$r1.res_title$>
</res>

Get all attachments in current topic too.
<res id="r1" topic=<$top_code$>>
     <$r1.res_title$>
</res>

Get all attachments which importance is "very important", and order by publish date
<res id="r1" topic=<$top_code$> where="a.important=2" orderby="a.publishdate">
     <$r1.res_title$>
</res>

Get top 20 attachments in topic coded in "top1"
<res id="r1" topic="top1" rows=20>
     <$r1.res_title$>
</res>

Get all attachments in current topic,and display them by 20 rows per page
<res id="r1" page=20>
     <$r1.res_title$>
</res>