Skip to Content
0

Rename multiple WebI Documents

Nov 28, 2017 at 12:07 PM

74

avatar image

Hi,

How I can rename multiple WebI Documents at once? I need to replace some symbols for

hundreds of WebI documents in the BI platform.

If you know a secure way how to do it it would be great if you could share with the solution.

Currently thinking about scanning the CMS DB and looking for the tables that are storing the WebI Document names. Is there anything else that needs to be changed in order to not corrupt the WebI report, its schedules, etc.

Thank you in advance,

Vytautas Thienel

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Bharath B N
Nov 28, 2017 at 02:10 PM
1
void modifyInfoObject(IEnterpriseSession enterpriseSession, String oldName, String newName) throws SDKException
{
	IInfoStore infostore = (IInfoStore) enterpriseSession.getService("InfoStore");
	String query = "SELECT SI_ID FROM CI_INFOOBJECTS " 
		+ "WHERE SI_KIND='" + IFolder.FOLDER_KIND + "' "
		+ "And SI_NAME='" + oldName + "' And SI_INSTANCE=0";
	IInfoObjects objs = infostore.query(query);
    	
	IInfoObject obj = (IInfoObject) objs.get(0);
	obj.setTitle(newName);

	infostore.commit(objs);
}
Show 1 Share
10 |10000 characters needed characters left characters exceeded

Good approach. You'd only have to add a loop to go through your hundreds of documents. Works like a charm and is rather quick.

Cheers

Roland

0
Bharath B N
Nov 28, 2017 at 12:11 PM
0

Using JAVA SDK you can achieve this.

-

Bharath

Share
10 |10000 characters needed characters left characters exceeded
Dell Stinnett-Christy Dec 06, 2017 at 03:15 PM
0

You cannot do this directly in the database. The relevent information is in a proprietary format in a blob field. So, you will have to use the SDK. The code in the original answer to this shows how to do it for a single report. I might do something like this instead:

void changeRptNames(IEnterpriseSession eSession, string oldSymbol, string newSymbol){
IInfoStore infostore = (IInfoStore) enterpriseSession.getService("InfoStore"); String query = String.format("Select SI_ID, SI_NAME from CI_INFOOBJECTS where SI_INSTANCE = 0 and SI_NAME like '%s'", oldSymbol); IInfoObjects objs = infostore.query(query); for (Object obj : objs){ IInfoObject iobj = (IInfoObject) obj; iobj.setTitle(iobj.getTitle().replace(oldSymbol, newSymbol); } objs.commit(); }

Note: by default an infostore query will only return up to 1,000 records. If you have more reports than that, you'll need to either use a paged query or (easier) change the query to Select Top n SI_ID, SI_NAME... where "n" is a number that is equal or greater than the number of reports that you expect to find.

-Dell

Share
10 |10000 characters needed characters left characters exceeded