cancel
Showing results for 
Search instead for 
Did you mean: 

Conditional Statements in TRIM Searches

Highlighted
spowers3
Super Collector

Conditional Statements in TRIM Searches

Is there a way to create conditional statements in a TRIM search? I would like to search TRIM for documents of a particular type in a particular container than do NOT have matching rendition and version numbers.

 

To do this, I believe I need an (if else) statement and for TRIM to recognize Boolean returns of true or false. Can TRIM do this?

 

Steve

10 REPLIES
EWillsey
Honored Contributor

Re: Conditional Statements in TRIM Searches

You can't do it through the TRIM interface.  You could do it through SQL though.  But renditions don't have numbers associated with them.  Did you mean count?

spowers3
Super Collector

Re: Conditional Statements in TRIM Searches

Thanks for the reply!

 

As for count, I assume yes, we have a "Number of Renditions" column, so I believe you are correct that it is the count and not an acutaly number. My mistake there. 

 

As for SQL, I was told this was not possible with TRIM and that only searches through the client are supported. I had orginally asked if SQL was possible since, as you pointed out, it can do everything I need it to. If you can run SQL queries against TRIM, how does one go about doing this?

 

Steve

EWillsey
Honored Contributor

Re: Conditional Statements in TRIM Searches

You can indeed go directly to the database. HP will not support you if you start making changes to the database though. Connecting into it for Crystal Reports or custom reports is common.

You'd need to talk to you database administrator about what level of access they'd give you. If you are intending to do it routinely then you could just put your query into an excel macro and go through the TRIMSDK. If it's not a routine thing then just have the DBA run the query whenever you need it. Talk with HP or a partner if you want the report automated.

Here is the query for checking if the number of renditions matches the number of revisions (replace the container number and rectypename spots):

select * from TSRECORD where rcContainerUri = (select uri from TSRECORD where recordId = '<CONTAINERNUMBER>') AND rcRecTypeUri = (select uri from TSRECTYPE where TSRECTYPE.recTypeName = '<RECTYPENAME>') AND (select COUNT(*) from TSRENDITIO where TSRENDITIO.rrRecordUri = TSRECORD.uri) != (select TSRECELEC.reVersions from TSRECELEC where TSRECELEC.uri = TSRECORD.uri)


spowers3
Super Collector

Re: Conditional Statements in TRIM Searches

EWilsey,

 

Thank you for your time and answers, this is most helpful. My final question would be about using regular expressions to change filenames stored in TRIM, from what you described it doesn't sound like HP would support this unless there is a way for TRIM itself to do bulk changes like that.

 

Steve

EWillsey
Honored Contributor

Re: Conditional Statements in TRIM Searches

TRIM doesn't support regular expressions.  Also TRIM doesn't really have a "filename".... when you open an electronic object the local file name is set to match the title of the object in TRIM.  TRIM will automatically remove some characters if they aren't supported on the file system.

 

That being said there are lot of ways to go about bulk-updating titles in TRIM.  Some people use TRIMPort, some go directly to the database, and others use the SDK.

spowers3
Super Collector

Re: Conditional Statements in TRIM Searches

TRIMPort? We're extremely new to TRIM here and I don't think we were aware of these things. Let me just make sure we're on the same page about my descrption here. By file name, I am talking about the revisions and renditions that are uploaded into TRIM. There is very little file name validation of what had previously been entered into TRIM and I would like to clean them up a bit.

 

I would normally do this with a shell script and some regular expressions in the directory. I believe I could also do this with SQL if it had the right extenstions like PL/SQL. TRIMPort or the SDK would also offer options for this?

EWillsey
Honored Contributor

Re: Conditional Statements in TRIM Searches

TRIMPort is the admnistrative import/export utlity (Tools->Context Administration->Import/Export from within TRIM Context).

If you're that new to TRIM I wouldn't recommend you start playing with the database. The SDK would be better cause at least then you can't really break it.

It might be worth you contacting your reseller/partner for more information on making bulk changes within TRIM.
spowers3
Super Collector

Re: Conditional Statements in TRIM Searches

Thanks for all the help!

 

Steve

Rich_Kid
Esteemed Contributor

Re: Conditional Statements in TRIM Searches

Going through the SDK means that Trim will audit log the changes made (provided you are auditing those events!)

 

Changes made at the Database level are not audited, so this could cause issues later down the track when if these is an issue with a record and the Audit log doesn't have all a complete history of changes.

 

regards

 

spowers3
Super Collector

Re: Conditional Statements in TRIM Searches

Thanks for the info Rich Kid. At this point I think the goal will be to just run SQL reports against the database to get better reporting and then make the changes manuall through the TRIM client.

//Add this to "OnDomLoad" event