It's all about the answers!

Ask a question

Auto-Lock in eclipse for office files

Stefan Hoffmann (14411820) | asked Oct 09 '15, 8:55 a.m.
edited Oct 10 '17, 11:43 a.m. by David Lafreniere (4.8k7)


I tried to get the auto-lock feature running, but wasn't successful.
Environment: Windows 7, RTC 6.0 default client (tried 32 and 64 bit versions), Office 2007.
I have configured a stream to auto-lock .pptx files, checked one in, reloaded the component and, tata, the file has set the read only flag.
But now when I double click, power point opens in eclipse as editor. The save button is integrated into the eclipse toolbar, so we have it really "embedded".

But now I can edit the file, save, and nothing happens. Only the "read-only" flag is removed from the file.

(btw, the news and noteworthy describing this feature shows a
.ppt extension)


Ralph Schoon commented Oct 09 '15, 10:31 a.m.

I don't use this feature at the moment (I should). All I can think of is the following:

If PowerPoint opens, it is still not an Eclipse editor. It is associated to the pptx file type in the preferences. So if PowerPoint opens, it opens outside of Eclipse. It should see the read only flag and if you try to save it would tell you that it is read only and you can only save as a new version. Basically that is what my PP does if a file is read only on the file system. In this case you would have to go back to make it writable, which would trigger the dialog in the description.

If PPT makes it writable without Eclipse noticing the change It would not come up with the dialog.

Stefan Hoffmann commented Oct 12 '15, 4:38 a.m.

Hi Ralph,

The powerpoint integration does something in eclipse, but not what I want.

If I open the file from the windows explorer (outside of eclipse), power point behaves as you mentioned, it asked for removing the write protection. But if I open the file from within eclipse, it doesn't, just removes the protection and saves.

And removing the "read-only" flag in eclipse (properties of the file) doesn't trigger anything, it just removes the flag without opening the lock dialog.

I've checked with a simple *.txt file, there everything behaves as wanted. It is opened in eclipse, and when I try to modify the lock dialog pops up.

Currently I would say the feature is useless. The interesting files for locks (as images, offices documents) are mostly handled with an external editor (opened in the context of eclipse), but it seems external editors don't work.

Accepted answer

permanent link
Ralph Schoon (63.1k33646) | answered Oct 12 '15, 6:05 a.m.
I just had the a bit time to try it out on RTC 6.0 Ifix3 and MSOffice 2012 or so.

  1. I created a stream and a component
  2. Added *.pptx to the auto lock files.
  3. I created a project on disk
  4. Added a pptx file (read/write)
  5. Shared the project
  6. The file was now read only

If I open the file with "Default editor" or "In Place Editor" the file appears in Eclipse.

  1. If I edit the file the dirty indicator shows
  2. If I hit the safe button or CTRL-S nothing happens
  3. If I close the editor a dialog pops up, if I want to save
  4. If I choose to save the file gets saved despite it is read only and no lock is applied

This is something to report, I think this should not be possible, weather this is a defect of RTC or a problem of Eclipse, I can't say.

If I open the file with "System editor" or set up an external editor the file is opened appears outside of Eclipse.

  1. I can open the file in Eclipse and, preferred, open it in the system editor
  2. The file is read only mode, this is recognized by PowerPoint - I can not change the file and I can't save it.
  3.  I have to lock the file in Eclipse and open it again, to edit it
  4. I can override the read only for the file and do changes

I don't think that Eclipse or RTC can do anything about the scenario 4.

David Lafreniere selected this answer as the correct answer

Your answer

Register or to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.