How do you add custom mediators to the eclipse palette when developing an API in WSO2 Developer Studio? - wso2-integration-studio

I am trying to customize the palette in eclipse to include items for custom mediators that I have written. I have tried digging through the tooling source, but am unable to find the location of these configurations.
Palette

Developer Studio is written on the Eclipse GMF framework. And, its properties view is implemented using the Eclipse EEF framework. If we want to add a mediator onto the palette, we have to add its configuration into the ecore model, and generate respective models and codebase, accordingly. Please refer this, for more details.

Related

Create a VS 2017 extension to add new code file

I hope someone can point me in the right direction. I have two separate piece of code that functions outside of Visual Studio.
The last step performed by the second piece of code currently creates a new c# source file. I would like to combine both pieces of code into a single VSIX extension.
Unfortunately I have never worked with VS Extensions and I am a bit lost. I have worked through various VSIX examples, but none of these create files.
Can anyone perhaps point me to a working example of how to add new source files to a project via an extension?
I have seen some examples, but they all refer to old Add-In style plugins and not VSIX.
Create a VS 2017 extension to add new code file
As we know the Visual Studio Extensions is:
Extensions are add-ons that allow you to customize and enhance your
experience in Visual Studio by adding new features or integrating
existing tools. An extension can range in all levels of complexity,
but its main purpose is to increase your productivity and cater to
your workflow.
So, the Visual Studio extension is service for Visual Studio IDE to customize and enhance your experience in Visual Studio, rather than serving a specific project.
What I suspect the Project and item templates should be helps.
Hope this helps.

Create a property page without admin rights to install a target

I'm developing a visual studio plugin (VS 2010 to 2017). I need project specific configuration.
Visual Studio already has GUI for project specific properties like compiler and linker options which can be opened by right-clicking the project and choosing properties.
How can I create auch a propery page without requiring admin rights to install a target?
A possible solution would be to deliver a target file inside the VSIX and to point VS to this file. Bu I don't know whether and how this is possible.
The new property page shall be shown on existing C/C++ projects. So creating my own project type is not an option.
I already found
https://www.codeproject.com/Articles/881782/Creating-custom-UI-property-pages-sheets-in-Visual
and
https://blogs.msdn.microsoft.com/vsproject/2009/06/18/platform-extensibility-part-2/
but it looks like I have to create (and store) a target to get VS to show the property page.
Update
A proposed solution are property sheets.
How can I inject targets or items (PropertyPageSchema) without modifying the vcxproj and without installing something globally (C:\Program Files (x86)\MSBuild). That means I want to define new settings without the user needing to install something additional to the vsix.
You could create a property page for your project type so that users can view and change properties in projects that are based on your template. And you also could set some default property values in your custom property page, which doesn't require admin rights.
Detailed steps about how to create property page for your project type, please refer to this document.
https://msdn.microsoft.com/en-us/library/cc826178(v=vs.140).aspx#Anchor_8
Update:
If you want to add your custom properties for C++ project, I suggest you add custom property sheet because as the document you mentioned that "The Visual C++ project system does not support project subtypes.".
Following document introduce detailed steps about how to create custom property sheet for C++ project.
https://www.codeproject.com/Articles/319827/Sharing-project-properties-in-Visual-Cplusplus

Refer custom alfresco content Content Model in maven project

I am using the alfresco repo archetype maven project (alfresco maven SDK 2.1.1) and have a custom alfresco content model defined. In my custom alfresco content model, I need to use/refer an aspect defined in another alfresco content model from a separate amp.
Can anyone please advise what is the correct methodology how achieving the above described?
Note
I can add the custom content model xml file to the maven project and bootstrap it but I am more after a cleaner method keeping in mind module dependency management when doing a release of my amps.
Any help much appreciated.
Regards,
Kavi
In order to have one AMP depend on another you have to use the all-in-one archetype. You can then add the AMPs your project depends on with an overlay, see How to use multiple alfresco AMP file in eclipse

Customizing newly created projects in Aptana

