Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## jet.server.api
Interface ParameterRecorder

    public interface ParameterRecorder

Interface `ParameterRecorder` manages the saved parameter value list.

Log keyword is "ParamListManager".

Term:

- ParamList: it used to describe a parameter value list, is a collection of parameter values which is saved in history-parameter.xml. It contains 2 levels, they are ReportParamList and SheetParamList.
- ReportParamList: it used to describe a report parameter value list, is a collection of report parameter values which is saved into <ReportParamList> in history-parameter.xml.
- SheetParamList: it used to describe a sheet parameter value list, is a collection of report sheet parameter values or LC parameter values which is saved into <SheetParamList> in history-parameter.xml.
- ParamValue: it used to describe parameter value saved into <Param> in history-parameter.xml.

Example:
XML content before V11.1Update1(deprecated since V11.1Update1):
<history-parameter report="/SampleReports/Cascade Parameters.cls">
<ParameterList1 creattime="1353378091178" isAutosaveParam="false" rptversion="1" sheets="report1">
<para isexpression="false" ismultiplevalue="false" ismultival_all="false" name="p_EndDate" value="2010-12-31"/>
<para isexpression="false" ismultiplevalue="false" ismultival_all="false" name="P_TerritoryFilter" value="Southeast, USA"/>
<para isexpression="false" ismultiplevalue="false" ismultival_all="false" name="P_ShipperNameFilter" value="Merrill Traffic Corp."/>
<para isexpression="false" ismultiplevalue="false" ismultival_all="false" name="P_StartDate" value="2009-1-1"/>
</ParameterList1>
</history-parameter>

XML content since V11.1Update1:
<history-parameter report="/SampleReports/Cascade Parameters.cls" dontShowParamPage="true">
<ReportParamList creattime="1353378091178" type="1" locale="en_US" name="ParameterList1">
<SheetParamList name="report1">
<Param type="Date" pattern="yyyy-MM-dd" name="P_StartDate" value="2009-1-1" displayValue="2009-1-1"/>
<Param type="Date" pattern="yyyy-MM-dd" name="p_EndDate" value="{expr=\"Today()\"}" displayValue="Today()"/>
<Param type="String" name="P_TerritoryFilter" >
<Value isAll="true"><ALL></Value>
</Param>
<Param type="String" name="P_ShipperNameFilter">
<Value value="Merrill Traffic Corp.">Merrill Traffic Corp.</Value>
<Value value="Merrill Traffic Corp.2">Merrill Traffic Corp2.</Value>
<Value value="Merrill Traffic Corp.3">Merrill Traffic Corp3.</Value>
</Param>
</SheetParamList>
</ReportParamList>
</history-parameter>
or(Not report sheet)
<history-parameter report="/SampleReports/Cascade Parameters.cls" dontShowParamPage="true">
<ReportParamList creattime="1353378091178" type="1" locale="en_US" name="ParameterList1">
<Param type="Date" pattern="yyyy-MM-dd" name="P_StartDate" value="2009-1-1" displayValue="2009-1-1"/>
<Param type="Date" pattern="yyyy-MM-dd" name="p_EndDate" value="{expr=\"Today()\"}" displayValue="Today()"/>
<Param type="String" name="P_TerritoryFilter" >
<Value isAll="true"><ALL></Value>
</Param>
<Param type="String" name="P_ShipperNameFilter">
<Value value="Merrill Traffic Corp.">Merrill Traffic Corp.</Value>
<Value value="Merrill Traffic Corp.2">Merrill Traffic Corp2.</Value>
<Value value="Merrill Traffic Corp.3">Merrill Traffic Corp3.</Value>
</Param>
</ReportParamList>
</history-parameter>

<history-parameter> node description:

- "report" attribute used to describe resource path of current report.
- "dontShowParamPage" attribute used to describe whether show parameter page when next running report.

<ParameterListXXX> and <ReportParamList> node description:

