jgonzalez Posted January 3, 2012 Report Share Posted January 3, 2012 Hi, You should use .Net framework 2.0 and 32 bit platform. Let me know how it goes, please! -Jesús M. Link to comment Share on other sites More sharing options...
diegohb Posted November 2, 2012 Report Share Posted November 2, 2012 As promised, here is a sample extension. It connects to a postgres database to retrieve the task data. This is the LoadTask method. You need to reference the extensioncommon.dll assembly to build it. Basically you'll want to implement the methods in ITaskProvider (reflektor is your friend To use it, add an <Extensions> section to your client.conf pointing to your assembly. (Configure one extension from the gui and replace the entry created in client.conf with your assembly) using System; using System.Data; using System.Drawing; using System.Diagnostics; using System.Collections; using System.Windows.Forms; using Codice.Client.Extension; using Npgsql; using log4net; namespace Codice.Client.Extension { public class TtsExtensionConfiguration : BaseExtensionConfiguration { public string User = "tts"; public string Password = "tts"; public string DatabaseConnectionString ="SERVER=192.168.1.2;PORT=5432;USER ID={0};PASSWORD={1};DATABASE=tts;ENCODING=UNICODE"; public string TtsViewDefectUrl = "http://juno/tts/visualize.php?iddefect={0}"; } internal class ConnectionFactory { public static IDbConnection GetConnection(TtsExtensionConfiguration config) { IDbConnection result = new NpgsqlConnection(config.DatabaseConnectionString); result.Open(); return result; } } public class TtsExtension: BasePlasticExtension { protected TtsExtensionConfiguration mConfig; protected IExtensionContainer mInstance; private static readonly ILog mLog = LogManager.GetLogger("extensions"); private string mConfigFile = "druidextension.conf"; public TtsExtension() { // Load config from disk mConfig = (TtsExtensionConfiguration) ExtensionServices.LoadConfig(mConfigFile, typeof(TtsExtensionConfiguration)); if (mConfig == null) mConfig = new TtsExtensionConfiguration(); mConfig.DatabaseConnectionString = String.Format(mConfig.DatabaseConnectionString, mConfig.User, mConfig.Password); mConfig.SetDefaultAttributePrefix ("druid"); mBaseConfig = mConfig; } #region Miembros de IPlasticExtension public override string GetName() { return "Druid TTS sample extension"; } #endregion #region Miembros de ITaskProvider public override PlasticTask[] LoadTask (string[] ids, string repName) { if (ids[0] == null || ids[0] == String.Empty) return null; ArrayList result = new ArrayList(); for (int i = 0; i < ids.Length; i++) { PlasticTask task = new PlasticTask(); IDbConnection conn = ConnectionFactory.GetConnection(mConfig); try { IDbCommand command = conn.CreateCommand(); command.CommandText = "SELECT d.iid, sheadline, s.sname as status, stext " + "FROM defect d, enclosure e, defectstatus s " + "WHERE d.iiddefectstatus = s.iid AND d.iid = e.iiddefect AND d.iid = " + ids[i]; IDataReader reader = command.ExecuteReader(); if (reader.Read()) { task.Id = ids[i]; task.Title = (string)reader["sheadline"]; task.Description = (string)reader["stext"]; task.Owner = string.Empty; task.Status = (string)reader["status"]; } reader.Close(); } catch (Exception ex) { mLog.ErrorFormat("TTSExtension: {0}\n\t{1}", ex.Message, ex.StackTrace); return null; } finally { conn.Close(); } result.Add(task); } return (PlasticTask[])result.ToArray(typeof (PlasticTask)); } public override void OpenTask(string id, string repName) { System.Diagnostics.Process.Start(string.Format(mConfig.TtsViewDefectUrl, id) ); } public bool Checkin(PlasticChangeset[] changesets) { return false; } #endregion } } Does this API still work for plastic 4.1? Also, will i still be able to set a branch prefix and projectKey=MULTI_PROJECTS just like the JIRA integration works? I guess a screenshot of an implemented custom plugin settings window would help a lot. thanks! Link to comment Share on other sites More sharing options...
manu Posted November 5, 2012 Report Share Posted November 5, 2012 Hi! Yes, it's still available. Let me check if we have an open source integration. We are thinking if open source all of them. Link to comment Share on other sites More sharing options...
wvd_vegt Posted November 23, 2012 Report Share Posted November 23, 2012 Hi Manu, Out of interest i'm creating a extension (not tied to any system yet) but i'm having some problems/questions. 1) I coded: public DrupalSupportExtension() { Debug.WriteLine("DrupalSupportExtension()"); // Load config from disk mConfig = (DrupalSupportExtensionConfiguration)ExtensionServices.LoadConfig(mConfigFile, typeof(DrupalSupportExtensionConfiguration)); if (mConfig == null) { mConfig = new DrupalSupportExtensionConfiguration(); } mConfig.SetDefaultAttributePrefix("support"); mBaseConfig = mConfig; } and public override PlasticTask[] LoadTask(string[] ids, string repName) { Debug.WriteLine("LoadTask({" + String.Join(", ", ids) + " }, " + repName + ")"); ... The prefix is 'support' and i created a branch named 'support072' in one of my repositories. but always see the following output (and no tasks in the branch viewer at all). LoadTask({, }, ) The other methods are also called (Checkin/GetName/Constructor). 2) How do i code some user-interface (to enter configuration settings) in the preference dialog? regards Link to comment Share on other sites More sharing options...
manu Posted November 26, 2012 Report Share Posted November 26, 2012 Hi! Let us prepare a guide, it's possible to create a user interface, actually, it'e needed, otherwise the custom integration will only work with the "scm" branch prefix, that I think it's the issue you are having. Link to comment Share on other sites More sharing options...
manu Posted November 26, 2012 Report Share Posted November 26, 2012 We'll also open source the Bugzilla integration Link to comment Share on other sites More sharing options...
wvd_vegt Posted November 26, 2012 Report Share Posted November 26, 2012 Hi Manu The prefix seems be be the problem. When changed to the default 'scm' things start to work and i see dummy tasks in the client. Even the jump to browser button work nicely. Small gui issue: when the issue is shown (right side of the client) the height of the selection background of the issue (just click it with a mouse) changes in height (to full height) when the window is resized (it colors blue on my machine). Clicking the table button twice restores the smaller height initially shown. regards Link to comment Share on other sites More sharing options...
wvd_vegt Posted December 13, 2012 Report Share Posted December 13, 2012 Hi Manu. Hi! Let us prepare a guide, it's possible to create a user interface, actually, it'e needed, otherwise the custom integration will only work with the "scm" branch prefix, that I think it's the issue you are having. Any progress on the guide? regards Link to comment Share on other sites More sharing options...
manu Posted December 13, 2012 Report Share Posted December 13, 2012 There's no guide yet BUT I have just uploaded the source code of the bugzilla integration. So enter to our web page and inside "labs" you will find it! Link to comment Share on other sites More sharing options...
wvd_vegt Posted December 14, 2012 Report Share Posted December 14, 2012 Hi Manu Thanks, looks simple enough, change the base class of a form and implement some interface method. regards Link to comment Share on other sites More sharing options...
manu Posted December 17, 2012 Report Share Posted December 17, 2012 Yep! Link to comment Share on other sites More sharing options...
jpsilva Posted February 27, 2014 Report Share Posted February 27, 2014 Hi Manuel. Sorry foro posting on an old thread, but is it the source code still available?, or any Java source code examples? I was not able to find the "labs" section of your site, so I couldn't download any of it. I guess the guide is still not available, is it? Thanks in advance. JP Link to comment Share on other sites More sharing options...
manu Posted March 3, 2014 Report Share Posted March 3, 2014 Sorry the guide is not available but the Bugzilla integration code helps a lot to view how it works. Of course if you have any question just ask. Here you have the direct link for the plugin code: https://www.plasticscm.com/releases/labs/BugzillaProject.zip Link to comment Share on other sites More sharing options...
manu Posted March 3, 2014 Report Share Posted March 3, 2014 BTW, which issue tracking are you trying to support? regards! Link to comment Share on other sites More sharing options...
jpsilva Posted March 4, 2014 Report Share Posted March 4, 2014 Hi Manuel, Thanks for the link. I am not really trying to support an issue tracking system, but to figure out how to add some model-aware functionality to Plastic (yes, I know that is not its purpouse). Right now I'm trying to find a way in which to plug into it, and perform some queries, file contents queries mostly. Any help in that direction would also be very much appreciatted. Thanks again, JP Link to comment Share on other sites More sharing options...
psantosl Posted March 18, 2014 Report Share Posted March 18, 2014 Hey, If you need to query file contents, cm shell and cm cat are your friends. cm cat can cat several files in a single command, good for performance, which will be something you'll be looking for. Automating cm shell (or checkin the CmdRunner) is what you really need to get this finished. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.