Strategy&word documents files

i have 3 questions
1. the strategy as i understand is a common interface being implemented by more than one class .. and there is a class (which is the strategy) that will instanciate one object of one of those classes (that implement the interface) everytime called.. did i understand the strategy right ??
2. what is a composit .. can someone explain it with an easy example please ?
3. i wrote a document using microsoft word as my user manual, it contains links within the document.. how can i view it in java with maintaining the links? can i run the MS word with the file as a parameter (if so then how?) or is there any better way ?
thanks for helping

Hello,
1) Your understanding of strategy is not entirely correct. Though, operationally you are accurate in saying what you have. A strategy is a concept, that encapsulates an algorithm i.e. logic. Strategy is used in many circumstances, one example is when we want the logic applicable on a data set to vary conditionally (as you may have observed, a simple if..else could be used in this situation, however, that is the point of using a strategy, encapsulating the concern of varying logic).
2) A composit, as the name suggests, is an entity which is composed of many other entities. You can view composit being constructed of smaller entities with various functions, whose total behavior is the composits behavior. It is mostly used when we want to combine together behavior of many concerns together and is most often used in combination with another patter, the "Deligate", where each of the smaller entities take responsibility to do a specific part of the Composits total behavior (this behavior should not be confused witha Proxy or Facade :D)
3) I do not know of a direct way (without going into the encoding of MSWord i.e. RTF) to do this, what I can suggest, however, is to convert the document into an HTML and view it from a Java application (the conversion can be done by MSWord quite easily).
Hope this helps.
Ironluca

