Java Doc for Concatenator.java in  » Web-Crawler » WebSPHINX » websphinx » 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 » Web Crawler » WebSPHINX » websphinx 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   websphinx.HTMLTransformer
      websphinx.LinkTransformer
         websphinx.RewritableLinkTransformer
            websphinx.Concatenator

Concatenator
public class Concatenator extends RewritableLinkTransformer (Code)
Transformer that concatenates multiple pages into a single HTML page.

The entire set of pages is preceded by a "prolog" and followed by an "epilog", which are constant strings of HTML. Each page is preceded by a "header" and followed by a "footer". Adjacent pages are separated by a "divider".

Concatenator performs the following transformations on pages before appending them together:

  • deletes elements that would conflict, including <HEADf>, <TITLEf>, <BODYf>, <HTMLf>, <STYLE>, and <FRAMES>.
  • deletes <BASEf> or replaces it with a user-specified <BASEf>
  • changes links among the written pages into in-page references, of the form "#concatenator_N"
  • changes links to other pages into absolute references


Field Summary
public static  StringdefaultDivider
    
public static  StringdefaultEpilog
    
public static  StringdefaultFooter
    
public static  StringdefaultHeader
    
public static  StringdefaultProlog
    
 Stringdivider
    
 Stringepilog
    
 Stringfooter
    
 Stringheader
    
 intnPages
    
 booleanneedRewrite
    
 Stringprolog
    

Constructor Summary
public  Concatenator(String filename)
     Make a new Concatenator that writes to a file.

Method Summary
public synchronized  voidclose()
     Close the concatenation.
public  StringgetDivider()
     Get the divider.
public  StringgetEpilog()
     Get the epilog.
public synchronized  intgetPageCount()
     Get number of pages written to this mirror.
public  StringgetPageFooter()
     Get the footer.
public  StringgetPageHeader()
     Get the header.
public  StringgetProlog()
     Get the prolog.
protected  voidhandleElement(Element elem)
     Process an HTML element for concatenation.
public static  voidmain(String[] args)
    
public synchronized  voidrewrite()
     Rewrite the concatenation.
public synchronized  voidsetDivider(String divider)
     Set the divider.
public synchronized  voidsetEpilog(String epilog)
     Set the epilog.
public synchronized  voidsetPageFooter(String footer)
     Set the footer.
public synchronized  voidsetPageHeader(String header)
     Set the header.
public synchronized  voidsetProlog(String prolog)
     Set the prolog.
Parameters:
  prolog - string of HTML that is emitted at the beginningof the concatenation.
public synchronized  voidwritePage(Page page)
     Write a page to the concatenation.

Field Detail
defaultDivider
public static String defaultDivider(Code)



defaultEpilog
public static String defaultEpilog(Code)



defaultFooter
public static String defaultFooter(Code)



defaultHeader
public static String defaultHeader(Code)



defaultProlog
public static String defaultProlog(Code)



divider
String divider(Code)



epilog
String epilog(Code)



footer
String footer(Code)



header
String header(Code)



nPages
int nPages(Code)



needRewrite
boolean needRewrite(Code)



prolog
String prolog(Code)




Constructor Detail
Concatenator
public Concatenator(String filename) throws IOException(Code)
Make a new Concatenator that writes to a file.
Parameters:
  filename - Filename to write concatenated pages to
exception:
  IOException - if file cannot be opened




Method Detail
close
public synchronized void close() throws IOException(Code)
Close the concatenation. Makes sure all the links among concatenated pages have been fixed up and closes the file.



getDivider
public String getDivider()(Code)
Get the divider. string of HTML that is emitted betweeneach pair of pages.



getEpilog
public String getEpilog()(Code)
Get the epilog. string of HTML that is emitted afterthe entire concatenation.



getPageCount
public synchronized int getPageCount()(Code)
Get number of pages written to this mirror. number of calls to writePage() on this mirror



getPageFooter
public String getPageFooter()(Code)
Get the footer. string of HTML that is emitted aftereach page.



getPageHeader
public String getPageHeader()(Code)
Get the header. string of HTML that is emitted beforeeach page.



getProlog
public String getProlog()(Code)
Get the prolog. string of HTML that is emitted at the beginningof the concatenation.



handleElement
protected void handleElement(Element elem) throws IOException(Code)
Process an HTML element for concatenation. Deletes tags that would conflict with other pages (such as <HEAD>), changes the URLs in Link elements, and deletes or remaps the BASE element.
Parameters:
  elem - HTML element to process



main
public static void main(String[] args) throws Exception(Code)



