Hi Paul,
Another possibility is to replace the Attachment tab at the bottom of pages by your
version, with a form to add some extra metadata. As Aaron mentioned, it’s not too hard to
create your own XClass to hold extra attachment metadata and when uploading a new
attachment to add an XObject of that type to a page. Then in scripting you can access the
XObjects using the query manager.
Now XWiki already saves a few metadata related to the attachment. FYI we save by default:
<property name="docId" type="long"
column="XWA_DOC_ID" index="ATT_DOC_ID" />
<property name="filename" type="string"
column="XWA_FILENAME" length="255" not-null="true" />
<property name="filesize" type="integer"
column="XWA_SIZE"/>
<property name="mimeType" type="string"
column="XWA_MIMETYPE" length="255"/>
<property name="date" type="timestamp"
column="XWA_DATE" index="ATT_DATE" not-null="true" />
<property name="author" type="string"
column="XWA_AUTHOR" length="255" index="ATT_AUTHOR" />
<property name="version" type="string"
column="XWA_VERSION" length="255" not-null="true" />
<!-- Align the max comment size with the document max comment size (i.e.
XWD_COMMENT) -->
<property name="comment" type="string"
column="XWA_COMMENT" length="1023" />
where:
* docId is the reference to the document holding the attachment
* comment is not used in the UI at the moment (not sure why :)) but it should be possible
to easily add the UI for it.
Of course you have access to all these metadata from your page in any scripting language
(velocity, grooyv, etc), so you can display them in a table if you wish.
The attachment macro
(
http://extensions.xwiki.org/xwiki/bin/view/Extension/Attachments+Macro) displays several
of them but it could be improved to display more if need be.
What kind of extra metadata would you like to add? Some business-related metadata?
Thanks
-Vincent
On 21 Jan 2016 at 17:32:27, Aaron Hardy at AC
(ashtarcommunications@gmail.com(mailto:ashtarcommunications@gmail.com)) wrote:
I can't speak to whether there's a better/more
sensible way to do it, but
your last idea is certainly workable - on several XWiki sites I've defined
a custom class to hold attachment meta-data and then built a submission
form that saves meta-data (including the attachment url) along with the
attachment. The custom class is then used for display in a table, rather
than the built-in Attachment macro. It's a bit inelegant, but it works.
aaron
On Thu, Jan 21, 2016 at 11:14 AM, Paul Pinkerton (ACLCO)
wrote:
We are using a SharePoint site to house a
document library. I'd like to
move this into our xwiki site, but haven't figured out how to configure
pages in a way that would make this viable.
We use lists in SP - so people can add documents and when they upload
them, they need to add in fields such as a description of the document and
notes, usually related to when the document was current as of. The site
auto adds in who uploaded it.
While I can add pages that use the Attachment macro and that makes it easy
to display documents, it’s the extra fields that make the information more
valuable - and that's the functionality I'd be interested in.
One thought I had was to use a form which would then populate a table, but
not sure if that's a truly workable solution.
Thoughts or ideas would be welcomed!
Paul Pinkerton
KnowledgeNow Project/ ACLCO
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users