BOB: Business Objects Board
Not endorsed by or affiliated with SAP

Register | Login 

Follow BOB on Twitter! 
Follow BOB on Twitter! (Opens a new window)  

General Notice: Upcoming Events: PGHBOUG: Aug 31.

Change Report Owner

Goto page Previous  1, 2, 3, 4  Next
 
Search this topic... | Search XI Server Discussion... | Search Box
Register or Login to Post    Forum Index -> Server Administration, Installation, Upgrades -> XI Server Discussion  Previous TopicPrint TopicNext Topic
Author Message
shiva.tomar
Principal Member
Principal Member



Joined: 04 Oct 2007

Posts: 263



PostPosted: Thu Nov 12, 2009 11:32 am 
Post subject: Re: Change Report Owner

Thanks Cornish blue,

Could anyone please answer my question mentioned in the below link:
http://www.forumtopics.com/busobj/viewtopic.php?p=673588#673588

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

Thanks for understanding.

_________________
Shiva
Sr. DW/BI Consultant - BO (6.5, XI, XIR2 & XI3.1), SSAS, OBIEE 10g & 11g, Mercator, Oracle Data Integrator, GoldenGate, Oracle BI Publisher, Oracle BI Applications.
OCA and TOGAF 9 Certified.
shiva.tomar@yahoo.com

"Dreams are not what you see when you sleep; dreams are what keep you from sleeping."- !!.
Back to top
Buddy
Principal Member
Principal Member



Joined: 04 Aug 2006

Posts: 165


flag
PostPosted: Mon Dec 21, 2009 6:05 pm 
Post subject: Re: Change Report Owner

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!
Back to top
BoB LoblaW
Forum Enthusiast
Forum Enthusiast



Joined: 23 Oct 2007

Posts: 1167
Location: Cincinnati, OH


flag
PostPosted: Mon Dec 21, 2009 9:27 pm 
Post subject: Re: Change Report Owner

Buddy wrote:
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?

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:

Code:
iObject.properties().setProperty(CePropertyID.SI_OWNERID, newOwnerID);
Back to top
Buddy
Principal Member
Principal Member



Joined: 04 Aug 2006

Posts: 165


flag
PostPosted: Tue Dec 22, 2009 1:29 pm 
Post subject: Re: Change Report Owner

thank you "my bff jill" icon_biggrin.gif
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

Code:
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!
Back to top
BoB LoblaW
Forum Enthusiast
Forum Enthusiast



Joined: 23 Oct 2007

Posts: 1167
Location: Cincinnati, OH


flag
PostPosted: Tue Dec 22, 2009 1:56 pm 
Post subject: Re: Change Report Owner

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
Back to top
Buddy
Principal Member
Principal Member



Joined: 04 Aug 2006

Posts: 165


flag
PostPosted: Tue Dec 22, 2009 2:59 pm 
Post subject: Re: Change Report Owner

Oh yes...there you go. I as well can now find that in the documentation that I have with me. thumbsup.gif icon_smile.gif
Back to top
JPetlev
Forum Enthusiast
Forum Enthusiast



Joined: 01 Nov 2006

Posts: 1097



PostPosted: Tue Feb 02, 2010 3:33 pm 
Post subject: Re: Change Report Owner

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.
Back to top
Buddy
Principal Member
Principal Member



Joined: 04 Aug 2006

Posts: 165


flag
PostPosted: Wed Feb 03, 2010 12:19 am 
Post subject: Re: Change Report Owner

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!
Back to top
Mak 1
Forum Aficionado
Forum Aficionado



Joined: 06 Jan 2005

Posts: 13958
Location: London


flag
PostPosted: Wed Feb 03, 2010 9:02 am 
Post subject: Re: Change Report Owner

Quote:
I shall share the code with you tomorrow when I go to work..(don't have it with me right now)


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.

_________________
Next Available for Contract Work - August 2017

Business Objects Versions 4,5,6, XI R2, 3.2, 4.1 SP3
Oracle, SQL Server, Sybase, Netezza, SAP BW.

Red Adair: "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur."
Back to top
GigaGuy
Principal Member
Principal Member



Joined: 13 Feb 2007

Posts: 107
Location: Durham, NC


flag
PostPosted: Wed Feb 17, 2010 9:13 pm 
Post subject: Re: Change Report Owner

Do you have to set both SI_OWNER and SI_OWNERID?

Here's what I've tried:

Code:

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.
Back to top
BoB LoblaW
Forum Enthusiast
Forum Enthusiast



Joined: 23 Oct 2007

Posts: 1167
Location: Cincinnati, OH


flag
PostPosted: Thu Feb 18, 2010 8:31 am 
Post subject: Re: Change Report Owner

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 ).
Back to top
GigaGuy
Principal Member
Principal Member



Joined: 13 Feb 2007

Posts: 107
Location: Durham, NC


flag
PostPosted: Thu Feb 18, 2010 8:47 am 
Post subject: Re: Change Report Owner

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.

Code:

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();
Back to top
BoB LoblaW
Forum Enthusiast
Forum Enthusiast



Joined: 23 Oct 2007

Posts: 1167
Location: Cincinnati, OH


flag
PostPosted: Thu Feb 18, 2010 10:44 am 
Post subject: Re: Change Report Owner

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:

Code:
...
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");
Back to top
GigaGuy
Principal Member
Principal Member



Joined: 13 Feb 2007

Posts: 107
Location: Durham, NC


flag
PostPosted: Thu Feb 18, 2010 11:03 am 
Post subject: Re: Change Report Owner

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

Thanks for your help.
Back to top
BoB LoblaW
Forum Enthusiast
Forum Enthusiast



Joined: 23 Oct 2007

Posts: 1167
Location: Cincinnati, OH


flag
PostPosted: Thu Feb 18, 2010 12:42 pm 
Post subject: Re: Change Report Owner

Glad to hear it is working.
Back to top
Display posts from previous:   
Register or Login to Post    Forum Index -> Server Administration, Installation, Upgrades -> XI Server Discussion  Previous TopicPrint TopicNext Topic
Page 2 of 4 All times are GMT - 5 Hours
Goto page Previous  1, 2, 3, 4  Next
 
Jump to:  

Index | About | FAQ | RAG | Privacy | Search |  Register |  Login 

Get community updates via Twitter:

Not endorsed by or affiliated with SAP
Powered by phpBB © phpBB Group
Generated in 0.0673 seconds using 17 queries. (SQL 0.0212 Parse 0.0335 Other 0.0125)
CCBot/2.0 (http://commoncrawl.org/faq/)
Hosted by ForumTopics.com | Terms of Service
phpBB Customizations by the phpBBDoctor.com
Shameless plug for MomentsOfLight.com Moments of Light Logo