BusinessObjects Board

Change Report Owner

Actually there is one simple way to change ownership from admin to some user. It depends on system security. We can save report as ORIGINAL_NAME+CHANGE, then delete report with ORIGINAL_NAME. FInaly ask user to open report ORIGINAL_NAME+CHANGE and rename it back to ORIGINAL_NAME.
Unfortunately this turn to be very annoying in case of renaming 40 reports :frowning:


travian :czech_republic: (BOB member since 2007-12-05)

Hi Trivian

Could you please explain more on this? As I could not understand the point you are trying to make here. Your patience would be deeply appreciated.

Regards,
Shiva

Note: Assuming the Owner is Administrator and you need to change it to my name “Shiva”. Could you please take this as example.


shiva.tomar (BOB member since 2007-10-05)

Shiva,

Travian’s point is to republish the report to corporate documents with the user’s(in your case Shiva’s) user id.

Kevin


boxiadmin :us: (BOB member since 2007-03-09)

Thanks for the response Kevin,

But how do i do it if i’m the admin??

Regards,
Shiva


shiva.tomar (BOB member since 2007-10-05)

If you log in as Admin and don’t already have a personal account you will need to create one. In this case call it Shiva and make sure it has permission to save reports to the public folders.

Login as the Admin and send the report to the Shiva accounts Business Objects inbox. Make sure you send a copy and not a shortcut.

Login in as Shiva. Retrieve the report from your inbox and then publish the report to the relevant folder. The report owner will now show as Shiva.


cornish blue :uk: (BOB member since 2006-08-02)

Thanks Cornish blue,

Could anyone please answer my question mentioned in the below link:

As the topics are same. I dont want to be repetitive.

Thanks for understanding.


shiva.tomar (BOB member since 2007-10-05)

My friends on BOB,

I am developing a Java SDK code to change the owner of a report (any report, I will pass the name) to the username that I will pass to the program. I have a question. Hope someone can help me.

I could see that there are setDescription(), setTitle() methods using which one can easily set SI_DESCRIPTION & SI_NAME of a report. However, in my case, I want setOwnerID() to be there. Is it present? Meaning, can I change the owner of a report by using setOwnerID(NewUser) ?
If yes, great I will try. If not, what are my options?

Thanks in advance,
Buddy!


Buddy :india: (BOB member since 2006-08-04)

There is no method (I believe) to change the owner ID directly. That’s somewhat surprising because I don’t see changing the owner as an exotic action. Anyway, you can change the owner by accessing the property bag directly as in this example:

iObject.properties().setProperty(CePropertyID.SI_OWNERID, newOwnerID);

BoB LoblaW :us: (BOB member since 2007-10-23)

thank you “my bff jill” :smiley:
I think you are right. I tried doing getOwnerID() and that did not work, so I tried setOwnerID() and as expected, it did not work either. So there is no easy way to set Owner as one would set name/description.
I think the method you suggested would work. I would wait for our environment to be available so I test it.

By the way, I have always wondered, where did you find that

iObject.properties().setProperty(CePropertyID.SI_OWNERID, newownerid);

code? I could not find it in the BusinessObjects Enterprise Java SDK!
Please let me know.

Thanks again,
Buddy!


Buddy :india: (BOB member since 2006-08-04)

Hmmm…I think I picked up on the setProperty() method of setting object properties when I started using the SDK a few years ago. I likely spotted a piece of code on BOB and emulated the method for the attributes I did not know how to manipulate. While this does work, it is much slower than calling the proper method if one is available especially for nested properties (e.g. getTitle() is faster than .properties.getProperty(…)). I used to think that was the only way to manipulate objects until I leafed through the Developer Library.

Edit
On second thought, I do recall seeing this described in the R2 Developer Guide:

http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/en/BOE_SDK/boesdk_java_dg_doc/doc/boesdk_java_dg/SDKFundamentals36.html#1040740


BoB LoblaW :us: (BOB member since 2007-10-23)

Oh yes…there you go. I as well can now find that in the documentation that I have with me. :+1: :slight_smile:


Buddy :india: (BOB member since 2006-08-04)

Was a solution ever found for an easy way to change the owner of bulk objects? (Say a few dozen WEBI reports and Xcelsius published Flash objects).

I created everything under my ID as a developer/admin, but I’ve been asked to change the owner from my ID, to the company Name instead since these will be seen by external clients.

I’ve created an account with our Company name as the Account name but short of opening each one up and resaving, I wonder if there is an easier way?

