Open an iFS document in Java

hi,
I have two questions:
1) I have a document in folder /public/docs
and i want to read its contents from a jsp file.
The only method i found in the javadoc is getDocumentContent that returns an InputStream. Still, it requires as a parameter a Document Object. How can i convert the String "/public/docs/a.txt" into a Document.
2) I create new documents from a jsp and are created successfully, but their type icon(in the container.jsp) is images/icons/16x16/invalid.gif. Why does it show the documents as invalid? If i make a local copy, the files have the contents i wanted.
this is the code:
LibrarySession ifsSession = login.getSession();
String text = "lala\nfoo";
DocumentDefinition dd = new DocumentDefinition(ifsSession);
dd.settAttribute("NAME", AttributeValue.newAttributeValue("lala.txt"));
dd.setContent(text);
Document doc = (Document)ifsSession.createPublicObject(dd);
DirectoryUser thisUser = ifsSession.getDirectoryUser();
PrimaryUserProfile pup = ifsSession.getPrimaryUserProfile(thisUser);
Folder hf = pup.getHomeFolder();
hf.addItem(doc);
thanks
loukas

seems to be a problem here.
i write:
<%@ page import = "oracle.ifs.adk.filesystem" %>
but the compiler:
Class oracle.ifs.adk.filesystem.IfsFileSystem not found in import.
any ideas?
loukas