rewrite
public synchronized void rewrite() throws IOException(Code)
Rewrite the concatenation. Makes sure all the links among concatenated pages have been fixed up.



setDivider
public synchronized void setDivider(String divider)(Code)
Set the divider.
Parameters:
  divider - string of HTML that is emitted betweeneach pair of pages.



setEpilog
public synchronized void setEpilog(String epilog)(Code)
Set the epilog.
Parameters:
  epilog - string of HTML that is emitted afterthe entire concatenation.



setPageFooter
public synchronized void setPageFooter(String footer)(Code)
Set the footer. The footer can contain the same macros as the header (%t, %u, %a, %p); see setPageHeader for more details.
Parameters:
  footer - string of HTML that is emitted aftereach page.



setPageHeader
public synchronized void setPageHeader(String header)(Code)
Set the header. The header can contain macro codes which are replaced with attributes of the page about to be written:
%t
title of the page
%u
URL of page
%a
anchor name of the page ("pageN", where N is the page number)
%p
page number (starting from 1)

Parameters:
  header - string of HTML that is emitted beforeeach page. The default value is:
<TABLE WIDTH="100%"><TR>\n
<TD ALIGN=left><A NAME="%a">%t [%u]</A>\n
<TD ALIGN=right>Page %p</TABLE>\n



setProlog
public synchronized void setProlog(String prolog)(Code)
Set the prolog.
Parameters:
  prolog - string of HTML that is emitted at the beginningof the concatenation. Default value is:
<HTML><HEAD><TITLE>Concatenation</TITLE></HEAD><BODY>\n



writePage
public synchronized void writePage(Page page) throws IOException(Code)
Write a page to the concatenation.
Parameters:
  page - Page to write



Fields inherited from websphinx.RewritableLinkTransformer
final static int BUFFER_SIZE(Code)(Java Doc)
final static String PLACEHOLDER(Code)(Java Doc)

Methods inherited from websphinx.RewritableLinkTransformer
public void close() throws IOException(Code)(Java Doc)
protected void handleLink(Link link) throws IOException(Code)(Java Doc)
public void rewrite() throws IOException(Code)(Java Doc)

Fields inherited from websphinx.LinkTransformer
protected URL base(Code)(Java Doc)
boolean emitBaseElement(Code)(Java Doc)
protected Hashtable map(Code)(Java Doc)
boolean needToEmitBase(Code)(Java Doc)

Methods inherited from websphinx.LinkTransformer
public URL getBase()(Code)(Java Doc)
public boolean getEmitBaseElement()(Code)(Java Doc)
protected void handleBase(Element elem) throws IOException(Code)(Java Doc)
protected void handleElement(Element elem) throws IOException(Code)(Java Doc)
protected void handleLink(Link link) throws IOException(Code)(Java Doc)
public boolean isMapped(URL url)(Code)(Java Doc)
public String lookup(URL base, URL url)(Code)(Java Doc)
public synchronized void map(URL url, String href)(Code)(Java Doc)
public synchronized void map(URL url, URL newURL)(Code)(Java Doc)
public synchronized void setBase(URL base)(Code)(Java Doc)
public synchronized void setEmitBaseElement(boolean emitBase)(Code)(Java Doc)
public synchronized void writePage(Page page) throws IOException(Code)(Java Doc)

Methods inherited from websphinx.HTMLTransformer
public synchronized void close() throws IOException(Code)(Java Doc)
protected void emit(Region r) throws IOException(Code)(Java Doc)
protected void emit(String string) throws IOException(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
public synchronized void flush() throws IOException(Code)(Java Doc)
public long getFilePointer() throws IOException(Code)(Java Doc)
public OutputStream getOutputStream()(Code)(Java Doc)
public Writer getOutputWriter()(Code)(Java Doc)
public RandomAccessFile getRandomAccessFile()(Code)(Java Doc)
protected void handleElement(Element elem) throws IOException(Code)(Java Doc)
public void seek(long pos) throws IOException(Code)(Java Doc)
public void setOutput(OutputStream out)(Code)(Java Doc)
public void setRandomAccessFile(RandomAccessFile raf)(Code)(Java Doc)
protected void transformContents(Element elem) throws IOException(Code)(Java Doc)
protected void transformElement(Element elem) throws IOException(Code)(Java Doc)
public synchronized void write(String string) throws IOException(Code)(Java Doc)
public synchronized void write(Region region) throws IOException(Code)(Java Doc)
public synchronized void writePage(Page page) throws IOException(Code)(Java Doc)

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.