Similar Messages

  • How can I convert my Open Source document files into Word document files? I cannot download Pages since my Macbook Air does not have the most recent software.

    How can I convert my Open Source document files into Word document files? I cannot download Pages since my Macbook Air does not have the most recent software. I downloaded open office to my mac to try and save money. It worked well for a while. Now I get this pop-up message that asks me to "Reopen" and when I select the option, nothing happens. I cannot save my documents anymore and I cannot convert them to word. Help!

    dwb wrote:
    Does OpenOffice output Word documents by default or do you have to select it manually?
    You have 17 options to save as in Open Office, one of which is .doc  files,  yes it needs to be saved manually.
    You may be able to default to DOC, but have not tried same.
    Since Open Office is 99% same as Word, I use it, or Word, either one.  Open Office is a bit less buggy than Word 11'

  • How can I change a Microsoft Word document file into a picture file?

    How can I change a Microsoft Word document file into a picture or jpeg file? I am wanting to make the image I created my background on my macbook pro.

    After I had the document image the way I wanted it, I saved it as a web page and went from there. Below are the steps starting after I did the "save as" option in Word:
    1) Select "Save As Web Page". I changed the location from documents to pictures when the window came up to save it as a web page.
    2) Go to "Finder" on you main screen, or if it's on your main toolbar at the bottom.
    3) Click on the "Pictures" tab and find the file you just re-saved as a web page. (I included "web page" or something similar in the new title so I could easily find the correct file I was looking for)
    4) Open the correct file and then "right click" on the actual image. (Use 2 fingers to do so on a Mac)
    5) Select 'Use Image As Desktop Picture", and voilà! The personally created image, or whatever it is that you wanted, is now your background.
    **One problem I encountered while doing this is that the image would show up like it was right-aligned in relation to the whole screen. The only way I could figure how to fix this was to go back to the very original document in Word, (the one before it was saved as a web page), and move everything over to the left.
    I hope this helps someone else who was as frustrated as I was with something that I thought would have been very simple to do! If you have any tips or suggestions of your own, please feel free to share. : )

  • How to attache a word document file

    Hi all,
       Thanks in advance,
       Does anyone know please help me out.
       I want to attach word document file  into one of the field in my customised screen, and when i double click the path it has to open that particular file in a small window .
    Please provide  me sample of code, I think that can be done throu oop .
    Thanks and reagards
    Shiva prasad D

    Use the following code to execute the native application to open your document.  Example,  if user click on a word document, this will open the document in Microsoft Word.  If execl, will open the document in Microsoft Excel. 
      CALL METHOD CL_GUI_FRONTEND_SERVICES->EXECUTE
        EXPORTING
          DOCUMENT               = 'C:test.doc'
          MAXIMIZED              = 'X'
          SYNCHRONOUS            = 'X'
        EXCEPTIONS
          CNTL_ERROR             = 1
          ERROR_NO_GUI           = 2
          BAD_PARAMETER          = 3
          FILE_NOT_FOUND         = 4
          PATH_NOT_FOUND         = 5
          FILE_EXTENSION_UNKNOWN = 6
          ERROR_EXECUTE_FAILED   = 7
          OTHERS                 = 8.
    Regards,
    Rich Heilman

  • Load word document file into database

    Hello,
    Kindly tell me how do i load word document file into my database.

    you can use BLOB columns to store the word document in the database
    But not sure how are you trying to load (i.e what is your application front end)
    Oracle Forms, Java etc.
    so based on that specific solution can be given.

  • Cannot open Word document files in a Portfolio

    I have set up a portfolio with multiple file types. I can open Excel and Power Point files within the portfolio without a problem. When I try to open Word documents it tells me that "Acrobat cannot open this file attachment because your pdf file attachment settings do not allow for this file type to be opened. I went into preferances and checked to see if the box was checked in "trust manager" to allow files other than pdf to opened. It is checked but I am still unable to open word documents in the portfolio for some reason.

    Acrobat cannot open Word files. Have you tried opening the files from within Word? If so, most probably you have a file association problem.

  • API FOR READING MICROSOFT WORD DOCUMENT FILE

    HELLO
    I need to know are there any api's to read a word document i.e a .doc file into a java program. If there r api where can i find them & how can i use them

    For Reading PDF documents, you can use PDFBox, for reading word documents, Apache's POI . But POI supports only Excel right now, Word will soon be supported

  • Word document files appearing as Excel in IMail

    Hello:
    When I receive a Word document attachment it appears  in IMail as a .doc file extension but with an Excel Icon.  When I attempt to open it, Excel opens and informs me it is not a valid file.  The only way I am able to open these documents is by first saving on my desktop, then opening from inside Word.
    I am using the latest IMac with OS 10.9.  I also have Parallels installed and am running the virtual machine with Windows 8.  In that platform, I have my Microsoft Word, version 12.  I don't think the problem is that I am using a Virtual machine, as the problem seems to appear as how the document is received in IMail.
    TIA for any help you can offer.  It is driving me crazy!

    Actually I think my problem is a bit different from the first one.  My preview handler for Office documents (doc xls ppt etc) is not working at all.  But the kpmitch's question sounds like it relates more to the need to RESTORE the default list of allowed and disallowed file attachment types in the Preferences-Trust Manager.  Maybe for that problem Word fell off the list.
    My problem is that none of the office files will preview in the preview pane.
    I see that I am able to preview a Word doc using Acrobat.com.  I guess the preview handler for that web-based service is different from the preview handler used by the Acrobat 9 Professional Extended installed on my computer. 
    By the way - The computer I am using to test the problematic preview handler is network based (work) computer, Windows XP (SP3), using Office 2003 or Office 2007.  (I've tried it on different computers with both of these Office packages.) 
    Since our IT people use their own confguration to deploy the program, they are wondering if perhaps something in that custom build needs to be changed to enable the preview handler to work.  It isn't working on any of our machines. 
    Thanks for continuing to assit with this query! 
    Regards, 
    jeannie 

  • How can I transfer pdf and word document files from my computer to iphone 4?

    Hi,
    I have recently purchased an iphone 4,I need to know how to transfer my files from laptop to iphone, i have downloaded iTunes but can not add my iphone, basically I dont know if there is anything else i should do to be able to connect my laptop to iphone so that i can easily transfer files.
    Also,does any body know what application i can open my word documents with?
    and how easy it is to search through the file for a specific topic if its for example 1000 pages? how about in pdf files? how can i find a topic i need as fast as possible, say in an open book exam condition?!!
    thanks

    Try using the App PDF Reader Lite, I downloaded from the iTunes App store, it is free and works. Not only for PDF but Doc, page, etc.
    I Am using it and it is working oK

  • PDF Conversion of Word document file too large

    I am going crazy trying to figure out why PDF document files I make on my Mac are so much larger (file size) than the same document converted on my Windows machine using Adobe Acrobat. I also tested the file size by having a friend use her CutePDF document converter to convert it for me and my PDF document with a file size of 2.18 Mb came back from her at 78.5 Kb. However, when I try to view the document it has a message where the images are that "QuickTime and a decompressor are needed to see this picture". But she could see everything fine.
    I always loved my Adobe Acrobat software when I was a Windows user. With the exception of using Quicken on my MacBook using VMWare Fusion for running Windows, I don't want to use Windows anymore so I don't want to have Acrobat sitting on that partition. I know my Mac can convert to PDF but is there a way I can get the file sizes smaller? Or am I going to have to get a PDF writer program specifically for converting and compressing file sizes where other users, whether be Mac or Windows can see them.
    HELP please. I'm about ready to purchase the Adobe Acrobat X Professional for Mac OS X. I only need the Standard package but it appears they don't have a Mac version for anything less than the Professional package. I'm also wondering if CutePDF would work for me. Hmmm. I truly need the knowledge of you seasoned users.
    Thanks a bunch!!!
    CJ

    CeeJaa@Mac wrote:
    switch platforms ad upgrade to Acrobat 9 Pro. That'll fix it.
    I suspect you're right. Good luck.

  • How do I create a PDF file from a word document file?

    How do I create  PDF document from a word document

    Acrobat Pro will do this. See: http://www.adobe.com/products/acrobat/word-to-pdf-converter.html
    Hope that helps,
    Brian

  • Why word document file types wouldn't allow file download?

    I noticed that my Flash movie wouldn't allow for word file
    type download. I have a pdf file type as a download link, and it
    worked fine. This issue happens only on IE. Any thoughts?

    CeeJaa@Mac wrote:
    switch platforms ad upgrade to Acrobat 9 Pro. That'll fix it.
    I suspect you're right. Good luck.

  • How to open word document form html container url iam getting internal_error while opening file

    Hi all,
    By using below code i am able to download word document file from html container. But before downloading i need edit these document to add Macro.
    I am unable to open word document.
    CREATE OBJECT G_HTML_CONTAINER
          EXPORTING
            CONTAINER_NAME = 'PDF'.
       CREATE OBJECT G_HTML_CONTROL
          EXPORTING
            PARENT = G_HTML_CONTAINER.
    * Convert xstring to binary table to pass to the LOAD_DATA method
        CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
          EXPORTING
            BUFFER     = LV_CONTENT
          TABLES
            BINARY_TAB = LT_DATA.
    data_tab = LT_DATA ).
    * Load the HTML
        CALL METHOD G_HTML_CONTROL->LOAD_DATA(
           EXPORTING
             TYPE         = 'application'
             SUBTYPE      = 'DOC'
           IMPORTING
             ASSIGNED_URL         = LV_URL
           CHANGING
             DATA_TABLE           = LT_DATA
           EXCEPTIONS
             DP_INVALID_PARAMETER = 1
             DP_ERROR_GENERAL     = 2
             CNTL_ERROR           = 3
             OTHERS               = 4 ).
    * Show it
        CALL METHOD G_HTML_CONTROL->SHOW_URL( URL = LV_URL
          IN_PLACE = 'X' ).
    Before file download i want edit the file for that i am using below class.
    PROXY TYPE REF TO I_OI_DOCUMENT_PROXY.
    by using (get_document_proxy) method  getting proxy .
    call method control->get_document_proxy
    exporting
    document_format   = 'x'
    document_type      = 'Word.Document'
    register_container  = 'x'
    importing
    document_proxy     = proxy
    after these.
    call method proxy->open_document
    exporting
    document_url    = lv_url
    open_inplace    = 'x'
    hear i m getting retcode as INTERNAL ERROR
    can any one suggest me how to open document from html container.
    Thanks and reagards
    jogu yadav

    I got resolution
    Thanks and regards,
    Jogu yadav

  • Downloading of file(Microsoft Word Document)

    I have a problem regarding with downloading of Word Document file, the download is working but the when i open the file an was Exception written in the File, here is my code, can anybody help me with this problem? any help is greatly appreciated
    public ActionForward execute(ActionMapping mapping, ActionForm form,
                   HttpServletRequest request, HttpServletResponse response)
                   throws Exception {
              ActionErrors errors = new ActionErrors();
              ActionForward forward = new ActionForward(); // return value
              UtilityBean _bean = null;
              String fileName = "Sample.doc";
              System.out.println("Download Word Document");
              //               set the header details
              int id = 8;
              System.out.println("ID is: " + id);
              // details
              System.out.println("Download Word Document");
              // set the header details
              try {
                   _bean = new UtilityBean();
                   _bean = DAOFacade.file(id);
                   response.setContentType("application/msword");
                   response.setHeader("Content-Disposition", "attachment; filename="
                             + fileName);
                   //set the content type to related file
                   FileOutputStream fileOut = new FileOutputStream(
                             "c:\\tempWordOutput.doc");
                   InputStream inStream = new BufferedInputStream(new FileInputStream(
                             "c:\\tempWordOutput.doc"));
                   OutputStream outStream = response.getOutputStream();
                   // set buffer size. Each attempt to read the file will use // //
                   // specified number of bytes
                   byte[] buf = new byte[4 * 1024];
                   int bytesRead = 0;
                   while ((bytesRead = inStream.read(buf)) != -1) {
                        outStream.write(buf, 0, bytesRead);
                   outStream.flush();
                   outStream.close();
                   inStream.close();
              } catch (Exception e) {
                   e.printStackTrace();
              // If a message is required, save the specified key(s)
              // into the request for use by the <struts:errors> tag.
              if (!errors.isEmpty()) {
                   saveErrors(request, errors);
                   // Forward control to the appropriate 'failure' URI (change name as
                   // desired)
                   //     forward = mapping.findForward("failure");
              } else {
                   // Forward control to the appropriate 'success' URI (change name as
                   // desired)
                   // forward = mapping.findForward("success");
              // Finish with
              return (forward);
         * @return
         private HttpServletResponse HttpServletResponse() {
              // TODO Auto-generated method stub
              return null;
    //------------------------GENERATED FILE------------------------------------
    <H1>Error page exception</H1>
    <H4>The server cannot use the error page specified for your application to handle the Original Exception printed below. Please see the Error Page Exception below for a description of the problem with the specified error page.</H4>
    <BR><H3>Original Exception: </H3>
    <B>Error Message: </B><BR>
    <B>Error Code: </B>500<BR>
    <B>Target Servlet: </B>action<BR>
    <B>Error Stack: </B><BR>
    java.lang.NullPointerException
    <BR>    
         at org.apache.struts.action.RequestProcessor.processForwardConfig&#40;RequestProcessor.java:441&#41;
    <BR>    
         at org.apache.struts.action.RequestProcessor.process&#40;RequestProcessor.java:279&#41;
    <BR>    
         at org.apache.struts.action.ActionServlet.process&#40;ActionServlet.java:1482&#41;
    <BR>    
         at org.apache.struts.action.ActionServlet.doGet&#40;ActionServlet.java:507&#41;
    <BR>    
         at javax.servlet.http.HttpServlet.service&#40;HttpServlet.java:743&#41;
    <BR>    
         at javax.servlet.http.HttpServlet.service&#40;HttpServlet.java:856&#41;
    <BR>    
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.service&#40;ServletWrapper.java:1212&#41;
    <BR>    
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest&#40;ServletWrapper.java:629&#41;
    <BR>    
         at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest&#40;WebApp.java:2837&#41;
    <BR>    
         at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest&#40;WebGroup.java:220&#41;
    <BR>    
         at com.ibm.ws.webcontainer.VirtualHost.handleRequest&#40;VirtualHost.java:204&#41;
    <BR>    
         at com.ibm.ws.webcontainer.WebContainer.handleRequest&#40;WebContainer.java:1681&#41;
    <BR>    
         at com.ibm.ws.webcontainer.channel.WCChannelLink.ready&#40;WCChannelLink.java:77&#41;
    <BR>    
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination&#40;HttpInboundLink.java:421&#41;
    <BR>    
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation&#40;HttpInboundLink.java:367&#41;
    <BR>    
         at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete&#40;HttpICLReadCallback.java:94&#41;
    <BR>    
         at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete&#40;WorkQueueManager.java:548&#41;
    <BR>    
         at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO&#40;WorkQueueManager.java:601&#41;
    <BR>    
         at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun&#40;WorkQueueManager.java:934&#41;
    <BR>    
         at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run&#40;WorkQueueManager.java:1021&#41;
    <BR>    
         at com.ibm.ws.util.ThreadPool$Worker.run&#40;ThreadPool.java:1332&#41;
    <BR>    
    <BR>
    <BR><BR><H3>Error Page Exception: </H3>
    <B>Error Message: </B>SRVE0199E: OutputStream already obtained<BR>
    <B>Error Code: </B>0<BR>
    <B>Target Servlet: </B>null<BR>
    <B>Error Stack: </B><BR>
    java.lang.IllegalStateException: SRVE0199E: OutputStream already obtained
    <BR>    
         at com.ibm.ws.webcontainer.srt.SRTServletResponse.getWriter&#40;SRTServletResponse.java:462&#41;
    <BR>    
         at com.ibm.ws.webcontainer.webapp.WebApp.sendError&#40;WebApp.java:2484&#41;
    <BR>    
         at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest&#40;WebApp.java:2861&#41;
    <BR>    
         at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest&#40;WebGroup.java:220&#41;
    <BR>    
         at com.ibm.ws.webcontainer.VirtualHost.handleRequest&#40;VirtualHost.java:204&#41;
    <BR>    
         at com.ibm.ws.webcontainer.WebContainer.handleRequest&#40;WebContainer.java:1681&#41;
    <BR>    
         at com.ibm.ws.webcontainer.channel.WCChannelLink.ready&#40;WCChannelLink.java:77&#41;
    <BR>    
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination&#40;HttpInboundLink.java:421&#41;
    <BR>    
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation&#40;HttpInboundLink.java:367&#41;
    <BR>    
         at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete&#40;HttpICLReadCallback.java:94&#41;
    <BR>    
         at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete&#40;WorkQueueManager.java:548&#41;
    <BR>    
         at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO&#40;WorkQueueManager.java:601&#41;
    <BR>    
         at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun&#40;WorkQueueManager.java:934&#41;
    <BR>    
         at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run&#40;WorkQueueManager.java:1021&#41;
    <BR>    
         at com.ibm.ws.util.ThreadPool$Worker.run&#40;ThreadPool.java:1332&#41;
    <BR>    
    <BR>

    <B>Error Message: </B>SRVE0199E: OutputStream already obtained<BR>
    <B>Error Code: </B>0<BR>
    <B>Target Servlet: </B>null<BR>
    <B>Error Stack: </B><BR>
    java.lang.IllegalStateException: SRVE0199E: OutputStream already obtained
    this is the error because you have alredy closed the output stream
    outStream.flush();
    outStream.close();
    and then you return the Actionforward and struts Controller tries to write to the already closed output stream once again and hence the above exception is thrown
    Please refer to the below link to find how to implement a download action in struts
    http://wiki.apache.org/struts/StrutsFileDownload

  • Error in converting a pdf document to a Word document

    I have Adobe Acrobat 6 running under Win XP.
    My Panasonic Lumix camera manual is a pdf file that I wish to place on my Kindle 4. I copied the pdf file across but, although Kindle is supposed to be able to handle pdf files, it wouldn't with this one - it simply froze when I opened it in the Kindle. I therefore decided to convert the pdf file to a Word document file and email it to Amazon for a free conversion to a Kindle azw file. I attempted to use Save As in Acrobat to save the pdf file as a doc file but, after a few pages, I got the error message:
    Bad pdf; could not read page structure. <Bad pdf; error in processing fonts: cannot find CMap resource file> [26-27].

    For what it's worth I pulled in some of the product line's user guide PDFs. Those I looked over were authored with FrameMaker or InDesign.
    As these both support solid PDF output and from a quick look-see I'd not attribute the core issue to a poorly created PDF.
    With that said; two things are evident. They are not Tagged and, with the heavy graphics content, of a healthy file size.
    Tagged PDF is more than a little important as this is what provides the essential ingredient for export of PDF content (retaining font info, format, layout, etc.).
    A healthy file size associated with the significant graphics content means that what is "under the hood" of the computer in use is significant as export puts a load on these resources.
    Example: A local machine having  integrated graphics is hard pressed compared to a local machine having a dedicated graphics card with a comfortable amount of onboard RAM.
    Due to "design" improvements over the years Acrobat X does a much better job of "export"/"save as" for untagged PDF.
    But, "export"/"save as" of a well-formed Tagged PDF trumps.
    Be well...

Maybe you are looking for