Extend local history to save more data on changes - eclipse

We are evaluating a project where eclipse should be extended in a way to enable more analysis on code changes. As these changes are already stored by eclipse in the local history, we don't want to save all data again in files on the system and are searching for a good way to efficiently build it on top.
More details:
Java files are changing multiple times in a lifecycle of a project. To build some statistics about developer habits, we want to store additional data as last time modified, username, some user input, and some more things. This data should be displayed in a compare view with annotations but should be a normal comparison view also.
We don't find any extension points or classes to extend, which could make this possible so we think asking here for help is maybe a try to find an answer/tip for our project.
Thanks to all in advance.

Related

Eclipse plugin saving metadata

I'm writing an Eclipse plugin and I need to save some properties files and binary files as metadata of the plugin. The idea is that when the user starts Eclipse next day he/she won't need to configure/type all again from scratch.
I'm good about writing and reading the files, but I'm not sure about the best location for them. It seems like the perfect location would be something like:
<WORKSPACE_HOME>/.metadata/.plugins/org.myplugin.name
But how do I get or assemble this path? So far I've got to assemble this path as shown below:
<WORKSPACE_HOME>: I could use ResourcesPlugin.getWorkspace().getRoot().getLocation().
.metadata/.plugins: Should I hard code this section? Could it change in the future?
org.myplugin.name: This is the easy one since it's my plugin name.
Is it possible to get that path without hard coding values?
Do I need to create the last directory (my plugin name)? (I guess I need to)
Ask org.eclipse.core.runtime.Platform for your Bundle's "private" state location. If you have a plug-in activator, you can get the Bundle from there. Otherwise, there's a different method on Platform to get the right instance based on the ID.
https://help.eclipse.org/oxygen/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/core/runtime/Platform.html#getStateLocation-org.osgi.framework.Bundle-

Hybrid version control & sync system?

Is anyone aware of a hybrid version control and synchronising system?
I'm currently a happy mercurial user, but my projects usually contain a mixture of files.
Most of these (code, documentation, ...) I want to be version-controlled. This is why I use mercurial.
However, on the rare occasion I have files that I would like to synchronise between my working copies, but not version control.
For example, I version control the code I write to do image processing. This code can produce a whole bunch of output images which I'd like to have synchronised so I don't have to remember to shuffle them around my various computers, but there's no point having these version controlled.
To clarify - I am aware of extension to mercurial such as bfiles and bigfiles, which are handy for my image example, but I was just wondering if anyone out there knows of alternative ways to handle this. I just want the one system that I can tell "version control all files except those ones, which should be synced but have no history".
cheers!
EDIT: I could do something like adding a hg marksync <filename> that added <filename> to a list of files to be synced, and then adding a hook to hg push/hg pull that would (say) run rsync (or whichever sync tool) in the background, but I wondered if there was a less hacky solution (I think bfiles/bigfiles do something along these lines anyway).
Version Control System (any) doesn't care about synchronization of
not versioned data
besides default pathes
If you want sync any files - use specially designed for this task tools: f.e. rsync
This code can produce a whole bunch of output images which I'd like to have synchronised
Is this DATA or part of your CODE?
If data: Keep out of your versioning system, just don't go there. If it is part of your code (like layout images) check it in. Those are the only ways which are the generally accepted.
A nice solution for the data would be syncing OR generating them. So you might add a step after deployment to a server: GenerateImages().
edit: In addition to the comment made by the thread starter:
If the images are data and you need to process them on a different system don't think about the version control for your code. It is unrelated. The steps which would make sense to me, in order of processing:
Start with updating your image code, check it in versioning. Then deploy (yes this is deployment) the updated code to the cruncher computer. Now code is done.
Then you have tasks which the number cruncher should handle. Like processing the images. So start that processing from either the cruncher itself (probably some queue happens there) or from a central dispatcher.
Then you have the results locally at the cruncher. Now something has to happen with that data, so that's also part of your software. Decide whether you want the cruncher to send them to some central storage, your workstation or another location. Let the software handle that. This is the most hard part as I read through your question. Many solutions are possible from just FTP/network transfers to specific storage solutions. Willing to help but need more info about the real issues, amounts, sizes etc. on these parts.
If the new updated version of the image processor makes the old generated images obsolete implement that also in your code, by for example attaching an attribute to the files generated, a seperate folder or another indication. That way you could request the cruncher after update to re-generate any obsolete files.

