- This topic is empty.
- AuthorPosts
-
- 09/12/2011 at 1:35 am #4218
AnonymousParticipantHi. 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
- 09/12/2011 at 1:35 am #6548
AnonymousParticipant, 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?
- 09/12/2011 at 1:39 am #6486
AnonymousParticipantHi 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.
- 09/12/2011 at 1:50 am #6487
AnonymousParticipantHi 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).
- 09/12/2011 at 1:52 am #6488
AnonymousParticipantHi 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.
- 09/12/2011 at 7:49 am #4960
AnonymousParticipantHi 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
– 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.
- 09/12/2011 at 8:10 am #6544
AnonymousParticipantHello . 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.
- 09/12/2011 at 8:20 am #6545
AnonymousParticipantCreate 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.
- 09/12/2011 at 8:40 am #6546
AnonymousParticipantWhere I can download this samples ? Can you please send me a link?
-
09/12/2011 at 9:09 am #6489
AnonymousParticipant,
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;
}
}
- 09/12/2011 at 9:45 am #6547
AnonymousParticipantWe 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.
- 09/12/2011 at 10:11 am #4959
AnonymousParticipantHi 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.
Set the qListView to allow multiple selection and allows checkbox to be displayed next to the row displayed in the view.
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.
- 09/13/2011 at 7:25 am #6539
AnonymousParticipantThe 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.
- 09/13/2011 at 8:58 am #6540
AnonymousParticipantThanks, 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?
- 09/13/2011 at 9:09 am #6541
AnonymousParticipantDid 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.
- 09/13/2011 at 9:51 am #6542
AnonymousParticipantThanks for all your suggestions, I got it working.
- 09/13/2011 at 9:59 am #6543
AnonymousParticipantI'm glad to hear that.
Thanks for marking the question as answered.
-
- AuthorPosts
You must be logged in to reply to this topic.