Java Doc for MailMerge.java in  » J2EE » Sofia » com » salmonllc » mailmerge » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » Sofia » com.salmonllc.mailmerge 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.salmonllc.mailmerge.MailMerge

MailMerge
public class MailMerge implements Runnable(Code)
Mail Merge for Winword on Server Requirements: Need Winword installed on server. Need the following properties in properties file, preferably system.properties WinWordPath=d:\\Microsoft Office\\Office WinWordTemplatePath=d:\\Microsoft Office\\Templates WinWordPath is the Path to winword.exe WinWordTemplatePath is the Path to the location of Salmon.dot which is required to be deployed to the server. Deploy Salmon.dot file to the directory specified by WinWordTemplatePath property. Use mailMergePrint to print the mail merged document on the server printer. Use mailMergePrintToFile to print the mail merged document to a file, useful for generating PDF's see below. Use mailMergeSaveAs to save the mail merged document to a doc file, which can be sent back to a browser for client side printing. If you want to print to pdf, you must have Acrobat installed on the server and setup as the default printer and use mailMergePrintToFile method to generate the PDF which can be sent back to a browser for client side printing. Creation date: (1/11/02 2:53:36 PM)
author:
   : Fred Cahill



Constructor Summary
public  MailMerge()
     Creates a MailMerge object.

Method Summary
public  voidaddOLEFileField(String sField, File fOLEFile)
     Specifies an OLE File to be inserted at a field location in a word template. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  sField - java.lang.String Name of a field in a word template file
Parameters:
  fOleFile - java.io.File A File object pointing to a OLE File.
public  voidaddPictureField(String sField, File fPicture)
     Specifies a Picture File to be inserted at a field location in a word template. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  sField - java.lang.String Name of a field in a word template file
Parameters:
  fPicture - java.io.File A File object pointing to a Picture File.
public  voidaddSimpleFileField(String sField, File fSimpleFile)
     Specifies a Simple File to be inserted at a field location in a word template. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  sField - java.lang.String Name of a field in a word template file
Parameters:
  fSimpleFile - java.io.File A File object pointing to a Simple File.
public  voidaddTextField(String sField, String sText)
     Specifies text to be inserted at a field location in a word template.
public static  voidconcatFilesPrint(String sFile1, String sFile2)
     Concatenates two word files and prints the result.
public static  voidconcatFilesPrintToFile(String sFile1, String sFile2, String sPrintFileName)
     Concatenates two word files and prints the result to a file.
public static  voidconcatFilesSaveAs(String sFile1, String sFile2, String sSaveAsFileName)
     Concatenates two word files and saves the result to a file.
public static  voidmailMergePrint(String sTemplateFileName, String sDataSourceFileName)
     Mail Merges a template file with the values in DataSource File and prints the result.
public static  voidmailMergePrint(String sTemplateFileName, String sDataSourceFileName, Hashtable htFields)
     Mail Merges a template file with the values in DataSource File and a Hashtable and prints the result.
public static  voidmailMergePrint(String sTemplateFileName, Hashtable htFields)
     Mail Merges a template file with the values in the Hastable and prints the result.
public static  voidmailMergePrintToFile(String sTemplateFileName, String sDataSourceFileName, String sPrintFileName)
     Mail Merges a template file with the values in DataSource File and prints the result to a file.
public static  voidmailMergePrintToFile(String sTemplateFileName, String sDataSourceFileName, String sPrintFileName, Hashtable htFields)
     Mail Merges a template file with the values in DataSource File and Hashtable and prints the result to a file.
public static  voidmailMergePrintToFile(String sTemplateFileName, String sPrintFileName, Hashtable htFields)
     Mail Merges a template file with the values in the Hastable and prints the result to a file.
public static  voidmailMergeSaveAs(String sTemplateFileName, String sDataSourceFileName, String sSaveAsFileName)
     Mail Merges a template file with the values in DataSource File and saves the result to a file.