One option i’m debating with, is to simply rename the Admin account to the company name… then delete my personal account ID. That will revert all owners to the admin ID.
Furthermore, since I don’t use favorites and I’m the admin with full password access, I could just login under the new administrator ID to create any new reports.

Even though I’m the admin and really the sole developer at this point, I somehow don’t feel comfortable with using the Admin ID in this fashion, as I’m sure it’ll cause an issue down the road.

I’m wondering if that Java SDK mentioned by Buddy above was ever developed, or if perhaps the LCM might have an option to change owner name when migrating from a Dev/QA environment to a production.


JPetlev (BOB member since 2006-11-01)

Hi JPetlev

I saw your post just now. Yes I successfully came up with a code that takes access details, report name and new owner’s bo username and changes the owner of the report to that username.
I shall share the code with you tomorrow when I go to work…(don’t have it with me right now)
But as you said, I think it’s not a bad idea just to rename your username to company name, that way you don’t have to keep changing the owner of each and every report. You wil have to do that via SDK itself though.
I leave it upto you what you want to do…

Cheers,
Buddy!


Buddy :india: (BOB member since 2006-08-04)

Hi Buddy,

It may be an idea to get this put on the BoBs downloads section, then others will be able to make use of it…

Cheers,

Mark.


Mak 1 :uk: (BOB member since 2005-01-06)

Do you have to set both SI_OWNER and SI_OWNERID?

Here’s what I’ve tried:


sourceUser = (IInfoObjects) iStore.query("select * from ci_infoobjects where si_id=" + repID);

for ( int i = 0; i < sourceUser.getResultSize(); i++ ) {
oSourceUserObject = (IInfoObject)sourceUser.get(i);

//oSourceUserObject.properties().setProperty("SI_OWNERID",ownerID); //set new Name/ID
//oSourceUserObject.properties().setProperty("SI_OWNER","Administrator"); //set new Name/ID

oSourceUserObject.properties().setProperty(CePropertyID.SI_OWNERID,ownerID); //set new Name/ID
oSourceUserObject.properties().setProperty(CePropertyID.SI_OWNER,"Administrator"); //set new Name/ID

		}
iStore.commit( sourceUser );

As you can see, I’ve tried several different ways, but that change never gets made.

Thanks.


GigaGuy :us: (BOB member since 2007-02-13)

Only SI_OWNERID works. The SI_OWNER field is dynamic and its value is derived from SI_OWNERID. Also, try oSourceUserObject.save() instead of iStore.commit( sourceUser ).


BoB LoblaW :us: (BOB member since 2007-10-23)

Tried that, still no change. I should mention this is XI3.1, not R2.
I didnt know where the save should go, so I put it before and after loop.


sourceUser = (IInfoObjects) iStore.query("select * from ci_infoobjects where si_id=" + repID); 

for ( int i = 0; i < sourceUser.getResultSize(); i++ ) { 
oSourceUserObject = (IInfoObject)sourceUser.get(i); 

//oSourceUserObject.properties().setProperty("SI_OWNERID",ownerID); //set new Name/ID 

oSourceUserObject.properties().setProperty(CePropertyID.SI_OWNERID,ownerID); //set new Name/ID 

oSourceUserObject.save();
      } 
oSourceUserObject.save(); 

GigaGuy :us: (BOB member since 2007-02-13)

Hmmm…does your ID have rights to change the owner? Is the InfoObject ID belong to the report you think it should? Is the new owner ID a valid ID?

I use this code to change owners and it has never given me a problem:

...
IInfoObjects reports = Utils.getInfoObjects(infoStore, query);

String oldowner = "";
for (Object o : reports) {
	IInfoObject iObject = (IInfoObject)o;
	oldowner = (String)iObject.properties().getProperty(CePropertyID.SI_OWNER).getValue();
	
	// Change the owner
	iObject.properties().setProperty(CePropertyID.SI_OWNERID, newOwnerID);
	
	// Change the submitter if it is an instance
	if (iObject.isInstance()){
		ISchedulingInfo schedInfo = iObject.getSchedulingInfo();
		schedInfo.properties().setProperty(CePropertyID.SI_SUBMITTERID, newOwnerID);
	}
		
									
	System.out.format("%s\t%s\t%s%n", iObject.getTitle(), oldowner, NEWOWNER);
}

System.out.println("Saving...");
infoStore.commit(reports);
System.out.println("Complete");

BoB LoblaW :us: (BOB member since 2007-10-23)

Your code works. The only difference I can see is the loop.

Thanks for your help.


GigaGuy :us: (BOB member since 2007-02-13)

Glad to hear it is working.


BoB LoblaW :us: (BOB member since 2007-10-23)