RCServiceDefinition Class Methods
In this section, the RCServiceDefinition class methods are presented in alphabetical order.
Syntax
AppendRCParam(name)
Description
Use the AppendRCParam method to add a service URL parameter by name to the related content service definition.
Parameters
Field or Control |
Definition |
---|---|
name |
Specifies the name of the service URL parameter as a string value. |
Returns
A PTCS_SRVDEFN:RCParameter object.
Example
import PTCS_SRVDEFN:*;
Component PTCS_SRVDEFN:RCServiceDefinition &rcServDefn;
&rcServDefn = create PTCS_SRVDEFN:RCServiceDefinition("SERVICE_DEFN", "ENG");
Local string &rcParam1 = "APPTEST_PARAM1";
Local PTCS_SRVDEFN:RCParameter &rcParam1Ret = &rcServDefn.AppendRCParam(&rcParam1);
Local boolean &Ret = &rcServDefn.Save();
Syntax
CloneForNew(&RCSrvcDefn)
Description
Use the CloneForNew method to create an identical copy of the related content service definition executing this method.
Parameters
Field or Control |
Definition |
---|---|
&RCSrvcDefn |
Specifies an already instantiated PTCS_SRVDEFN:RCServiceDefinition object that is to be copied to. |
Returns
A boolean value: True if the copy is successful, False otherwise.
Example
import PTCS_SRVDEFN:*;
Component PTCS_SRVDEFN:RCServiceDefinition &rcServDefn;
Component PTCS_SRVDEFN:RCServiceDefinition &rcCloneServDefn;
&rcServDefn = create PTCS_SRVDEFN:RCServiceDefinition("SERVICE_DEFN", "ENG");
&rcCloneServDefn = create PTCS_SRVDEFN:RCServiceDefinition("NEW_SERVICE_DEFN", "ENG");
Local boolean &bRet = False;
If ( True = &rcServDefn.CloneForNew(&rcCloneServDefn)) Then
&bRet = &rcCloneServDefn.Save();
End-If;
Syntax
Delete()
Description
Use the Delete method to delete this related content service definition.
Parameters
None.
Returns
A boolean value: True if the delete is successful, False otherwise.
Example
import PTCS_SRVDEFN:*;
Component PTCS_SRVDEFN:RCServiceDefinition &rcServDefn;
&rcServDefn = create PTCS_SRVDEFN:RCServiceDefinition("SERVICE_DEFN", "ENG");
Local boolean &bRet = False;
If (&rcServDefn <> Null) Then
&bRet = &rcServDefn.Delete();
End-If;
Syntax
DeleteRCParam(nItem)
Description
Use the DeleteRCParam method to delete the nth service URL parameter from the related content service definition.
Parameters
Field or Control |
Definition |
---|---|
nItem |
Specifies which service URL parameter as a number value. |
Returns
A boolean value: True if the delete is successful, False otherwise.
Example
import PTCS_SRVDEFN:*;
Component PTCS_SRVDEFN:RCServiceDefinition &rcServDefn;
&rcServDefn = create PTCS_SRVDEFN:RCServiceDefinition("SERVICE_DEFN", "ENG");
Local boolean &delRcParamRet = False;
Local number &rcParamCount = &rcServDefn.GetRCParamCount();
&delRcParamRet = &rcServDefn.DeleteRCParam(&rcParamCount - 1);
If ( True = &delRcParamRet) Then
/* do some processing */
Local boolean &Ret = &rcServDefn.Save();
End-If;
Syntax
GetRCParamCount()
Description
Use the GetRCParamCount method to return the number of service URL parameters defined for this related content service definition.
Parameters
None.
Returns
A number value.
Example
import PTCS_SRVDEFN:*;
Component PTCS_SRVDEFN:RCServiceDefinition &rcServDefn;
&rcServDefn = create PTCS_SRVDEFN:RCServiceDefinition("SERVICE_DEFN", "ENG");
Local number &rcParamCount = &rcServDefn.GetRCParamCount();
If (&rcParamCount > 0) Then
/* do some processing */
End-If;
Syntax
GetRCParameter(nItem)
Description
Use the GetRCParameter method to return a PTCS_SRVDEFN:RCParameter object representing the nth parameter of this related content service definition.
Parameters
Field or Control |
Definition |
---|---|
nItem |
Specifies which service URL parameter as a number value. |
Returns
A PTCS_SRVDEFN:RCParameter object.
Example
import PTCS_SRVDEFN:*;
Component PTCS_SRVDEFN:RCServiceDefinition &rcServDefn;
&rcServDefn = create PTCS_SRVDEFN:RCServiceDefinition("SERVICE_DEFN", "ENG");
Local number &rcParamCount = &rcServDefn.GetRCParamCount();
Local PTCS_SRVDEFN:RCParameter &rcSrvcParam = &rcServDefn.GetRCParameter(&rcParamCount);
If ( Null <> &rcSrvcParam) Then
/* do some processing */
End-If;
Syntax
RCServiceDefinition(service_ID, lang_CD)
Description
Use the RCServiceDefinition constructor method to instantiate a PTCS_SRVDEFN:RCServiceDefinition object. Use the IsNew property to determine whether the object was instantiated from an existing service definition (that is, the service_ID parameter corresponds to an existing definition) or as a new service definition.
Parameters
Field or Control |
Definition |
---|---|
service_ID |
Specifies the unique identifier for the service definition as a string value. |
lang_CD |
Specifies the language code for this definition as a three-character string. |
Returns
A PTCS_SRVDEFN:RCServiceDefinition object.
Example
import PTCS_SRVDEFN:*;
Component PTCS_SRVDEFN:RCServiceDefinition &rcServDefn;
&rcServDefn = create PTCS_SRVDEFN:RCServiceDefinition("SERVICE_DEFN", "ENG");
Syntax
Rename(new_srvc_ID)
Description
Use the Rename method to rename the related content service definition.
Parameters
Field or Control |
Definition |
---|---|
new_srvc_ID |
Specifies the new service ID as a string value. |
Returns
A boolean value: True if the rename is successful, False otherwise.
Example
import PTCS_SRVDEFN:*;
Component PTCS_SRVDEFN:RCServiceDefinition &rcServDefn;
&rcServDefn = create PTCS_SRVDEFN:RCServiceDefinition("SERVICE_DEFN", "ENG");
Local boolean &bRet = False;
If ( True = &rcServDefn.Rename("NEW_SERVICE_DEFN")) Then
&bRet = &rcServDefn.Save();
End-If;
Syntax
Save()
Description
Use the Save method to save the related content service definition to the database. Invoke the Save method after instantiating a new service definition, after updating service definition properties, or after invoking any of these methods: AppendRCParam, CloneForNew, DeleteRCParam, or Rename.
Parameters
None.
Returns
A boolean value: True if the save is successful, False otherwise.
Example
import PTCS_SRVDEFN:*;
Component PTCS_SRVDEFN:RCServiceDefinition &rcServDefn;
Component PTCS_SRVDEFN:RCServiceDefinition &rcCloneServDefn;
&rcServDefn = create PTCS_SRVDEFN:RCServiceDefinition("SERVICE_DEFN", "ENG");
&rcCloneServDefn = create PTCS_SRVDEFN:RCServiceDefinition("NEW_SERVICE_DEFN", "ENG");
Local boolean &bRet = False;
If ( True = &rcServDefn.CloneForNew(&rcCloneServDefn)) Then
&bRet = &rcCloneServDefn.Save();
End-If;