Hi Mario,

In this case you are getting the ItemNotFoundException because the UUID you are 
using refers to the DMS workspace, not the imaging workspace. That isn't quite 
the right way to do it.

Normally, you let your user select an image from the DMS. You can use the "dam" 
control from the standard templating kit to do this. See the 
/generic/controls/tabImage dialog for an example.

You can configure which types of images (normally upload and/or dms) the user 
can use in your site definition using the node "damSupport" - not sure if this 
is still the way to do it in 4.5, it was in 4.4, see here for documentation: 
http://wiki.magnolia-cms.com/pages/viewpage.action?pageId=32080078 .

Then you configure your variations in your theme. See 
http://documentation.magnolia-cms.com/templates/stk/themes.html for 
documentation and the "pop" theme for examples.

You can then use the methods from the stkfn object like: stkfn.getAssetLink() 
to get a link for the STK variation. This will be served by the "stk" generator.
You can modify the "stk" generator if you need additional image-ops, but those 
will then affect all images.

You can use your own generator, but you will have to get by without the 
stkfn.getAssetLink() functions, and instead will have to build the URLs 
yourself.
This could look something like this (untested code, but should give you the 
idea):
[#assign imgNode=cmsfn.contentByIdentifier("dms",uuid) /]
[#assign imgUrl=$contextPath + "/.imaging/operationChain/dms" + imgNode.path /]

Note that if you only need to insert some special image-operations for certain 
variations, then I would recommend using the "stk" generator, and configuring 
your variations to use the class 
"info.magnolia.module.extendedtemplatingkit.imaging.generation.ImageOperationProvidingVariation".
 Then you can configure an image-operation-chain right in the variation itself 
(beginning with a load operation, as always!).

I hope that helps you along...

Regards from Vienna,

Richard

 






-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[email protected]] 
Im Auftrag von Mario Martínez Campos (via Magnolia Forums)
Gesendet: Dienstag, 23. Oktober 2012 13:24
An: Magnolia User List
Betreff: [magnolia-user] Re: Help with Imaging Module

I have another question about this.
I have a component wich dialog has a uuidLink control for the user select an 
image. I want to resize this image before render it, so I have configured the 
imaging module. I am able to get the resized image putting the correct url into 
the web browser. But now, I need to do this from the uuid that the user 
provides. I have something like this:

[code]public String getURL(String uuid){
                String url="";
                try {
                        url = LinkUtil.createAbsoluteLink("imaging", uuid);
                        
                } catch (RepositoryException e) {
                        e.printStackTrace();
                        return "";
                }
                
                
                return url;
        }[/code]

but doesn't work, I get an ItemNotFound Exception due to "imaging" is not 
recognized. What is the correct way to do this??

Thanks!

-- 
Context is everything: 
http://forum.magnolia-cms.com/forum/thread.html?threadId=a3ea9cac-e89d-403a-b016-efff7c12b60a


----------------------------------------------------------------
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: <[email protected]>
----------------------------------------------------------------





----------------------------------------------------------------
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: <[email protected]>
----------------------------------------------------------------

Reply via email to