- <ParameterListXXX> will be deprecated since V11.1 Update1, take the place of <ReportParamList>;
- "rptversion" attribute will be deprecated since V11.1 Update1, because saved parameter value is NOT version level;
- "isAutosaveParam" will be deprecated since V11.1Update1, take the place of "type" attribute. It's old value is true means "type" is TYPE_AUTO, old value is false means "type" is TYPE_MANUAL;
- "sheets" attribute will be deprecated since V11.1 Update1;
- "type" attribute used to describe saved type, options are TYPE_MANUAL/TYPE_AUTO/TYPE_DEFAULT constant in `ReportParamList` class.
- "locale" attribute used to describe country and language information when running report.
- "name" attribute used to describe saved parameter value list name. Only existed in <ReportParamList>;

<SheetParamList> node description:

- "name" attribute used to describe report sheet name or LC name in Dashboard;

<para> and <Param> node description:

- <para> will be deprecated since V11.1Update1, take the place of <Param>;
- "isexpression/ismultiplevalue/ismultivalue_all" will be deprecated since V11.1Update1 attributes;
- "name" attribute used to describe parameter name which do NOT contains "jrs.param$" prefix;
- "type" attribute used to describe parameter type;
- "pattern" attribute used to describe parameter pattern;
- "value" attribute used to describe parameter single value:
  - XML attribute value is JSON expression if parameter type is Date/Time/DateTime and value is expression;
  - XML attribute value is string for other;
  - XML attribute value is separated by "[]" if parameter is multiple before V11.1Update1, it is deprecated since V11.1Update1, it take the place of <Value> node nested in <Param>.
- "value" attribute priority is higher than "<Value>" node.
- "displayValue" attribute used to describe parameter display value.
- <Value> node nested in <Param> used to describe parameter multiple value
  - "value" attribute used to describe parameter value
  - "isAll" attribute used to describe parameter ALL value
  - content text used to describe display value.
  - "value" attribute is JSON expression string if parameter type is Date/Time/DateTime and value is expression;
  - "value" attribute is string for other;

Since:
  9.0

Method Summary
`void` | `appendUsedParameter(java.lang.String userName, org.w3c.dom.Document document)` Deprecated. since V11.1Update1
`void` | `decreaseUserParameterRecordSize(java.lang.String userName, int maxNum)` Decreases the size of auto-complete list, removes the early item.
`boolean` | `deleteReportParamList(java.lang.String userName, java.lang.String reportPath, java.lang.String reportParamListName, byte reportParamListType)` Delete parameter value list and remove it from history-parameter.xml file by specified name.
`void` | `deleteRptParameterRecords(java.lang.String report)` Deletes all used parameter records for all users.
`void` | `deleteUserParameterRecord(java.lang.String userName)` Deletes all used parameter records for the specified user.
`boolean` | `existReportParamList(java.lang.String userName, java.lang.String reportPath, java.lang.String reportParamListName, byte reportParamListType)` Check whether the saved parameter value list existed?
`ReportParamList` | `getDefaultReportParamList(java.lang.String userName, java.lang.String reportPath)` Get user defined default saved parameter value list.
`ReportParamList` | `getReportParamList(java.lang.String userName, java.lang.String reportPath, java.lang.String reportParamListName, byte reportParamListType)` Get saved parameter value list.
`java.util.List<ReportParamList>` | `getReportParamLists(java.lang.String userName, java.lang.String reportPath, byte reportParamListType)` Get saved parameter value list collection.
`org.w3c.dom.Document` | `getUserParameterRecords(java.lang.String userName)` Deprecated. since V11.1Update1
`boolean` | `isDontShowParamPage(java.lang.String userName, java.lang.String reportPath)` Check whether show parameter page when running report.
`void` | `modifyUsedParameter(java.lang.String userName, org.w3c.dom.Document document)` Deprecated. since V11.1Update1
`void` | `removeUsedParameter(java.lang.String userName, org.w3c.dom.Document document)` Deprecated. since V11.1Update1
`boolean` | `saveReportParamList(java.lang.String userName, ReportParamList reportParamList)` Save parameter value list and persist to history-parameter.xml file.
`void` | `setDontShowParamPage(java.lang.String userName, java.lang.String reportPath, boolean dontShow)` Set whether show parameter page when next running report.

