How to Delete Current Version and Its History

Hi Gurus.
I need help on such a case;
Let's assume that;
I have enabled versioning on a folder.
I have uploaded a document as the first version.
Then I uploaded a new version of this document as second version.
At this moment i noticed that "oopss i uploaded wrong document, so i need delete it!!!"
There is the problem. I need to delete current version of the document and also from the versionin history so I can't duplicate the first version of the document as current, becuase it's an error by me.
As final case I need to have;
1st version as current version,
There is no 2nd verison...
If I upload a new version after a while, it will be the 2nd version of the document; not the 3rd one so there will be no loss at versioning number....
How can I realize it by using standard properties of KM or by code or by using a custom property like "my version"??
Thank you for ur responses....

Hi,
some tips about versioning in EP Java:
if (res.isVersioned()) {
          // get versions...
          IVersionHistory versions = res.getVersionHistory();
          if (versions != null) {
            for (int i = 0, size = versions.size(); i < size; i++) {
IResource ver = versions.get(i);
// now try to delete the version - haven't tried yet...
if(ver.isrevision)
  ver.delete();
hope this helps a bit,
Romano

Similar Messages

  • Help me Friends - How to Delete a Folder and its contents in java

    Hi Friends
    I want to delete a folder and its contents by passing the folderpath.
    Can any one help me in this..
    Thanks in Advance
    Regards
    Krishna

    * Delete a directory including all of its content.
    * @param directory Directory path to delete.
    public static void deleteDirectory(String directory) {
    if (directory != null) {
    File file = new File(directory);
    if (file.exists() && file.isDirectory()) {
    //1. delete content of directory:
    File[] files = file.listFiles();
    int count = files.length;
    for (int i = 0; i < count; i++) { //for each file:
    File f = files;
    if (f.isFile()) {
    f.delete();
    } else if (f.isDirectory()) {
    deleteDirectory(f.getAbsolutePath());
    }//next file
    file.delete(); //finally delete (empty) input directory
    }//else: input directory does not exist or is not a directory
    }//else: no input value
    }//deleteDirectory()

  • IS-Auto Warranty - How to delete a version and check the warranty result.

    I need to implement warranty for an OEM. The scenario is that dealers of the OEM should place warranty claims on the web and it should get automatically validated. The requirement is of post-crediting. I want to use vehicle VIN number (Object type VELO) as object for warranty claim. I have created VIN number, subsequently created equipment for this VIN using standard actions, assigned master warranty and measuring point to the VIN.
    Now while trying to create warranty claim, I'm facing problem and need few clarifications,
    a) Should I maintain the usage of the vehicle in Kilomenters under version specific measuring details or at object level? I need to check warranty of the vehicle.
    b) After recording measurement document at object level, I run the action 'S003', but nothing happended. how can I check the status of warranty now? System should update the warranty status automatically but it is not happening. Please guide.
    c) How can we set the system so that warranty is checked automatically as soon as the claimant enters the warranty claim. Currently, I have to manually run the action S003.
    d) After copying the 'version from claimant' to 'verison to reimburser', If we notice some mistake, can the second verison be deleted? How can we handle this situation?
    e) If the dealer wants to mention the part price and the applicable tax in the warranty claim document, where can he enter the tax code/ tax percentage?
    Please reply.
    Regards
    Pulak

    Open Launchpad, press Option key and delete the program

  • I want to delete current autofill and clearing history doesn't work.

    I want to get rid of the autofills on my Yahoo mail accounts and Twitter as there have been mistakes made over the time I've had them and they ALL show up every time I type the first couple of letters in. I have cleared the history, deleted cookies, followed all of the guidelines suggested for clearing this out and I still get the autofills. I appreciate any help :)

    See [[Remembering passwords]]
    http://kb.mozillazine.org/Deleting_autocomplete_entries

  • How to delete old version of itunes and install the latest? When I update an error message pop-up.  "the feature you are trying to use is on a network resource that is unavailable".  Plese help!

    How to delete older version of itunes and installed the new version? When I try to install the new version (update) a message popup.  " The feature you are trying to use is on a network resourse that is unavailable".  Please can someone help? Thanks!

    Which particular .msi file is the message going on to say can't be found? (Several different msi files can be mentioned in this context: itunes.msi, bonjour.msi, AppleSoftwareUpdate.msi, etc.)

  • Any advice on how to switch to ICloud on my 3g IPhone?  I am supposed to install OS 5, but the dialogue box says that my 4.2.1 OS is the current version and does not give me the option of downloading OS5.  Apple says I have to be running 5 to switch.

    Any advice on how to switch to ICloud on my 3g IPhone?  I am supposed to install OS 5, but the dialogue box says that my 4.2.1 OS is the current version and does not give me the option of downloading OS5.  Apple says I have to be running OS5 to switch.

    "iCloud requires iOS 5 on iPhone 3GS or later, iPod touch (3rd and 4th generation), iPad, or iPad 2; a Mac computer with OS X Lion
    From here >  http://www.apple.com/icloud/

  • I deleted a contact out of my iPhone 4S but when I go to send a message the contact appears although that individual is no longer in my address book. I deleted all text and call history pertaining to the deleted contact but still shows up.

    I deleted a contact out of my iPhone 4S but when I go to send a message the contact appears although that individual is no longer in my address book. I deleted all text and call history pertaining to the deleted contact but still shows up. Does anyone have the same issue and how do I fix it?

    dam122577 wrote:
    but wont restoring as new delete all my info on my phone
    Yes. That is why I added...
    it will disappear over time due to non-use.

  • How to get current version of safari. without having safari browser?

    how to get current version of safari. without having safari browser?

    I don't understand the question. Safari is a browser.
    Can you elaborate on what your are trying to do that initiated the question? People may be able to come up with some other option that gets you working the away you want.
    When you respond, please post the version of the Mac OS and the version of Safari you currently have. Otherwise, people are guessing and the quailty of help you get plummets.

  • How to Delete Messages in Spotlight Search History without Resetting or Syncing!!

    I know there are a lot of individuals dealing with this issue and if you are like me you spend hours searching "how to delete messages in spotlight search history" and it seems like every post either says to reset your phone or sync it! I'm sorry but I did not want to go through the hassle of resetting my phone but I did try to sync it which did nothing so I decided to just mess around with my settings and I believe to have found the answer to everyone's question!!
    This worked for me so I really hope this works for you! Just follow the steps below:
    1. Go to <settings><general><spotlight search><uncheck messages>
    2. Then turn your phone off and wait a minute! Turn your phone back on and off again 2 or 3 more times while waiting a minute in between turning it off!
    3. After you are done doing that go back to step 1 and <check messages>!
    4. Now go to your spotlight search and those messages should be deleted! If they are deleted I would recommend going back to step 1 and <uncheck messages> so you do not have the same problem with messages showing up again in the spotlight search!
    It works for Mail too! Just follow the same steps listed above but uncheck mail instead of messages or do both at the same time!!
    *Here is an extra tip which will remove deleted Mail Messages, just follow the steps below:
    1. Go to <settings><mail, contacts, calendars><your mail account> scroll down and click <advanced> Now click <remove> under the title Deleted Messages and you can choose to have your mail removed After One Day, After One Week, After One Month or Never.
    I hope this post was detailed enough and easy to understand!
    I really hope it works for you like it did for me!
    Good Luck!!!

    I tried this fix and it does not work.
    I have read that this is a problem for a long time - years. Me, personally, I do have emails and texts from the past that are private and were deleted, that I do not want my husband or daughter to read. Many people have this complaint and have had it a long time. Why does Apple not fix it?!?
    Another privacy issue is the iMessage default settings on new devices. We bought a new iPhone for my college-age daughter and received all of her text messages until we noticed it and told her. We did a temporary fix. Then I got a new iPhone and the same thing happened. I had to set up iCloud accts. for each of us so that we each have privacy that cannot be tampered with. We still share our original iTunes account. Why did that have to happen?!? 
    We have been Apple consumers (laptops, iPads, iPods, iPhones) for over ten years (? longer w/just desk top) w/ the same account. These breaches in privacy are upsetting!!  My point here is that these breaches are unacceptable!  The spotlight search issue appears to be unresolved.  FIX THIS APPLE! 

  • How to delete modified version datasource

    I have a datasource in M version and A version. I am getting datasource activation error in BI 7.0
    Please let me know how to delete Modified version.
    Thanks
    Liza

    I removed a field from LO datasource 2LIS_11_VAITM , activated, tested  successfully in R/3.
    I replicated the datasource successfully in BW. But when activate the data source I am getting short  dump ST22 ,the error message is  "  The ASSERT condition was violated".  I am BI 7.0.
    BW side in datasouece I found a not equal to sign ( which means M version is not equal to A version) and datasource is inactive.
    ST22 -
    Short text
        The ASSERT condition was violated.
    Error analysis
        The following checkpoint group was used: "No checkpoint group specified"
        If in the ASSERT statement the addition FIELDS was used, you can find
        the content of the first 8 specified fields in the following overview:
        " (not used) "
        " (not used) "
        " (not used) "
        " (not used) "
        " (not used) "
        " (not used) "
        " (not used) "
        " (not used) "
    Thanks
    Liza

  • Why i have to delete the Current word Text if i type wrong Previous word text in the sentence, my fingers are broad cannot accurately point the specific character, I am forced to delete current word text, its really making my mind to get rid of  iPhone4.

    Why i have to delete the Current word Text if i type wrong Previousword text in the sentence, my fingers are broad cannot accurately point thespecific character, I am forced to delete current word text, its really makingmy mind to get rid of  iPhone4.

    Hold your finger on the word for a little time - after a second or so, a magnifying view appears showing the few letters around your finger, with a cursor. Roll your finger to move the cursor to just in front of the letter you want to fix. Then let your finger go. You can now backspace to delete and replace the incorrect letter.

  • How to delete "Protect version" of TCC sw on ONS15454

    Hello,
    How to delete "Protect version" of TCC sw on ONS15454?
    Because just noticing "MEM-LOW" alarm to active TCC card.
    Btw, is there any concern if deleting prot. sw version ?
    Ricky

    Hi,
    According to the troublshooting guide:
    MEM-LOW
    Default Severity: Minor (MN), Non-Service-Affecting (NSA)
    SDH Logical Object: EQPT
    The Free Memory of Card Almost Gone alarm occurs when data generated by software operations is close to exceeding the memory capacity of the TCC2/TCC2P card. The alarm clears when additional memory becomes available. If additional memory is not made available and the memory capacity of the card is exceeded, CTC ceases to function.
    IMHO, it seems that you don't need to do anything.

  • I connect my iphone 4 to my itunes and when I press update to get the new iOS 7 software, it says "This version of iTunes (10.6.3) is the current version" and it tells me to press ok. Why is my phone not updating??

    My phone says it is connected to itunes and beside the update button it says "a newer version of iphone software is available (version 7.0)...." but when I press 'update' a box pops up that says ""This version of iTunes (10.6.3) is the current version" and then I press okay and nothing else happens. I'm getting frustrated. if anyone can explain to me why I can't update please tell me! Or else I'll have to call up Apple I guess.
    thanks!

    You have answered your own question:
    "requires 10.6.3 or higher"
    " i upgraded my itunes to 10.5 "
    You need itunes 10.6.3 or later.

  • How to display Current Year and Month in Drop Down list

    Hi Dear friends,
    I am devloping a report. It has got 2 pages--input and output(Report) page.
    IN input page, user will select Month and Year from drop down list as one of the input parameters. (seperate drop down list 4 month and year)
    Now, my problem is:
    HOw to display current month and year by default in the dropdown list...........
    I hope my question is clear.
    Please help.
    Regards,
    ASh

    NO da,
    it is not working.
    First i tired with for-loop. I initialized variable "i" to -2 (i=-2) I would get the year drop down list from 2003 but, by default 2003 would come.
    So, i posted the question.
    I tried your code. It is giving following error.
    A Servlet Exception Has Occurred
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occured between lines: 122 and 127 in the jsp file: /test/inpt.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:182: Invalid type expression.
    first.set(Calendar.YEAR, 2003)
    ^
    An error occured between lines: 127 and 131 in the jsp file: /test/inpt.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:186: Invalid declaration.
    out.write("\r\n \r\nYear : \r\n \r\n"); ^ An error occured between lines: 198 and 203 in the jsp file: /test/inpt.jsp Generated servlet error: C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:282: Invalid type expression. first1.set(Calendar.YEAR, 2003) ^ An error occured between lines: 203 and 207 in the jsp file: /test/inpt.jsp Generated servlet error: C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:286: Invalid declaration. out.write("\r\n \r\nYear :\r\n \r\n");
    ^
    4 errors
    Pls. Help.
    Regards,
    Ashu

  • How to view current  date and time on SAP screen

    Hi Everybody,
    How to view current  date and time on SAP screen .I have set time zone in T-code STZAC.now iam getting correct date n time in my tranctions but i want to check without any tractions
    Plz repay,Regards,
    Sadik.

    Hi,
    You can check the time by running a report .
    It will show the database and central instance time : Report name :rsdbtime
    Thanks and Regards
    Vijay kumar G
    Edited by: vijay kumar gopal on Mar 4, 2008 1:09 PM

