Re: Trim Webservice Search Clauses (183 Views)
Reply
Occasional Contributor
ashok athikam
Posts: 7
Registered: ‎10-30-2008
Message 1 of 6 (341 Views)
Accepted Solution

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.

Please use plain text.
Frequent Advisor
Nathan  Godfrey
Posts: 40
Registered: ‎11-02-2008
Message 2 of 6 (341 Views)

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.
Please use plain text.
Occasional Contributor
ashok athikam
Posts: 7
Registered: ‎10-30-2008
Message 3 of 6 (341 Views)

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


Please use plain text.
Frequent Advisor
Terry Seiver
Posts: 70
Registered: ‎10-19-2008
Message 4 of 6 (341 Views)

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
Please use plain text.
Occasional Visitor
Geoscience
Posts: 1
Registered: ‎07-01-2013
Message 5 of 6 (191 Views)

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 };

Please use plain text.
Honored Contributor
EWillsey
Posts: 1,706
Registered: ‎04-20-2010
Message 6 of 6 (183 Views)

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";
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation