upload_file_on_save and SFTP remote files

A forum to discuss professional features of Aptana Studio.

Moderator: Aptana Staff

upload_file_on_save and SFTP remote files

Postby andrey99 » Mon Nov 03, 2008 3:19 am

Hi

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) {}
andrey99
 
Posts: 3
Joined: Mon Nov 03, 2008 2:48 am

Postby mxia » Fri Nov 07, 2008 1:15 am

Hi Andrey,

Sorry for the late reply.

I'm not sure if modifying the script could fix the issue you're seeing. Instead, it is something we could fix on the Studio side where Sync.uploadCurrentEditor() will not pop up a warning if the current editor is already for a remote file, in which case there is no need to do an upload. Let me know if that's what you're looking for.
User avatar
mxia
 
Posts: 233
Joined: Mon Aug 11, 2008 10:21 pm

Postby andrey99 » Fri Nov 07, 2008 4:49 am

hi mxia, thx for your reply

yup, i think thats what i looking for, not to upload_on_save if the current editor is a remote file (SFTP,FTP...)

so how exactly to achive this? I will purchase the studio pro if this can be sloved, not only to get the SFTP function, but to have ONE IDE to handle all my projects, servers, locally and remotely, from HTML, PHP to Python coding... UTF8 and Chinese...

thx
andrey99
 
Posts: 3
Joined: Mon Nov 03, 2008 2:48 am

Postby mxia » Fri Nov 07, 2008 8:02 pm

Hi Andrey,

The request from our professional users will get higher priority when we are looking at the items to address for the next version/update, so I'd certainly encourage you to get the pro version and file a ticket on our ASAP system.

BTW, is this problem blocking your work? From my point of view, it appears to be more of an annoyance to see that warning message each time a remote file is saved when the script is enabled. Does it in fact prevent the file from being directly saved?
User avatar
mxia
 
Posts: 233
Joined: Mon Aug 11, 2008 10:21 pm

Postby andrey99 » Sun Nov 09, 2008 9:36 am

hi mxia

thanks for your reply, i will go for the pro license this week.

yup, it wont affect my work, just an annoying box pops up, things work as its expected

Thanks
andrey99
 
Posts: 3
Joined: Mon Nov 03, 2008 2:48 am

Re: upload_file_on_save and SFTP remote files

Postby chrisramakers » Fri Oct 09, 2009 2:16 pm

Has this issue actually been resolved? I'm experiencing the same issue and it's quite annoying since i work on remote files quite often.

Or is there an easy way to just disable the script?
chrisramakers
 
Posts: 3
Joined: Tue Jan 27, 2009 7:36 am


Return to Studio Professional