Method Detail

### getUserParameterRecords

    org.w3c.dom.Document getUserParameterRecords(java.lang.String userName)

  Deprecated. since V11.1Update1

  Gets the used parameter information for the specified user.

  Parameters:
    `userName` - the user name, same as user ID.
  Returns:
    the used parameter value document.

### decreaseUserParameterRecordSize

    void decreaseUserParameterRecordSize(java.lang.String userName,
                                         int maxNum)

  Decreases the size of auto-complete list, removes the early item. You can set the maximum number of auto-complete list on Profile page, If you change the setting number to be less than the old setting, JReport Server will remove the early item.

  Parameters:
    `userName` - the user name, same as user ID.
    `maxNum` - the maximum number of auto-complete list on Profile page.

### appendUsedParameter

    void appendUsedParameter(java.lang.String userName,
                             org.w3c.dom.Document document)

  Deprecated. since V11.1Update1

  Appends the used parameter information for the specified user to his/her historical parameter records.

  Parameters:
    `userName` - the user name, same as user ID.
    `document` - a set of used parameter values.

### modifyUsedParameter

    void modifyUsedParameter(java.lang.String userName,
                             org.w3c.dom.Document document)

  Deprecated. since V11.1Update1

  Changes the used parameter information for the specified user in his/her historical parameter records.

  Parameters:
    `userName` - the user name, same as user ID.
    `document` - a set of used parameter values.

### removeUsedParameter

    void removeUsedParameter(java.lang.String userName,
                             org.w3c.dom.Document document)

  Deprecated. since V11.1Update1

  Removes the used parameter information for the specified user from his/her historical parameter records.

  Parameters:
    `userName` - the user name, same as user ID.
    `document` - a set of used parameter values.

### deleteRptParameterRecords

    void deleteRptParameterRecords(java.lang.String report)

  Deletes all used parameter records for all users. When a report is removed from JReport Server, all historical used parameter records which is related with this report will be deleted.

  Parameters:
    `report` - , the full path report name on the resource tree, for example, /SampleReports/Report1.cls.

### deleteUserParameterRecord

    void deleteUserParameterRecord(java.lang.String userName)

  Deletes all used parameter records for the specified user. When a userID is removed from JReport Server, his/her historical used parameter recodes will be deleted.

  Parameters:
    `userName` - the user name, same as user ID.

### saveReportParamList

    boolean saveReportParamList(java.lang.String userName,
                                ReportParamList reportParamList)

  Save parameter value list and persist to history-parameter.xml file.
  - This method can be used to save manually saved parameter value list.
  - This method can be used to save automatically saved parameter value list.
  - This method can be used to save user defined default saved parameter value list.
  - The older saved parameter value list will be removed if the current user saved parameter value list size is gather the max of settings.
  - It will be modified if the parameter value list name is existed.
  - It will be added if the parameter value list name is NOT existed.
  - "name" attribute of <ReportParamList> should keep empty or remove it in this method implements if ReportParamList object is user defined default.
  - "name" attribute of <ReportParamList> should be automatically generated in this method implements if ReportParamList save type is TYPE_AUTO.
  ReportParamList object properties are corresponding with XML nodes or attributes, the detail relationship of corresponding reference `ReportParamList` class.

  Parameters:
    `userName` - this user name is name of user current running report
    `reportParamList` - the object is a report level parameter value list, null will be ignore.
  Returns:
    If parameter value list existed or save failed, false will be return. else return true.
  Since:
    V11.1Update1

### existReportParamList

    boolean existReportParamList(java.lang.String userName,
                                 java.lang.String reportPath,
                                 java.lang.String reportParamListName,
                                 byte reportParamListType)

  Check whether the saved parameter value list existed?

  Parameters:
    `userName` - the current name of user running report.
    `reportPath` - the current report resource path. for example: "/SampleReports/ShipmentStatus.wls"
    `reportParamListName` - specified saved parameter value list name
    `reportParamListType` - specified saved parameter value list type, reference `ReportParamList.TYPE_XXXX`
  Returns:
    if specified name existed return true, else return false.
  Since:
    V11.1Update1

