Maybe my question wasn't very clear in the first place, but I solved it by 
adding the AppContext to the constructor.

[code]    public CropImageAction(MediaEditorActionDefinition definition, 
MediaEditorView view, @Named(MediaEditorEventBus.NAME) EventBus eventBus, 
EditHistoryTrackingProperty dataSource, AppContext appContext, SimpleTranslator 
i18n) {

...


        
        /**
         * Get path of asset from appContext
         * @return path of the asset
         */
        private String getAssetPath(AppContext appContext) {
                AppInstanceController controller  = 
(AppInstanceController)appContext;
        Location location = controller.getCurrentLocation();
        String assetPath = location.getParameter().replaceAll(":edit", "");
                return assetPath;
        } 
 [/code]

But I guess there must be a more direct and elegant way.

-- 
Context is everything: 
http://forum.magnolia-cms.com/forum/thread.html?threadId=39172c76-6f28-4a1c-8f02-0c38eb3f3c45


----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <user-list-unsubscr...@magnolia-cms.com>
----------------------------------------------------------------

Reply via email to