The DOC_INFO service provides a good example of how services, queries, and templates work together.
DOC_INFO Attributes
The following table describes the attributes of the DOC_INFO service:

DOC_INFO Actions
The DOC_INFO service executes the following ten actions.
Action 1 Definition and Description
Action 1 takes the following form:
■ Action 1 – 5:QdocInfo:DOC_INFO:2:!csItemNoLongerExists2
■ 5: Select cache query action that retrieves information from the database using a query.
■ QDocInfo: This action retrieves content item information using the QDocInfo query in the query.htm file.
■ DOC_INFO: The result of the query is assigned to a ResultSet called DOC_INFO and stored for later use.
■ 2: The Check result non-empty control mask specifies that the query must return a record, or the action fails.
■ !csItemNoLongerExists2: If this action fails on an English Content Server system, it returns the error message string: This content item no longer exists.
Action 2 Definition and Description
Action 2 takes the following form:
■ Action 2: 3:mapNamedResultSetValues:DOCINFO,dStatus,dStatus,dDocTitle,dDocTitle:0:null
■ 3: Java method action specifying a module that is a part of the Java class implementing the service.
■ mapNamedResultSetValues: This action retrieves the values of dStatus and dDocTitle from the first row of the DOC_INFO ResultSet and stores them in the local data. (This increases speed and ensures that the correct values are used.)
■ DOC_INFO,dStatus,dStatus,dDocTitle,dDocTitle: Parameters required for the mapNamedResultSetValues action.
■ 0: No control mask is specified.
■ null: No error message is specified.
Action 3 Definition and Description
Action 3 takes the following form:
■ Action 3: 3:checkSecurity:DOC_INFO:0:!csUnableToGetRevInfo2(dDocName)
■ 3: Java method action specifying a module that is a part of the Java class implementing the service.
■ checkSecurity: This action retrieves the data assigned to the DOC_INFO ResultSet and evaluates the assigned security level to verify that the user is authorized to perform this action.
■ DOC_INFO: ResultSet that contains the security information to be evaluated by the checkSecurity action.
■ 0: No control mask is specified.
■ !csUnableToGetRevInfo2(dDocName): If this action fails on an English Content Server system, it returns the error message string: Unable to retrieve information for ‘{dDocName}.’
Action 4 Definition and Description
Action 4 takes the following form:
■ Action 4: 3:getDocFormats:QdocFormats:0:null
■ 3: Java method action specifying a module that is a part of the Java class implementing the service.
■ getDocFormats: This action retrieves the file formats for the content item using the QdocFormats query in the query.htm file. A comma-delimited list of the file formats is stored in the local data as dDocFormats.
■ QdocFormats: Specifies the query used to retrieve the file formats.
■ 0: No control mask is specified.
■ null: No error message is specified.
Action 5 Definition and Description
Action 5 takes the following form:
■ Action 5: 3:getURLAbsolute::0:null
■ 3: Java method action specifying a module that is a part of the Java class implementing the service.
■ getURLAbsolute: This action resolves the URL of the content item and stores it in the local data as DocUrl.
■ blank: This action takes no parameters.
■ 0: No control mask is specified.
■ null: No error message is specified.
Action 6 Definition and Description
Action 6 takes the following form:
■ Action 6: 3:getUserMailAddress:dDocAuthor,AuthorAddress:0:null
■ 3: Java method action specifying a module that is a part of the Java class implementing the service.
■ getUserMailAddress: This action resolves the e-mail address of the content item author. ■ dDocAuthor,AuthorAddress: This action passes dDocAuthor and AuthorAddress as parameters.
■ 0: No control mask is specified
■ null: No error message is specified.
Action 7 Definition and Description
Action 7 takes the following form:
■ Action 7: 3:getUserMailAddress:dCheckoutUser,CheckoutUserAddress:0:null
■ 3: Java method action specifying a module that is a part of the Java class implementing the service.
■ getUserMailAddress: This action resolves the e-mail address of the user who has the content item checked out.
■ dCheckoutUser,CheckoutUserAddress: This action passes dCheckoutUser and CheckoutUserAddress as parameters.
■ 0: No control mask is specified.
■ null: No error message is specified.
Action 8 Definition and Description
Action 8 takes the following form:
■ Action 8: 3:getWorkflowInfo:WF_INFO:0:null
■ 3: Java method action specifying a module that is a part of the Java class implementing the service.
■ getWorkflowInfo: This action evaluates whether the content item is part of a workflow. If the WF_INFO ResultSet exists, workflow information is merged into the DOC_INFO template.
■ WF_INFO: This action passes WF_INFO as a parameter.
■ 0: No control mask is specified.
■ null: No error message is specified.
Action 9 Definition and Description
Action 9 takes the following form:
Action 9: 3:getDocSubscriptionInfo:QisSubscribed:0:null
■ 3: Java method action specifying a module that is a part of the Java class implementing the service.
■ getDocSubscriptionInfo: This action evaluates if the current user has subscribed to the content item: – If the user is subscribed, an Unsubscribe button is displayed. – If the user is not subscribed, a Subscribe button is displayed.
■ QisSubscribed: Specifies the query used to retrieve the subscription information.
■ 0: No control mask is specified.
■ null: No error message is specified.
Action 10 Definition and Description
Action 10 takes the following form:
■ Action 10:5:QrevHistory:REVISION_HISTORY:0:!csUnableToGetRevHistory(dDocName)
■ 5: Select cache query action that retrieves information from the database using a query.
■ QrevHistory: This action retrieves revision history information using the QrevHistory query in the query.htm file.
■ REVISION_HISTORY: The result the query is assigned to a ResultSet called REVISION_HISTORY. The DOC_INFO template loops on this ResultSet to present information about each revision.
■ 0: No control mask is specified.
■ !csUnableToGetRevHistory(dDocName): If this action fails on an English Content Server system, it returns the error message string:
Ubpnable to retrieve revision history for »{dDocName}. »
DOC_INFO Template
The template page for the DOC_INFO service is the DOC_INFO template.
It is important to know what is happening between the files so that you can understand the interactions between the template page and the actions performed in a service.
The definition for the content that the doc_info.htm template contains is located in the IdcHomeDir/components/Folders/resources/std_page.htm file.
Code from both files appear in the following markup section: Markup from the IdcHomeDir/resources/core/templates/doc_info.htm file
Markup from the IntradocDir/config/resources/std_services.htm file that defines what will appear in the doc_info.htm template
Laisser un commentaire