<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Accessing the Active Repository from an Addin in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Accessing-the-Active-Repository-from-an-Addin/m-p/865#M232</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
We do not currently publish an API for accessing this information.  &lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
Chris</description>
    <pubDate>Tue, 20 Jun 2006 17:23:44 GMT</pubDate>
    <dc:creator>ChrisHemedinger</dc:creator>
    <dc:date>2006-06-20T17:23:44Z</dc:date>
    <item>
      <title>Accessing the Active Repository from an Addin</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Accessing-the-Active-Repository-from-an-Addin/m-p/864#M231</link>
      <description>Is it possible to determine the active repository from within an Add-in?</description>
      <pubDate>Mon, 19 Jun 2006 21:43:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Accessing-the-Active-Repository-from-an-Addin/m-p/864#M231</guid>
      <dc:creator>pwe</dc:creator>
      <dc:date>2006-06-19T21:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing the Active Repository from an Addin</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Accessing-the-Active-Repository-from-an-Addin/m-p/865#M232</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
We do not currently publish an API for accessing this information.  &lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
Chris</description>
      <pubDate>Tue, 20 Jun 2006 17:23:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Accessing-the-Active-Repository-from-an-Addin/m-p/865#M232</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2006-06-20T17:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing the Active Repository from an Addin</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Accessing-the-Active-Repository-from-an-Addin/m-p/866#M233</link>
      <description>I am using EG 4.1&lt;BR /&gt;
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.&lt;BR /&gt;
In a similar vein, I would want to query tables to create a custom dialogue&lt;BR /&gt;
peter</description>
      <pubDate>Fri, 23 Jun 2006 01:25:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Accessing-the-Active-Repository-from-an-Addin/m-p/866#M233</guid>
      <dc:creator>pwe</dc:creator>
      <dc:date>2006-06-23T01:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing the Active Repository from an Addin</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Accessing-the-Active-Repository-from-an-Addin/m-p/867#M234</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
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 &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
1. Add a reference to SAS.EG.SDS.Metadata.dll and SAS.EG.SDS.Model.dll (found in the EG install directory)&lt;BR /&gt;
&lt;BR /&gt;
2. Add this statement to the top of your C# file (assuming C# here -- let me know if you want a VB.NET translation):&lt;BR /&gt;
&lt;BR /&gt;
  using SAS.EG.SDS.Metadata;&lt;BR /&gt;
&lt;BR /&gt;
3. Some C# code to get repository info and assign it to some UI label controls:&lt;BR /&gt;
&lt;BR /&gt;
SAS.EG.SDS.Model.Broker _broker = new SAS.EG.SDS.Model.Broker();&lt;BR /&gt;
&lt;BR /&gt;
SAS.EG.SDS.Metadata.IMetadataManager mm = _broker.MetadataManager;&lt;BR /&gt;
&lt;BR /&gt;
SAS.EG.SDS.Metadata.IRepository _rep = mm.ActiveRepository;&lt;BR /&gt;
&lt;BR /&gt;
lblRepName.Text = string.Format("Current Repository: {0}",_rep.Name);&lt;BR /&gt;
lblType.Text = (_rep.Type == Repository.eType.OMS) ? "SAS Metadata Repository" : "Enterprise Guide Repository";&lt;BR /&gt;
lblHost.Text = _rep.HostName;&lt;BR /&gt;
lblPort.Text = (_rep.Type == Repository.eType.OMS) ? _rep.Port : "N/A";&lt;BR /&gt;
lblUser.Text = _rep.User;&lt;BR /&gt;
lblRepository.Text = (_rep.Type == Repository.eType.OMS) ? _rep.RepName : "N/A";&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
This will work with EG 4.1, but it is not a public API and it is subject to change in future releases.&lt;BR /&gt;
&lt;BR /&gt;
Chris</description>
      <pubDate>Fri, 23 Jun 2006 20:54:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Accessing-the-Active-Repository-from-an-Addin/m-p/867#M234</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2006-06-23T20:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing the Active Repository from an Addin</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Accessing-the-Active-Repository-from-an-Addin/m-p/868#M235</link>
      <description>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</description>
      <pubDate>Tue, 27 Jun 2006 21:32:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Accessing-the-Active-Repository-from-an-Addin/m-p/868#M235</guid>
      <dc:creator>pwe</dc:creator>
      <dc:date>2006-06-27T21:32:13Z</dc:date>
    </item>
  </channel>
</rss>

