cancel
Showing results for 
Search instead for 
Did you mean: 

Paste action does not work

sergi_l
Champ on-the-rise
Champ on-the-rise
Hi all!

I extended the /jsp/browse/browse.jsp page to show the properties of my custom model as grid columns when the user is watching the corresponding content type.
So, adding these rules to my web-client-config-custom.xml file:

   <config evaluator="node-type" condition="sos:folderTest">
         <navigation>
          <override from-view-id="/jsp/browse/browse.jsp" to-view-id="/jsp/extension/browse/browseTest.jsp" />
          <override from-outcome="browse" to-view-id="/jsp/extension/browse/browseTest.jsp" />
         </navigation>
   </config>   

When the user is watching a folderTest's node, the browseTest.jsp is shown instead of the normal browse.jsp. Everything's fine.

The problem is the "paste all" action!! It doesn't work. I have cut a document belonging to a custom type and it's correctly added to the clipboard. It can be correctly pasted to a normal folder but paste action doesn't work if I try to paste it to my custom folder.
Debugging the code I think the problem is the navigation rule!

17:25:27,156 DEBUG [org.alfresco.web.bean.clipboard.ClipboardBean] Clipboard destination View Id: /jsp/extension/browse/browseTest.jsp
17:25:27,156 DEBUG [org.alfresco.web.bean.clipboard.ClipboardBean] Clipboard Item: workspace://SpacesStore/e928c800-5eba-4f18-a6af-d355700b9a8f not suitable for Move paste to current View Id.

   private boolean performClipboardOperation(ClipboardItem item, int action)
      throws Throwable
   {
      boolean success = false;
     
      FacesContext fc = FacesContext.getCurrentInstance();
     
      // test the current JSF view to see if the clipboard item can paste to it
      if (logger.isDebugEnabled())
         logger.debug("Clipboard destination View Id: " + fc.getViewRoot().getViewId());
      if (item.getMode() == ClipboardStatus.CUT)
      {
        if (item.canMoveToViewId(fc.getViewRoot().getViewId()) == true)
         {
            success = item.paste(fc, fc.getViewRoot().getViewId(), action);
         }
         else
         {
            // we cannot support this view as a Move paste location
            if (logger.isDebugEnabled())
               logger.debug("Clipboard Item: " + item.getNodeRef() + " not suitable for Move paste to current View Id.");
         }
      }

And no error is shown! The document remains in the original folder and no action is taken.

How can I fix it?? How can I allow the paste action to my custom JSPs???
I just wanted to add some columns to the grid when the user views some content types. I thought all the actions would continue working!

Thanks!
Sergi
6 REPLIES 6

sergi_l
Champ on-the-rise
Champ on-the-rise
Anyone?
Please folks! I need help!

Sergi

kevinr
Star Contributor
Star Contributor
Yes you could consider that as a bug, as you can extend (override) the browse.jsp but the paste code has effectively hardcoded the list of pages that support the PasteAll action - it should be added to the config. Feel free to raise it.

Cheers,

Kev

shmoula
Champ in-the-making
Champ in-the-making
Are you joking that this bug is already there after more than two years? 😮

mikeh
Star Contributor
Star Contributor
Are you joking that this bug is already there after more than two years? 😮
Are you joking that nobody raised the issue in JIRA so therefore it's very unlikely to get prioritised 😮

:wink:

shmoula
Champ in-the-making
Champ in-the-making
I just did 😉
https://issues.alfresco.com/jira/browse/ALF-10644

but two years… there are more things like this - well, i'm going to raise them all!

mikeh
Star Contributor
Star Contributor
I just did 😉
https://issues.alfresco.com/jira/browse/ALF-10644

but two years… there are more things like this - well, i'm going to raise them all!
That's good news - that's exactly what JIRA is for!

Thanks,
Mike