Maybe you are looking for

  • Can I put an app i bought for my macbook pro onto my iphone without buying it again?

    I was just wondering if I bought an app for my Macbook Pro and I want to use it on my iPhone as well, is there a way to download it onto my iPhone without purchasing it again?

  • I want to copy my iphoto library from my iMac to my new Macbook Pro.

    I am having a lot of difficulty copying my existing iphoto library from our imac to our new macbook pro.  We have the two computers set up through Time Machine.  I tried using dropbox and though I was successful until I tried to click on the thumbnai

  • Controlling area & operating concern must have same fiscal year variant

    Dear Experts, Whether i can assign two controlling area with different fiscal year variant to one operating concern. Getting error 'Controlling area & operating concern must have same fiscal year variant' Fiscal year variant must be same or Number of

  • Kanban replenishment with WM

    I am using Kanban replenishment with strategy stock transfer from a WM managed storage location(strategy 0006).If I put the Kanban status to empty,I am able to generate Transfer requirement.I converted the TR to TO and confirmed the TO.I am able to m

  • Using n Changing

    Can any body tell me why do we use 'using'  and 'changing'. what is the use of them. for Eg in the code below : FORM help_input_file  USING    p_phys_file   TYPE c                                p_locl_file   TYPE c                       CHANGING p_s