Loading...

qList View copy documents between Libraries

qList View copy documents between Libraries

Home Forums QuickApps Forum qList View copy documents between Libraries

  • This topic is empty.
Viewing 16 reply threads
  • Author
    Posts
    • #4218
      Anonymous
      Anonymous
      Participant

      Hi. I am new to Sharepoint Development. Can somebody help me with qList View Copy/move functionality? I have a requrements to show documents from other site library. Then I need to select documents and copy/move it to diferent library.

      Should I create custom action to impement it? any help will be appriecuated

    • #6548
      Anonymous
      Anonymous
      Participant

      , Thank you, will search for these samples. Does it have any instruction how to create and deploy it to? Do know if any video or step by step instructions available?

    • #6486
      Anonymous
      Anonymous
      Participant

      Hi Chen. Thank you for your suggestion, but I don't need select Documents or s how it in the grid.

      I would like to copy all documents from the Library without selecting this.

      After user click on "Move all" button I need to copy ALL documents from lib1 to lib2.

      Please let me know if you have any suggestions how to implement it.

    • #6487
      Anonymous
      Anonymous
      Participant

      Hi Linda

      According to your posted question "I have a requrements to show documents from other site library. Then I need to select documents and copy/move it to diferent library", my recommendation seems to be the best fit.

      If your requirement changed, I would take what has said and create custom action class and hook it up with Custom Action property (toolbar button).

    • #6488
      Anonymous
      Anonymous
      Participant

      Hi Linda,

         Please check the Custom Action help section in our documentation, it provides the information you need.

      If you still have problems please let me know and I can help you out.

    • #4960
      Anonymous
      Anonymous
      Participant

      Hi Linda,

         This is what you need to do to accomplish your goal:

      Thi sis my env:

      Site name: QWP doc lib name Lib

      Subsite name QWP1 (subsite of QWP) doc lib name QWP1

      – use qListview to display both doc libraries (you can aggregate them from different sites)

      Viewed List config

      <Lists>

        <List SiteUrl="./qwp1" ListName="Lib1" />

        <List SiteUrl="." ListName="Lib" />

      </Lists>

      Display fields:

      <Fields>

        <Field Name="Name" />

        <Field Name="Title" />

      </Fields>

      – select one document then click Copy/Move

      The following dialog shows up

      CopyMove.png

      – Then select the action and the destination.

      I hope this helps.

      If you find that this answers your question pelase mark it so.

      Any questions please let me know.

    • #6544
      Anonymous
      Anonymous
      Participant

      Hello . Thank you so much for your suggestion.

      Do you know how can I copy/ move documents without folder selection and pressing "Go" button

      Here is what I am trying to implement:

      For example:

      Site name: QWP doc lib name Lib1

      Subsite name QWP1 (subsite of QWP) doc lib name Lib2

      I need to move ALL documents from Lib1  to Lib2 ( always to specific folder)   by select Action–>Move all .

      Do I need to create Custom Action for this?

      Do you have any examples?

      Thank you for your help.

    • #6545
      Anonymous
      Anonymous
      Participant

      Create your custom action based on the sample we provide with the installer package (check the folder named Sample Code).Open the project, got to pleCustomActionEx class and write your code to move the docs then create a toolbar button to invoke your custom action.

    • #6546
      Anonymous
      Anonymous
      Participant

      Where I can download this samples ?  Can you please send me a link?

    • #6489
      Anonymous
      Anonymous
      Participant

      Thank you so much for your help, I am really appreciate it.

      I created a custom Action to copy documents from 1 library to other.

      I deploy the code and put it under bin folder, I can see my action is available and I can add from the list. However I am getting the error on webpart refresh:

      The following error occurs: Unable to retrieve the string from the resource list because the Resource List property is not defined.

      Here is my code:  ( I need to copy from library "Templates" to "Dest", this libraries are from different site collections).

      public ActionResult Perform(CustomActionContext context, CustomActionCancelEventArgs evt)

              {

                  ActionResult actionResult = new ActionResult();

                 SPWeb oWebsite=SPContext.Current.Web;

                  SPFolder oFolder=oWebsite.GetFolder("Templates");

                  SPFileCollection collFile=oFolder.Files;

                  //copy the files to list

                  List<SPFile> listfiles=new List<SPFile>(collFile.Count);

               

                  foreach (SPFile oFile in collFile)

                  {

                      listfiles.Add(oFile);

                  }

                  //copy the files

                  foreach(SPFile cfile in listfiles)

                  {

                     cfile.CopyTo("http://Name:8000/sites/MyTest/Dest/" + cfile.Name,true);

                   

                  }

                  return actionResult;

              }

          }   

    • #6547
      Anonymous
      Anonymous
      Participant

      We ship the sample code along with our product.

      Just go to the installation folder (C:\Program files\Quest Software\Quest web Parts for Share Point xx" then open the folder called "Sample Code".

      If you don't have access to the server please let me know your emsial and I send the package directly to you.

    • #4959
      Anonymous
      Anonymous
      Participant

      Hi Linda

      Based on your description, you may accomplish your requirement without involving coding for custom action classes. qListView allows you to select multiple documents in the view and a toolbar button associated with the built-in action Copy or Move should all you to copy them all or move them all to the target (you did mentioned that they always go to a specific folder).

      The following screen shot shows what I meant.

      test1.png

      Set the qListView to allow multiple selection and allows checkbox to be displayed next to the row displayed in the view.

      test2.png

      Define a custom action as Toolbar button, define the action type in the detail editor screen and choose Type to be either Copy or Move, then fill in the rest of the field, i.e. Target Site URL, Target Folder and etc.

    • #6539
      Anonymous
      Anonymous
      Participant

      The error message shows an error related to the localization.

      Please check the Localization tab on the ezEdit form and be sure that the settings are ok.

      If you localize resources please remove temporary the localization and try it again.

      Please let us know how it goes.

    • #6540
      Anonymous
      Anonymous
      Participant

      Thanks, it's going to my code now, but I got different issue..

      I am getting an error when trying copy from 1 library to other:

      here is my code

      SPSite siteCollection = new SPSite("http://test/sites/mysite/");
                

                  using (SPWeb oWebsite = siteCollection.OpenWeb())

                  {
                      SPFileCollection collFiles =
                          oWebsite.GetFolder("source").Files;

                      for (int intIndex = 0; intIndex < collFiles.Count; intIndex++)
                     
                      {
                          collFiles[intIndex].CopyTo("http://test/sites/mysite/main/dest/" + collFiles[intIndex].Name);
                     
                      }
                     
                     
                  }

      This line of code :

      collFiles[intIndex].CopyTo("http://test/sites/mysite/main/dest/" + collFiles[intIndex].Name); 

      collFiles[intIndex].Name returning the correct document name that i need to copy to dest library on http://test/sites/mysite/main

      error I am getting  

      System.ArgumentException was unhandled by user code
        Message=Value does not fall within the expected range.
        Source=Microsoft.SharePoint
        StackTrace:
             at Microsoft.SharePoint.SPWeb.GetWebRelativeUrlFromUrl(String strUrl, Boolean includeQueryString, Boolean canonicalizeUrl)
             at Microsoft.SharePoint.SPFile.MoveCopyInternal(String strNewUrl, Int32 grf, Boolean requireWebFilePermission)
             at Microsoft.SharePoint.SPFile.CopyTo(String strNewUrl)
              

      Can you please help me to resolve it?

    • #6541
      Anonymous
      Anonymous
      Participant

      Did you try to debug?

      Check the index value (intIndex) on each iteration within the for loop.

      PS

      In order to debug build the custom action in debug mode, place the assembly in the privae bin, then remove from GAC the assembly (if you've delpoyed there).

      An iisreset would be good before debugging.

    • #6542
      Anonymous
      Anonymous
      Participant

      Thanks for all your suggestions, I got it working.

    • #6543
      Anonymous
      Anonymous
      Participant

      I'm glad to hear that.

      Thanks for marking the question as answered.

Viewing 16 reply threads

You must be logged in to reply to this topic.