BookmarkSubscribeRSS Feed
pwe
Fluorite | Level 6 pwe
Fluorite | Level 6
Is it possible to determine the active repository from within an Add-in?
4 REPLIES 4
ChrisHemedinger
Community Manager
Hi,

We do not currently publish an API for accessing this information.

However, if you post back with what version of EG you are using and what information you want to access, I can provide a simple code snippet that will do the job. All of the usual caveats about unpublished, subject-to-change information will apply, of course.

Chris
It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
pwe
Fluorite | Level 6 pwe
Fluorite | Level 6
I am using EG 4.1
I want to determine what my active repository is since some resources I would want will not be available in all repositories. I would like to be able to query the resources and then let the user know if he.she can use the stored process.
In a similar vein, I would want to query tables to create a custom dialogue
peter
ChrisHemedinger
Community Manager
Hi,

I'm still not exactly sure what you're after, but here are some instructions to get basic repository information. It's a proprietary, internal API and in order to keep it somewhat mysterious, I'm not going to really explain the code 🙂

1. Add a reference to SAS.EG.SDS.Metadata.dll and SAS.EG.SDS.Model.dll (found in the EG install directory)

2. Add this statement to the top of your C# file (assuming C# here -- let me know if you want a VB.NET translation):

using SAS.EG.SDS.Metadata;

3. Some C# code to get repository info and assign it to some UI label controls:

SAS.EG.SDS.Model.Broker _broker = new SAS.EG.SDS.Model.Broker();

SAS.EG.SDS.Metadata.IMetadataManager mm = _broker.MetadataManager;

SAS.EG.SDS.Metadata.IRepository _rep = mm.ActiveRepository;

lblRepName.Text = string.Format("Current Repository: {0}",_rep.Name);
lblType.Text = (_rep.Type == Repository.eType.OMS) ? "SAS Metadata Repository" : "Enterprise Guide Repository";
lblHost.Text = _rep.HostName;
lblPort.Text = (_rep.Type == Repository.eType.OMS) ? _rep.Port : "N/A";
lblUser.Text = _rep.User;
lblRepository.Text = (_rep.Type == Repository.eType.OMS) ? _rep.RepName : "N/A";


This will work with EG 4.1, but it is not a public API and it is subject to change in future releases.

Chris
It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
pwe
Fluorite | Level 6 pwe
Fluorite | Level 6
Thanks. That looks somewhat like the bits I am after. I will muck about with it for a while and see how much damage I can cause

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 949 views
  • 0 likes
  • 2 in conversation