Best practices for deploying data to a custom folder

Sometimes when we issue an upgrade to our application we need to install some files to the application's Data folder. We want to make it possible for the users to move this folder to a place of their liking. But how to deal with this at install time?
I was thinking of deploying to the user's AppData folder and have the application somehow check there for new files at startup.
Any advice or references would be very welcome!
We use InnoSetup for a VB6 application if that matters for your answer.
Generally the best solution I've found is to allow the user to move the folder from within the application.
This allows the application to keep track of where its data is being kept (by adding a reference to it in a file or registry entry which it accesses at load time) and to access it seamlessly in the future.
Your update routines can then also access this information to determine where to place the update files.
Alternatively, make sure the folder name is as distinctive as possible and add a search routine to look for the directory in a number of sensible places at load time. Then write your manual specifying that the data folder can be moved to one of those locations ONLY.
Wouldn't the users just run an update or patch package? I'm not sure why they'd want or need to see such files. It's pretty rare for commercial software to offer users the options of where to store program settings and other internal-use files.
Give some thought to this before putting a lot of stuff into users' roaming profiles. You might want LocalAppData instead.

PowerBuilder IDE Customization for SCC

Our PowerBuilder application is fairly large and has many objects in several PBLs for organizing our code. We often have 10 or more datawindows on one window, and these datawindows may be spread across two or three PBLs. For version control, we use exclusive check-out to avoid merge conflicts.
The situation is that when you right-click on a datawindow object from the Window painter you get a context-menu with options like "Script" and "Properties" and "Modify Datawindow...". We'd like to add one for "Check-out..." to avoid having to hunt for the datawindow in several PBLs.
Any ideas on how to do this, or something similar, would be greatly appreciated.
I think the best you can do is to create a temporary library at the top of your library list, locate your datawindows by jumping to them via "Modify Datawindow...", then saving them into your temporary library, and finally using the tools in your source control system to locate them by name and lock them.
One other trick that I use is to uncheck the tick box in the source control options that clears down the .srd etc files, then using your operating system's find tools to search on file name for these (since Powerbuilder still doesn't support searching for objects by name...). Of course if you don't have many objects, and if your objects don't have many references, you could always use Powerbuilder's search... but who do you know in the that fortunate position?!!
I think you've hit on a problem that a lot of people run into, which runs right through a loophole in PB that lets you start editing a DataWindow without warning you to check it out. Unfortunately, to the best of my knowledge there is no way to hook into the context menu.
However, you can hook into toolbar items. If that was the way I wanted to go, and I had plenty of time to spare, I'd write an app that I would launch from the toolbar, and here's what it would do:
Find the PowerBuilder window with APIs
Find the current sheet in PB
Get the object name out of the title
Get the current application (registry or PB.INI, depending on the version of PB, and may involve getting the workspace first, then the current target)
Get the library list (PB.INI or target file)
Do a LibraryExport() on the object that's open
Find all DataWindow controls (this may involve looking at ancestors to determine control types)
Identify dataobjects for these controls (again, you may need to look at ancestors)
Use LibraryDirectory() to get a list of all objects in all PBLs
Find the dataobjects' PBLs
Throw up a window listing the dataobjects and their PBLs
OTOH, if I had PBL Peeper (and, yes, this is biased advice), I'd
Launch the "PBL Peeper (Browse current application)" icon on my desktop (OK, that's a lie; I'd already have PBL Peeper open and would just switch to the Browse page)
Ctrl-Q (for QuickFind) and start typing the name of the object (if you pause, it will find a partial match on what you've typed)
Hit [Enter] once to accept QuickFind's selection
Hit [Enter] again to expand the object
Find the DataWindow control in question and RMB on it
Select "Go to Default DataWindow"
If it doesn't show the library and name in the microhelp (it's been a long time since I've released a version, and I can't keep track of what's in the released version), find the Up toolbar item to go up to the PBL
I know this doesn't achieve a checkout, but it does "avoid having to hunt for the datawindow in several PBLs". And, you can probably achieve this faster than my first suggestion.
Good luck,
Terry
The way I do it is to right-click and choose Modify DataWindow. When the painter opens you can just read the PBL from the title of the painter. Then close the DataWindow painter so PB will let you check out the DataWindow. For the more general case of locating an arbitrary user object, use Terry's PBL Peeper method.
You could separate the organization of PBLs used for development from those used for deployment.
As long as the PBL names don't conflict between the two views into the source code. The PBG files registered in source control won't clobber each other.
The downside is that when new objects are added or deleted, you will need to update both locations.
I would create a datawindow only PBL with all the related objects and put them in the same target. When I worked with that sub-system or report i could then check out all the objects in the same library.

How to highlight the differences between two versions of a text in .NET web app?

I have been supporting a web application at work for our Call Center unit for about 2 years now. The app is written in ASP.NET 3.5 with SQL server 2005 database. I’ve been asked to expand the call detail section to allow agents to edit the current call note with the ability to revert back to its previous version. Now, that’s all cool but now the manager wants to be able to click on any particular note and see all edits with changes highlighted in yellow (and if something was deleted, he wants to SEE the deleted text crossed out). Actually, what I need is very similar to how Stackoverflow handles edits on their questions. I’ve been thinking about how to go about this and after doing research and Google-ing of course, I am still unsure which route to take. I am fairly new to .NET development. Any ideas on the best technique for highlighting the changes in UI? I am afraid I am going to have to store a copy of the entire note each time they make a change because the manager wants to be able to easily review notes and revert back to ANY version (not just the most recent one) before sending the monthly call report off to our VIP customers. Since this department OFTEN changes their mind on things, I want to make sure the new functionality is scalable and easy to maintain. Any ideas would be greatly appreciated. I am really just looking for someone to point me in the right direction; maybe there are some tools out there that can be useful, recommended keywords in Google lookup, etc.
This will be difficult do to.
You'll need a "text editor" control that can not only edit the text, but which can also tell you what changes were made.
You then need to store not only the final text string, but also the list of changes
You'll then need to be able to display the text plus changes, using strike-outs, and different colors for inserts vs. changes
You'll need to do this not only for the changes of a single user, but you'll need to store each users' changes in the database, and will need to be able to display all the changes, all at once.
Your manager should be really sure he needs this.
Some tools for doing the diff for you can be found at Any decent text diff/merge engine for .NET?.
This would entail storing every version like you say. This should allow you to implement it similarly to SO. I seem to recall reading or hearing Jeff mention it, but wasn't able to find it, likely in one of the SO podcasts.
Easiest would be to store the text for each revision, then when the user wants to see the diff use a diff tool to generate the highlighted text.
Here is some Javascript diff code:
http://ejohn.org/projects/javascript-diff-algorithm/
If all the computers have Word installed you may be able to use a Word control to accomplish this. TortoiseSVN has scripts in its program directory which can take two word documents and produce a document with changes highlighted. To see this create c:\aaa.doc and bbb.doc, then install TortoiseSVN and run:
wscript.exe "C:\program files\tortoisesvn\Diff-Scripts\diff-doc.js" c:\aaa.doc c:\bbb.doc //E:javascript
I think you should see http://en.wikipedia.org/wiki/Revision_control