Similar Messages

  • Not able to open a webi document in java

    final String CMS = "pundl10492:6400";
              final String userID = "administrator";
              final String password = "";
              final String auth = "secEnterprise";
              IEnterpriseSession enterpriseSession = null;
              try
                   ISessionMgr mySessionMgr = CrystalEnterprise.getSessionMgr();
                   enterpriseSession = mySessionMgr.logon(userID, password, CMS,auth);
                   System.out.println("Session created : "+ enterpriseSession.toString());
                   if (enterpriseSession != null)
                        IInfoStore iStore = (IInfoStore)enterpriseSession.getService("InfoStore");
                        ReportEngine reportEngine = (ReportEngine)enterpriseSession.getService("WebiReportEngine");
                        final String query = "SELECT SI_ID, SI_NAME FROM CI_INFOOBJECTS WHERE SI_KIND = 'Webi' " +
                                                      "and SI_NAME like '%Least Accessed Documents%'";
                        IInfoObjects objInfoObjectsWIDs = (IInfoObjects) iStore.query(query);
                        IInfoObject objInfoObjectWID = (IInfoObject) objInfoObjectsWIDs.get(0);
                        int docId = objInfoObjectWID.getID();
                        System.out.println("docID : "+docId);
                        DocumentInstance doc = reportEngine.openDocument(docId);
                        FileOutputStream l_fos= null;
                        String fileName = "morcom" + "_" + userID+ "."+"xls";
                        l_fos = new FileOutputStream("D:\\_workarea\\MORCOM_POC\\reports\\"+fileName);
                        BinaryView docBinaryView = (BinaryView)doc.getView(OutputFormatType.XLS);
                        byte[] b = docBinaryView.getContent();
                        l_fos.write(b);
                        System.out.println("File created");
              catch(Exception e)
                   e.printStackTrace();
    I am trying to open a document and the code iam using is given above. I am using BO XIR3 and i get
    Exception in thread "main" java.lang.NoClassDefFoundError: com/crystaldecisions/celib/trace/h
         at com.businessobjects.sdk.plugin.desktop.webi.internal.d.<clinit>(Unknown Source)
         at com.businessobjects.sdk.plugin.desktop.webi.internal.WebiFactory.makePlugin(Unknown Source)
         at com.crystaldecisions.sdk.occa.pluginmgr.internal.PluginMgr.getPluginInterface(PluginMgr.java:291)
         at com.crystaldecisions.sdk.occa.infostore.internal.InfoObjects.continueUnpack(InfoObjects.java:409)
         at com.crystaldecisions.sdk.occa.infostore.internal.InfoObjects.startUnpack(InfoObjects.java:361)
         at com.crystaldecisions.sdk.occa.infostore.internal.InternalInfoStore.queryHelper(InternalInfoStore.java:712)
         at com.crystaldecisions.sdk.occa.infostore.internal.InternalInfoStore.query(InternalInfoStore.java:566)
         at com.crystaldecisions.sdk.occa.infostore.internal.InfoStore.query(InfoStore.java:167)
         at BOTest.main(BOTest.java:42)
    error at this line:-
         IInfoObjects objInfoObjectsWIDs = (IInfoObjects) iStore.query(query);
    Can anyone give a code snippet for opening a webi document in release3. The same code works in release 2.
    Thanks
    Shruti

    You have a "NoClassDefFoundError", so a code snippet won't help.
    XI Release 2 -> XI 3, then jar files have been renamed and object files refactored.
    You've ended up with mixed XI Release 2 and XI 3 jars.  
    Remove your jars and re-add from XI 3.
    Sincerely,
    Ted Ueda

  • Opening a word document in Java

    HI
    I am new to java. I am trying to open a word document when user press the button. I just want to open the document that exists on my computer. I have tried using exec() method of Runtime class. But I was not succeed. Here the code that I have used.
    public void actionPerformed(ActionEvent ae)     {
         String str = ae.getActionCommand();
         if(str.equals("Search")){
              Runtime r = Runtime.getRuntime();
              Process p = null;
              try{
                   p = r.exec("C:\\Program Files\\Microsoft Office\\OFFICE11\\WINWORD.exe C:\\Resume\\coverletter.doc");
              }catch (IOException e){
                   System.out.println("Error");
    repaint();
    Here "Search" is th name of Button.
    So if anyone have a solution please help me regarding to this.
    Thank you

    Use java.awt.Desktop (available since Java 6), it provides a .open() method that will open any file with the users associated application (so no dangerous hardcoding of application paths necessary).
    If you insist on using Runtime.exec, then you must read [When Runtime.exec() wont|http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html].

  • HOW TO OPEN WORD DOCUMENT FROM JAVA???

    hi everyone! Can you please help me to come with this problem? Let me to set my main target I want to achieve:
    1) In my program user should first press a button;
    2) Then already created Word Document should be opened (I DO NOT NEED to open that Word Document in Java or something like JField). Just simply it should be opened as a Microsoft Word Document.
    I DO NEED YOUR HELP! PLEASE HELP ME....!

    Running cmd using the exec is also a windows only solution, there is no "more" or "less" it that solution compared to the rundll.
    Since word is a windows format its pretty obvious that the application is ran under windows platform.
    If you are running on a different platform (maybe using open office you can open word documents, i'm not sure) you might want to use the JDIC library (https://jdic.dev.java.net/) which enables you to open/edit/browse such files using the default viewer/editor/browser of the system you are working on.
    Look at the org.jdesktop.jdic.desktop.Desktop object for these methods.
    You can also find the Desktop object in J2SE6 but its still in beta.

  • Open a word document from a Java Application

    Hi,
    Can I open a word document from a java GUI apllication and point to a bokkmark automatically in the word document when opened.

    See this thread:
    http://forum.java.sun.com/thread.jspa?threadID=228332&messageID=810684

  • Opening a Word Document with a Java program in Windows

    When running a Java program in Windows, is it possible to have a button where when it is clicked it will open a Word document?
    If so, is it hard and can someone tell me how to do it??
    Thanks

    try this instead of Excel.exe you have to use Word.exe
    1. Declare your button
                   JButton butexlcom = new JButton("Carnet Offre");
                   butexlcom.addActionListener( new ButExlCommercial(msgout));
                   butexlcom.setBounds(215,510,110,30);
                   c.add( butexlcom );
    2. run your word document.
    class ButExlCommercial implements ActionListener {
         private JTextArea msgout;
         public ButExlCommercial( JTextArea msg) {
         msgout = msg;
         public void actionPerformed( ActionEvent e ) {
              try {
                   Runtime.getRuntime().exec("c:\\Program Files\\Microsoft Office\\Office\\Excel.exe NameWordDocument");
              catch(Exception en) {
                   msgout.append( "\n*** PROBLEME WORD ***\n" );
    }

  • ColdFusion Builder 3 - Search on Open Documents produces java.lang.NullPointerException

    ColdFusion Search Dialog:
    Search on Open Documents produces java.lang.NullPointerException
    Works well with Search on Current Documents
    Paid license.
    Please Advice.

    Thank you, TechFuser. I have experimented by searching on 'Open Documents', but am unable to reproduce the error. However, there indeed seems to be a problem. It failed to work for me either.
    Like you, I got a NullPointerException. But that seemed to happen whenever I restarted ColdFusion Builder 3. The details are as follows:
    CFBuilder Version: 3.0.0
    Build: 292483
    Message:
    Unhandled event loop exception
    Exception Stack Trace:
    org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
      at org.eclipse.swt.SWT.error(SWT.java:4397)
      at org.eclipse.swt.SWT.error(SWT.java:4312)
      at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:138)
      at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4145)
      at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3762)
      at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.ja va:1113)
      at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
      at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java :997)
      at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:140)
      at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:611)
      at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
      at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
      at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
      at com.adobe.ide.coldfusion.rcp.intro.Application.start(Unknown Source)
      at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLau ncher.java:110)
      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.jav a:79)
      at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
      at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
      at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
      at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
    Caused by: java.lang.NullPointerException
      at com.adobe.ide.coldfusion.appcodegeneration.runtime.views.ViewContributionService$1.run(Vi ewContributionService.java:113)
      at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:164)
      at org.eclipse.ui.internal.UISynchronizer$3.run(UISynchronizer.java:158)
      at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
      at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
      ... 23 more
    Session Data:
    eclipse.buildId=unknown
    java.version=1.7.0_55
    java.vendor=Oracle Corporation
    BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
    Command-line arguments:  -os win32 -ws win32 -arch x86

  • How To open a MS Word/Excel document using Java

    How do i open a MS-Word/Excel document using Java Code.

    Get SDK (which is freeware) at
    http://www.simtel.net/product.php?id=60701&sekid=0&SiteID=simtel.net
    http://shareware.pcmag.com/product.php?id=60701&SiteID=pcmag
    http://downloads.suntimes.com/product.php?id=60701&SiteID=suntimes
    There you will find examples for MSWord and Excel (example sources are packed with binaries).

  • Hi i need to download java se runtime 6 to open a certain document. But i cannot find a download anywhere, anyone got any ideas?.

    Hi i need to download java se runtime 6 to open a certain document. But i cannot find a download anywhere, anyone got any ideas?.

    Hello Scurran08,
    The article linked below should answer your question about where to download Java for your MacBook Pro.
    Get Java for your Mac - Apple Support
    Ciao,
    -Jason

  • Open/save word document in jsp

    I can open a word document in jsp but i don't know how to save and close it to where i want again inside same jsp.
    I find a code that do thing i want to do but it was written in vb script.
    How can i convert vb code below to java / jsp?
    Dim wrdApp As Word.Application
    MyStr = Format(dtMyDate, "mmm dd, yyyy") & ".doc"
    Set wrdApp = New Word.Application 'released first resources
    With wrdApp
    .Documents.Add "normal.dot", , , True
    strPatientName = txtName.Text
    strFileName = "c:\MJCC\Lab\" & strPatientName & "_" & MyStr
    .ActiveDocument.SaveAs strFileName
    .ActiveDocument.Close
    .Quit
    End With
    Set wrdDoc =Nothing

    <%@ page contentType="application/vnd.ms-excel" language="java"%>
    <meta http-equiv="Content-Type" content="application/vnd.ms-excel; charset=iso-8859-1">
    by using this 2 codes, when i run this page, it will pop up a box for me to save the jsp file..
    i'm able to save it in xls / csv format...
    so, mayb you can try change the ms-excel to ms-word or something else..
    hope this is useful...

  • Sometimes (but not always), when I try to open a pdf document from the US bankruptcy court website, I get a window asking if I want to use Adobe Acrobat. After I click "yes", I get a bland screen.

    == Issue
    ==
    Firefox is having problems with certain web sites
    == Description
    ==
    Sometimes (but not always), when I try to open a pdf document from the US bankruptcy court website, I get a window asking if I want to use Adobe Acrobat. After I click "yes", I get a bland screen.
    == URL of affected sites
    ==
    http://
    == Troubleshooting information
    ==
    Firefox Version
    3.6.3
    Extensions
    Name
    Version
    Enabled
    ID
    Skype extension for Firefox 2.2.0.70 false
    Java Console 6.0.01 false
    Java Console 6.0.02 true
    == Firefox version
    ==
    3.6.3
    == Operating system
    ==
    Windows 7
    == User Agent
    ==
    Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
    == Plugins installed
    ==
    *-Office Plugin for Netscape Navigator
    *Download and Print Plug-in DLL
    *Default Plug-in
    *Shockwave Flash 10.0 r45
    *Adobe PDF Plug-In For Firefox and Netscape

    Hi.
    Does this only open on that specific site?
    In any case, you may want to:
    - instruct Firefox to handle PDF files in a specific way by going into Tools > Options > Applications and selecting the option you want for the PDF files
    - reinstall Adobe Reader and its Firefox plugin
    - install another reader instead of Adobe Reader. I recommend Foxit Reader ( http://www.foxitsoftware.com/pdf/reader/ ), since it's free, VERY light, VERY fast, safe and also has a Firefox plugin (make sure you don't have both Adobe Reader plugin and Foxit Reader plugin enabled/installed at the same time in Firefox)

  • Opening a word document for editing with webdav

    I'm not sure if this is the correct place for this question..
    I am attempting to open a word document, which resides in a webdav folder from web app. I need IE to start word and open the original document from the webdav folder and allow the user to make changes to the document and save it back to the webserver.
    Wep app this http://www.javatalks.ru/go.php?uri=http://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk/java/org/apache/catalina/servlets/WebdavServlet.java
    I've got it to open the document but it seemed to have copied the document to my temporary internet files folder and opened the copy from there. The original file name is "test.doc" but the opened temprary file is "test[1].doc" and so on. How can I get it to open the original document for editing?
    Any help would be appreciated..

    Not sure about payment options but you can check for yourself at http://success.adobe.com/en/na/sem/products/acrobat/feature.html

  • How to open the pdf document from KM  through Link to URL UI element

    Hi All,
    I have Link to URL UI element  in webdynpro java layout - on click of the link we need to open the pdf document from KM respository.
    KM Document location : irj/go/km/docs/documents/RHPortal//USA/A/Test/Employee_details.pdf.
    Once this is transported to Test and Production portals , we need to retrieve the KM document from the respective portal location through the Link to URL UI element .
    Thanks,
    Portaluser100

    Hi,
    If you set the link to your document in a Context attribute by using a relative path this should work just fine.
    Example:
    wdContext.currentContextElement().setUrl("/irj/go/km/docs/documents/RHPortal//USA/A/Test/Employee_details.pdf");
    Bind that attribute to the reference property of the LinkToURL element.
    Cheers,
    Leo

  • Open the OpenOffice document in Internet explorer

    How to open the OpenOffice Document in Internet explorer using core java?

    the only ideas that I can give you are...
    applet
    and look at the OpenOffice SDK.

  • Opening a browser window with Java

    Is there a way I can open a Browser Window (with a specific html document) from Java? Thanks.

    Use Runtime.exec(cmd) with the following command:
    Under Windows 9x:
       command.com /C" start "urltofile.html"Under other Windows:
       cmd.exe /C [start] "urltofile.html"  (start is needed when url begins with 'http://")

Maybe you are looking for

  • How to connect printer wireless i dont have wirelee router? my printer is deskjet 4625

     i m unable to connect my printer wireless and generate code for registering at eprint.how to connect printer wireless i dont have wirelee router? my printer is deskjet 4625. please suggest ? i have installed printer on my computer and laptop. comput

  • Remoteviewer ActiveX never popup (install link wont go away)

    Running 11.2, and trying to use IE8 and/or IE9 on Win 7 x64 for remote control. On some of the administrators machines, when trying to remote control the link for installing the remote control viewer never goes away. Installation of the viewer works

  • I can't re-install itunes, help!

    I tried to update my itunes so that it would support my iphone 5. I followed the instuctions telling me how to uninstall itunes completely but now I can't re-install it. I get an error message saying that the apple application support can't be found.

  • How to replace images?

    Hi all.. I have a vector of images and each individual images are display in JLabel. When double clicked any of the images, it able to change the image from the file chooser. I have a problem here: whenever i clicked one image so as to change the pic

  • Creation data warehouse par l'outil oracle warehouse builder  (OWB)

    Bonjour, Dans le cadre de mon PFE je veux construire un data warehouse par l'outil Oracle warehouse builder. je cherche des exemples et un tutorial en français pour faire l'ETL d'une base de données de l'ERP JD Edwards. SVP, aidez moi et merci.