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


java.lang.Object
   org.apache.cocoon.jcr.source.JCRSourceFactory

All known Subclasses:   org.apache.lenya.cms.jcr.LenyaJCRSourceFactory,
JCRSourceFactory
public class JCRSourceFactory implements ThreadSafe,SourceFactory,Configurable,Serviceable(Code)
JCRSourceFactory is an implementation of ModifiableTraversableSource on top of a JCR (aka JSR-170) repository.

Since JCR allows a repository to define its own node types, it is necessary to configure this source factory with a description of what node types map to "files" and "folders" and the properties used to store source-related data.

A typical configuration for a naked Jackrabbit repository is as follows:

 <source-factories>
 <component-instance class="org.apache.cocoon.jcr.source.JCRSourceFactory" name="jcr">
 <folder-node type="rep:root"  new-file="nt:file" new-folder="nt:folder"/>
 <folder-node type="nt:folder" new-file="nt:file"/>
 <file-node type="nt:file" content-path="jcr:content" content-type="nt:resource"/>
 <file-node type="nt:linkedFile" content-ref="jcr:content"/>
 <content-node type="nt:resource"
 content-prop="jcr:data"
 mimetype-prop="jcr:mimeType"
 lastmodified-prop="jcr:lastModified"
 validity-prop="jcr:lastModified"/>
 </component-instance>
 </source-factories>
 
A <folder-node> defines a node type that is mapped to a non-terminal source (i.e. that can have children). The new-file and new-folder attributes respectively define what node types should be used to create a new terminal and non-terminal source.

A <file-node> defines a note type that is mapped to a terminal source (i.e. that can have some content). The content-path attribute defines the path to the node's child that actually holds the content, and content-type defines the type of this content node.

The content-ref attribute is used to comply with JCR's nt:linkedFile definition where the content node is not a direct child of the file node, but is referenced by a property of this file node. Such node types are read-only as there's no way to indicate where the referenced content node should be created.

A <content-node> defines a node type that actually holds the content of a file-node. The content-prop attribute must be present and gives the name of the node's binary property that will hold the actual content. Other attributes are optional:

  • mimetype-prop defines a string property holding the content's MIME type,
  • lastmodified-prop defines a date property holding the node's last modification date. It is automatically updated when content is written to the content-node.
  • validity-prop defines a property that gives the validity of the content, used by Cocoon's cache. If not specified, lastmodified-prop is used, if present. Otherwise the source has no validity and won't be cacheable.

The format of URIs for this source is a path in the repository, and it is therefore currently limited to repository traversal. Further work will add the ability to specify query strings.
version:
   $Id: JCRSourceFactory.java 449153 2006-09-23 04:27:50Z crossley $


Inner Class :protected static class NodeTypeInfo
Inner Class :protected static class FolderTypeInfo extends NodeTypeInfo
Inner Class :protected static class FileTypeInfo extends NodeTypeInfo
Inner Class :protected static class ContentTypeInfo extends NodeTypeInfo

Field Summary
protected  ServiceManagermanager
    
protected  Repositoryrepo
    
protected  Stringscheme
    
protected  MaptypeInfos
    


Method Summary
public  voidconfigure(Configuration config)
    
public  NodecreateContentNode(Node fileNode)
     Create the content node for a file node.
public  NodecreateFileNode(Node folderNode, String name)
     Create a child file node in a folder node.
public  JCRNodeSourcecreateSource(JCRNodeSource parent, Node node)
    
public  JCRNodeSourcecreateSource(Session session, String path)
    
public  NodegetContentNode(Node node)
    
public  PropertygetContentProperty(Node node)
    
public  StringgetFolderNodeType(Node folderNode)
     Get the node type to create a new subfolder of a given folder node.
public  PropertygetLastModifiedDateProperty(Node node)
    
public  PropertygetMimeTypeProperty(Node node)
    
public  StringgetScheme()
    
public  SourcegetSource(String uri, Map parameters)
    
public  NodeTypeInfogetTypeInfo(Node node)
     Get the type info for a node.
public  NodeTypeInfogetTypeInfo(String typeName)
     Get the type info for a given node type name.
