How to store data in KM from a JSP file

Hi
In our portal we have a JSP file with a text view where the user can add notes/things to remember etc. I need somewhere to store that information. I don't want to store it directly on the portalserver or the backendsystem. Is there a way to store the information of each user in KM from the jsp page? Is there a service/api I can use ?
Thanks
/Jakob

Hi
I used following code to upload file in km using wd java:
/*Get an object of current Portal user */ IWDClientUser wdClientUser =
WDClientUser.getCurrentUser(); com.sap.security.api.IUser sapUser = wdClientUser.getSAPUser();
/*create an ep5 user from the retrieved user
IUser ep5User =WPUMFactory.getUserFactory().getEP5User(sapUser);
ResourceContext context = new ResourceContext(ep5User);
/*Give the path to KM in the variable path */
RID rid = RID.getRID(path);
IResourceFactory factory =
ResourceFactory.getInstance();
ICollection folder = (ICollection) factory.getResource(rid,context);
Using the upload element we can upload the files to a location in the server drive
/*temperory location for writing */
String location = u201Cgive the location hereu201D;
String fileName = location+fileelement.getFilename();
file = new File(fileName);
/Create an output stream for writing to the temperory location/
FileOutputStream out = new FileOutputStream(file);
out.write(fileelement.getFiledata());
out.close();
/From the temporary location read the file using an input stream/
FileInputStream fin = new FileInputStream(fileName);
fin.read();
/*Using this input stream we can write to the repository
Content content = new Content(fileelement.getFiledata(),fileelement.get) */
Content content = new Content(fin,"byte", -1);
IResource newResource = folder.createResource(fileelement.getFilename(),null, content);

