How to copy a document from one CM Repository to another CM Repository?

I am trying to build a UI Command that similiar to the standard "Delete" UICommand, but the only thing is before the document get deleted in the current repository (say Default  - it is a CM Repository with fsdb mode), it create a copy in another archive repository (say Default_Archieve - is is a it is a CM Repository with fsdb mode).
Here is some portion of my UICommand class (it is a modification of the standard "delete" UICommand)
Code Start----
import com.sapportals.wcm.command.CopyResourceCommand;
import com.sapportals.wcm.command.DeleteResourceCommand;
private IRenderingEvent execute(IResource res) throws WcmException {
          String dispname = res.getDisplayName(true);
//Here we copy the resource to another repository before the delete the resource in the current repository.
CopyResourceCommand copyCommand = new CopyResourceComman();
copyCommand.setResource(res);
System.err.println("ArchiveResource:execute:" + dispname + " is set to be copied.");     
String rid = res.getRID().toString();
System.err.println("ArchiveResource:execute:rid=" + rid);
String new_rid = rid.replaceAl("default","default_archive");
System.err.println("ArchiveResource:execute:new_rid=" + new_rid);
copyCommand.setTarget(newRID);
copyCommand.execute();
DeleteResourceCommand deleteCommand = new DeleteResourceCommand();
deleteCommand.setResource(res);
deleteCommand.execute();
if (deleteCommand.failed())
return new InfoEvent(StatusType.ERROR, deleteCommand.getMessage());
if (sendDeleteEvent())
     return new DeleteEvent(
     StatusType.OK,
     getBundleString("xmsg_DeleteSuccessful",dispname));
     else
     return new InfoEvent(
                    StatusType.OK,
                    getBundleString("xmsg_DeleteSuccessful", dispname));
Code End----
If I change the target uri to be copied to the location in the same repository (default), this command work fine, it is just when it is copied cross repository, this cod doesn't work.
Thanks fo advice.
Kent

Hi, Boris.
I try to do it with subfolder path as following:
Code----
String newRID ="/mbcokm_archive/" + resource.getDisplayName();
                         writeln(res, "newRID= " + newRID);
                         copyCommand.setTarget(newRID);
                         copyCommand.execute();
But still it does not take it.
If I change it to some location in the same repository, like the following:
Code----
String newRID ="/mbcokm/" + resource.getDisplayName();
                         writeln(res, "newRID= " + newRID);
                         copyCommand.setTarget(newRID);
                         copyCommand.execute();
So, I am pretty sure that something to do with the cross repostory copy.
I am trying to use the standard API to copy the resource, instead of using the com.sapportals.wcm.command.CopyResourceCommand.
Do you think you can do some testing on cross repository testing, and see how it will look for you.
Thanks a lot.
Kent

Similar Messages

  • How to copy a table from one text frame to another...

    Is there a way to copy a table from one text frame to another? I'm using JavaScript. The following will move a table from one text frame to another, but I need to copy.
    var srcFrame = document.textFrames.item("section-template");
    var dstFrame = document.textFrames.item("test");
    srcFrame.characters[0].move(LocationOptions.before, dstFrame.insertionPoints[0]);
    Thanks,
    Mike-

    Hi Bhupinder,
    According to your description, you want to copy a table with Primary keys from one database to another database.
    As per my understanding, I think the best method is use Transfer SQL Server Objects Task in SQL Server Integration Services. The Transfer SQL Server Objects task transfers one or more types of objects in a SQL Server database between instances of SQL Server.
    Server roles, roles, and users from the specified database can be copied, as well as the permissions for the transferred objects. Indexes, Triggers, Full-text indexes, Primary keys, Foreign keys can also be copied.
    To use the Transfer SQL Server Objects Task, we should create a SQL Server Integration Services Project in SQL Server Data Tools, then drag a Transfer SQL Server Objects Task to Control Flow pane. Specify SourceConnection, SourceDatabase, DestinationConnection
    and DestinationDatabase for the Connection, select the table in the ObjectsToCopy category, then change CopyPrimaryKeys to True and the other corresponding properties in the task.
    References:
    Transfer SQL Server Objects Task
    Transfer SQL Server Objects Task in SSIS 2008 R2 With Example
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to copy a tab from one tab group to another?

    In Tab groups view, drag and drop allows one to move one tab from one group to another. But how to copy a tab?

    Press '''CTRL''' while dragging to copy instead of moving.

  • How to copy function group from one SAP system to another

    dear all,
    our company will set up a sub-company currently,and the sub-company want to copy some programs from our SAP system.
    how to pack and copy function group?
    pls help me,tks!

    Hello  Snow zeng,
    Will the 2 systems be connected ? I.e Same land scape ?
    If they are non connected systems, check this Wiki by Marcin [How to copy Repository Objects between non-connected SAP systems|http://wiki.sdn.sap.com/wiki/display/ABAP/HowtocopyRepositoryObjectsbetweennon-connectedSAPsystems]
    Regards

  • How to Copy customizing data from one company code to another company code

    Hi
    Big Boss opened a new company, we need to implement SAP system for this new company. this new company has same business with our one old company. so, we may almost use old the company customizing data for this new company. anybody can tell me how to copy the customizing data.
    Regads
    Henry

    Hi, Paraschand G
    Thank your very good solution as BC Sets. I had general knowledge on Rollout and BC Sets now.
    How ever, I have a problem on creating my first BC Sets. Should I creat a BC Sets as my template via copy existing customizing data? I seen some existing BC Sets which arenot I want. We implemented big5 modules for some company codes. I want to copy one of them as my BC Sets template. I won't create it manually because I worried about I will miss some data if I select these data one by one. I cannot find out a Full-BC Sets template contains all customizing data. Could you please give me some guide. I cannot ensure my understanding of BC Sets. Please correct it if I have wrong idea.
    Regards
    Henry

  • How to copy an ORDImage from one DB instance to another instance

    Hello,
    I need to copy a table with ORDImage columns from one DB to a different DB in a global/distributed transaction. What is the best way to to this:
    Do I really need to do the "insert empty ORDImage, select for update, Load BLOB data into ORDImage Proxy, update" cycle for inserting the ORDImage in the target DB or is there a better way?
    Pete

    Hello,
    i want to copy my application in to another system…Are you talking about deploying a fully developed application (like in a client site) or copy your application into a different development instance?
    Regards,
    Arie.

  • Copying a page from one picture book into another

    Does anyone know how to copy a page from one picture book into another. I have made 2 books and would like to make a third consisting of pages from the first 2 but seem unable to do it without starting again, or at least starting from a duplicate of one and re doing all the missing pages.

    Garageclan
    Welcome to the Apple user to user assistance forums
    print each page you want to include in "book 3" to a PDF and use the send PDF to iPhoto option - this will give you the pages as images in iPhoto that you can them place into "book 3"
    See Old Toad's tutorial #19 for more details - http://web.mac.com/toad.hall/OldToadsTutorials/No._19.html - note that it is slightly different - you are only using the beginning part
    LN

  • How to copy a folder from one document library to another document library ?

    How to copy a folder from one document library to another document library by programmtically?
    Samarendra Swain
    Team Sharepoint
    www.manuhsolutions.com

    You can use the SPFolder.CopyTo method.
    public static void CopyFolder()
    SPFolder folder = null;
    using (SPSite site = new SPSite("http://basesmcdev2/sites/tester1"))
    using (SPWeb web = site.OpenWeb())
    folder = web.GetFolder("shared%20documents/newfolder");
    folder.CopyTo("tester4/newfolder");
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfolder.copyto.aspx
    certdev.com

  • HT204053 how do i move page and numbers documents from one icloud login to another?

    how do i move page and numbers documents from one icloud login to another?
    I had to change my email address whcih meant new apple login.
    I have a number of docs in iwork/pages and iwork/numbers.  How do I transfer them to my new login?

    There's a couple of ways but my tip backing up your documents in the cloud is as good as any.

  • How to copy OVD configuration from one machine to another?

    We have two machines with OVD servers on them. The configurations should be identical from one machine to the other. We suspect there is a problem with the configuration on one of them. We need to know how to copy OVD configuration from one machine to another.
    Can you tell us how to do that?

    well i have this in mind which may help you.
    You would need to have a public ip address to the machine you have consoled to and on internet.
    Download the tftp software from below link.
    http://tftpd32.jounin.net/
    This software does not only act as the tftp server but also you can select the interface of you ethernet card as tftp server ip address.
    For ex if you are connected to a console and have a wireless card which is connected to internet also you connect you eth lan card to the eth or fast eth of the router.
    you can select which ever interface you want to act as the tftp server.
    you will need to add ip addres for you lan card and also config the router port as same if needed.

  • How to copy List item from one list to another using SPD workflow using HTTP call web service

    Hi,
    How to copy List item from one list to another using SPD workflow using HTTP call web service.
    Both the Lists are in different Web applications.
    Regards, Shreyas R S

    Hi Shreyas,
    From your post, it seems that you are using SharePoint 2013 workflow platform in SPD.
    If that is the case, we can use Call HTTP web service action to get the item data, but we cannot use Call HTTP web service to create a new item in the list in another web application with these data.
    As my test, we would get Unauthorized error when using Call HTTP web service action to create a new item in a list in another web application.
    So I recommend to achieve this goal programmatically.
    More references:
    https://msdn.microsoft.com/en-us/library/office/jj164022.aspx
    https://msdn.microsoft.com/en-us/library/office/dn292552.aspx?f=255&MSPPError=-2147217396
    Thanks,
    Victoria
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • HOW TO COPY A FORM FROM ONE TO ANOTHER CLIENT

    HOW TO COPY A FORM FROM ONE TO ANOTHER CLIENT

    Hi Tina,
    To copy either a Script or a Smartform fron one client to another client i.e from reference client 000 to any client say 010  follow instructions as given below:
    Go to Tcode SE71->Give Form name MEDRUCK then go to Menu path Utilities->Copy From Client, give
    Form Name: MEDRUCK
    SOURCE:000 (it will be already there)
    Target Form: Zmedruck(here give ur form zname)
    Execute
    It will be copied into all languages.
    Then come back to SE71
    Give your form name Zmedruck
    Language:: de then goto change mode
    then menu path->utilities->convert original languge to En and enter you will get a message original language of form zmedruck converted from de to en,
    now  change language de to en in se71 main screen and then do what ever changes you want to do , this is how you can copy a script or smartform from one client to another client.
    If this answer is useful reward points any queries revert me back.

  • How do I copy an image from one Keynote presentation to another one?

    I have a previously saved presentation on Keynote in iCloud. I created it from my desktop at work. Some of the images I used for the presentation I want to use again in another presentation, onlh this time I am working off my laptop and don't have the same access to those images. Is it possible to copy/paste images from one Keynote presentation into another? I can't even seem to click on the image and save it.
    Any suggestions?

    Clicking and dragging does not work.
    Click on the image and Copy and Paste
    or
    Inspector > Metrics > File Info > click on the icon of the file and drag it to your desktop
    You can then drag that file back in wherever you want.
    Peter

  • How do i transfer data from one internal tabe to another.

    Hi All,
             How do i transfer data from one internal tabe to another.
             Can i do it ebven if he tables are different in structure.
    Please Advice.
    Thanks in advance.

    Hi Saket Tiwari,
    I hope the earlier post by kashyap is good enough an answer. anywas in addition to it let me give a detailed
    explanation of how you can populate an internal table.
    1) Append data line by line.
         Syntax :  APPEND [<wa> TO / INITIAL LINE TO] <itab>.
    this appends new line to internal table <itab>.
    2) Using COLLECT statement.
                 COLLECT is another form of statement used for populating the internal tables.  Generally COLLECT is used while inserting lines into an internal table with unique standard key. The syntax for COLLECT statement is as shown
         Syntax : COLLECT [<wa> INTO] <itab>.
    3) Using INSERT statement
         Syntax  INSERT [<wa> INTO / INITIAL LINE INTO] <itab> [index <idx>].
    INSERT statement adds a line/work area to the internal table. You can specify the position at which the new line is to be added by using the INDEX clause with the INSERT statement.
    Now coming to your request..
    To append part or all of an internal table
         Syntax
                  APPEND LINES OF <itab1> [FROM <n1>] [TO <n2>] TO <itab2>.
    *     Note:
    Without the FROM and TO options, this statement appends the entire table <itab1> to <itab2>.*
    b) To insert part or all of an internal table into another internal table
         Syntax
              INSERT LINES OF <itab1> [FROM <n1>] [TO <n2>]
              INTO <itab2> [INDEX <idx>].
    c) Using Move statement.
    To copy entire contents of one table into another in one execution
         Syntax MOVE  <itab1> To <itab2>.
                   OR
              <itab1> = <itab2>.
    but u hav to be careful because he contents of itab2 will eb overwritten on the execution of this statement.
    These copy the contents of ITAB1 to ITAB2. Incase of internal tables with header line we have to use [] inorder to distinguish from work area. So, to copy contents of internal tables with header line  the syntax becomes,
    ITAB1[] = ITAB2[].
    Coming to the letter part of your question, Yes, we can copy values between tables having different structures.
    for this we use    
                                MOVE-CORRESPONDING <itab1> TO <itab2>
        this executes the statement for their header lines. Searches for the sub-fields which occur both in itab1 and itab2 and then generates, for all relevant field pairs which correspond to the
            sub-fields ni , statements of the form MOVE itab1-ni TO itab2-ni. The other fields remain unchanged.
    I hope the information provided has been of your help.
    Reward if useful.
    Regards,
    Jose

  • How can i upload files from one ip address to another  ip address machine ?

    how can i upload files from one ip address to another ip address machine ?

    i need to copy files from one client m/c to server m/c like sftp
    please suggest solution on this

