Image widget wherein we should be able to drop an image from content finder along with click to upload from local machine : BIT URGENT | Community
Skip to main content
Level 9
May 29, 2016
Solved

Image widget wherein we should be able to drop an image from content finder along with click to upload from local machine : BIT URGENT

  • May 29, 2016
  • 8 replies
  • 2094 views

Hi All, 

I am making use of the below section in my dialog for the image to appear. However, if I upload the image from my local instance, I see entries in the crx below my component 

as 

1] /component/jcr:content/file : with some basic properties like created by and primary type.

2] /component/jcr:content/file/jcr:content : with properties as jcr:data, some fields w.r.t last modification, jcr:mimetype, jcr:primarytype, jcr:uuid.

3] If I want to show this image component on the page[in footer section], what property should I use in java file to read and display in my sightly.

Any thoughts/pointers/reference/snippet on this will be really helpful.

<image
                        jcr:primaryType="cq:Widget"
                        allowBlank="{Boolean}true"
                        allowUpload="{Boolean}true"
                        border="{Boolean}true"
                        ddGroups="[media]"
                        fieldLabel="Footer Image"
                        fileNameParameter="./fileName"
                        fileReferenceParameter="./fileReference"
                        height="200"
                        name="./file"
                        xtype="smartimage"/>

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by kautuk_sahni

Hi

[Exactly what you are looking for]

Please have a look at this community article:

Demo:- https://drive.google.com/file/d/0B4d6KmbLkAumWnUzVWNRcVpBT0U/view?pref=2&pli=1

Package:- https://drive.google.com/file/d/0B4d6KmbLkAumeFRNblpORExZUjQ/view?pref=2&pli=1

Link:- http://experience-aem.blogspot.in/2015/08/aem-61-touch-ui-fill-dialog-fields-with-default-values-on-image-drop.html

 

This is exactly what you are looking here. This component allows you to upload image from content finder and as well as from local file system.

Please confirm if you have any problem in this.

Thanks and Regards

Kautuk Sahni

8 replies

smacdonald2008
Level 10
May 29, 2016

A lot of the questions that you are asking can be addressed by reading and understanding the SIghtly logic in this article:

https://helpx.adobe.com/experience-manager/using/movie.html

This article talks about using assets in SIghtly. 

askdctmAuthor
Level 9
May 29, 2016

Hi Scott,

Thank you for your reply.

Went through the article, but the media file is fetched from DAM location. With the dialog structure which I am trying[mentioned above], not sure how do I read an external[i.e, uploaded from my local machine] image. Not getting it.

smacdonald2008
Level 10
May 29, 2016

Before you can use an AEM component dialog to select an image, you need to get the image from desktop to JCR . Once you do that, you can build a component dialog to select image. 

smacdonald2008
Level 10
May 29, 2016

A lot of the questions that you are asking can be addressed by reading and understanding the SIghtly logic in this article:

https://helpx.adobe.com/experience-manager/using/movie.html

This article talks about using assets in SIghtly. 

smacdonald2008
Level 10
May 29, 2016

It's like how we select the video in the artilce; same idea - except in your use case - you want to select an image, Then the image is displayed in a Sightly component. But as i stated - make sure you get the image into the JCR (DAM or another location) 

askdctmAuthor
Level 9
May 30, 2016

Hi Scott,

Also, in the article here, https://helpx.adobe.com/experience-manager/using/creating-logo.html servlet is used. Trying to make use of this, but no luck.

I was under the impression that we will be able to display images from DAM as well as the one present on the local computer machine.

kautuk_sahni
Community Manager
kautuk_sahniCommunity ManagerAccepted solution
Community Manager
May 30, 2016

Hi

[Exactly what you are looking for]

Please have a look at this community article:

Demo:- https://drive.google.com/file/d/0B4d6KmbLkAumWnUzVWNRcVpBT0U/view?pref=2&pli=1

Package:- https://drive.google.com/file/d/0B4d6KmbLkAumeFRNblpORExZUjQ/view?pref=2&pli=1

Link:- http://experience-aem.blogspot.in/2015/08/aem-61-touch-ui-fill-dialog-fields-with-default-values-on-image-drop.html

 

This is exactly what you are looking here. This component allows you to upload image from content finder and as well as from local file system.

Please confirm if you have any problem in this.

Thanks and Regards

Kautuk Sahni

Kautuk Sahni
kautuk_sahni
Community Manager
Community Manager
May 30, 2016

Reference:- /libs/granite/ui/components/foundation/form/fileupload

// For Uploading files from File system.

Kautuk Sahni