Hi!
Lockie wrote:
Hello all,
I'm running my Xwiki as an information management Intranet alongside a
networked drive that holds hundreds of documents. Based off the TODO
tutorial, I made a system of inputting these documents as objects on
individual pages that then appear on a filterable-sortable table. The link
being a windowsPath macro. The idea behind this is that users can access
these documents much easier.
So, you are using XWiki to "annotate" or add "metainformation" to
files
stored in your Windows file system, on that networked hard drive. I
guess you have created a customized class where you fill in several
properties for each file. One of that properties stored the mapped path
for a given file. Provided the box where you are running the client
accessing XWiki has the correct mapping, users will be able to recover
each file by entering this path in an explorer window. What you want is
to have "active links" to this mapped drive.
Concerning this development I think you must be aware of the current
developments oriented to set an alternative store for attachments in the
system file. Check devs list for "The future of attachments and
attachment versioning" and related threads and Jira issues. Once this is
working, you could have this networked drive set as alternative storage
location. About having alternative methods to access those files...
well, we'll see! It is always tricky to access a single repository with
several, let's call them, agents (XWiki will be the primary agent, that
storing files and being able to apply all its logic to add huge amounts
of information and metainformation to each stored file).
The problem with this system is if a new document is
created,
Do you mean a new file stored in the file system?
Perhaps this initiative could be useful for you by changing stored
attachments with paths/filenames in the networked drive.
Lool for [xwiki-users] Create application similar to attach file
application in the users list.
the user then
has to manually add it to this table, and if the document's title is
changed, the link gets broken. So I'm after a way of automatically listing
the documents and have working links, to make it require as little upkeep as
possible.
To avoid to get this links broken, you need to reference the files with
a UID independente from the name. By the end, even though I'm not a
developer, you will end requiring the complexity needed to develop the
alternative repository referenced above.
So far I am able to list the name and the path of all
the documents in the
directory, but I need some help in integrating the sortable table html tags
and turning the path into a working link, without breaking the groovy macro.
This is what I have so far:
----
{{groovy}}
import groovy.io.FileType
def list = []
def dir = new File("R:/Quality/FORMS/")
dir.eachFileRecurse (FileType.FILES) { file ->
list << file
}
list.each {
println it.name
println it.path
}
{{/groovy}}
----
Any help would be appreciated,
Thanks,
-----
----
Lockie
Finally, consider also this Jira issue about UNC paths...
http://jira.xwiki.org/jira/browse/XWIKI-193
Hope this helps!
Ricardo
--
Ricardo RodrÃguez
CTO
eBioTIC.
Life Sciences, Data Modeling and Information Management Systems