I need to define a model for newly created projects in Aptana.
Basically, I want, anytime, when I create a new project, it adds some defined directories/files (not existing files, but new ones) to this project.
I'm not even sure it's possible.
Aptana doesn't appear to support that.
Maybe you can just create a small external sript to do it for you? Not the ideal solution, but better then none.
This might be a longshot, but it is worth mentioning. Since Aptana is based on Eclipse, you might be able to see how Eclipse would handle custom project templates. It appears that the easiest way to go about this is to actually create an Eclipse plugin that has a Template Wizard. IBM has a nice guide on how to use PDE to create a Custom Template. I am not sure if you will be able use PDE from within Aptana (you might be able to), otherwise, you might need to download a stock version of Eclipse, create the Plugin, then install it in Aptana.
Aptana is based on eclipse, so you could use a combination of Maven Archetypes and the Maven eclipse plugin to achieve this really easily.
Download and install maven
Create a basic maven project using the quickstart archetype, Archetypes are project templates used to rubber stamp new project structures. The quickstart is a very basic project template
mvn archetype:generate
generate the eclipse project files using the eclipse plugin. This will create the standard
mvn eclipse:eclipse
tweak the pom until and re-run step 3 until you're satisfied with the layout etc. You'll no doubt have to add configuration the eclipse plugin to add the correct build spec and project nature. If you open an existing .project file it will contain the values you need. you can see here how to add them.
once the project is set up to your liking you can create your own archetype out of it and use this to rubber stamp new projects in the future.
mvn:archetype:create-from-project
now you can run the generate again and can select your archetype from the list. If its not there, you may need to run this first to update the list of archetypes
mvn archetype:crawl
Open Source your archetype for others to use ;)
It's very simple in Studio 3. Try the following: http://wiki.appcelerator.org/display/tis/Creating+a+new+template#Creatinganewtemplate-Creatinganewprojecttemplate
Basically you create a .zip file of the project content, and then write a few lines of Ruby code to reference it.
Aptana uses (as I'm sure you know) its own 'new rails' project that gives you a variety of options.
I don't think it's beyond Will (the RadRails maintainer) to add a simple text field to that Wizard that would allow you to enter a command-line option parameter. He's always been very responsive with my previous bug and feature requests.
If you want to give that a try, and that works, then I would HIGHLY and STRONGLY recommend that you look into one of the new Rails features 'templates' in which you could make a generic template, then call it through the new input box. We use templates at my current job and they save us about 4 hours of work on each project. They are very easy to use...def...definitely.
If you can't wait for the input box, then you could always write the template then call it from within the command line (see
http://m.onkey.org/2008/12/4/rails-templates
for info about templates)
Unless RadRails three is light-years ahead of the latest release, though, you'll be missing out on a lot of very handy advantages of using a more community-supported solution such as VIM or TextMate. (I switched to VIM from RadRails about 4 months ago and have never looked back).
Eclipse has a Plugin Development Environment. If I'm not mistaken, you can also create project templates with it. Please try: http://www.ibm.com/developerworks/library/os-eclipse-pde/

Adding NUnit to the options for ASP.NET MVC test framework

I have nUnit installed.
I have VS2008 Team Edition installed.
I have ASP.Net MVC Preview 4 (Codeplex) installed.
How do I make Visual Studio show me nUnit as a testing framework when creating a new MVC project? At this point I still only have the Microsoft Testing Framework as a choice.
Update: I installed nUnit 2.5, but still with no success. From what I've found Googling, it would seem I need to create templates for the test projects in order for them to be displayed in the "Create Unit Test Project". I would have thought that templates be readily available for nUnit, xUnit, MBUnit, et. al. Also, it looks like I need to created registry entries. Anybody have any additional information?
Update: I determined the answer to this through research and it's posted below.
After a bunch of research and experimentation, I've found the answer.
For the record, the current release of nUnit 2.5 Alpha does not seem to contain templates for test projects in Visual Studio 2008.
I followed the directions here which describe how to create your own project templates and then add appropriate registry entries that allow your templates to appear in the drop-down box in the Create Unit Test Project dialog box of an MVC project.
From a high level, what you have to do is:
Create a project
Export it as a template (which results in a single ZIP archive)
Copy it from the local user's template folder to the Visual Studio main template test folder
Execute devenv.exe /setup
Run regedit and create a few registry entries.
So much for the testing framework selection being easy! Although, to be fair MVC is not even beta yet.
After all that, I did get the framework of choice (NUnit) to show up in the drop down box. However, there was still a bit left to be desired:
Although the test project gets properly created, it did not automatically have a project reference to the main MVC project. When using Visual Studio Unit Test as the test project, it automatically does this.
I tried to open the ZIP file produced and edit the MyTemplate.vssettings file as well as the .csproj project file in order to correct the aforementioned issue as well as tweak the names of things so they'd appear more user friendly. This for some reason does not work. The ZIP file produced can not be updated via WinZip or Win-Rar -- each indicates the archive is corrupt. Each can extract the contents, though. So, I tried updating the extracted files and then recreating the ZIP file. Visual Studio did not like it.
So, I should probably read this as well which discusses making project templates for Visual Studio (also referenced in the blog post I linked to above.) I admit to being disappointed though; from all the talk about MVC playing well with other testing frameworks, etc, I thought that it'd be easier to register a 3rd party framework.
Man, they have VS 2008 project template listed in their release notes. I guess that doesn't mean they have it integrated with the dialog yet.
I use MbUnit with Gallio and everything worked like a charm. I had to install an Alpha of Gallio and MbUnit and when I read the above in the release notes, I figured they implemented it also.
Just keep a look out on nUnit's site for future alpha releases. I am sure they'll have it implemented soon. You could also implement the feature yourself and submit a patch. :-)
Although they do not have one bundled with the framework here is a link to post containing a download to automatically create the test project for "NUnit with moq" for you NUnit with Moq
(did not work right away on my computer, W7 Beta, make sure you use elevated permissions)
Do install Testdriven.net to integrate NUnit with Visual Studio. MbUnit and later versions of NUnit also contain project templates for unit tests.
You can use those project templates to create a test project and then reference to your ASP.NET MVC project and be able to test its code.

Resources