public static  voidmailMergeSaveAs(String sTemplateFileName, String sDataSourceFileName, String sSaveAsFileName, Hashtable htFields)
     Mail Merges a template file with the values in DataSource File and Hashtable and saves the result to a file.
public static  voidmailMergeSaveAs(String sTemplateFileName, String sSaveAsFileName, Hashtable htFields)
     Mail Merges a template file with the values in the Hastable and saves the result to a file.
public  voidprint(String sTemplateFileName, String sDataSourceFileName)
     Prints a Template File after Mail Merging with a Datasource.
public  voidprintToFile(String sTemplateFileName, String sDataSourceFileName, String sPrintFileName)
     Prints to a File a Template File after Mail Merging with a Datasource.
public  voidrun()
    
public  voidsaveAs(String sTemplateFileName, String sDataSourceFileName, String sSaveAsFileName)
     Saves to a File a Template File after Mail Merging with a Datasource.
public  voidsetAutoPrint(boolean bAutoPrint)
     Indicates that if the document is view that it should auto print.
public  voidsetBackground(File fBackground)
     Sets the Background of a Word Document.
public  voidsetBottomMargin(float fBottomMargin)
     Sets the Bottom Margin of a Word Document.
public  voidsetFooterDistance(float fFooterDistance)
     Sets the Footer Distance of a Word Document.
public  voidsetGutter(float fGutter)
     Sets the Gutter of a Word Document.
public  voidsetHeaderDistance(float fHeaderDistance)
     Sets the Header Distance of a Word Document.
public  voidsetLeftMargin(float fLeftMargin)
     Sets the Left Margin of a Word Document.
public  voidsetPrinter(String sPrinter)
     Sets the Printer for a Word Document.
public  voidsetRightMargin(float fRightMargin)
     Sets the Right Margin of a Word Document.
public  voidsetTopMargin(float fTopMargin)
     Sets the Top Margin of a Word Document.


Constructor Detail
MailMerge
public MailMerge()(Code)
Creates a MailMerge object. Creation date: (3/15/02 10:44:02 AM)




Method Detail
addOLEFileField
public void addOLEFileField(String sField, File fOLEFile) throws MailMergeException(Code)
Specifies an OLE File to be inserted at a field location in a word template. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  sField - java.lang.String Name of a field in a word template file
Parameters:
  fOleFile - java.io.File A File object pointing to a OLE File. Examples are .xls,.doc,.ppt



addPictureField
public void addPictureField(String sField, File fPicture) throws MailMergeException(Code)
Specifies a Picture File to be inserted at a field location in a word template. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  sField - java.lang.String Name of a field in a word template file
Parameters:
  fPicture - java.io.File A File object pointing to a Picture File. Examples are .bmp,.gif,.jpg



addSimpleFileField
public void addSimpleFileField(String sField, File fSimpleFile) throws MailMergeException(Code)
Specifies a Simple File to be inserted at a field location in a word template. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  sField - java.lang.String Name of a field in a word template file
Parameters:
  fSimpleFile - java.io.File A File object pointing to a Simple File. Examples are .txt



addTextField
public void addTextField(String sField, String sText)(Code)
Specifies text to be inserted at a field location in a word template. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  sField - java.lang.String Name of a field in a word template file
Parameters:
  sText - java.lang.String The text to be inserted



concatFilesPrint
public static void concatFilesPrint(String sFile1, String sFile2) throws MailMergeException(Code)
Concatenates two word files and prints the result. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  sFile1 - String Primary word document
Parameters:
  sFile2 - String Document to append to primary one.



concatFilesPrintToFile
public static void concatFilesPrintToFile(String sFile1, String sFile2, String sPrintFileName) throws MailMergeException(Code)
Concatenates two word files and prints the result to a file. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  sFile1 - String Primary word document
Parameters:
  sFile2 - String Document to append to primary one.
Parameters:
  sPrintFileName - String Name of the generated print file.