public  PropertygetValidityProperty(Node node)
    
public  booleanisCollection(Node node)
     Does a node represent a collection (i.e.
protected  voidlazyInit()
    
public  voidrelease(Source source)
    
public  voidservice(ServiceManager manager)
    

Field Detail
manager
protected ServiceManager manager(Code)



repo
protected Repository repo(Code)
The repository we use



scheme
protected String scheme(Code)
Scheme, lazily computed at the first call to getSource()



typeInfos
protected Map typeInfos(Code)
The NodeTypeInfo for each of the types described in the configuration





Method Detail
configure
public void configure(Configuration config) throws ConfigurationException(Code)



createContentNode
public Node createContentNode(Node fileNode) throws RepositoryException(Code)
Create the content node for a file node.
Parameters:
  fileNode - the file node the content node for this file node
throws:
  RepositoryException - if some error occurs



createFileNode
public Node createFileNode(Node folderNode, String name) throws RepositoryException(Code)
Create a child file node in a folder node.
Parameters:
  folderNode - the folder node
Parameters:
  name - the child's name the newly created child node
throws:
  RepositoryException - if some error occurs



createSource
public JCRNodeSource createSource(JCRNodeSource parent, Node node) throws SourceException(Code)
Creates a new source given its parent and its node
Parameters:
  parent - the parent
Parameters:
  node - the node a new source
throws:
  SourceException -



createSource
public JCRNodeSource createSource(Session session, String path) throws SourceException(Code)
Creates a new source given a session and a path
Parameters:
  session - the session
Parameters:
  path - the absolute path a new source
throws:
  SourceException -



getContentNode
public Node getContentNode(Node node) throws RepositoryException(Code)
Get the content node for a given node
Parameters:
  node - the node for which we want the content node the content node
throws:
  RepositoryException - if some error occurs, or if the given node isn't a file node or a content node



getContentProperty
public Property getContentProperty(Node node) throws RepositoryException(Code)
Get the content property for a given node
Parameters:
  node - a file or content node the content property
throws:
  RepositoryException - if some error occurs



getFolderNodeType
public String getFolderNodeType(Node folderNode) throws RepositoryException(Code)
Get the node type to create a new subfolder of a given folder node.
Parameters:
  folderNode - the child folder node type
throws:
  RepositoryException - if some error occurs



getLastModifiedDateProperty
public Property getLastModifiedDateProperty(Node node) throws RepositoryException(Code)
Get the lastmodified property for a given node
Parameters:
  node - a file or content node the lastmodified property, or null if no such property exists
throws:
  RepositoryException - if some error occurs



getMimeTypeProperty
public Property getMimeTypeProperty(Node node) throws RepositoryException(Code)
Get the mime-type property for a given node
Parameters:
  node - a file or content node the mime-type property, or null if no such property exists
throws:
  RepositoryException - if some error occurs



getScheme
public String getScheme()(Code)



getSource
public Source getSource(String uri, Map parameters) throws IOException, MalformedURLException(Code)



getTypeInfo
public NodeTypeInfo getTypeInfo(Node node) throws RepositoryException(Code)
Get the type info for a node.
Parameters:
  node - the node the type info
throws:
  RepositoryException - if node type couldn't be accessed or if no type info is found



getTypeInfo
public NodeTypeInfo getTypeInfo(String typeName) throws RepositoryException(Code)
Get the type info for a given node type name.
Parameters:
  typeName - the type name the type info
throws:
  RepositoryException - if no type info is found



getValidityProperty
public Property getValidityProperty(Node node) throws RepositoryException(Code)
Get the validity property for a given node
Parameters:
  node - a file or content node the validity property, or null if no such property exists
throws:
  RepositoryException - if some error occurs



isCollection
public boolean isCollection(Node node) throws RepositoryException(Code)
Does a node represent a collection (i.e. folder-node)?
Parameters:
  node - the node true if it's a collection
throws:
  RepositoryException - if some error occurs



lazyInit
protected void lazyInit()(Code)



release
public void release(Source source)(Code)



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



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.