Similar Messages

  • How to store data in ipad from computer

    please explain me how to store data (music video & pictures) in  ipad from any personal computer...kindly explain me in simple steps...

    The iPad can only sync with one computer.  To do this you need to have iTunes installed on the computer and have it associated with your Apple ID.  you can then use iTunes to transfer music, movies and pictures from that computer, and that computer only.
    iOS: Syncing your data with iTunes
    http://support.apple.com/kb/ht1386
    If you need to get files from other computers, you would need a 3rd party App that can handle the formats you wish to transfer, and possibly transfer them either through iTunes file sharing or Wifi transfer depending on what the App supports.
    iOS: About File Sharing
    http://support.apple.com/kb/ht4094

  • How to store data in chinese from oracle and show it to jsp?

    hi, please help.
    i have design a jsp page for registeration of a website in chinese,
    but after the user have enter the chinses data throught the jsp~
    the jsp have shown some monster code~
    it can't show the valid date in chinese!!! how can i fix it????
    when i select data from SQL PLUS, monster code is showed. how to show the chinese data in the oracle.
    i am using tomcat 5.0 ~servlet 2.2 and oracle 9i for database~~
    thx thx thx~~~~~pls help me!!

    The how to at following url shows how to store, retrieve and display characters of different languages from Oracle database onto a JSP page.
    http://otn.oracle.com/sample_code/tech/java/codesnippet/jdbc/nls/Globalization.html
    HTH
    Chandar

  • How to import data into JTable from a text file?

    thanks in advance!

    My guess is you will have to read the data in from the file, parse it, populate some vectors or something and use those vectors to instantiate the JTable. You could use FileReader to read in the data:
    FileReader in = new BufferedReader(new FileReader(file));then use StringTokenizer to parse it.
    m

  • How to view data in Xcelsius from an external Excel file

    Hi Everyone,
    i wonder if you know How to view data in Xcelsius from external Excel file and not depend only on the emebded excel sheet.

    Hi,
    As per my understanding, excel has to be imported in Xcelsius to draw up the dashboard. Your aggregated data sits in the xlf file. Using an external excel file will not be possible (I guess).
    One of the ways to connect to an external excel, is the use XML Maps but then your data has to be in the form of XML which will be pulled into excel first and then needs to be brought in Xcelsius using Data Manager.
    You can explore XML Maps in xcelsius in SDN.
    Regards
    Nikhil

  • What is a cube? how we store data in that? how we fetch data from cube?

    Hi,
    What is a cube? how we store data in that? how we fetch data from cube?
    Regards.
    venkat

    >
    venkey B wrote:
    > Hi,
    >
    >
    > What is a cube? how we store data in that? how we fetch data from cube?
    >
    >
    > Regards.
    >
    > venkat
    Hi Venkat,
    I guess you mean an infocube from the SAP BI product. I propose to look at the forum for Business Intelligence to find your answers.
    E.g. SAP POS DM writes the sales data in infocubes.....

  • How to store data from textfile to vector and delete a selected row.

    Can someone teach me how to store data from textfile to vector and delete a selected row. And after deleting, i want to write the changes in my textfile.
    Do someone has an idea? :)

    nemesisjava wrote:
    Can someone teach me how to store data from textfile to vector and delete a selected row. And after deleting, i want to write the changes in my textfile.
    Do someone has an idea? :)What's the problem? What have you done so far? What failed?
    What you described should be pretty easy to do.

  • How to store data (in tdm files)

    I'm looking for advice on how to store data in tdm/tdx files.
    The main challenge is like this: At regular time intervals there is new data available (say every 10 minutes there are 10 minutes of new data available). All data is time based. So every ten minutes I may create a new tdm/tdx file containing this data segment. However, when i want to analyze the data i dont necessarily want to view 10 minutes of data from all channels, but maybe 20 hours of data from one particular channel.
    The way I've achieved this so far is to manually load each 10 minute segment of this particular channel and then add these parts together. This is both time consuming and cumbersome. Is there a better way to do this that I've simply not discovered yet? Is there a better way to store data to simplify this process?
    One solution is of course to save data from several 10-minute frames in one file, but seeing as there is a never ending supply of data i cant simply save all data in one giant file, it has to be split up at some point, and the problem will still remain.
    One factor to have in mind here is that this is rather large amounts of data (maybe 10GB each day), so the option to simply load all the data into memory goes out the window rather quickly.
    Feel free to ask if I've not made myself very clear

    Hi salte,
    If your test ever ended, and if you had LabVIEW 8.20 or higher, I would recommend using a TDMS file, which handles data appeands flawlessly.  DIAdem 10.1 now also does data reduction and index windowing during file loading for TDM / TDMS / DataPlugin files, so that you could easily load out only the part of the file you wanted to look at.  But since you describe your data acquisition as never stopping and amassing 10 GB per day, I agree that it would be impractical to use only 1 data file.  So we are stuck with some number of files which each contain a part of your measurement.  This approach can have advantages, since you can save operational properties for each "buffer" such as average value, dominant frequency, ambient room temperature, etc., and later on you can use the DataFinder to query out only the data buffers which meet specific conditions based on these properties.  The problem remains to load and assemble data based on multiple files.  This is an old problem in DIAdem, and one for which I have an efficient and I hope satisfactory workaround application.  It does what you describe already doing in the minimum amount of time and with the minimum amount of user interaction, and it can be highly parametrized to suit your particular situation.  The ideal way to start the application would be as part of a ResultsList custom menu.  This would enable you to query out the buffers you wanted, highlight those rows in the ResultsList, right-click and choose your custom menu, and WHAM! the selected buffers for your queried channel(s) are automatically appended together in the DataPortal.  Launching from a ResultsList custom menu would mean that you could skip the file dialog and just read out the data sources directly from the ResultsList selection.
    Let me know what you think,
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments
    Attachments:
    Importing Data from Multiple DataPlugin Files.zip ‏198 KB

  • How to download data in excel from web report in sap ?

    how to download data in excel from web report made  in sap abap?
    through tcode smw0.

    for exemple using
    MS_EXCEL_OLE_STANDARD_DAT

  • How-to extract data in chunks from one R3 to another R3 system

    Does anybody know how to extract data in chunks from one system to another? Imagine you would like to extract 1M records in chunks of 10K records, how would you do it between 2 different R3 systems? A cursor (even with hold) doesn't work
    Any suggestion appreciated
    Thanks
    Ioan

    Hi Ioan,
    I'd do it with fm : TABLE_ENTRIES_GET_VIA_RFC (with where clause-tab)
    or fm GET_TABLE_RFC (get all items)
    regards Andreas

  • How to Extract data and reports from the SAP BW warehouse

    Hi to All Guru's
    I am new to SAP BW. Can any one help me to know, How to Extract data and reports from SAP BW. Do we use any tools.  After Extracting the data from SAP BW how can we move all the data to Cognos.  It would be kind enough to provide me with any documentation or links.  Step by step procedure would be very much helpfull to me.
    Thanks
    Venu

    Hi Voodi
    Thanks for the quick response. I think Open hub is to extract the data from SAP BW, but what about sending this data into Cognos.  Can you please let me know in detail regarding answer. If possible send me any documentation or links regarding this.  Thanks for your concern.
    Venu

  • How LDAP stores data?

    What is the diff bet. LDAP & Data base?
    How LDAP stores data?

    LDAP uses a hierarchical tree structure. This is why LDAP queries are formed like ldap://mydomain.com/...

  • How to bulk import data into CQ5 from MySQL and file system

    Is there an easy way to bulk import data into CQ5 from MySQL and file system?  Some of the files are ~50MB each (instrument files).  There are a total of ~1,500 records spread over about 5 tables.
    Thanks

    What problem are you having writing it to a file?
    You can't use FORALL to write the data out to a file, you can only loop through the entries in the collection 1 by 1 and write them out to the file like that.
    FORALL can only be used for SQL statements.

  • How to open or install fonts from a .suit file under Lion?

    How to open or install fonts from a .suit file under Lion? Thanks!

    although I believe I *have* used the .suit extension when I was creating suitcase files for TrueType fonts.
    You can get away with that because you haven't really changed anything. It's already a suitcase file, with a Type code of FFIL (the Creator code is mostly irrelevant). Adding .suit still tells the OS it's a suitcase.
    However, if you do something silly like change the Type code to LWFN (the outline portion of a PST1 set), then neither Font Book, or any other font manager knows what to do with it. It's recognizing the LWFN code, but the data structure of course doesn't match. The file is still a Mac legacy TrueType font. Suitcase Fusion 5 tosses this on the screen when I change the Type code to the wrong one:
    Changing the extension to something obviously wrong, like .otf produces the same message. It's trying to parse the data according to what the extension says it is, and nothing lines up.
    Trying to use .ttf or .ttc also doesn't work. A Mac legacy suitcase TrueType font is not built the same as a .ttf or .ttc font. Either is technically correct (it is a TrueType font), but that's the only similarity. What's happening in that case is Mac legacy TT fonts have all of the data in the resource fork. When you add .ttf or .ttc to the name, the OS and any font manager then tries to find the data in the data fork. Nothing there.

  • How to store 2C array to a singl binary file

    Hi
    I have to store multiple waveforms output that is each 1D array to a single binary file. how do i do this.
    i can store 1D array to binary file and retrieve it by reading the binary file and plotting the waveform. but i am not able to store 2D array to the single file. how do store many 1D array in one binary file,
    Thank you. Hema

    (We would also need to know your LabVIEW version. If you have a very old version, things would be quite different.)
    As Smercurio_fc already mentioned, the option to "prepend array size" would make things much easier here, because then you would read it as a single 2D array.
    Here's how that would look like. This is probably the recommended solution, just for simplicity reasons.
    Not prepending the size is more useful if you write the data in increments, but later want to read it as one.
    Message Edited by altenbach on 11-15-2008 09:02 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    SaveRestore2D.png ‏21 KB

Maybe you are looking for

  • Unable to download file to application server

    Hi, I am trying to download a file to the application server. I've also attached my code below.After the execution of this program, it is just returning blank values to the application server file. Let me know why it is not populating the values to t

  • Mac mini, mybookwd, two ipods

    I and my son both have user accounts on the mac mini. We both have our own libraries on itunes and purchase from the same itunes account (have different libraries tho). I am trying to move our collections to the mybook external hd. First I copied his

  • Photo titles in Apple TV 2?

    Am I missing a setting somewhere? How can I get my photo titles to show up on my Apple TV2? It seems only logical that I should be able to somehow see them when I see them either via the web (Mobile Me) or on my iPhone (Gallery) when synched from iPh

  • Best practice - Migrate from WLC4404 to WLC5508

    Hello everyone, I would like to have pointers how to migrate from WLC4404 to WLC5508. I want to know your propositions. I could replicate the configuration manually but there is a lot of confirugation menus and all. If both could be online and migrat

  • Collect calls

    Can you accept collect call from jail to your at&t go phones