Eclipse Generic File Templates - sql

I've seen this question in various guises around the place, but as yet haven't found a suitable answer. If this is a duplicate, appologies (I'd be surprised if it wasn't a duplicate!)
Basically, I have a project which is using (mostly) shell code and sql. I want to make sure all the files have a similar setup, and that I document things consistently. To this end, I want to have template files / skeleton code within Eclipse.
It seems easy enough with Java, but not other file types. I have checked out ShellEd and it didn't appear to have this feature (correct me if I'm wrong).
It would be great to be able to add this as a new file type, such that I can say File -> New -> sh/sql and have the correct basic template with the right header etc.
Also, if possible I would like to be able to, one click, add a function prototype with the correct documentation to my files...
I thought this would be easy enough, but a few days of Googling and messing about, it seems I need to write a plugin of my own... but I can't beleive that it's not possible, more likely my Google skills aren't up to scratch...
any help?
cheers
Rob
P.S I'm normally a Vi (not Vim) user, but have had Eclipse forced upon me!

For SQL the Data Tools Platform Extender SDK (DTP) Eclipse project contains a SQL editor with templates (under Database Development in Install New Software).

Related

In phpStorm IDE add keymapping to tools Window + extended Live Templates source

1) I've started to use Jetbrains phpStorm IDE, but I can't figure out how to add the key mapping to the tools Windows, so that I can see it on the side-bar and look at it any time. Now I have to navigate to File->settings->keymap.
(Actually I've set Visual studio Key mapping but in reality it differs from it even for basic operations.)
2) I would also like attach an extended and "standard" kind of Live Template list, which is right the after implementation pretty slim.
Sublime text has pretty good .xml files for these (HTML, JQuery, JavaScript etc.) but I don't know if I can import/translate them somehow into phpStorm. I use Sublime quiet often (love it) and want to use it parallel with phpStorm. so it would be nice to have the same abbreviations in both.
To answer the second option is not so important, I can figure it out, but to solve the first question I've spent half a day ferreting around the web.

updating IDE old to new C++ Builder

I'm currently trying to compile an old program (made with C++ builder 2 or 3) with the "current" Embarcadero RAD Studio XE2.
So, I was wondering whether there is an easy way to use the old code, as Borland once claimed to be fully compatible to lower versions... however I couldn't find a "project-file", only source-code (.cpp, .h, .res, etc.).
I tried to "add to project" the main .cpp, however there seem to be some wrong include-paths... it also seem to use the OWL-package and includes its important source-files...
I'm a bit confused which type of main project I have to open first, since you need to open a new project before adding the source to it. As the running .exe has a GUI, I tried a Form-Window first, but it may be better to use a console or service as the real form is produced within the code as far as I understand.
So, after installing OWL and correcting the include-paths, do you think it should be running fine? Or is there something else to take care of?
If your old project was using OWL, you're probably well outside of the supported upgrade path.
That being said, valid C++ code should still compile and work and I've heard of people using OWL with recent versions of C++Builder. (via OWLNext)
Regarding your confusion as to which type of project to use, I believe a console application would be your best bet. A forms application is completely wrong, that will bring in the VCL and give you no end of problems trying to reconcile the different windowing systems. A service application is a completely different beast as well, and isn't meant for GUI applications. A console application should work, but you'll need more. The OWLNext project has a wiki that should help quite a bit.

Best way to fork/copy a VB.NET solution using VS2010

