The SelectEntryTemplate command displays the FileNet Workplace Select Entry Template Java™Server Pages (JSP) page, which enables a user to select an entry template from a filtered list of choices. The client application must use the ISelectEntryTemplateCmd interface to specify the filtered list of template choices.
After the SelectEntryTemplate command has been executed by calling IAppIntCmd::Invoke, a pointer to the selected entry template is returned in the SelectEntryTemplate response component. Client applications may interact with the response component via the standard IAppIntRsp and custom ISelectEntryTemplateRsp interfaces. For more information about working with command and response components and their COM interfaces, see Command and Response components.
DLL | FnAppIntSelectEntryTemplateCmd.dll |
See Also | Add command |
The SelectEntryTemplate command uses the following interfaces:
Interface | Description |
---|---|
ISelectEntryTemplateCmd |
This is a custom interface used to initialize the data contained in the SelectEntryTemplate command component. The client application can use the methods in this interface to customize the JSP page, including filtering the list of available entry templates by object store name and template type, as well as specifying the page title. |
ISelectEntryTemplateRsp |
This is a custom interface for the SelectEntryTemplate response component that is returned when the SelectEntryTemplate command is executed. This interface enables the client application to obtain information about the entry template that was selected by the user. |
IAppIntCmd |
This is a standard interface which is automatically used by the SelectEntryTemplate command to invoke the SelectEntryTemplate command component. The client application executes the SelectEntryTemplate command by calling this interface and passing the AppIntSession component on which the SelectEntryTemplate command component is invoked. Each time the command is executed, an SelectEntryTemplate response component is returned. |
IAppIntRsp |
This is a standard interface that is automatically used by the SelectEntryTemplate command to determine the success or failure of the command, as well as retrieve any error code or messages. |
The following is a fragment from the complete example for the AddViaTemplate command.
In the application's StdAfx.h header file:
#import"C:\Program Files\FileNet\AppInt\FnAppIntCmd.tlb" named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntHttpRequest.dll" named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntBrowserDlg.dll" named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntHttpConnection.dll" named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntResources.dll" named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntClientRecordBase.tlb" named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntClientStore.dll" named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntSession.dll" named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntSessionLogin.dll" named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntCmdComponents.dll" named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntSelectEntryTemplateCmd.dll" named_guids no_namespace
In the application's primary .cpp source file:
// Instantiate the StdSessionLogin component
IStdSessionLoginPtr spIStdSessionLogin;
HRESULT hResult = spIStdSessionLogin.CreateInstance(__uuidof(StdSessionLogin));
if (FAILED(hResult)) { std::cout << "Could not create the StdSessionLogin component." << std::endl; _ASSERTE(0); } try {
// Initialize the StdSessionLogin component to create // a separate, non-unified login for the client application // by specifying the session / client application name. std::cout << "Initializing the StdSessionLogin component to use NON-unified login..." << std::endl; _bstr_t sessionName(_T("WordPerfect")); spIStdSessionLogin->InitializeViaSessionName(sessionName);
// Instantiate the AppIntSession component
IAppIntSessionPtr spIAppIntSession;
hResult = spIAppIntSession.CreateInstance(__uuidof(AppIntSession)); if (FAILED(hResult)) { std::cout << "Could not create the AppIntSession component." << std::endl; _ASSERTE(0); } // Initialize the AppIntSession component with the StdSessionLogin component
std::cout << "Initializing the AppIntSession component..." << std::endl;
spIAppIntSession->Initialize(spIStdSessionLogin); // * The Client Application may invoke a SessionLogin here; otherwise, // * it will automatically be invoked as needed when commands are executed. std::cout << "Checking Login Status..." << std::endl; VARIANT_BOOL bIsLoggedIn = spIAppIntSession->IsLoggedIn(); if (bIsLoggedIn == VARIANT_TRUE) { std::cout << "User is currently Logged In." << std::endl; } else {
std::cout << "User is NOT currently Logged In." << std::endl;
std::cout << "Attempting Login..." << std::endl;
hResult = spIAppIntSession->Login(); if (FAILED(hResult)) { std::cout << "Login failed." << std::endl; _ASSERTE(0); }
std::cout << "Login succeeded." << std::endl; } // Instantiate the custom SelectEntryTemplate command component ISelectEntryTemplateCmdPtr spISelectEntryTemplateCmd;
hResult = spISelectEntryTemplateCmd.CreateInstance(__uuidof(SelectEntryTemplateCmd));
if (FAILED(hResult)) {
std::cout << "Could not create the SelectEntryTemplate command component.\n"; _ASSERTE(0);
} // Initialize the custom SelectEntryTemplate command component with the // page title, object store name, and template type(s). _bstr_t bstrPageTitle = (_T("Customized Select Entry Template Operation")); _bstr_t bstrObjectStoreName = (_T("Alaska")); TemplateType enTemplateTypes = eTemplateTypeDocument; std::cout << "Initializing the SelectEntryTemplate command component..." << std::endl; spISelectEntryTemplateCmd->Initialize(bstrPageTitle, bstrObjectStoreName, enTemplateTypes); // Execute the SelectEntryTemplate command and capture the response component std::cout << "Executing the SelectEntryTemplate command..." << std::endl; IAppIntCmdPtr spIAppIntCmd(spISelectEntryTemplateCmd);
IAppIntRspPtr spIAppIntRsp = spIAppIntCmd->Invoke(spIAppIntSession);// Determine if the command failed, before accessing response component data hResult = spIAppIntRsp->GetHResult(); if (FAILED(hResult)) { std::cout << "The SelectEntryTemplate command failed to execute." << std::endl; // Examine the error information provided in the standard response component _bstr_t bstrErrorName = spIAppIntRsp->GetErrorName(); std::cout << "ErrorName=" << ( bstrErrorName.length() ? (LPCSTR) bstrErrorName : _T( "" ) ) << std::endl; _bstr_t bstrErrorMsg = spIAppIntRsp->GetErrorMsg(); std::cout << "ErrorMsg=" << ( bstrErrorMsg.length() ? (LPCSTR) bstrErrorMsg : _T( "" ) ) << std::endl; _bstr_t bstrErrorDetails = spIAppIntRsp->GetErrorDetails(); std::cout << "ErrorDetails=" << ( bstrErrorDetails.length() ? (LPCSTR) bstrErrorDetails : _T( "" ) ) << std::endl; _ASSERTE(0); } else { std::cout << "The SelectEntryTemplate command succeeded." << std::endl; // Obtain the response name and description from the standard response component _bstr_t bstrResponseDescription = spIAppIntRsp->GetDescription(); std::cout << "ResponseDescription=" << ( bstrResponseDescription.length() ? (LPCSTR) bstrResponseDescription : _T( "" ) ) << std::endl; _bstr_t bstrResponseName = spIAppIntRsp->GetName(); std::cout << "ResponseName=" << ( bstrResponseName.length() ? (LPCSTR) bstrResponseName : _T( "" ) ) << std::endl; // Obtain the entry template contained in the custom SelectEntryTemplateRsp component ISelectEntryTemplateRspPtr spISelectEntryTemplateRsp(spIAppIntRsp);
_ASSERTE(spISelectEntryTemplateRsp != 0);
IObjectStoreItemPtr spIObjectStoreItemEntryTemplate = spISelectEntryTemplateRsp->GetObjectStoreItem();
_ASSERTE(spIObjectStoreItemEntryTemplate != 0); std::cout << "Details for the entry template selected by the user:<< std::endl;
std::cout << "ObjectStoreName=" << (LPCSTR) spIObjectStoreItemEntryTemplate->GetObjectStoreName() << std::endl;
std::cout << "ItemType=" << (LPCSTR) CItemTypeConverter::EnumToBSTR(spIObjectStoreItemEntryTemplate->GetItemType()) << std::endl;
std::cout << "VersionSeriesID=" << (LPCSTR) spIObjectStoreItemEntryTemplate->GetVersionSeriesID() << std::endl;
std::cout << "VersionID=" << (LPCSTR) spIObjectStoreItemEntryTemplate->GetVersionID() << std::endl;}
...