Java Doc for DatabaseReader.java in  » Content-Management-System » apache-lenya-2.0 » org » apache » cocoon » reading » 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 » Content Management System » apache lenya 2.0 » org.apache.cocoon.reading 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.cocoon.reading.AbstractReader
   org.apache.cocoon.reading.ServiceableReader
      org.apache.cocoon.reading.DatabaseReader

DatabaseReader
public class DatabaseReader extends ServiceableReader implements Configurable,Disposable,CacheableProcessingComponent(Code)
This Reader pulls a resource from a database. It is configured with the Connection to use, parameters specify the table and column to pull the image from, and source specifies the source key information.
author:
   Berin Loritsch
version:
   CVS $Id: DatabaseReader.java 452159 2006-10-02 18:20:45Z vgritsenko $




Method Summary
public  voidconfigure(Configuration conf)
     Configure the Reader so that we can use the same database for all instances.
public  voiddispose()
    
public  voidgenerate()
     Generates the resource we need to retrieve verbatim from the database.
public  java.io.SerializablegetKey()
     Generate the unique key.
public  StringgetMimeType()
    
protected  StringgetQuery()
     This method builds the query string used for accessing the database.
public  SourceValiditygetValidity()
     Generate the validity object.
protected  booleanmodifiedSince(ResultSet set, Request request, Response response)
     Tests whether a resource has been modified or not.
public  voidrecycle()
    
public  voidserialize(Response response)
     This method actually performs the serialization.
public  voidservice(ServiceManager manager)
    
public  voidsetup(SourceResolver resolver, Map objectModel, String src, Parameters par)
     Set the SourceResolver the object model Map, the source and sitemap Parameters used to process the request.



Method Detail
configure
public void configure(Configuration conf) throws ConfigurationException(Code)
Configure the Reader so that we can use the same database for all instances.



dispose
public void dispose()(Code)



generate
public void generate() throws ProcessingException, SAXException, IOException(Code)
Generates the resource we need to retrieve verbatim from the database. Granted, this can be used for any resource from a database, so we may want to get rid of the bias toward images. This reader requires a number of parameters:
 <parameter name="table" value="database_table_name"/>
 <parameter name="image" value="database_resource_column_name"/>
 <parameter name="key" value="database_lookup_key_column_name"/>
 
Please note that if any of those parameters are missing, this Reader cannot function. There are a number of other parameters that allow you to provide hints for the reader to optimize resource use:
 <parameter name="last-modified" value="database_timestamp_column_name"/>
 <parameter name="content-type" value="content_mime_type"/>
 <parameter name="type-column" value="database_content_mime_type_column"/>
 <parameter name="expires" value="number_of_millis_before_refresh"/>
 <parameter name="where" value="alternate_key = 'foo'"/>
 <parameter name="order-by" value="alternate_key DESC"/>
 
Lastly, the key value is derived from the value of the source string.



getKey
public java.io.Serializable getKey()(Code)
Generate the unique key. This key must be unique inside the space of this component. The generated key hashes the src



getMimeType
public String getMimeType()(Code)



getQuery
protected String getQuery() throws ProcessingException(Code)
This method builds the query string used for accessing the database. If the required parameters do not exist, then we cannot build a correct query.



getValidity
public SourceValidity getValidity()(Code)
Generate the validity object. The generated validity object or null if thecomponent is currently not cacheable.



modifiedSince
protected boolean modifiedSince(ResultSet set, Request request, Response response) throws SQLException(Code)
Tests whether a resource has been modified or not. As Blobs and database columns usually do not have intrinsic dates on them (at least easily accessible), we have to have a database column that holds a date for the resource. Please note, that the database column must be a Timestamp column. In the absence of such a column this method always returns true. This is because databases are much more prone to change than filesystems, and don't have intrinsic timestamps on column updates.



recycle
public void recycle()(Code)



serialize
public void serialize(Response response) throws IOException, SQLException(Code)
This method actually performs the serialization.



service
public void service(ServiceManager manager) throws ServiceException(Code)



setup
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException(Code)
Set the SourceResolver the object model Map, the source and sitemap Parameters used to process the request.



Fields inherited from org.apache.cocoon.reading.ServiceableReader
protected ServiceManager manager(Code)(Java Doc)

Methods inherited from org.apache.cocoon.reading.ServiceableReader
public void service(ServiceManager manager) throws ServiceException(Code)(Java Doc)

Fields inherited from org.apache.cocoon.reading.AbstractReader
protected Map objectModel(Code)(Java Doc)
protected OutputStream out(Code)(Java Doc)
protected Parameters parameters(Code)(Java Doc)
protected SourceResolver resolver(Code)(Java Doc)
protected String source(Code)(Java Doc)

Methods inherited from org.apache.cocoon.reading.AbstractReader
public long getLastModified()(Code)(Java Doc)
public String getMimeType()(Code)(Java Doc)
public void recycle()(Code)(Java Doc)
public void setOutputStream(OutputStream out)(Code)(Java Doc)
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException(Code)(Java Doc)
public boolean shouldSetContentLength()(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.