I am planning to switch to aptana from dreamweaver , Zend Studio 6.1, eclipse... and i love aptana, u guys done a great job!
anyway, i use the upload_current_file_on_save.js script to sync. a copy to remote SFTP server whenever I save my file, and it worked very well for the past year.
However, when i decided to test on the AptanaPro and going to purchase the software, I found the upload_current_file_on_save.js has a conflict with direct SFTP save. When i have the upload_on_save activated, it pops up a warning box saying "The items you have selected don't share a common synchronication connection parent" when i try to save a direct SFTP edit (from File>SFTP>)
I am sure by adding 1-2 lines of codes in this js will stop the upload conflict for direct SFTP files, if someone can help me out
** direct SFTP edit: i mean if i directly edit a remote file using SFTP connection, and don't have a local copy/project
probably somewhere in here to tell not to trigger if its a direct SFTP edit?
- Code: Select all
if (commandId == "org.eclipse.ui.file.save")
{
sync.uploadCurrentEditor();
/* Replace above line if you'd like to limit it to just certain projects
var fileName = editors.activeEditor.uri;
if(fileName.match(/projectName/ig))
{
sync.uploadCurrentEditor();
}
*/
}
- Code: Select all
/*
* Currently an example script (disabled)> Copy as your own script, and modify
* the Listener command as shown below
*
* Menu: Synchronize > Upload Current File On Save Enabled
* Kudos: Ingo Muschenetz
* License: EPL 1.0
* Listener: commandService().addExecutionListener(this);
* DOM: http://localhost/com.aptana.ide.syncing
* DOM: http://download.eclipse.org/technology/dash/update/org.eclipse.eclipsemonkey.lang.javascript
*/
/**
* Returns a reference to the workspace command service
*/
function main() {
sync.uploadCurrentEditor();
}
function commandService()
{
var commandServiceClass = Packages.org.eclipse.ui.commands.ICommandService;
// same as doing ICommandService.class
var commandService = Packages.org.eclipse.ui.PlatformUI.getWorkbench().getAdapter(commandServiceClass);
return commandService;
}
/**
* Called before any/every command is executed, so we must filter on command ID
*/
function preExecute(commandId, event) {}
/* Add in all methods required by the interface, even if they are unused */
function postExecuteSuccess(commandId, returnValue) {
// if we see a save command
if (commandId == "org.eclipse.ui.file.save")
{
sync.uploadCurrentEditor();
/* Replace above line if you'd like to limit it to just certain projects
var fileName = editors.activeEditor.uri;
if(fileName.match(/projectName/ig))
{
sync.uploadCurrentEditor();
}
*/
}
}
function notHandled(commandId, exception) {}
function postExecuteFailure(commandId, exception) {}

