RE: [Vif-devel] suspend participation
Brought to you by:
aktion-hip
|
From: Luthiger S. B. <ben...@id...> - 2006-03-04 23:58:46
|
Dear Jacek
The calendar widget looks cool and works fine, thanks a lot.
Storing of the data entered works fine too.
However, in the code to store the suspend period I saw that you iterate =
through the query result of the groups the user is participating, =
retrieve the entry in tblParticipant and eventually store the suspend =
period. This needs two calls to the database for every group the user is =
participating.
That should be reduced to one single but clever update command. =
Unfortunately, the framework doesn't offer this feature yet :-( This is =
a serious shortage of the framework and I'll fix that immediately.
After having checked in the improved update functionality (I'll do this =
next Monday) you should be able to implement in =
org.hip.vif.bom.impl.ParticipantHomeImpl a method like:
---
public void suspendParticipation(Long inActorID, Timestamp inFrom, =
Timestamp inTo)=20
throws BOMChangeValueException {
try {
KeyObject lChange =3D new KeyObjectImpl();
lChange.setValue(ParticipantHome.KEY_SUSPEND_FROM, inFrom);
lChange.setValue(ParticipantHome.KEY_SUSPEND_TO, inTo);
=09
KeyObject lWhere =3D new KeyObjectImpl();
lWhere.setValue(ParticipantHome.KEY_MEMBER_ID, inActorID);
PreparedUpdateStatement lStatement =3D new =
PreparedUpdateStatement(this, lChange, lWhere);
lStatement.executeUpdate();
lStatement.commit();
}=20
catch (VException exc) {
throw new BOMChangeValueException(exc.getMessage());
}=20
catch (SQLException exc) {
throw new BOMChangeValueException(exc.getMessage());
}
}
---
In org.hip.vif.forum.tasks.impl.SuspendSaveTask all you'll need to do is =
one single command to store the suspend period:
---
getParticipantHome().suspendParticipation(lActorID, new =
Timestamp(sdf.parse(lSuspendFrom).getTime()),new =
Timestamp(sdf.parse(lSuspendTo).getTime()));
---
Some more suggestions:
- Information displayed in the list of discussion groups the participant =
is registered: At this point, only the group's title and description are =
relevant. Group size and state can be eliminated, thus giving the =
description column more space (in case of longer descriptions).
- Place of button "Suspend" should be above the list (beyond the form) =
for that users don't have to scroll in case of long lists.
- If a user successfully saves his input, the input fields should be =
filled when the form is redisplayed.=20
- If a user clicks the "Suspend" button without entering (valid) data in =
both fields, a warning should be displayed (instead of the error message =
"An error occurred in the application. Please contact the =
administrator.").
- I noticed that if I enter a date like 03-20-2006 (instead of =
20-03-2006), the date is transformed to some date in the next year. =
However, a feedback like "The date you entered is not a valid date" is =
better than silently transforming the input in a valid, but not intended =
date. Is this possible?
- Language and date format should be passed to the page and calendar =
widget displayed.
So, there's still something to do ;-)
On thing that troubled me at the beginning was that I had to patch the =
popcalendar.js: In the last line of this file I had to write "init();" =
instead of "window.onload =3D init;". Can you explain that? I use =
Firefox 1.5.0.1, which browser do you use?
All in all I'm very pleased with the work you've done so far.
Greetings,
Benno
> -----Original Message-----
> From: vif...@li...
> [mailto:vif...@li...]On Behalf Of Jacek
> Obarymski
> Sent: Mittwoch, 1. M=E4rz 2006 00:33
> To: vif...@li...
> Subject: [Vif-devel] suspend participation
>=20
>=20
> Dear Beno
>=20
> I've committed code concerning the suspend participation task to my
> brunch of the repository. German language version hast to be added
> yet.
>=20
>=20
> --=20
> Regards
> Jacek mailto:jac...@po...
>=20
>=20
|