2 Replies Latest reply on Jun 13, 2013 11:57 PM by stemau

    Droptarget for multiple documents

    stemau Level 1

      I am trying to create a droptarget where an admininstrator could drag and drop documents from the content finder. These documents should later be shown in a list.

      The behaviur is exactly like the default download component but with the possibility of adding multiple versions of the same document (languages for example).

      This works perfectly fine with one document or if you shift-select a couple of documents, but when i add documents one after another new nodes are not created. The original node is overwritten with a new file reference.

      I would like it to work like in the parsys where an index is added to each new component (filter, filter_1, filter_2 etc).

       

      My drop target config looks like this (got some inspiration from the slideshow component where i found the use of $-sign in the property name):

       

      <?xml version="1.0" encoding="UTF-8"?>

      <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"

                xmlns:nt="http://www.jcp.org/jcr/nt/1.0"

                cq:actions="[_clear,insert]"

                jcr:primaryType="cq:EditConfig">

          <cq:dropTargets jcr:primaryType="nt:unstructured">

              <pdfdownload

                      jcr:primaryType="cq:DropTargetConfig"

                      accept="[.*]"

                      groups="[default]"

                      propertyName="./pdf$/filereference"/>

          </cq:dropTargets>

          <cq:listeners

                  jcr:primaryType="cq:EditListenersConfig"

                  afterinsert="REFRESH_PAGE"/>

      </jcr:root>

       

       

      Am i looking the wrong way? Should i use a parsys instead? Can i drop documents on the parsys from the content finder?

        • 1. Re: Droptarget for multiple documents
          sarwarbhuiyan Level 1

          I think the challenge you are facing is to use the existing image to handle multiple files being dropped on it. The way I see it, you have two choices:

           

          1. Develop your own smartfile widget which can handle this sort of thing

          2. Develop a component which has a built in parsys just for documents. Dragging and dropping a document is as simple as adding a document component there and dragging the file to that.  Or you could make it a custom parsys which can directly accept a file from the content finder and creates the doc components for you. (At the moment, if you hold down Alt and drag a file from Content Finder to parsys, it will autocreate a document component for you. Unfortunately, that functionality is built into the content finder tab. I think there might be a way to override it. If not, you can write your own content finder tab which creates your custom document component when Alt-Drag is used.

           

          Hope this gives you some ideas.


          Sarwar

          • 2. Re: Droptarget for multiple documents
            stemau Level 1

            Thanx

            did not know about the alt-drag trick. I will investigate this further.