Maybe you are looking for

  • Why won't my computer recognize my Canon XHA1s via firewire anymore?

    My Windows 7 HP computer will not recognize my camera (XHA1s) anymore.  I used it two weeks ago to record and transfer the video, and everything went just fine.  I went to use the same exact setup two days ago and the computer will not recognize the

  • HDMI Issues with Samsung LED 3D TV

    Purchased a 3D LED TV from Best Buy at end of 2010 for nearly $2500.  The HDMI ports have now blown 2x, once in warranty, and now just out of warranty.  Appears to be a flaw with this TV.  Image qualtiy is/was excellent, and 3D not too bad.  Cars hav

  • Syntax error in Merge Query

    This is the first time i am using Merge Query and the query is ;MERGE saSalesStockRecevedSub AS T    USING @tableSRN AS S    ON (T.prodCode=S.prodCode AND T.packtypeID=S.packtypeID AND T.batchCode=S.batchCode and T.stockReceiveMainID=S.stockReceiveMa

  • Obtaining smooth transitions in iPhoto'09

    I am preparing a slideshow in iPhoto'09 and have put the images in sequence at the top of the 'play' window. I then adjusted the settings to give a slow dissolve on all slides. However whilst the majority of dissolves work smoothly several, four, jum

  • HP 6520 - Wireless All-in-One - System restarts automatically

    My HP 6520 will reboot/restart without user prompting on it's own.  Does so every hour or so, comes back on-line with no issues.  I can hear the printer cycling and giving audio tones, the screen on the printer goes blank and the rotating icon appear