Is there a straightforward way to make a copy of a VB.NET solution and continue the project in another direction?
I'd think this is a common problem but haven't been able to find an easy solution. Copying the files and renaming seems messy to me.
Does the VS IDE provide anything like this?
Update: It's a small project on my home computer so I'm currently not using source control. I wasn't expecting to need to fork or anything. Is there a way I can do this without setting up git or similar?
IMHO this is an SCM (source control management) question, not an editor (VS IDE) question.
Why is copying and renaming messy? That's eventually what has to happen anyway. You don't mention which SCM you're using, but if it's SVN/Tortoise, if you rename the project file you'll get a dialog asking you if you want to rename other files similarly named. (e.g. the .filters files) That makes it go easier.
You might want to look at a source control package to accomplish this. git is an excellent option for this type of thing because of the ease of branching and merging--or more simply, saving a particular "state" of your solution and then continuing in another direction. There's also a nice Visual Studio integration option for git called Git Source Control Provider.

Best practice for a Sitecore project

I am rather new to Sitecore and would like to know a bit more about the regular approach to a new project. I'm therefore willing to listen and try out some of the experienced Sitecore developers solutions. I have alot of questions, i won't ask them all. I am just very curious to the approach other people have.
What would be the best approach to start a Sitecore project?
How would you set your project up?
What will be your approach looking at the recycling of code in future projects?
In short: What experiences do YOU have (if you have worked with or are working on Sitecore projects) and how would you recommend other people to work with Sitecore.
Right now we are busy on building Sitecore blocks that we can just recycle in other projects but i know for sure there are 1001 handy tips and tricks out there. I hope we have some Sitecore pro's # stackoverflow that could help a bit.
Here is some general setup info, based on how we do things.
Subversion
This is not Sitecore specific but we set up our repository like this
branches - This is used for working on big updates to the site that may take a while. Say for example I wanted to update how all of the sidebars on the site worked, and this was going to take a few weeks to complete. What we do is create a new branch, and set up another sitecore instance for this dev branch and do what we need to do. When it is complete we merge it back into the trunk for testing and deployment.
tags - This is used for keeping a copy of code that will never be merged back into the trunk (that is the difference between this and branches), so for example when we deploy an update to a site we can create a tag of said code so we can go back to it if necessary.
trunk - The active code, anything checked in here should always be deployable.
The Trunk
This is where we are actively developing/fixing bugs, depending on which part of the project that we are on. We set it up something like this (as an example the project is called TheProject)
We keep our solution file at the root of this folder, this will reference the various libraries in the src folder as well as the web project in the website folder.
docs - A place to put documentation about the site. I strongly suggest that as you complete features/sections you write up a little guide about any special knowledge needed for it to work. So say I am working on a featured content box on a landing page. This box will automatically pull some content unless it is explicitly overridden. What I do when I complete something like this is I write a guide for the customer, using a lot of screenshots. I send the guide to the customer as well as put it in the docs folder. This both helps the customer train their staff, as well as helps new developers come up to speed with how things are done.
lib - This is where we keep any DLLs we are going to need to reference in our projects.
test - A place to put unit tests.
src - This is where we keep our project specific library code. So in here we would have a folder called TheProject.Library, and in there would be the visual studio project for said
web/Website - This is where we have Sitecore installed and is the root of the site. In here we have a project called something along the lines of TheProject.Web. In the project we add all of the general stuff like the web.config/layouts folder and so on.
General Sitecore Code Library
One the best things you can do is from the start setup a general Sitecore library that can be added onto over time. Then when you write any code for a project that is not only applicable to the project, you can add it there. It may seem obvious, but this will really help in the long term. You will end up with much more solid code, see link text .
So when we are done with all this we have something like this as a solution/project structure
TheProject (The solution)
TheProject.Library
TheProject.Web
MyCompany.SitecoreLibrary (our general sitecore library)
Tools
This is another general thing, but I find it can really help speed up Sitecore development. If you find yourself doing something over and over in Sitecore, using API write a tool to do it for you. This not only helps with solving whatever problem you are tackling, but also helps to get you more familiar with the API.
Resharper
This is more of a general .NET development suggestion, use Resharper(http://www.jetbrains.com/resharper/index.html). I am sort of a a Resharper fan boy, it makes so many things with development easier and quicker. In my mind the biggest advantage though is how easy it makes refactoring code, which is really important to do over time to keep things clean and understandable.
I hope some of this helps.
Gabe
This is, as you said, quite a big question. Here are some of my thoughts:
Developing Environment
First of all when I start a new project I install Sitecore on my developing environment and I make sure everything works. Either during installation or after I place the databases on a separate SQL-server and change the connectionstring accordingly.
I open up Visual Studio and create a solution and include the files needed. I create some kind of HelloWorld rendering and try building the solution so that I can verify that everything is working as it should.
When everything is up and running I create a zip-file of the whole solution, including the data-folder. Now it is time to add this to some kind of version control system, in my case Subversion.
I add the zip-file to subversion and also add all files that I think will be changed during the project, usually I tell subversion to ignore the sitecore folder, this speeds up performance drastically when checking in files.
After I perform a commit-action the other team members of my project can check out the code and start developing (after unzipping the zip-file, off-course)
We all work towards the same database although this goes against Sitecore recommendations, we havent had any problems with this approach however items in GUI created/changed by one developer take some time before it is created/changed for all the others.
We could off-course develop several different projects using the same Sitecore installation but since almost all customers use different versions of Sitecore we have found this approach a bit cumbersome.
Often we set up an automated build-server but this is a whole other issue.
Reusable code and renderings
I would like to say that we create neat packages based on the same codebase that gets reused between projects but unfortunately we are not there yet. Today it is a lot of cut and pasting between solutions.
Uploading code to customer
This is done via sitecore packages, normally with some kind of dynamic selection for what files to include, say all ascx-files in a specific folder changed the last 5 days.
There you have it.
Take a look at this series.
Especially the component architecture part have increased our level of reusability.
When you create your Visual Studio's project in Sitecore's web root folder and you will keep all Sitecore's dlls files inside bin directory, don't forget to add to project's references all these files:
bin\ComponentArt.Web.UI.dll
bin\HtmlAgilityPack.dll
bin\ITHit.WebDAV.Server.dll
bin\Lucene.Net.dll
bin\Mvp.Xml.dll
bin\Newtonsoft.Json.dll
bin\RadEditor.Net2.dll
bin\Sitecore.Kernel.dll
bin\Sitecore.Logging.dll
bin\Sitecore.NVelocity.dll
bin\Sitecore.Zip.dll
Because when you CLEAN your project and you will have reference only Sitecore.Kernel.dll (in most of cases), you will lost most of dlls from bin directory!!

An alternative IDE for Sybase Powerbuilder

Does anyone know of an alternative IDE for Sybase Powerbuilder? It feels pretty clunky, after working with VS2008 and Eclipse.
If not, has anyone successfully worked with this language outside the IDE? I'm not against using a simple text editor, but I find edit-import-regenerate-test-export-edit is clunkier than simply using the Powerbuilder editor.
To date, the only tools I have had any success with are:
PowerGen, for builds (with NUnit and CruiseControl.NET)
ConTEXT, which has syntax highlighting for Powerbuilder
PBL Peeper, which has some interesting features not present in the IDE
EDIT: I added a bounty to draw some wider attention to the question. It would be a very nice thing to have, if it exists.
EDIT: Well that was disappointing. The bounty apparently did not cause even 1 new person to look at the question.
None that I'm aware of, although you could probably use a source control tool, edit in your source control repository, and Get Latest Version from the PB IDE to shorten your text editor cycle. Be warned that there are hacks required to edit anything over 128 ASCII. (My guess is that this is to allow everything Unicode to be source controlled in the most restrictive source control tools.)
As Paul said, PB12 is coming with based on the Visual Studio shell, and will include things like collapsible code blocks, Intellisense, etc.... However, for PB12, this will only be used for WPF targets and a few .NET-type targets (like assemblies), last I heard. Win32 targets will continue to use the "classic" IDE.
Good luck,
Terry.
P.S. Thanks for the PBL Peeper compliment.
The PowerBuilder IDE is clunky, but I don't think developing completely outside the PowerBuilder IDE is a good idea. I think there are just too many dependencies right now.
However, the IDE for PowerBuilder 12 will be built using Microsoft's Visual Studio Isolated Shell so it ought to be much better when that is released. Also, I believe they'll be doing away with the PBL format which ought to make source control much easier to work with.
Certainly something to watch.
What I do is right-click the object and edit source. Then I copy the text and paste it into Notepad++ to edit. I copy and paste back to PowerBuilder, then I can save and see any errors. I've got a fairly decent User Defined Language for PowerScript if anyone's interested.
Added:
Please be aware that I've seen the PB Source editor corrupt DataWindows. They were all large DataWindows. To be safe always export DataWindows to edit.
One tool that will most probably make your PB experience way better is Visual Expert, which provides a good source browser. Such a tool should have been integrated into the PB IDE a long time ago, IMHO. Only problem is that it's not free, as opposed to the other tools you mention.
Regarding using external source editors, you can probably take advantage of OrcaScript, which is a scripting language that lets you perform actions such as export and import of PB objects from outside of the IDE. It will require some effort, but you can setup a basic dev env using batch files with ORCA scripts and some additional external tools. However, this setup will lack any visual editing capabilities, which means no (feasible) GUI or DW work. If you're mostly into NVOs, it could work. But then if that's the case, why use PB in the first place?...
I too have heard PB12's use of VS will be limited to some .NET stuff, which will probably benefit only a very small portion of the PB programmers community. I'm afraid the rest of us are stuck with the awful IDE for years to come.
Other than exporting the source and editing it I don't know of another IDE for PB. One problem you may have is that the exported source contains a lot of syntax that is not documented in the manuals. The PB IDE generates this code but there is no support for creating it by hand. I think you are stuck with the PB IDE
In my modest five Years of experiences starting with Powerbuilder 5/6, now using PB 10, I tempt to :
build my own browser from the classdefinition object based on Powerbuilder
tried to use autohotkey in order to open datawindows comfortable (we have several thousands in the project and i am two-finger-driven)
truly investigated in the idea using an external editor/IDE suppoted by an autohotkey script which is undermined by sybase allowing only mouse-click-usage of PB
using Visual Expert which is neither a truly integration in the IDE, nor is really worth in analyzing datwindow/powerscript interaction
ending by build hopes on PB12 Visual Studio, which lacks - depending on compatibility issues - ...
... i came to the conclusion that there will be no chance in improving Powerbuilder to an state-of-the-art language
In my philosophy - I obtained during those years - I distinguish between two types of OOP-oriented languages:
the one that award using object-orientation like C#, Python, Ruby (C++) etc. and very much the Java-Eclipse/Netbeans-Universe does
the other one that punish using object-orientation like Powerbuilder and the old Visual Basic, for example (which is causative the OOP-Idea comes afterwards and is "plugged in").
Especially the demand that all object should always be compiled (regenerated) and that you could't work with ancestors and descandants concurrently makes it painful to use real OOP.
...In memory of the good old Unix(Solaris)/C++ days...
I was researching a replacement solution that would be similar to PowerBuilder and I came across two that caught my eye.
The first was 'React Studio' https://reactstudio.com/ which I found via Alternativeto.net .
And the second was from an ad at the top of some Google searches but it was similar enough and looked good enough at first glance for me to want to take a closer look at it, and it's called 'Servoy' https://servoy.com/ .
Still researching but I currently have React Studio at the top of our list.
The TextPad editor has a syntax definition file for PowerBuilder 6.x contributed by anr#aon.at that I downloaded for free and customized several years ago. It works fine for later versions (including 8), doing keyword color highlighting on PowerScript srx files. Editing large source files in PB could get it to crash so it's usually safer, faster and more convenient to export to srx file, edit outside the IDE then re-import.