concatFilesSaveAs
public static void concatFilesSaveAs(String sFile1, String sFile2, String sSaveAsFileName) throws MailMergeException(Code)
Concatenates two word files and saves the result to a file. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  sFile1 - String Primary word document
Parameters:
  sFile2 - String Document to append to primary one.
Parameters:
  sSaveAs - String Name of the generated file.



mailMergePrint
public static void mailMergePrint(String sTemplateFileName, String sDataSourceFileName) throws MailMergeException(Code)
Mail Merges a template file with the values in DataSource File and prints the result. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  sTemplateFileName - java.lang.String Name of a word template file
Parameters:
  sDataSourceFileName - java.lang.String Name of a DataSoure File usually a .csv file.



mailMergePrint
public static void mailMergePrint(String sTemplateFileName, String sDataSourceFileName, Hashtable htFields) throws MailMergeException(Code)
Mail Merges a template file with the values in DataSource File and a Hashtable and prints the result. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  sTemplateFileName - java.lang.String Name of a word template file
Parameters:
  sDataSourceFileName - java.lang.String Name of a DataSoure File usually a .csv file.
Parameters:
  htFields - java.util.Hashtable A hashtable of field names & values to be used to populate template.



mailMergePrint
public static void mailMergePrint(String sTemplateFileName, Hashtable htFields) throws MailMergeException(Code)
Mail Merges a template file with the values in the Hastable and prints the result. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  sTemplateFileName - java.lang.String Name of a word template file
Parameters:
  htFields - java.util.Hashtable A hashtable of field names & values to be used to populate template.



mailMergePrintToFile
public static void mailMergePrintToFile(String sTemplateFileName, String sDataSourceFileName, String sPrintFileName) throws MailMergeException(Code)
Mail Merges a template file with the values in DataSource File and prints the result to a file. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  sTemplateFileName - java.lang.String Name of a word template file
Parameters:
  sDataSourceFileName - java.lang.String Name of a DataSoure File usually a .csv file.
Parameters:
  sPrintFileName - java.lang.String Name of the printed file output



mailMergePrintToFile
public static void mailMergePrintToFile(String sTemplateFileName, String sDataSourceFileName, String sPrintFileName, Hashtable htFields) throws MailMergeException(Code)
Mail Merges a template file with the values in DataSource File and Hashtable and prints the result to a file. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  sTemplateFileName - java.lang.String Name of a word template file
Parameters:
  sDataSourceFileName - java.lang.String Name of a DataSoure File usually a .csv file.
Parameters:
  sPrintFileName - java.lang.String Name of the printed file output
Parameters:
  htFields - java.util.Hashtable A hashtable of field names & values to be used to populate template.



mailMergePrintToFile
public static void mailMergePrintToFile(String sTemplateFileName, String sPrintFileName, Hashtable htFields) throws MailMergeException(Code)
Mail Merges a template file with the values in the Hastable and prints the result to a file. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  sTemplateFileName - java.lang.String Name of a word template file
Parameters:
  sPrintFileName - java.lang.String Name of the printed file output
Parameters:
  htFields - java.util.Hashtable A hashtable of field names & values to be used to populate template.



mailMergeSaveAs
public static void mailMergeSaveAs(String sTemplateFileName, String sDataSourceFileName, String sSaveAsFileName) throws MailMergeException(Code)
Mail Merges a template file with the values in DataSource File and saves the result to a file. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  sTemplateFileName - java.lang.String Name of a word template file
Parameters:
  sDataSourceFileName - java.lang.String Name of a DataSoure File usually a .csv file.
Parameters:
  sSaveAsFileName - java.lang.String Name of the saved file



mailMergeSaveAs
public static void mailMergeSaveAs(String sTemplateFileName, String sDataSourceFileName, String sSaveAsFileName, Hashtable htFields) throws MailMergeException(Code)
Mail Merges a template file with the values in DataSource File and Hashtable and saves the result to a file. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  sTemplateFileName - java.lang.String Name of a word template file
Parameters:
  sDataSourceFileName - java.lang.String Name of a DataSoure File usually a .csv file.
