EES - acquiring locks and linking to 'edit file' interface

I've been using the Easy Edit Suite and must say I am quite impressed. There are two issues I have run into however:


Firstly, I am a bit of a novice to Matrix so this one should hopefully be simple to answer. I notice in the documentation for EES that there are screens for editing files, editing images, etc. I only seem to be able to craft a link that will allow me to edit a page (by appending /_edit to the URL). Can you provide me with an example link for accessing the EES simple edit interface for editing a document and also an image?



Secondly, we have a large asset tree powering our website (thousands of pages and PDFs linked together in a polyhierarchy) and EES simply takes too long to acquire locks in certain situations. If I access the simple edit interface (/_edit) of a top-level page (which has many children assets) and press the 'Edit' button that takes me into EES, Firebug shows the JS API request for acquireLocks() taking an excessively long time (ranging from 16 seconds to 56 seconds depending on the page). This is for a single acquireLocks() request (there are actually two - one for attributes and one for links), so as you can imagine EES either takes a minute to load or it throws up the timeout error page. Pages with no children load quickly however.



By going into Active Locks under System Configuration, it quickly becomes apparent that the JS API is acquiring locks for the page asset, every child asset, every child's child asset, etc. Basically it is attempting to acquire thousands of locks when I imagine it should only be locking the current page.



Anyway, I managed to fix this locally by manually editing the EES easyedit.min.js and simply changing (hacking) the 'dependants_only' parameter of the JS API aquireLocks() call to true instead of false. Although everything seems to work, I don't know if this will cause any repercussions and wanted to point it out in case you had not been aware of the issue (maybe testing against a site with a smaller asset tree).



Thanks for all your hard work and for taking the effort to backport EES to Matrix. Look forward to the next release.

[quote]
I've been using the Easy Edit Suite and must say I am quite impressed. There are two issues I have run into however:



Firstly, I am a bit of a novice to Matrix so this one should hopefully be simple to answer. I notice in the documentation for EES that there are screens for editing files, editing images, etc. I only seem to be able to craft a link that will allow me to edit a page (by appending /_edit to the URL). Can you provide me with an example link for accessing the EES simple edit interface for editing a document and also an image?

[/quote]



You can access live file assets by using the asset id to reference them in the url. Eg, if your asset id was 123 the url you would use to edit would be:

    http://www.example.com/_edit?limbo_assetid=123

(this is the format used by the existing matrix simple edit interface)



Links to files in the preview screen automatically pick up this url, or alternatively there is an asset finder in development that will allow you to navigate to files more effectively.


[quote]

By going into Active Locks under System Configuration, it quickly becomes apparent that the JS API is acquiring locks for the page asset, every child asset, every child's child asset, etc. Basically it is attempting to acquire thousands of locks when I imagine it should only be locking the current page.

[/quote]



Quite right, this is something that slipped through our net and the function was using an incorrect default value. A fix has been committed for the next release.

Great, thanks - works nicely. We also did a bit of digging and found out how to link to a particular screen within EES, so I will leave a note here for other readers:

    
    'http://www.example.com/_edit?limbo_assetid=123'                   # "Preview" screen
    'http://www.example.com/_edit?limbo_assetid=123&screen=details'    # "Edit: Details" screen
    'http://www.example.com/_edit?limbo_assetid=123&screen=attributes' # "Edit: Details" screen (again)
    'http://www.example.com/_edit?limbo_assetid=123&screen=metadata'   # "Edit: Metadata" screen
    'http://www.example.com/_edit?limbo_assetid=123&screen=workflow'   # "Edit: Workflow" screen
    'http://www.example.com/_edit?limbo_assetid=123&screen=linking'    # "Edit: Linking" screen
    'http://www.example.com/_edit?limbo_assetid=123&screen=urls'       # "Edit: URLs" screen
    ...

[quote]
'http://www.example.com/_edit?limbo_assetid=123&screen=attributes' # "Edit: Details" screen (again)

[/quote]



Just a side note on that, any screen name that isn't recognised by EES will show the details screen by default. Nice job on digging those up though :slight_smile: