HPE Content Manager (HPE RM) Forum
Showing results for 
Search instead for 
Do you mean 

GetRecordSet in the .NET SDK

Senior Member

GetRecordSet in the .NET SDK

In the COM SDK there is a GetRecordset call to execute a query directly against the database.  Is an equivalent method available in the .NET SDK?

8 REPLIES
Regular Advisor

Re: GetRecordSet in the .NET SDK

A few TRIMSDK.Net classes./..from my observation.

- TrimMainObjectSearch
- TrimSearchClause
- Results to Array

Not quite COM SDK.Database.GetRecordset("SQL Query") as recordset.

- TrimSearchClause is important.

**My opinions are my own personal opinions.


kapish.com.au
Honored Contributor [Founder]

Re: GetRecordSet in the .NET SDK

There is no method with this name, and nothing I can find that looks even remotely similar. Hope I am wrong, but sorry.

Note: Any posts I make on this forum are my own personal opinion and do not constitute a formal commitment on behalf of Hewlett Packard Enterprise.
Regular Advisor

Re: GetRecordSet in the .NET SDK

Don't be sorry; I'm wrong ?.

**My opinions are my own personal opinions.


kapish.com.au
Honored Contributor

Re: GetRecordSet in the .NET SDK

I'm pretty sure it doesn't exist.
Regular Advisor

Re: GetRecordSet in the .NET SDK

Not quite the same as TRIMSDK.Database.GetRecordSet. Below is a very simple example that perhaps may or not acheive the same results.

 

 

private void SampleTrimBaseObjectRecursiveSearch(HP.HPTRIM.SDK.BaseObjectTypes baseObjectType,string query)
        {
            //Enable String-based Search Editor - Important to note.


            if (baseObjectType == null || baseObjectType == HP.HPTRIM.SDK.BaseObjectTypes.Unknown) return;
            switch (baseObjectType)
            {
                case HP.HPTRIM.SDK.BaseObjectTypes.TodoItem:
                    break;
                case HP.HPTRIM.SDK.BaseObjectTypes.StopWord:
                    break;
                case HP.HPTRIM.SDK.BaseObjectTypes.Space:
                    break;
                case HP.HPTRIM.SDK.BaseObjectTypes.ReportBitmap:
                    break;
                case HP.HPTRIM.SDK.BaseObjectTypes.Report:
                    break;
                case HP.HPTRIM.SDK.BaseObjectTypes.Record:
                    break;
                case HP.HPTRIM.SDK.BaseObjectTypes.ActionDef:
                    break;
                case HP.HPTRIM.SDK.BaseObjectTypes.Unknown:
                    return;
                default: return;
                    // Include other BaseObjectTypes as per your requirements
            }

            HP.HPTRIM.SDK.TrimMainObjectSearch trimMainObjectSearch = new HP.HPTRIM.SDK.TrimMainObjectSearch(trimDb, baseObjectType); // TrimMainObjectSearch is BaseObjectTypes.Sensitive
            //trimSearch.SearchString = "query";
            HP.HPTRIM.SDKUI.ObjectSelector.EditQuery(IntPtr.Zero, trimMainObjectSearch);
            
            long[] arryOftrimObjectUris = trimMainObjectSearch.GetResultAsUriArray(); // or override and perform a bouncing list of uris according to TrimMainObjectSearch.BaseObjectTypes
            foreach (var objectUri in arryOftrimObjectUris)
            {
                HP.HPTRIM.SDK.TrimMainObjectSearch trimLocationSearch = new HP.HPTRIM.SDK.TrimMainObjectSearch(trimDb, HP.HPTRIM.SDK.BaseObjectTypes.Location);
                long[] arrayOfLocationUris = trimLocationSearch.GetResultAsUriArray(); // or override and perform a bouncing list of uris according to TrimMainObjectSearch.BaseObjectTypes
                // Maybe call SpitOutTrimObjectPropertyValue by ref or by value
                SampleTrimBaseObjectRecursiveSearch(HP.HPTRIM.SDK.BaseObjectTypes.Location, objectUri.ToString());
            }

            // or Loop through results as per normal based object TrimObjectType
            foreach (HP.HPTRIM.SDK.TrimObject trimObject in trimMainObjectSearch)
            {
                //SampleTrimBaseObjectRecursiveSearch(HP.HPTRIM.SDK.BaseObjectTypes.Location, trimObject.URI);
            }
        }


        object SpitOutTrimObjectPropertyValue(HP.HPTRIM.SDK.PropertyOrFieldDef propDef, HP.HPTRIM.SDK.TrimObject trimObject)
        {
          //..Implement your own logic
            //SpitOutTrimObjectPropertyValue(null,null);
            return null;
        }


**My opinions are my own personal opinions.


kapish.com.au
Senior Member

Re: GetRecordSet in the .NET SDK

Thanks for that Ralf

 

Unfortunately I'm trying to access the TSEventDat, and I don't think that is possible using this method.

 

Cheers

Regular Advisor

Re: GetRecordSet in the .NET SDK

Event Processor events is not quite as easy for retrieval like getrecordset.

Few approaches (and given in TRIM 7, events are processed and deleted on successful processing)

 

1. Create dedicated user in TRIM RDMBS with read only permissions and do direct SQL calls to tseventdat table or stored procedures within your own solution. (security and dependencies will be an issue)

 

2. Create a dedicated REST service specifically for polling TSeventdat table as per option 1 but can be reused for other requirements and or other TRIM objectS for reporting purposes

 

3. Create a simple console/winforms/windows service application that periodically retrieves information based on option 1 and persists information to a log file somewhere on the network or back to a TRIM dataset for reuse. (Maybe similar to statistical aggregator)

 

4. Build your own custom Event Processor Add-in to trap all events to a SQL databases or anywhere for persistence reporting purposes

 

5. HP reintroduce getrecordset again?:0)

 

6. Maybe HP expose TRIM Enterprise Studio as an API so we can monitor Event Processes and incorporate based on our own requirements

 

7. Possibly another approach through TRIM SDK that we are not familiar with.

 

Cheers


**My opinions are my own personal opinions.


kapish.com.au
Regular Advisor

Re: GetRecordSet in the .NET SDK

Or 8...maybe given the current climate; inject to and from SharePoint as list items.

**My opinions are my own personal opinions.


kapish.com.au