Parameters:
  sSaveAsFileName - java.lang.String Name of the saved file
Parameters:
  htFields - java.util.Hashtable A hashtable of field names & values to be used to populate template.



mailMergeSaveAs
public static void mailMergeSaveAs(String sTemplateFileName, String sSaveAsFileName, Hashtable htFields) throws MailMergeException(Code)
Mail Merges a template file with the values in the Hastable and saves the result to a file. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  sTemplateFileName - java.lang.String Name of a word template file
Parameters:
  sSaveAsFileName - java.lang.String Name of the saved file
Parameters:
  htFields - java.util.Hashtable A hashtable of field names & values to be used to populate template.



print
public void print(String sTemplateFileName, String sDataSourceFileName) throws MailMergeException(Code)
Prints a Template File after Mail Merging with a Datasource. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  sTemplateFileName - java.lang.String Name of the word template file
Parameters:
  sDataSourceFileName - java.lang.String Name of the Data Source File usually a .csv file



printToFile
public void printToFile(String sTemplateFileName, String sDataSourceFileName, String sPrintFileName) throws MailMergeException(Code)
Prints to a File a Template File after Mail Merging with a Datasource. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  sTemplateFileName - java.lang.String Name of the word template file
Parameters:
  sDataSourceFileName - java.lang.String Name of the Data Source File usually a .csv file
Parameters:
  sPrintFileName - java.lang.String Name of the Print File Output.



run
public void run()(Code)



saveAs
public void saveAs(String sTemplateFileName, String sDataSourceFileName, String sSaveAsFileName) throws MailMergeException(Code)
Saves to a File a Template File after Mail Merging with a Datasource. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  sTemplateFileName - java.lang.String Name of the word template file
Parameters:
  sDataSourceFileName - java.lang.String Name of the Data Source File usually a .csv file
Parameters:
  sSaveAsFileName - java.lang.String Name of the Saved File.



setAutoPrint
public void setAutoPrint(boolean bAutoPrint) throws MailMergeException(Code)
Indicates that if the document is view that it should auto print. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  bAutoPrint - boolean If true document will automatically print if viewed.



setBackground
public void setBackground(File fBackground) throws MailMergeException(Code)
Sets the Background of a Word Document. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  fBackground - java.io.File A File pointing to a background for the document



setBottomMargin
public void setBottomMargin(float fBottomMargin)(Code)
Sets the Bottom Margin of a Word Document. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  fBottomMargin - float Bottom Margin in Inches



setFooterDistance
public void setFooterDistance(float fFooterDistance)(Code)
Sets the Footer Distance of a Word Document. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  fFooterDistance - float Footer Distance in Inches



setGutter
public void setGutter(float fGutter)(Code)
Sets the Gutter of a Word Document. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  fGutter - float Gutter in Inches



setHeaderDistance
public void setHeaderDistance(float fHeaderDistance)(Code)
Sets the Header Distance of a Word Document. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  fHeaderDistance - float Header Distance in Inches



setLeftMargin
public void setLeftMargin(float fLeftMargin)(Code)
Sets the Left Margin of a Word Document. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  fLeftMargin - float Left Margin in Inches



setPrinter
public void setPrinter(String sPrinter)(Code)
Sets the Printer for a Word Document. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  sPrinter - java.lang.String A String representing the printer to print to.



setRightMargin
public void setRightMargin(float fRightMargin)(Code)
Sets the Right Margin of a Word Document. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  fRightMargin - float Right Margin in Inches



setTopMargin
public void setTopMargin(float fTopMargin)(Code)
Sets the Top Margin of a Word Document. Creation date: (3/15/02 10:44:02 AM)
Parameters:
  fTopMargin - float Top Margin in Inches



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.