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: BOB is going to retire...please see details here.
General Notice: No events within the next 45 days.

Modify unx objects using SL SDK?


 
Search this topic... | Search SDK (VBA/ASP/JSP)... | Search Box
Register or Login to Post    Forum Index -> SDK (VBA/ASP/JSP)  Previous TopicPrint TopicNext Topic
Author Message
krishnapatel
Forum Member
Forum Member



Joined: 18 Oct 2019

Posts: 4



PostPosted: Fri Oct 18, 2019 1:23 pm 
Post subject: Modify unx objects using SL SDK?

Hello All.

I'm trying to update BO unx objects using Java SL SDK. after going through the documentation & forums i was able to get some information to add objects to universe using the code. For my requirement i need to edit the sql code to change the functions and the table names in the objects. can someone please let me know if its possible to modify the UNX object using SDK code?

Thanks a lot in Advance

Thanks,
Krishna
Back to top
joepeters
Forum Fanatic
Forum Fanatic



Joined: 29 Aug 2002

Posts: 6703
Location: Connecticut, USA


flag
PostPosted: Fri Oct 18, 2019 1:35 pm 
Post subject: Re: Modify unx objects using SL SDK?

Sure. I'm assuming you've gotten as far as retrieving the objects from their parent folders. You'll need to cast the BIItem down to BusinessObject (or Attribute / Dimension / Measure, as appropriate). Then call BusinessObject.getBinding() to get a Binding object. Cast it to RelationalBinding, and then you can use setSelect() and setWhere().

Untested sketch:
Code:

for(BIItem item : folder.getChildren())
{
   if(item instanceof BusinessObject)
   {
      BusinessObject bo = (BusinessObject)bo;
      RelationalBinding binding = (RelationalBinding)bo.getBinding();
      binding.setSelect("new_table.new_field");
   }
}
Back to top
krishnapatel
Forum Member
Forum Member



Joined: 18 Oct 2019

Posts: 4



PostPosted: Fri Oct 25, 2019 5:31 pm 
Post subject: Re: Modify unx objects using SL SDK?

Thanks a ton Joepeters,

Sorry, i took sometime to get back to you as i was looking into the code.

your code helped me to modify the objects and publish it back to CMS. With your code i was able to modify the objects in the parent folder. Just had another question. How do we go down to the subfolders to modify the objects. I looked into Javadocs and it has option to bring back parent folder but i do not see an option to go into subfolders.. How to go to sub folder to edit an object?

I'm not familiar with the Javascript, please bear with my dumb questions.

Thanks
Krishna
Back to top
joepeters
Forum Fanatic
Forum Fanatic



Joined: 29 Aug 2002

Posts: 6703
Location: Connecticut, USA


flag
PostPosted: Mon Oct 28, 2019 7:09 am 
Post subject: Re: Modify unx objects using SL SDK?

This is Java, not Javascript icon_smile.gif

Folder is a subinterface of BIItem, as is BusinessObject, so:
Code:

for(BIItem item : folder.getChildren())
{
   if(item instanceof BusinessObject)
   {
      BusinessObject bo = (BusinessObject)bo;
      RelationalBinding binding = (RelationalBinding)bo.getBinding();
      binding.setSelect("new_table.new_field");
   }
   else if(item instanceof Folder)
   {
       <<recurse back into method, passing (Folder)item>>
   }
}
Back to top
Marek Chladny
Forum Advocate
Forum Advocate



Joined: 27 Nov 2003

Posts: 19354
Location: Bratislava


flag
PostPosted: Mon Oct 28, 2019 8:22 am 
Post subject: Re: Modify unx objects using SL SDK?

[Moderator Note: Moved from Semantic Layer / Universe Designer to SDK (VBA/ASP/JSP)]
Back to top
krishnapatel
Forum Member
Forum Member



Joined: 18 Oct 2019

Posts: 4



PostPosted: Fri Dec 06, 2019 2:19 am 
Post subject: Re: Modify unx objects using SL SDK?

Thanks Joepeters,

Can you also please guide me on how to retrieve the sql for each dimension and measure in the unx. Basically when you right click on the object we have a option "show query script" to look at the object sql with select and from class. Attached is the screenshot for reference
Back to top
Display posts from previous:   
Register or Login to Post    Forum Index -> SDK (VBA/ASP/JSP)  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT - 5 Hours
 
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.0290 seconds using 18 queries. (SQL 0.0032 Parse 0.0009 Other 0.0249)
CCBot/2.0 (https://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