### deleteReportParamList

    boolean deleteReportParamList(java.lang.String userName,
                                  java.lang.String reportPath,
                                  java.lang.String reportParamListName,
                                  byte reportParamListType)

  Delete parameter value list and remove it from history-parameter.xml file by specified name.

  Parameters:
    `userName` - this user name is name of user current running report
    `reportPath` - the current report resource path. for example: "/SampleReports/ShipmentStatus.wls"
    `reportParamListName` - specified saved parameter value list name
    `reportParamListType` - specified saved parameter value list type, reference `ReportParamList.TYPE_XXXX`
  Returns:
    If parameter value list not existed or delete failed, false will be return. else return true.
  Since:
    V11.1Update1

### getReportParamList

    ReportParamList getReportParamList(java.lang.String userName,
                                       java.lang.String reportPath,
                                       java.lang.String reportParamListName,
                                       byte reportParamListType)

  Get saved parameter value list.

  ReportParamList object properties are corresponding with XML nodes or attributes, the detail relationship of corresponding reference `ReportParamList` class.

  Parameters:
    `userName` - this user name is name of user current running report
    `reportPath` - the current report resource path. for example: "/SampleReports/ShipmentStatus.wls"
    `reportParamListName` - specified saved parameter value list name, this name can be auto saved name or manual saved name.
    `reportParamListType` - specified saved parameter value list type, reference `ReportParamList.TYPE_XXXX`
  Returns:
    ReportParamList object if saved parameter value list existed, else return null.
  Since:
    V11.1Update1

### getDefaultReportParamList

    ReportParamList getDefaultReportParamList(java.lang.String userName,
                                              java.lang.String reportPath)

  Get user defined default saved parameter value list.

  ReportParamList object properties are corresponding with XML nodes or attributes, the detail relationship of corresponding reference `ReportParamList` class.

  Parameters:
    `userName` - this user name is name of user current running report
    `reportPath` - the current report resource path. for example: "/SampleReports/ShipmentStatus.wls"
  Returns:
    ReportParamList object if user defined default saved parameter value list existed, else return null.
  Since:
    V11.1Update1

### getReportParamLists

    java.util.List<ReportParamList> getReportParamLists(java.lang.String userName,
                                                        java.lang.String reportPath,
                                                        byte reportParamListType)

  Get saved parameter value list collection.

  If saved parameter type is automatically in profile settings, and will remove all manually saved parameter value list.

  If saved parameter type is manually in profile settings, and will remove all automatically saved parameter value list.

  Parameters:
    `userName` - this user name is name of user current running report
    `reportPath` - the current report resource path. for example: "/SampleReports/ShipmentStatus.wls"
    `reportParamListType` - specified saved parameter value list type, reference `ReportParamList.TYPE_XXXX`
  Returns:
    the list of ReportParamList, order is create time descend.
  Since:
    V11.1Update1

### isDontShowParamPage

    boolean isDontShowParamPage(java.lang.String userName,
                                java.lang.String reportPath)

  Check whether show parameter page when running report.

  It is corresponding with "dontShowParamPage" attribute of <history-parameter> node.

  Parameters:
    `userName` - this user name is name of user current running report
    `reportPath` - the current report resource path. for example: "/SampleReports/ShipmentStatus.wls"
  Returns:
    if do not show parameter page, true will be return, wlse return false.
  Since:
    V11.1Update1

### setDontShowParamPage

    void setDontShowParamPage(java.lang.String userName,
                              java.lang.String reportPath,
                              boolean dontShow)

  Set whether show parameter page when next running report.

  It is corresponding with "dontShowParamPage" attribute of <history-parameter> node.

  Parameters:
    `userName` - this user name is name of user current running report
    `reportPath` - the current report resource path. for example: "/SampleReports/ShipmentStatus.wls"
    `dontShow` - this value will be save to "dontShowParamPage" attribute of <history-parameter> node.
  Since:
    V11.1Update1

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD