HPE Records Manager and HPE TRIM Forum
Showing results for 
Search instead for 
Do you mean 

Trim Webservice Search Clauses

SOLVED
Go to Solution
Highlighted
Occasional Contributor

Trim Webservice Search Clauses


Hi, I am working for Oregon state, USA. We are using TRIM for maintaining million records of Archives holdings. We are using TRIM Web service for searching extracting the documents from Repository, I need some help on how to define Search clauses for searching on User Defined Fields of the Records.

Any suggestions on some reading stuff about TRIM web service would be appreciated.

1 ACCEPTED SOLUTIONS
Frequent Advisor

Re: Trim Webservice Search Clauses

Morning Ashok,

I'd suggest first having a look at the Connectivity Toolkit manual. This time last week I would have referred you to the TRIM Context Wiki hosted by Tower but this has since been removed and is no longer accessible. Hopefully it will appear under HP shortly. The doco on the site was quite sparce and at times incomplete so it may of not have been of any benefit.

I've actually done some work with the webservice and the key to setting User Defined Fields (UDF) is prepending 'udf:' (no quotes) to the front of the UDF's name when setting the Name property of an InputProperty object. Following is example c# code for creating a record via the webservice:

TrimCT.EngineWse engine = new EngineWse();
engine.PreAuthenticate = true;
engine.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;

Create create = new Create();
create.TrimObjectType = "Record";

InputProperty titlefreetextpart = new InputProperty();
titlefreetextpart.Name = "recTypedTitle";
titlefreetextpart.Val = "test document";

InputProperty recordClass = new InputProperty();
recordClass.Name = "recClassification";
recordClass.Val = "1429"; //uri of classification

InputProperty recordType = new InputProperty();
recordType.Name = "recRecordType";
recordType.Val = "71"; //uri of record type

InputProperty containerNo = new InputProperty();
containerNo.Name = "recContainer";
containerNo.Val = "434422";// Uri of container

InputProperty udf = new InputProperty();
udf.Name = "udf:User Defined Field";
udf.Val = "test test";

create.Items = new InputProperty[] { titlefreetextpart, recordClass, recordType, containerNo, udf };

TrimRequest request = new TrimRequest();
request.Items = new Operation[] { create };

TrimResponse response = new TrimResponse();
response = engine.Execute(request);

Once you have the response you need to check to see if the response object contains an ErrorResult or not. If it doesn't all is well otherwise there was an issue - see the details of the ErrorObject.

TIP: If you want to return the new record after creation you can also pass a Fetch operation with the Create operation.
5 REPLIES
Frequent Advisor

Re: Trim Webservice Search Clauses

Morning Ashok,

I'd suggest first having a look at the Connectivity Toolkit manual. This time last week I would have referred you to the TRIM Context Wiki hosted by Tower but this has since been removed and is no longer accessible. Hopefully it will appear under HP shortly. The doco on the site was quite sparce and at times incomplete so it may of not have been of any benefit.

I've actually done some work with the webservice and the key to setting User Defined Fields (UDF) is prepending 'udf:' (no quotes) to the front of the UDF's name when setting the Name property of an InputProperty object. Following is example c# code for creating a record via the webservice:

TrimCT.EngineWse engine = new EngineWse();
engine.PreAuthenticate = true;
engine.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;

Create create = new Create();
create.TrimObjectType = "Record";

InputProperty titlefreetextpart = new InputProperty();
titlefreetextpart.Name = "recTypedTitle";
titlefreetextpart.Val = "test document";

InputProperty recordClass = new InputProperty();
recordClass.Name = "recClassification";
recordClass.Val = "1429"; //uri of classification

InputProperty recordType = new InputProperty();
recordType.Name = "recRecordType";
recordType.Val = "71"; //uri of record type

InputProperty containerNo = new InputProperty();
containerNo.Name = "recContainer";
containerNo.Val = "434422";// Uri of container

InputProperty udf = new InputProperty();
udf.Name = "udf:User Defined Field";
udf.Val = "test test";

create.Items = new InputProperty[] { titlefreetextpart, recordClass, recordType, containerNo, udf };

TrimRequest request = new TrimRequest();
request.Items = new Operation[] { create };

TrimResponse response = new TrimResponse();
response = engine.Execute(request);

Once you have the response you need to check to see if the response object contains an ErrorResult or not. If it doesn't all is well otherwise there was an issue - see the details of the ErrorObject.

TIP: If you want to return the new record after creation you can also pass a Fetch operation with the Create operation.
Occasional Contributor

Re: Trim Webservice Search Clauses


Hi Godders, I appreciate your detailed reply.Info you have provided will be very helpful for me. I was beginning to worry ,if any one has ever used the web Service version of TRIM for an Enterprise application. I am a bit relaxed after seeing your reply.

Thanks again for your reply.

Ashok


Frequent Advisor Frequent Advisor

Re: Trim Webservice Search Clauses

Hi Ashok

We have started to use the web services for creating integration with other systems. So far its working quite well.

While we have loads of UDFs, we only use the title as a search method.

The SDK help file has lots of C# examples which I have found quite helpful.

Terry
Occasional Visitor

Re: Trim Webservice Search Clauses

Hi,

 

I can successfully search on the non user defined fields using the code listed below but I am still struggling to find a working example of searching on User Defined Fields. Please help

 

RecordStringSearchClause clause = newRecordStringSearchClause();

clause.Type =

RecordStringSearchClauseType.RecordNumber;

clause.Arg =

"D2013-136906";

// Construct a record search, and put our search clause in it

RecordSearch search = newRecordSearch();

search.Items =

newRecordClause[] { clause };

Honored Contributor

Re: Trim Webservice Search Clauses

You need to use a special clause object. I've provided an example below:


RecordUserFieldSearchClause rclause = new RecordUserFieldSearchClause();
rclause.UserDefinedFieldName = "myField";
rclause.From = "erik";
rclause.To = "erik";