Jörn Nettingsmeier wrote:
hi!

i'm playing around a bit to implement my suggestions for a new workflow menu. i figured the easiest thing to start with would be a per-user "notify submitter" preference.

i read ChangeVisiblity.java and copied it's structure. in pubs/default/config/menus/generic.xsp i added

<menu i18n:attr="name" name="Workflow">
  <block>
...
  </block>
  <block>
<item uc:usecase="site.changeNotification"><xsp:expr>notificationChar</xsp:expr><i18n:text>Notify submitter</i18n:text></item>
  </block>
</menu>

and declared a dummy notificationChar that is always "x" for a start.

then i created a file src/java/org/apache/lenya/cms/site/usecases/ChangeNotification.java.

Just a note - that should go into the notification module.

when i do "./build.sh --noconfig" it seems to be built along with the rest. it does nothing so far but implements the same methods as ChangeVisibility.

now when i restart lenya and look at the workflow menu, the new option appears to be grayed out. do i need to register this new usecase somewhere?

Yes, use a patch file

modules/notification/config/cocoon-xconf/usecase-changeNotification.xconf

i see that ChangeVisibility uses a patchfile, but i don't quite understand what it does.

It adds the component declaration to cocoon.xconf.
You'll find more info in the Avalon/Excalibur docs:

http://wiki.apache.org/avalon/IntroductionToAvalon
http://excalibur.apache.org/framework/index.html


next q: i think the switch "notify submitter" should ultimately become a user preference (which depends on the user having "reviewer" status). i looked at the "user" interface, which uses statically implemented get/set functions for each user setting. i wonder whether that's going to become a little kludgy if more settings are to be added... wouldn't it be nice to have some sort of dynamic preference list in the future?

That would certainly be a good idea.

that way, modifications don't have to be done in the interface and all classes that implement it. we just would have a vector or whatever it's called in java of preferences, and the base classes don't need to know what the individual prefs mean.

anyway, that's a little out of scope for now. how should i proceed to add a per-user two-state setting for notification? modify the user interface and everything above? or is there a more idiomatic way to do it?

Actually I'd just add the information to the session for the moment.

-- Andreas


--
Andreas Hartmann
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
[EMAIL PROTECTED]                     [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to