[
https://jira.jboss.org/jira/browse/DNA-553?page=com.atlassian.jira.plugin...
]
Randall Hauch commented on DNA-553:
-----------------------------------
Enhanced the file system connector so that it is much easier to define how non-standard
properties can be made to appear on nt:folder, nt:file, and nt:resource nodes. By
default, the file system connector behaves as it has in the past: it only uses the
standard properties defined by JCR for files, folders and content nodes.
There is a new CustomPropertiesFactory interface that defines several methods for getting
and setting custom properties. Simply implement this interface, and call
FileSystemSource.setCustomPropertiesFactory(...) with an instance of your implementation.
(Or, optionally subclass FileSystemSource, set the factory in the subclass'
constructor, and inherit all other functionality).
The connector uses this factory whenever it reads "nt:folder",
"nt:file", or "nt:resource" nodes, and includes in these nodes the
properties returned by the factory. The factory methods take several arguments, including
the ExecutionContext (which can be used to obtain the PropertyFactory, value factories
used to create property values, and even the MIME type detector), the java.io.File object,
the Location (which includes the path), and other information. Hopefully this is
sufficient to construct the necessary custom properties.
File system connector should make it possible to extend/customize the
properties on the nt:folder, nt:file, and nt:resource nodes
---------------------------------------------------------------------------------------------------------------------------------
Key: DNA-553
URL:
https://jira.jboss.org/jira/browse/DNA-553
Project: DNA
Issue Type: Feature Request
Components: Connectors
Affects Versions: 0.6
Reporter: Randall Hauch
Assignee: Randall Hauch
Fix For: 0.7
Using the JCR API to access files is a common use case for the file system connector and
our JCR implementation. See the referenced forum thread.
However, there are times when additional properties from the files (e.g., properties of
PDF or MS Office files) are to be loaded onto the nt:folder, nt:file, and nt:resource
nodes. The current implementation makes this much more difficult to achieve than it
should be, since it requires creating a whole new connector and subclassing most of the
classes in the existing file system connector.
The existing classes should be changed so that it is far easier to add custom logic.
This change should be quite straightforward.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira