/it-ru/trunk/webapp/WEB-INF/ak-itru.tld |
---|
File deleted |
/it-ru/trunk/webapp/WEB-INF/validation.xml |
---|
71,45 → 71,5 |
<msg name="currency" key="ak.itru.core.apartment.edit.price.wrong" /> |
</field> |
</form> |
<form name="ParticipantListForm"> |
<field property="event" depends="long"> |
<msg name="long" key="ak.itru.core.participant.edit.event.wrong" /> |
</field> |
</form> |
<form name="ParticipantForm"> |
<field property="event" depends="long"> |
<msg name="long" key="ak.itru.core.participant.edit.event.wrong" /> |
</field> |
<field property="id" depends="long"> |
<msg name="long" key="ak.itru.core.participant.edit.id.wrong" /> |
</field> |
</form> |
<form name="ParticipantEditForm"> |
<field property="event" depends="long"> |
<msg name="long" key="ak.itru.core.participant.edit.event.wrong" /> |
</field> |
<field property="id" depends="long"> |
<msg name="long" key="ak.itru.core.participant.edit.id.wrong" /> |
</field> |
<field property="nick" depends="required"> |
<msg name="required" key="ak.itru.core.participant.edit.nick.required" /> |
</field> |
<field property="email" depends="required,email"> |
<msg name="required" key="ak.itru.core.participant.edit.email.required" /> |
<msg name="email" key="ak.itru.core.participant.edit.email.wrong" /> |
</field> |
<field property="persons" depends="integer"> |
<msg name="integer" key="ak.itru.core.participant.edit.persons.wrong" /> |
</field> |
<field property="freeTransport" depends="integer"> |
<msg name="integer" key="ak.itru.core.participant.edit.freetransport.wrong" /> |
</field> |
<field property="freeSleep" depends="integer"> |
<msg name="integer" key="ak.itru.core.participant.edit.freesleep.wrong" /> |
</field> |
</form> |
</formset> |
</form-validation> |
/it-ru/trunk/webapp/WEB-INF/validator-rules.xml |
---|
983,18 → 983,6 |
</validator> |
<validator name="number" |
classname="ak.itru.util.Validator" |
method="validateNumber" |
methodParams="java.lang.Object, |
org.apache.commons.validator.ValidatorAction, |
org.apache.commons.validator.Field, |
org.apache.struts.action.ActionErrors, |
javax.servlet.http.HttpServletRequest" |
depends="" |
msg="errors.number" |
/> |
<validator name="currency" |
classname="ak.itru.util.Validator" |
method="validateCurrency" |
/it-ru/trunk/webapp/WEB-INF/web.xml |
---|
23,7 → 23,6 |
ak.itru.core.model.EventManager; |
ak.itru.core.model.ActManager; |
ak.itru.core.model.ApartmentManager; |
ak.itru.core.model.ParticipantManager; |
</param-value> |
</init-param> |
</filter> |
115,26 → 114,4 |
<taglib-location>/WEB-INF/ak-backpath.tld</taglib-location> |
</taglib> |
<security-constraint> |
<web-resource-collection> |
<web-resource-name>Admin</web-resource-name> |
<url-pattern>/admin/*</url-pattern> |
</web-resource-collection> |
<auth-constraint> |
<role-name>itru-admin</role-name> |
</auth-constraint> |
</security-constraint> |
<login-config> |
<auth-method>BASIC</auth-method> |
<realm-name>it-ru Admin</realm-name> |
</login-config> |
<security-role> |
<description> |
Administrator of it-ru |
</description> |
<role-name>itru-admin</role-name> |
</security-role> |
</web-app> |
/it-ru/trunk/webapp/WEB-INF/struts-config.xml |
---|
28,8 → 28,7 |
<form-property name="account" type="java.lang.String" /> |
<form-property name="enabled" type="java.lang.Boolean" /> |
<form-property name="comment" type="java.lang.String" /> |
<form-property name="acts" type="ak.itru.core.form.EventActBean[]" size="1" /> |
<form-property name="apartments" type="ak.itru.core.form.EventApartmentBean[]" size="1" /> |
<form-property name="acts" type="ak.itru.core.form.EventActBean[]" size="1" /> |
</form-bean> |
<form-bean |
62,42 → 61,6 |
<form-property name="url" type="java.lang.String" /> |
<form-property name="comment" type="java.lang.String" /> |
</form-bean> |
<form-bean |
name="ParticipantListForm" |
type="org.apache.struts.validator.DynaValidatorForm"> |
<form-property name="event" type="java.lang.String" /> |
</form-bean> |
<form-bean |
name="ParticipantForm" |
type="org.apache.struts.validator.DynaValidatorForm"> |
<form-property name="id" type="java.lang.String" /> |
<form-property name="event" type="java.lang.String" /> |
</form-bean> |
<form-bean |
name="ParticipantEditForm" |
type="org.apache.struts.validator.DynaValidatorForm"> |
<form-property name="id" type="java.lang.String" /> |
<form-property name="event" type="java.lang.String" /> |
<form-property name="nick" type="java.lang.String" /> |
<form-property name="email" type="java.lang.String" /> |
<form-property name="emailPublic" type="java.lang.Boolean" /> |
<form-property name="name" type="java.lang.String" /> |
<form-property name="phone" type="java.lang.String" /> |
<form-property name="persons" type="java.lang.String" /> |
<form-property name="fromZip" type="java.lang.String" /> |
<form-property name="fromCity" type="java.lang.String" /> |
<form-property name="departure" type="java.lang.String" /> |
<form-property name="freeTransport" type="java.lang.String" /> |
<form-property name="transportComment" type="java.lang.String" /> |
<form-property name="freeSleep" type="java.lang.String" /> |
<form-property name="sleepComment" type="java.lang.String" /> |
<form-property name="payed" type="java.lang.Boolean" /> |
<form-property name="comment" type="java.lang.String" /> |
<form-property name="privateComment" type="java.lang.String" /> |
</form-bean> |
</form-beans> |
<global-exceptions> |
247,51 → 210,6 |
> |
</action> |
<!-- == participant ========================================================================= --> |
<action |
path="/admin/participant/list" |
type="ak.itru.core.action.AdminParticipantAction" |
parameter="list" |
name="ParticipantListForm" |
validate="true" |
scope="request" |
> |
<forward name="default" path="/admin/participant/list.jsp" /> |
</action> |
<action |
path="/admin/participant/delete" |
type="ak.itru.core.action.AdminParticipantAction" |
parameter="delete" |
name="ParticipantForm" |
validate="true" |
scope="request" |
> |
</action> |
<action |
path="/admin/participant/edit" |
type="ak.itru.core.action.AdminParticipantAction" |
parameter="edit" |
name="ParticipantForm" |
validate="true" |
scope="request" |
> |
<forward name="default" path="/admin/participant/edit.jsp" /> |
</action> |
<action |
path="/admin/participant/submit" |
type="ak.itru.core.action.AdminParticipantAction" |
parameter="submit" |
name="ParticipantEditForm" |
validate="true" |
scope="request" |
input="/admin/participant/edit.jsp" |
> |
</action> |
</action-mappings> |
<controller processorClass="ak.strutsx.RequestProcessorX" /> |
/it-ru/trunk/webapp/admin/participant/edit.jsp |
---|
File deleted |
/it-ru/trunk/webapp/admin/participant/list.jsp |
---|
File deleted |
/it-ru/trunk/webapp/admin/event/list.jsp |
---|
36,7 → 36,6 |
<th>Enabled</th> |
<th> </th> |
<th> </th> |
<th> </th> |
</tr> |
<logic:iterate name="events" id="e"> |
43,8 → 42,8 |
<tr> |
<td><bean:write name="e" property="name" /></td> |
<td><bean:write name="e" property="place" /> </td> |
<td><bean:write name="e" property="start" format="dd.MM.yyyy" /> </td> |
<td><bean:write name="e" property="stop" format="dd.MM.yyyy" /> </td> |
<td><bean:write name="e" property="start" /> </td> |
<td><bean:write name="e" property="stop" /> </td> |
<td> |
<logic:equal name="e" property="enabled" value="true">x</logic:equal> |
<logic:notEqual name="e" property="enabled" value="true"> </logic:notEqual> |
55,9 → 54,6 |
<td> |
<backpath:link action="/admin/event/delete" paramId="id" paramName="e" paramProperty="id">delete</backpath:link> |
</td> |
<td> |
<backpath:link action="/admin/participant/list" paramId="event" paramName="e" paramProperty="id">participants</backpath:link> |
</td> |
</tr> |
</logic:iterate> |
</table> |
/it-ru/trunk/webapp/admin/event/edit.jsp |
---|
34,97 → 34,65 |
<table border=1> |
<tr> |
<th>Name</th> |
<td colspan=3><html:text property="name" /></td> |
<td><html:text property="name" /></td> |
</tr> |
<tr> |
<th>Place</th> |
<td colspan=3><html:text property="place" /></td> |
<td><html:text property="place" /></td> |
</tr> |
<tr> |
<th>Address</th> |
<td colspan=3><html:textarea property="address" /></td> |
<td><html:textarea property="address" /></td> |
</tr> |
<tr> |
<th>Transport Description</th> |
<td colspan=3><html:textarea property="transport" /></td> |
<td><html:textarea property="transport" /></td> |
</tr> |
<tr> |
<th>Start</th> |
<td colspan=3><html:text property="start" /></td> |
<td><html:text property="start" /></td> |
</tr> |
<tr> |
<th>Stop</th> |
<td colspan=3><html:text property="stop" /></td> |
<td><html:text property="stop" /></td> |
</tr> |
<tr> |
<th>Last registration</th> |
<td colspan=3><html:text property="lastreg" /></td> |
<td><html:text property="lastreg" /></td> |
</tr> |
<tr> |
<th>Last unregistration</th> |
<td colspan=3><html:text property="lastunreg" /></td> |
<td><html:text property="lastunreg" /></td> |
</tr> |
<tr> |
<th>Price per person</th> |
<td colspan=3><html:text property="price" /></td> |
<td><html:text property="price" /></td> |
</tr> |
<tr> |
<th>Account to transfer money</th> |
<td colspan=3><html:textarea property="account" /></td> |
<td><html:textarea property="account" /></td> |
</tr> |
<tr> |
<th>Enabled</th> |
<td colspan=3><html:checkbox property="enabled" /></td> |
<td><html:checkbox property="enabled" /></td> |
</tr> |
<tr> |
<th>Comment</th> |
<td colspan=3><html:textarea property="comment" /></td> |
<td><html:textarea property="comment" /></td> |
</tr> |
<tr> |
<th colspan=4>Acts for the event</th> |
</tr> |
<tr> |
<td>Name</td> |
<td>Include</td> |
<td>Comment</td> |
<td> </td> |
</tr> |
<logic:iterate name="EventEditForm" property="acts" id="acts" indexId="iid"> |
<tr> |
<th> |
<bean:write name="actList" property='<%= "objects[" + iid + "].name" %>' /> |
<td> |
<html:hidden name="acts" property="actId" indexed="true" /> |
</th> |
<td><html:checkbox name="acts" property="selected" indexed="true" /></td> |
<html:checkbox name="acts" property="selected" indexed="true" /> |
</td> |
<td><html:text name="acts" property="comment" indexed="true" /></td> |
<td> </td> |
</tr> |
</logic:iterate> |
<tr> |
<th colspan=4>Apartment for the event</th> |
</tr> |
<tr> |
<td>Name</td> |
<td>Include</td> |
<td>Comment</td> |
<td>Distance</td> |
</tr> |
<logic:iterate name="EventEditForm" property="apartments" id="apartments" indexId="iid2"> |
<tr> |
<th> |
<bean:write name="apartmentList" property='<%= "objects[" + iid2 + "].name" %>' /> |
<html:hidden name="apartments" property="apartmentId" indexed="true" /> |
</th> |
<td><html:checkbox name="apartments" property="selected" indexed="true" /></td> |
<td><html:text name="apartments" property="comment" indexed="true" /></td> |
<td><html:text name="apartments" property="distance" indexed="true" /></td> |
</tr> |
</logic:iterate> |
<tr> |
<td colspan=4> |
<td colspan=2> |
<html:submit>Submit</html:submit> |
<backpath:backlink>Back</backpath:backlink> |
</td> |
/it-ru/trunk/webapp/generalError.jsp |
---|
4,20 → 4,25 |
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> |
<%@ taglib uri="/WEB-INF/ak-backpath.tld" prefix="backpath" %> |
<%@ taglib uri="/WEB-INF/ak-strutsx.tld" prefix="strutsx" %> |
<%@ taglib uri="/WEB-INF/hostadmiral-core.tld" prefix="core" %> |
<html> |
<head> |
<meta http-equiv="expires" content="0"> |
<title>Error</title> |
<title><bean:message key="ak.hostadmiral.page.generalError.title" /></title> |
<link rel="stylesheet" type="text/css" href="<strutsx:root />/style/general.css"> |
</head> |
<body> |
<h1>Error</h1> |
<h1><bean:message key="ak.hostadmiral.page.generalError.title" /></h1> |
<p>There is a general error occured. Please go <backpath:backlink>back</backpath:backlink> and try again.</p> |
<p><bean:message key="ak.hostadmiral.page.generalError.message" /></p> |
<!-- FIXME: backpath:link><bean:message key="ak.hostadmiral.page.generalError.index" /></ backpath : link--> |
<br> |
<backpath:backlink><bean:message key="ak.hostadmiral.page.generalError.back" /></backpath:backlink> |
</body> |
</html> |
/it-ru/trunk/webapp/error.jsp |
---|
9,17 → 9,17 |
<head> |
<meta http-equiv="expires" content="0"> |
<title>Error</title> |
<title><bean:message key="ak.hostadmiral.page.error.title" /></title> |
<link rel="stylesheet" type="text/css" href="<strutsx:root />/style/general.css"> |
</head> |
<body> |
<h1>Error</h1> |
<h1><bean:message key="ak.hostadmiral.page.error.title" /></h1> |
<strutsx:errorsIterator id="errors" /> |
<strutsx:notEmpty name="errors"> |
<div class="error">There are some errors occured |
<div class="error"><bean:message key="ak.hostadmiral.page.general.errors" />: |
<ul> |
<logic:iterate name="errors" id="error"> |
<li><strutsx:message name="error" property="key" valuesProperty="values" /></li> |
29,7 → 29,7 |
</strutsx:notEmpty> |
<br> |
<backpath:backlink>back</backpath:backlink> |
<backpath:backlink><bean:message key="ak.hostadmiral.page.error.back" /></backpath:backlink> |
</body> |
/it-ru/trunk/src/ak/itru/core/action/AdminParticipantAction.java |
---|
File deleted |
/it-ru/trunk/src/ak/itru/core/action/ObjectList.java |
---|
File deleted |
/it-ru/trunk/src/ak/itru/core/action/AdminEventAction.java |
---|
24,28 → 24,13 |
import ak.itru.util.UserException; |
import ak.itru.core.model.Event; |
import ak.itru.core.model.EventManager; |
import ak.itru.core.model.EventAct; |
import ak.itru.core.model.EventApartment; |
import ak.itru.core.model.Act; |
import ak.itru.core.model.ActManager; |
import ak.itru.core.model.Apartment; |
import ak.itru.core.model.ApartmentManager; |
import ak.itru.core.form.EventActBean; |
import ak.itru.core.form.EventApartmentBean; |
public final class AdminEventAction |
extends Action |
implements ErrorHandlerX |
{ |
public void handleErrors(ActionMapping mapping, ActionForm form, |
HttpServletRequest request, HttpServletResponse response) |
throws Exception |
{ |
if("submit".equals(mapping.getParameter())) { |
initLists(request); // FIXME: if a list is changed between "edit" and "submit" then indicies are wrong |
} |
} |
public ActionForward execute(ActionMapping mapping, ActionForm form, |
HttpServletRequest request, HttpServletResponse response) |
throws Exception |
57,12 → 42,11 |
return mapping.findForward("default"); |
} |
else if("edit".equals(mapping.getParameter())) { |
DynaActionForm theForm = (DynaActionForm)form; |
Long eventId = StringConverter.parseLong(theForm.get("id")); |
DynaActionForm theForm = (DynaActionForm)form; |
Long eventId = StringConverter.parseLong(theForm.get("id")); |
Event event; |
List acts = new ArrayList(ActManager.getInstance().listActs()); |
List apartments = new ArrayList(ApartmentManager.getInstance().listApartments()); |
DynaActionForm showForm = (DynaActionForm)RequestUtilsX.populateActionForm( |
List acts = new ArrayList(ActManager.getInstance().listActs()); |
DynaActionForm showForm = (DynaActionForm)RequestUtilsX.populateActionForm( |
this, request, "EventEditForm"); |
if(eventId == null) { |
85,7 → 69,6 |
showForm.set("comment", event.getComment()); |
} |
// acts |
EventActBean[] a = new EventActBean[acts.size()]; |
Collections.sort(acts, ActManager.NAME_COMPARATOR); |
for(int i = 0; i < acts.size(); i++) { |
94,17 → 77,6 |
} |
showForm.set("acts", a); |
// apartments |
EventApartmentBean[] ap = new EventApartmentBean[apartments.size()]; |
Collections.sort(apartments, ApartmentManager.NAME_COMPARATOR); |
for(int i = 0; i < apartments.size(); i++) { |
Apartment apartment = (Apartment)apartments.get(i); |
ap[i] = new EventApartmentBean(apartment, (event == null) |
? null : event.getApartment(apartment.getId())); |
} |
showForm.set("apartments", ap); |
initLists(request); |
return mapping.findForward("default"); |
} |
else if("delete".equals(mapping.getParameter())) { |
117,9 → 89,9 |
return null; |
} |
else if("submit".equals(mapping.getParameter())) { |
DynaActionForm theForm = (DynaActionForm)form; |
Long eventId = StringConverter.parseLong(theForm.get("id")); |
Event event; |
DynaActionForm theForm = (DynaActionForm)form; |
Long eventId = StringConverter.parseLong(theForm.get("id")); |
Event event; |
if(eventId == null) { |
event = EventManager.getInstance().create(); |
128,56 → 100,6 |
event = EventManager.getInstance().get(eventId); |
} |
// acts |
EventActBean[] acts = (EventActBean[])theForm.get("acts"); |
for(int i = 0; i < acts.length; i++) { |
// FIXME: validate act id |
// get bean |
Long actId = StringConverter.parseLong(acts[i].getActId()); |
Act act = ActManager.getInstance().get(actId); |
EventAct eventAct = event.getAct(actId); |
if(acts[i].getSelected() == null || !acts[i].getSelected().booleanValue()) { |
if(eventAct != null) event.removeAct(eventAct); |
} |
else { |
if(eventAct == null) { |
eventAct = EventManager.getInstance().createAct(); |
eventAct.setEvent(event); |
eventAct.setAct(act); |
event.addAct(eventAct); |
} |
eventAct.setComment(acts[i].getComment()); |
} |
} |
// apartments |
EventApartmentBean[] apartments = (EventApartmentBean[])theForm.get("apartments"); |
for(int i = 0; i < apartments.length; i++) { |
// FIXME: validate apartment id, distance |
// get bean |
Long apartmentId = StringConverter.parseLong(apartments[i].getApartmentId()); |
Apartment apartment = ApartmentManager.getInstance().get(apartmentId); |
EventApartment eventApartment = event.getApartment(apartmentId); |
if(apartments[i].getSelected() == null || !apartments[i].getSelected().booleanValue()) { |
if(eventApartment != null) event.removeApartment(eventApartment); |
} |
else { |
if(eventApartment == null) { |
eventApartment = EventManager.getInstance().createApartment(); |
eventApartment.setEvent(event); |
eventApartment.setApartment(apartment); |
event.addApartment(eventApartment); |
} |
eventApartment.setDistance(StringConverter.parseNumber(apartments[i].getDistance())); |
eventApartment.setComment(apartments[i].getComment()); |
} |
} |
// name |
String name = (String)theForm.get("name"); |
if(EventManager.getInstance().nameExists(event, name)) { |
throw new UserException("ak.itru.core.event.name.nonunique"); |
184,7 → 106,6 |
} |
event.setName(name); |
// others |
event.setPlace((String)theForm.get("place")); |
event.setAddress((String)theForm.get("address")); |
event.setTransportDesc((String)theForm.get("transport")); |
197,7 → 118,6 |
event.setEnabled((Boolean)theForm.get("enabled")); |
event.setComment((String)theForm.get("comment")); |
// save |
EventManager.getInstance().save(event); |
response.sendRedirect(BackPath.findBackPath(request).getBackwardUrl()); |
return null; |
206,16 → 126,4 |
throw new Exception("unknown mapping parameter"); |
} |
} |
private void initLists(HttpServletRequest request) |
throws Exception |
{ |
List acts = new ArrayList(ActManager.getInstance().listActs()); |
List apartments = new ArrayList(ApartmentManager.getInstance().listApartments()); |
Collections.sort(acts, ActManager.NAME_COMPARATOR); |
request.setAttribute("actList", new ObjectList(acts)); |
Collections.sort(apartments, ApartmentManager.NAME_COMPARATOR); |
request.setAttribute("apartmentList", new ObjectList(apartments)); |
} |
} |
/it-ru/trunk/src/ak/itru/core/model/ParticipantManager.java |
---|
File deleted |
/it-ru/trunk/src/ak/itru/core/model/EventApartment.java |
---|
File deleted |
/it-ru/trunk/src/ak/itru/core/model/EventAct.java |
---|
9,10 → 9,10 |
* @hibernate.class table="event_acts" |
*/ |
public class EventAct |
extends GeneralModelObject |
{ |
private Event event; |
private Act act; |
private Long id; |
private Long eventId; |
private Long actId; |
private String comment; |
private Date modStamp; |
22,30 → 22,30 |
/** |
* |
* @hibernate.many-to-one |
* @hibernate.id generator-class="native" |
*/ |
public Event getEvent() |
public Long getId() |
{ |
return event; |
return id; |
} |
public void setEvent(Event event) |
protected void setId(Long id) |
{ |
this.event = event; |
this.id = id; |
} |
/** |
* |
* @hibernate.many-to-one |
* @hibernate.property |
*/ |
public Act getAct() |
public Long getEventId() |
{ |
return act; |
return eventId; |
} |
public void setAct(Act act) |
public void setEventId(Long eventId) |
{ |
this.act = act; |
this.eventId = eventId; |
} |
/** |
52,6 → 52,20 |
* |
* @hibernate.property |
*/ |
public Long getActId() |
{ |
return actId; |
} |
public void setActId(Long actId) |
{ |
this.actId = actId; |
} |
/** |
* |
* @hibernate.property |
*/ |
public String getComment() |
{ |
return comment; |
61,4 → 75,18 |
{ |
this.comment = comment; |
} |
/** |
* |
* @hibernate.timestamp column="mod_stamp" |
*/ |
public Date getModStamp() |
{ |
return modStamp; |
} |
public void setModStamp(Date modStamp) |
{ |
this.modStamp = modStamp; |
} |
} |
/it-ru/trunk/src/ak/itru/core/model/EventManager.java |
---|
28,8 → 28,6 |
"ak/itru/core/model/Event.hbm.xml"); |
HibernateUtil.getConfiguration().addResource( |
"ak/itru/core/model/EventAct.hbm.xml"); |
HibernateUtil.getConfiguration().addResource( |
"ak/itru/core/model/EventApartment.hbm.xml"); |
eventManager = new EventManager(); |
} |
133,18 → 131,6 |
} |
} |
public EventAct createAct() |
throws ModelException |
{ |
return new EventAct(); |
} |
public EventApartment createApartment() |
throws ModelException |
{ |
return new EventApartment(); |
} |
public static final Comparator NAME_COMPARATOR = new NameComparator(); |
public static final Comparator START_COMPARATOR = new StartComparator(); |
/it-ru/trunk/src/ak/itru/core/model/Participant.java |
---|
1,6 → 1,5 |
package ak.itru.core.model; |
import java.util.Date; |
import ak.itru.util.ModelException; |
import ak.itru.util.ModelSecurityException; |
11,24 → 10,11 |
public class Participant |
extends GeneralModelObject |
{ |
private String ident; |
private String nick; |
private String email; |
private Boolean emailPublic; |
private String name; |
private String phone; |
private Event event; |
private Integer persons; |
private String fromZip; |
private String fromCity; |
private Date departure; |
private Integer freeTransport; |
private String transportComment; |
private Integer freeSleep; |
private String sleepComment; |
private Boolean payed; |
private String comment; |
private String privateComment; |
protected Participant() |
{ |
38,20 → 24,6 |
* |
* @hibernate.property |
*/ |
public String getIdent() |
{ |
return ident; |
} |
public void setIdent(String ident) |
{ |
this.ident = ident; |
} |
/** |
* |
* @hibernate.property |
*/ |
public String getNick() |
{ |
return nick; |
76,20 → 48,6 |
this.email = email; |
} |
/** |
* |
* @hibernate.property column="email_public" |
*/ |
public Boolean getEmailPublic() |
{ |
return emailPublic; |
} |
public void setEmailPublic(Boolean emailPublic) |
{ |
this.emailPublic = emailPublic; |
} |
/** |
* |
* @hibernate.property |
118,150 → 76,10 |
this.phone = phone; |
} |
/** |
* |
* @hibernate.many-to-one |
*/ |
public Event getEvent() |
{ |
return event; |
} |
public void setEvent(Event event) |
{ |
this.event = event; |
} |
/** |
* |
* @hibernate.property |
*/ |
public Integer getPersons() |
{ |
return persons; |
} |
public void setPersons(Integer persons) |
{ |
this.persons = persons; |
} |
/** |
* |
* @hibernate.property column="from_zip" |
*/ |
public String getFromZip() |
{ |
return fromZip; |
} |
public void setFromZip(String fromZip) |
{ |
this.fromZip = fromZip; |
} |
/** |
* |
* @hibernate.property column="from_city" |
*/ |
public String getFromCity() |
{ |
return fromCity; |
} |
public void setFromCity(String fromCity) |
{ |
this.fromCity = fromCity; |
} |
/** |
* |
* @hibernate.property |
*/ |
public Date getDeparture() |
{ |
return departure; |
} |
public void setDeparture(Date departure) |
{ |
this.departure = departure; |
} |
/** |
* |
* @hibernate.property column="free_transport" |
*/ |
public Integer getFreeTransport() |
{ |
return freeTransport; |
} |
public void setFreeTransport(Integer freeTransport) |
{ |
this.freeTransport = freeTransport; |
} |
/** |
* |
* @hibernate.property column="transport_comment" |
*/ |
public String getTransportComment() |
{ |
return transportComment; |
} |
public void setTransportComment(String transportComment) |
{ |
this.transportComment = transportComment; |
} |
/** |
* |
* @hibernate.property column="free_sleep" |
*/ |
public Integer getFreeSleep() |
{ |
return freeSleep; |
} |
public void setFreeSleep(Integer freeSleep) |
{ |
this.freeSleep = freeSleep; |
} |
/** |
* |
* @hibernate.property column="sleep_comment" |
*/ |
public String getSleepComment() |
{ |
return sleepComment; |
} |
public void setSleepComment(String sleepComment) |
{ |
this.sleepComment = sleepComment; |
} |
/** |
* |
* @hibernate.property |
*/ |
public Boolean getPayed() |
{ |
return payed; |
} |
public void setPayed(Boolean payed) |
{ |
this.payed = payed; |
} |
/** |
* |
* @hibernate.property |
*/ |
public String getComment() |
{ |
return comment; |
270,21 → 88,7 |
public void setComment(String comment) |
{ |
this.comment = comment; |
} |
/** |
* |
* @hibernate.property column="private_comment" |
*/ |
public String getPrivateComment() |
{ |
return privateComment; |
} |
public void setPrivateComment(String privateComment) |
{ |
this.privateComment = privateComment; |
} |
public boolean equals(Object o) |
{ |
/it-ru/trunk/src/ak/itru/core/model/Event.java |
---|
2,7 → 2,6 |
import java.math.BigDecimal; |
import java.util.Collection; |
import java.util.Collections; |
import java.util.ArrayList; |
import java.util.Iterator; |
import java.util.Date; |
30,10 → 29,8 |
private String moneyAccount; |
private Boolean enabled; |
private String comment; |
private Collection acts; // Collection(EventAct) |
private Map actsMap = new HashMap(); // Map(Long id -> EventAct) |
private Collection apartments; // Collection(EventApartment) |
private Map apartmentsMap = new HashMap(); // Map(Long id -> EventApartment) |
private Collection acts; // Collection(EventAct) |
private Map actsMap = new HashMap(); |
protected Event() |
{ |
216,32 → 213,25 |
* @return Collection(EventAct) |
* |
* @hibernate.bag inverse="true" cascade="all-delete-orphan" lazy="true" |
* @hibernate.collection-key column="event" |
* @hibernate.collection-key column="eventid" |
* @hibernate.collection-one-to-many class="ak.itru.core.model.EventAct" |
*/ |
protected Collection getActs() |
public Collection getActs() |
{ |
return acts; |
} |
public Collection getActCollection() |
{ |
return Collections.unmodifiableCollection(acts); |
} |
/** |
* @param destinations Collection(EventAct) |
*/ |
protected void setActs(Collection acts) |
public void setActs(Collection acts) |
{ |
this.acts = acts; |
actsMap.clear(); |
if(acts != null) { |
for(Iterator i = acts.iterator(); i.hasNext(); ) { |
EventAct a = (EventAct)i.next(); |
actsMap.put(a.getAct().getId(), a); |
} |
for(Iterator i = acts.iterator(); i.hasNext(); ) { |
EventAct a = (EventAct)i.next(); |
actsMap.put(a.getActId(), a); |
} |
} |
249,66 → 239,4 |
{ |
return (EventAct)actsMap.get(actId); |
} |
public void addAct(EventAct act) |
{ |
acts.add(act); |
actsMap.put(act.getAct().getId(), act); |
} |
public void removeAct(EventAct act) |
{ |
acts.remove(act); |
actsMap.remove(act.getAct().getId()); |
} |
/** |
* @return Collection(EventApartment) |
* |
* @hibernate.bag inverse="true" cascade="all-delete-orphan" lazy="true" |
* @hibernate.collection-key column="event" |
* @hibernate.collection-one-to-many class="ak.itru.core.model.EventApartment" |
*/ |
protected Collection getApartments() |
{ |
return apartments; |
} |
public Collection getApartmentCollection() |
{ |
return Collections.unmodifiableCollection(apartments); |
} |
/** |
* @param destinations Collection(EventApartment) |
*/ |
protected void setApartments(Collection apartments) |
{ |
this.apartments = apartments; |
apartmentsMap.clear(); |
if(apartments != null) { |
for(Iterator i = apartments.iterator(); i.hasNext(); ) { |
EventApartment a = (EventApartment)i.next(); |
apartmentsMap.put(a.getApartment().getId(), a); |
} |
} |
} |
public EventApartment getApartment(Long apartmentId) |
{ |
return (EventApartment)apartmentsMap.get(apartmentId); |
} |
public void addApartment(EventApartment apartment) |
{ |
apartments.add(apartment); |
apartmentsMap.put(apartment.getApartment().getId(), apartment); |
} |
public void removeApartment(EventApartment apartment) |
{ |
apartments.remove(apartment); |
apartmentsMap.remove(apartment.getApartment().getId()); |
} |
} |
/it-ru/trunk/src/ak/itru/core/taglib/ExtendedLinkTag.java |
---|
File deleted |
/it-ru/trunk/src/ak/itru/core/form/EventApartmentBean.java |
---|
File deleted |
/it-ru/trunk/src/ak/itru/util/Validator.java |
---|
16,26 → 16,6 |
public class Validator |
{ |
public static BigDecimal validateNumber(Object bean, ValidatorAction va, Field field, |
ActionErrors errors, HttpServletRequest request) |
{ |
String value = null; |
if((bean == null) || (bean instanceof String)) |
value = (String)bean; |
else |
value = ValidatorUtil.getValueAsString(bean, field.getProperty()); |
if(value == null || "".equals(value)) return null; |
try { |
return new BigDecimal(NumberFormat.getInstance().parse(value).doubleValue()); |
} |
catch(ParseException ex) { |
errors.add(field.getKey(), Resources.getActionError(request, va, field)); |
return null; |
} |
} |
public static BigDecimal validateCurrency(Object bean, ValidatorAction va, Field field, |
ActionErrors errors, HttpServletRequest request) |
{ |
/it-ru/trunk/src/ak/itru/util/StringConverter.java |
---|
47,22 → 47,6 |
return (s == null) ? null : new Integer(s); |
} |
public static BigDecimal parseNumber(Object o) |
throws NumberFormatException, ParseException |
{ |
String s = preparse(o); |
return (s == null) |
? null : new BigDecimal(NumberFormat.getInstance().parse(s).doubleValue()); |
} |
public static String toNumber(Number n) |
{ |
if(n == null) |
return null; |
else |
return (new DecimalFormat("0")).format(n); |
} |
public static BigDecimal parseCurrency(Object o) |
throws NumberFormatException, ParseException |
{ |
94,21 → 78,6 |
return DateFormat.getDateInstance().format(d); |
} |
public static Date parseDateTime(Object o) |
throws NumberFormatException, ParseException |
{ |
String s = preparse(o); |
return (s == null) ? null : DateFormat.getDateTimeInstance().parse(s); |
} |
public static String toDateTime(Date d) |
{ |
if(d == null) |
return null; |
else |
return DateFormat.getDateTimeInstance().format(d); |
} |
public static String toString(Object o) |
{ |
if(o == null) |
/it-ru/trunk/build.xml |
---|
1,6 → 1,6 |
<project name="it-ru" default="deploy" basedir="."> |
<!--property name="build.compiler" value="jikes" /--> |
<property name="build.compiler" value="jikes" /> |
<property name="src" location="src" /> |
<property name="classes" location="classes" /> |
/it-ru/trunk/sql/00.tables.sql |
---|
4,7 → 4,6 |
create sequence hibernate_sequence; |
/* removed in this version |
create table participants |
( |
id integer not null, |
18,7 → 17,6 |
constraint participants_prim primary key (id), |
constraint participants_email unique(email) |
); |
*/ |
create table events |
( |
71,12 → 69,12 |
( |
id integer not null, |
event integer not null, |
apartment integer not null, |
apartments integer not null, |
distance decimal, |
comment text, |
mod_stamp timestamp, |
constraint event_apartments_prim primary key (event, apartment) |
constraint event_apartments_prim primary key (event, apartments) |
); |
create table acts |
101,7 → 99,6 |
constraint event_acts_prim primary key (event, act) |
); |
/* removed in this version |
create table participant_events |
( |
participant integer not null, |
114,41 → 111,12 |
transport_comment integer, |
free_sleep integer, |
sleep_comment text, |
payed char(1) default ' ', |
comment text, |
mod_stamp timestamp, |
constraint participant_events_prim primary key (participant, event) |
); |
*/ |
create table participants |
( |
id integer not null, |
ident varchar(255) not null, |
nick varchar(255) not null, |
email varchar(255) not null, |
email_public char(1) default ' ', |
name varchar(255), |
phone varchar(255), |
event integer not null, |
persons integer, |
from_zip varchar(10), |
from_city varchar(10), |
departure timestamp, |
free_transport integer, |
transport_comment text, |
free_sleep integer, |
sleep_comment text, |
payed char(1) default ' ', |
comment text, |
private_comment text, |
mod_stamp timestamp, |
constraint participants_prim primary key (id), |
constraint participants_email unique(email) |
); |
create table participant_acts |
( |
participant integer not null, |