Hi,

We have given thoughts about providing easier ways to implement that
kind of custom behaviours, I just filled a JIRA issue about it:
https://jira.nuxeo.org/browse/NXP-4798
We think the solution may be to provide hooks by raising seam events
in DocumentActionsBean methods, even more if overriding the component
is a problem for seam remoting features.
Do  you think it could fit your use case? If so, please feel free to
attach a diff to the jira issue: it's not planned for the 5.3.1
release but with a little help it could make it in time :)

Thanks,

-- 
Anahide Tchertchian, Nuxeo
Mail: [email protected] - Tel: +33 (0)1 40 33 79 87
http://www.nuxeo.com - http://www.nuxeo.org

On 24 February 2010 22:36, Sean Radford <[email protected]> wrote:
> Hi,
>
> For some document types we have a requirement to automatically prefix the
> usual generated document name with an additional code:
>
> i.e. instead of the document with title "My Test Document" getting the name
> "my-test-document", it would be something like "XYZ123-my-test-document"
>
> I first looked into using an event handling listening to the aboutToCreate
> event, but this does not work as any changes to the document path of the
> passed-in DocumentModel are not reflected/persisted. (Cannot remember the
> details but the handling class keeps a reference to the original name/path
> and uses that instead of the name/path that comes back in the DocumentModel
> passed in the Event).
>
> As a fall-back I decided to override DocumentActionsBean with my own class
> (higher Seam install precedence) and modified the
> saveDocument(DocumentModel) appropriately.
>
> This all work fine.... except I've now noticed an odd issue.... ticking the
> file/folder list checkboxes in the UI do not work...
>
> Hunting, I believe the problem is due to the Seam Remoting for
> DocumentActions not being setup correctly. The generated javascript should
> be:
>
> Seam.Remoting.type.documentActions = function() {
>  this.__callback = new Object();
>  Seam.Remoting.type.documentActions.prototype.processSelectRow =
> function(p0, p1, p2, p3, callback) {
>   return Seam.Remoting.execute(this, "processSelectRow", [p0, p1, p2, p3],
> callback);
>  }
>  Seam.Remoting.type.documentActions.prototype.checkCurrentDocAndProcessSelectRow
> = function(p0, p1, p2, p3, p4, callback) {
>   return Seam.Remoting.execute(this, "checkCurrentDocAndProcessSelectRow",
> [p0, p1, p2, p3, p4], callback);
>  }
>  Seam.Remoting.type.documentActions.prototype.checkCurrentDocAndProcessSelectPage
> = function(p0, p1, p2, p3, callback) {
>   return Seam.Remoting.execute(this, "checkCurrentDocAndProcessSelectPage",
> [p0, p1, p2, p3], callback);
>  }
>  Seam.Remoting.type.documentActions.prototype.processSelectPage =
> function(p0, p1, p2, callback) {
>   return Seam.Remoting.execute(this, "processSelectPage", [p0, p1, p2],
> callback);
>  }
> }
> Seam.Remoting.type.documentActions.__name = "documentActions";
>
>
> but is:
>
> Seam.Remoting.type.documentActions = function() {
>  this.comment = undefined;
>  Seam.Remoting.type.documentActions.prototype.getComment = function() {
> return this.comment; }
>  Seam.Remoting.type.documentActions.prototype.setComment = function(comment)
> { this.comment = comment; }
> }
>
> Seam.Remoting.type.documentActions.__name = "documentActions";
> Seam.Remoting.type.documentActions.__metadata = [
>  {field: "comment", type: "str"}];
>
>
> I guess this is due to the @WebRemote method declarations now being on a
> superclass instead of the actual class. I could copy-and-paste the whole of
> the original DocumentActionsBean, but this seems nasty.
>
> Does anyone have any ideas on how to achieve what I want (auto prefixing of
> document names) in a nice way? Should the aboutToCreate event allow one to
> change the document name?
>
> Any help much appreciated.
>
> Thanks and regards,
>
> Sean
>
>
> --
> Dr. Sean Radford, MBBS, MSc
> http://www.tacola.com/
> t: +44 (0)845 KEY HELP
> t: +44 (0)845 539 4357
> m: +44 (0)7802 24 24 86
>
> _______________________________________________
> ECM mailing list
> [email protected]
> http://lists.nuxeo.com/mailman/listinfo/ecm
> To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm
>
_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm
To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm

Reply via email to