Add new Content to a html/plain file

Hi Everybody,
how can is it possible to add new content (a new line) to a existing html/plain file? I have two methods, with the first one i can create a file but with the second one it is not possible to add new content to the just created file. What is my mistake?
Create a file (works!)
IResourceContext ctx1 = buildResourceContext();     
RID rid1 = RID.getRID("/SP");     
final IResourceFactory aResourceFactory = ResourceFactory.getInstance();
aCollection =(ICollection) aResourceFactory.getResource(rid1, ctx1);
String out = new String("<h3> Welcome </h3>");     
filedataStream = new ByteArrayInputStream( out.getBytes() );
fileContent =
     new Content(
       filedataStream,
       "text/html",
       filedataStream.available());
if (aCollection != null) {          
     fileResource = aCollection.createResource(
                   "NewFile.html",
                   null,
                   fileContent );
Add new Conent (doesn't work)
private void addNewContentToFile(){
IResourceFactory factory = ResourceFactory.getInstance();               
IResourceContext ctx = buildResourceContext();                         
RID rid = RID.getRID("/SP/NewFile.html" );
IResource resource = factory.getResource(rid,ctx);
String out = new String("<h3> my New Line </h3>");
ByteArrayInputStream data = new ByteArrayInputStream(out.getBytes());
IContent newContent = new Content(data, "html/plain", data.available());
resource.updateContent( newContent );
regards,
Seed
Edited by: seed_mopo on Oct 28, 2008 10:49 AM

Sorry, there was an exception (NoCheckOut...) --> Versioning = false.

Similar Messages

  • How can I add new content in iDVD to a DVD-RW disc which has ample remaining free space? After preparing the new video for burning and clicking on Burn to iDVD, I get a window saying the disc's already recorded and that I can either Erase or Eject.

    How can I add new content in iDVD to a DVD-RW disc with a video previously successfully recorded on it? (The disc has ample remaining free space.)
    After preparing the new video for burning and clicking in the File menu on Burn to iDVD, I get a window saying the disc's already recorded and that I can either Erase or Eject. My assumption has been that iDVD would automatically find the free space and continue with the new recording from there. I'd be grateful if anyone can shine light on this.

    There are, but not with a DVD written as a movie disk. It must be closed when completed, or it doesn't work.
    Apple's built in Burn utility also automatically closes any data CD, DVD or Blu-ray disk you burn. Doesn't matter how much space is unused, you can't use it. You'd have to use a more advanced disk creation app, such as Toast Titanium. I then have the option of choosing to write the data as a session:
    I can keep doing this until the disk is full. If I've written five sessions to the disk, when I put it in the drive, five CD/DVD icons will appear on the desktop since the OS will treat each session as if they are separate physical disks. At any point you choose Write Disk when writing a group of data, that means you're closing the disk, and again can't add anything after that. So if I had written two sessions, and the third was Write Disk, it's over. I can't put anything else on that disk.

  • Add new field in outgoing bank DME file

    Hi SAP FICO friends,
    I need your help in below issue resolution.
    After executed F110 transaction, DME file is generated for outgoing payment. Now client is requested for Add a new field (value date) in DME file. Please let me know how to add this new field in DME config?  Already I have checked DMEE transaction,  under the keyfield structure tab (4th tab), But I could not succeed to how proceed to add this field.
    Please let me know with complete details. Thanks,
    Raj

    What DME structure you are using?
    Go to DMEE
    Tree Type PAYM
    Enter your format tree.
    Go through in details, you will come to know where to add it and how to add it.

  • Cannot add new selectors or edit existing CSS file with my Mac

    I have just subscibed to Dreamweaver CC and I cannot add new selectors or edit the exisiting "main" css that comes with the tutorial. When asked to add selector a box appears but when I press enter/return twice it disappears. Also there is no option to edit existing properties. for example, to change a font color I pick color but there is no enter or "OK" option. I'm very puzzled and stuck.

    The trial version of Dreamweaver is fully functional. The only limitation is that it stops working after 30 days. If you're having problems with getting the software to work correctly, it might be a good idea to try posting a question in the Downloading, Installing, Setting Up forum, mentioning the fact that you've already posted here (otherwise, they might just transfer you back to this or one of the other Dreamweaver forums).
    If you can't make changes to files, it might have something to do with permissions or the user account that you've logged onto the computer with.
    When asking for help in the other forum, mention your operating system, and which version you're using. The problem might be related to your computer setup.

  • Error message when attempting to publish a new page or add new content

    Anyone know what this means...It's the error message I'm getting when attempting to publish..
    Can’t create the file “bar.gif.” The disk may be damaged or full, or you may not have sufficient access privileges.
    Help!

    Welcome to the Apple Discussions. Try the following:
    1 - close iWeb.
    2 - delete the iWeb preference file, com.apple.iWeb.plist, that resides in your User/Library/Preferences folder.
    3 - go to your User/Library/Caches/com.apple.iWeb folder and delete the contents.
    4 - reboot.
    5 - launch iWeb and try again.
    If that doesn't help continue:
    6 - move the domain file from your User/Library/Application Support/iWeb folder to the Desktop.
    7 - launch iWeb, create a new test site and save.
    8 - go to the your User/Library/Application Support/iWeb folder and delete the new domain file.
    9 - move your original domain file from the Desktop to the iWeb folder.
    10 - launch iWeb and try again.
    OT

  • First Generation IPad not syncing or able to add new content.

    I have a first generation Ipad that is not detected when plugged into my Imac.  I have tried to download movies and shows via wi-fi instead and it will not play them on the older Ipad because it says we don't have permission.  Please help.

    iTunes Store: Associating a device or computer to your Apple ID
    http://support.apple.com/kb/ht4627
    iTunes Store: About authorization and deauthorization
    http://support.apple.com/kb/ht1420
    iPad not appearing in iTunes
    http://www.apple.com/support/ipad/assistant/itunes/
    iOS: Device not recognized in iTunes for Mac OS X
    http://support.apple.com/kb/TS1591
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    iTunes for Windows: iTunes can’t contact the iPhone, iPad, or iPod software update server
    http://support.apple.com/kb/ts1814
    iTunes for Windows: Device Sync Tests
    http://support.apple.com/kb/HT4235
    IOS: Syncing with iTunes
    http://support.apple.com/kb/HT1386
    Apple - Support - iPad - Syncing
    http://www.apple.com/support/ipad/syncing/
    iTunes 10.5 and later: Troubleshooting iTunes Wi-Fi Syncing
    http://support.apple.com/kb/ts4062
    iOS: “Not enough free space” alert when trying to sync
    http://support.apple.com/kb/ts1503
    You may need to delete iTunes on your computer and then reinstall.
    How To Completely Uninstall and Remove All Traces of iTunes
    http://zardozz.com/zz/2008/04/how-to-completely-uninstall-and-remove-all-traces- of-itunes.html/
    Wi-Fi Sync Not Working? Here’s How to Fix it for All iOS Devices
    http://osxdaily.com/2013/02/17/wi-fi-sync-not-working-fix-ios/
     Cheers, Tom

  • Itunes will not add new material to my iPad and iPhone

    I have gotten a new imac and I am in the process of trying to reset up my ipad, and iphone. I cannot seem to add new content to either of these. I tell itunes to add certain pictures or music files, but it is not adding them onto either. I have had to restore factory setting to get the ipod up and running.

    Some people have reported exactly the same thing and the culprit appeared to be itunes Match. Some people wait for it to resolve itself >1day or othere switch off itunes match and re-import

  • Can I add Custom Content Type created programmatically to Custom List Definition?

    I have created Custom content type programmatically in the Feature Receiver. Followed by this have another feature which creates List Template. I want to add the custom content type to the list template.
    Using VS 2012, I added the custom content type to the list definition. The Schema.xml for the list definition looks as below:
    <ContentTypes>
    <ContentTypeRef ID="0x010100D7D9F4B1F4A9684BB44389571024B2EC00C393BB21B8AD7B41B62A87DF0501504D" />
    </ContentTypes>
    ID was automatically added by the VS tool.
    List Template is created, the new content Type is also added, but the Name is displayed as "Document" instead of the custom content type name. So I see two CTs with the name "Document".
    How can I achieve this? Any help is appreciated.

    Hi,
    Please add EnableContentTypes="TRUE" in the <List > tag.
    The following materials would be helpful:
    How to add custom content type to a custom list
    http://innersharepoint.blogspot.de/2009/10/how-to-add-custom-content-type-to.html
    SharePoint Custom List Definition with Content Type
    https://achrafsp.wordpress.com/2013/03/31/sharepoint-list-definition-with-content-type/
    Create a Custom SharePoint List Definition
    http://www.mssharepointtips.com/tip.asp?id=1188
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Ever since the last update I don't have my old bookmarks, can't add new ones and can't import my HTML file. How do I fix this?

    ever since the last firefox update I don't have my old bookmarks, can't add new ones and can't add my HTML file of my bookmarks

    A possible cause is a problem with the file places.sqlite that stores the bookmarks and the history.
    *http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox

  • Using the value "Image/*" for the accept attribute of the HTML input Element, how can I add .pdf to the array of preconfigured file types (.jpe, .jpg, .jpeg, .?

    On a form, using the value "image/*" for the accept attribute of the HTML input Element, how can I add .pdf to the array of pre-configured file types (.jpe, .jpg, .jpeg, .gif, .png, .bmp, .ico, .svg, .svgz, .tif, .tiff, .ai, .drw, .pct, .psp, .xcf, .psd, .raw)?
    Say I wanted to add .gif, .jfif or .ico. I find this array limited, how can I add types to image?
    <input type="file" name="file" accept="image/*" id="file" />
    mimeTypes.rdf does not seem to allow this.

    ''mimeTypes.rdf'' has nothing to do with web development. It's a file that stores your file handling preferences (e.g. if you want ZIP files automatically saved or opened).
    You can't change the file types of the pre-defined content specifiers (audio/*, video/*, image/*), but you can specify additional MIME types. To add PDF to your above example,
    <pre><nowiki><input type="file" name="file" accept="image/*,application/pdf" id="file" /></nowiki></pre>
    For details, see
    * [https://developer.mozilla.org/En/HTML/Element/Input developer.mozilla.org/En/HTML/Element/Input]

  • Viewing a pdf file with new and new content

    Hello folks,
    Assume that one creates a pdf and uses Preview or Reader to view it.
    Then adds something to the picture and opens the file again: new content, old filename.
    One would like to see one of the following schemes:
    a) Open would close the old window and present the new content in a new
    window.
    b) Open would keep the old window and create a new window for new content.
    What happens is:
    c) Open says: "I've already displayed a file with this name, I don't need to do a thing."
    Is there a way to force behaviour a) or b) ?
    Thanks,
    Miklos

    If the mountain does not come to Muhammad, then Muhammad goes to the mountain.
    On this basis I wrote a short perl script that increments a number, and constructs a new
    filename from the original filename and the incremented number.
    Then it copies the original file to the new name and runs Reader or Preview on the new file.
    Now I can see as many versions together as I like.
    Miklos

  • Updating content of index.html file of J2EE Engine

    Hi,
    I would like to update the content of index.html file, which is located under D:\usr\sap\NSP\JC01\j2ee\cluster\server0\apps\sap.com\com.sap.engine.docs.examples\servlet_jsp\_default\root\index.html.
    I have requirement to change the html file content with latest news and we want to access this latest news through http://host:port/index.html ( to avoid authentication to server). In this html file I will plase link to connect to portal.
    The problem is updated content of this html file is not displaying in the browser. It is taking from cache. How to avoid this cache problem.
    Thanks

    Hello,
    I think you wish to change your logon screen, this will not be done simply by changing the index.html
    Please check this link for more information:
    http://help.sap.com/saphelp_nw70/helpdata/EN/ff/c7de3fc6c6ec06e10000000a1550b0/frameset.htm
    Regards,
    Siddhesh
    Edited by: Siddhesh Ghag on May 21, 2008 1:54 PM

  • PerformancePoint Designer is not loading when clicking on "Add new item" from PerformancePoint Content List

    Hello,
    I am using Internet Explorer 9 to create a new item by launching Performance Point Dashboard Designer from browser. 
    When i click on "Add new item", an Iframe will open showing dashboard design redirect which keep loading for couple of minutes and the designer never opens. 
    Yes, there are working workarounds like opening these links in other tab or opening dashboard designer directly or by clicking on "Run Dashboard Designer"  from BI Center homepage. 
    However, Can someone please help me how to get designer opened when "Add new item" has been clicked from  PerformancePoint Content List from browser? 
    Thanks in advance.
    NKV Prasad Panthangi

    An Update :
    I found this is due to the browser limitation. 
    I have downgraded my Internet Explorer Browser to IE 8 and did the following changes in my browser settings. 
    Tools --> Internet Options --> Navigate to Security Tab --> Click on Custom Level Button --> Under Download --> Select "Enable" radio box for Automatic Prompting for File Downloads. 
    Sadly, I cannot ask users to downgrade their browser to IE 8 because MS already stopped support for this browser and there are no other solution for this except going by workarounds. 
    This clearly says why people are moving away from PerformancePoint Services in SharePoint. 
    Thanks
    NKV Prasad Panthangi

  • Applet. Is it new while browser opens html file?

    I want to know if applet is new every time. I have an applet in html. it works to write some strings so I use param to transfer new string content. do it takes time to download applet everytime while the new string transfer to html file? in fact, browser get asp file.
    by the way:
    I am confused about that I should deal string by applet in browser or in server? which on is the better? I use w_server and asp.
    Thank you for your attention.

    Your question is a little unclear. You may want to start here (below). It explains the basics of how an applet works and its lifecycle.
    http://download.oracle.com/javase/tutorial/deployment/applet/index.html

  • How to add new password policy to cn=config via LDIF file

    I am trying to add a new password policy called "Service Password Policy". I have the following LDIF file:
    dn: cn=Sservice Password Policy,cn=config
    changetype: add
    objectClass: top
    objectClass: passwordPolicy
    cn: Service Password Policy
    description: A password policy intended for proxy or service accounts.
    passwordMustChange: off
    passwordChange: off
    passwordMinAge: 0
    passwordInHistory: 0
    passwordExp: off
    passwordMaxAge: 2142720000
    passwordWarning: 0
    passwordExpireWithoutWarning: off
    passwordCheckSyntax: off
    passwordMinLength: 6
    passwordRootdnMayBypassModsChecks: off
    passwordStorageScheme: ssha
    passwordLockout: off
    passwordMaxFailure: 32700
    passwordUnlock: on
    I've tried various permutations of this command:
    dsconf import -h localhost -p 1389 /root/createServicePasswordPolicy.ldif "cn=Service Password Policy,cn=config"
    I get this error:
    "cn=config": suffix does not exist.
    The "import" operation failed on "localhost:1389".
    Thx for any help,
    CC

    Good it did not work or you would have overwritten all the data currently in cn=config. Anyway, "dsconf import" only works on regular backends. The cn=config tree is special a.
    You should use ldapmodify to add the contents to cn=config.
    $ ldapmodify -p 1389 -D cn=root -f a.ldif -a

Maybe you are looking for