I need some help regarding folder located in CMS repository. As folder located in CMS respository has a parent_ID and all the reports can be open when this parent_id is found. What i wanted to know how to get parent_id or folder_id giving input as folder name by the user. Is there any queries to handle that? I think, CI_INFOOBJECTS table don’t have any information regarding folder name.
You can use query builder to get the ID. Here is a sample query for a public folder named Test:
select SI_ID, SI_NAME
from ci_infoobjects
where si_name=‘Test’
and si_kind=‘Folder’
select SI_ID, SI_NAME
from ci_infoobjects
where si_name=‘Test’
and si_kind=‘Folder’ .
I think SI_ID is parent_id of all the reports/folder inside ‘Test’ folder. Is there way that you can combine two queries in BO Query builder. I was getting error.
Sample example:
select SI_ID, SI_NAME from ci_infoobjects where si_parentid IN (select SI_ID
from ci_infoobjects
where si_name=‘Test’
and si_kind=‘Folder’)
is there any other way to get all the folders/reports inside a folder giving input as folder name?
But when r u executing query it returns as IInfoObjects type. Then u have to get infoObject further u will get infoObject.getID() method to get the desired result for executing other query.
As
infoObjects = iStore.query("Select * From CI_INFOOBJECTS where SI_Name=‘Test’ ");
That how SDK was implemented by the vendor. If it makes you feel better you can combine all in one line using casts:
infoObjects = iStore.query(“Select * From CI_INFOOBJECTS where SI_parentid=”+((IInfoObject)(iStore.query("Select * From CI_INFOOBJECTS where SI_Name=‘Test’ ")).get(0)).getID());
One more thing, it is highly inefficient to use select *. Always select specific attributes you need like SI_ID, SI_NAME, etc.