<?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>Question Re: WebIDE Extension - Integration with external git in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/webide-extension-integration-with-external-git/qaa-p/11936802#M4485624</link>
    <description>&lt;P&gt;Thanks for the code snippet ! &lt;/P&gt;&lt;P&gt;It helped me a lot. Now the plugin works.&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;</description>
    <pubDate>Mon, 27 May 2019 14:03:41 GMT</pubDate>
    <dc:creator>skek</dc:creator>
    <dc:date>2019-05-27T14:03:41Z</dc:date>
    <item>
      <title>WebIDE Extension - Integration with external git</title>
      <link>https://community.sap.com/t5/technology-q-a/webide-extension-integration-with-external-git/qaq-p/11936800</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
  &lt;P&gt;I would like to create a Git plugin for the WebIDE. The plugin (extension) should connect a project with an external git.&lt;/P&gt;
  &lt;P&gt;In our case, we use gitlab. The Gitlab API is accessed via HTTP requests and creates an empty git repository. We have already been able to implement this as a plugin.&lt;/P&gt;
  &lt;P&gt;But afterwards we must initialize the local git repository of an existing project. Then, the remote origin of this local git repository should be set to the created gitlab repository.&lt;/P&gt;
  &lt;P&gt;For this plugin (extension) I would like to use the two existing functions/features of the WebIDE.&lt;/P&gt;
  &lt;OL&gt; 
  &lt;/OL&gt;
  &lt;P&gt;1. Initialization of the local git repository(see picture 1):&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1674573-git-step-1.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;2. Set the project remote (see picture 2):&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1674574-git-step-2.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;This will open a dialog in which you have to enter the URL of the Git repository (see picture 3).&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1674575-git-step-3.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;I would like to execute the two steps automatically in the background within my plugin without opening the dialogs.&lt;/P&gt;
  &lt;P&gt;As far as I know these two controls are use:&lt;/P&gt;
  &lt;P&gt;1. Sap.watt.ideplatform.gitclient/command/InitRepository&lt;/P&gt;
  &lt;P&gt;2. Sap.watt.ideplatform.gitclient/command/SetRemote&lt;/P&gt;
  &lt;P&gt;Does anybody know, if there is a way to call the two methods InitRepository and SetRemote without the dialogs?&lt;/P&gt;
  &lt;P&gt;If so, could you kindly send me a code example?&lt;/P&gt;
  &lt;P&gt;If this doesn't work, I'd like to call the methods that open the dialogs. Is this possible?&lt;/P&gt;
  &lt;P&gt;Or is it possible to execute the git commands&lt;/P&gt;
  &lt;P&gt;- git add -A &lt;/P&gt;
  &lt;P&gt;- git remote add origin &amp;lt;URL of Repository&amp;gt; &lt;/P&gt;
  &lt;P&gt;via Javascript&lt;/P&gt;
  &lt;P&gt;Best regards&lt;/P&gt;
  &lt;P&gt;Kevin Kussyk&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 11:10:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/webide-extension-integration-with-external-git/qaq-p/11936800</guid>
      <dc:creator>skek</dc:creator>
      <dc:date>2019-04-24T11:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: WebIDE Extension - Integration with external git</title>
      <link>https://community.sap.com/t5/technology-q-a/webide-extension-integration-with-external-git/qaa-p/11936801#M4485623</link>
      <description>&lt;P&gt;Hi Kevin,&lt;/P&gt;&lt;P&gt;I am afraid that git APIs are not public API and you are not supposed to use them. But since sap.watt.ideplatform.gitclient/command/InitRepository and sap.watt.ideplatform.gitclient/command/SetRemote are commands you can use the following workaround:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;execute: function () {
   var that = this;
   return this.context.service.command.getCommand("gitclient.initrepository").then(function (oInitRepoCommand) {
	return oInitRepoCommand.getService().execute().then(function () {
		return that.context.service.command.getCommand("gitclient.setRemote").then(function (oSetRemoteCommand) {
			return oSetRemoteCommand.getService().execute().then(function () {
				// do something
			});
		});
	});
   });
}
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rima&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2019 14:12:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/webide-extension-integration-with-external-git/qaa-p/11936801#M4485623</guid>
      <dc:creator>rima-sirich</dc:creator>
      <dc:date>2019-04-29T14:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: WebIDE Extension - Integration with external git</title>
      <link>https://community.sap.com/t5/technology-q-a/webide-extension-integration-with-external-git/qaa-p/11936802#M4485624</link>
      <description>&lt;P&gt;Thanks for the code snippet ! &lt;/P&gt;&lt;P&gt;It helped me a lot. Now the plugin works.&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2019 14:03:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/webide-extension-integration-with-external-git/qaa-p/11936802#M4485624</guid>
      <dc:creator>skek</dc:creator>
      <dc:date>2019-05-27T14:03:41Z</dc:date>
    </item>
  </channel>
</rss>

