xlawrence 2005/03/01 16:36:24 CET
Added files:
calClient/webapp/uiclient/src/java/org/jahia/suite/calendar/webApp/client
AddEventAction.java
AddEventRefAction.java
DelEventAction.java
EditEventAction.java
EventAction.java
Log:
added source
Revision Changes Path
1.1 +83 -0
uwcal_JSR168/calClient/webapp/uiclient/src/java/org/jahia/suite/calendar/webApp/client/AddEventAction.java
(new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/uwcal_JSR168/calClient/webapp/uiclient/src/java/org/jahia/suite/calendar/webApp/client/AddEventAction.java?rev=1.1&content-type=text/plain
1.1 +85 -0
uwcal_JSR168/calClient/webapp/uiclient/src/java/org/jahia/suite/calendar/webApp/client/AddEventRefAction.java
(new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/uwcal_JSR168/calClient/webapp/uiclient/src/java/org/jahia/suite/calendar/webApp/client/AddEventRefAction.java?rev=1.1&content-type=text/plain
1.1 +91 -0
uwcal_JSR168/calClient/webapp/uiclient/src/java/org/jahia/suite/calendar/webApp/client/DelEventAction.java
(new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/uwcal_JSR168/calClient/webapp/uiclient/src/java/org/jahia/suite/calendar/webApp/client/DelEventAction.java?rev=1.1&content-type=text/plain
1.1 +101 -0
uwcal_JSR168/calClient/webapp/uiclient/src/java/org/jahia/suite/calendar/webApp/client/EditEventAction.java
(new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/uwcal_JSR168/calClient/webapp/uiclient/src/java/org/jahia/suite/calendar/webApp/client/EditEventAction.java?rev=1.1&content-type=text/plain
1.1 +84 -0
uwcal_JSR168/calClient/webapp/uiclient/src/java/org/jahia/suite/calendar/webApp/client/EventAction.java
(new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/uwcal_JSR168/calClient/webapp/uiclient/src/java/org/jahia/suite/calendar/webApp/client/EventAction.java?rev=1.1&content-type=text/plain
Index: AddEventAction.java
====================================================================
/*
* ____.
* __/\ ______| |__/\. _______
* __ .____| | \ | +----+ \
* _______| /--| | | - \ _ | : - \_________
* \\______: :---| : : | : | \________>
* |__\---\_____________:______: :____|____:_____\
* /_____|
*
* . . . i n j a h i a w e t r u s t . . .
*
*
*
* ----- BEGIN LICENSE BLOCK -----
* Version: JCSL 1.0
*
* The contents of this file are subject to the Jahia Community Source License
* 1.0 or later (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.jahia.org/license
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the rights, obligations and limitations governing use of the contents
* of the file. The Original and Upgraded Code is the Jahia CMS and Portal
* Server. The developer of the Original and Upgraded Code is JAHIA Ltd. JAHIA
* Ltd. owns the copyrights in the portions it created. All Rights Reserved.
*
* The Shared Modifications are Jahia View Helper.
*
* The Developer of the Shared Modifications is Jahia Solution S�rl.
* Portions created by the Initial Developer are Copyright (C) 2002 by the
* Initial Developer. All Rights Reserved.
*
* ----- END LICENSE BLOCK -----
*/
package org.jahia.suite.calendar.webApp.client;
import org.jahia.suite.calendar.framework.model.SyncEvent;
import org.jahia.suite.calendar.framework.model.GUID;
import org.jahia.suite.calendar.framework.SyncManager;
import org.jahia.suite.calendar.calServer.SyncManagerFactory;
import edu.rpi.cct.uwcal.webclient.UWCalAddEventAction;
import edu.rpi.cct.uwcal.webclient.UWCalActionForm;
import javax.servlet.http.HttpServletRequest;
/**
* Action to add an Event.
* <p>No specific request parameters. Form should contain an initialised
* EventVO object.
* <p>Forwards to:<ul>
* <li>"doNothing" input error or we want to ignore the request.</li>
* <li>"success" added ok.</li>
* </ul>
*/
public class AddEventAction extends UWCalAddEventAction {
/** This is the routine which does the work.
*
* @param request Needed to locate session
* @param form Action form
* @return String forward name
*/
public String doAction(HttpServletRequest request,
UWCalActionForm form) throws Throwable {
final SyncManager manager = new SyncManagerFactory().
createSyncManager(SyncManagerFactory.BASIC);
final int eventId = form.getEventId();
final GUID guid = new GUID(eventId + "[EMAIL PROTECTED]");
final SyncEvent event = new SyncEvent(guid, new byte[0],
SyncEvent.UNKNOWN);
manager.getLock(event);
final String result = super.doAction(request, form);
manager.unlock(event);
return result;
}
}
Index: AddEventRefAction.java
====================================================================
/*
* ____.
* __/\ ______| |__/\. _______
* __ .____| | \ | +----+ \
* _______| /--| | | - \ _ | : - \_________
* \\______: :---| : : | : | \________>
* |__\---\_____________:______: :____|____:_____\
* /_____|
*
* . . . i n j a h i a w e t r u s t . . .
*
*
*
* ----- BEGIN LICENSE BLOCK -----
* Version: JCSL 1.0
*
* The contents of this file are subject to the Jahia Community Source License
* 1.0 or later (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.jahia.org/license
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the rights, obligations and limitations governing use of the contents
* of the file. The Original and Upgraded Code is the Jahia CMS and Portal
* Server. The developer of the Original and Upgraded Code is JAHIA Ltd. JAHIA
* Ltd. owns the copyrights in the portions it created. All Rights Reserved.
*
* The Shared Modifications are Jahia View Helper.
*
* The Developer of the Shared Modifications is Jahia Solution S�rl.
* Portions created by the Initial Developer are Copyright (C) 2002 by the
* Initial Developer. All Rights Reserved.
*
* ----- END LICENSE BLOCK -----
*/
package org.jahia.suite.calendar.webApp.client;
import org.jahia.suite.calendar.framework.model.SyncEvent;
import org.jahia.suite.calendar.framework.model.GUID;
import org.jahia.suite.calendar.framework.SyncManager;
import org.jahia.suite.calendar.calServer.SyncManagerFactory;
import edu.rpi.cct.uwcal.webclient.UWCalAddEventRefAction;
import edu.rpi.cct.uwcal.webclient.UWCalActionForm;
import javax.servlet.http.HttpServletRequest;
/**
* Action to add an event to a personal calendar.
* <p>Request parameters<ul>
* <li>"eventId" id of event.</li>
* </ul>
* <p>Forwards to:<ul>
* <li>"doNothing" when request seems wrong.</li>
* <li>"notPersonal" when this is not a personal calendar.</li>
* <li>"success" added ok.</li>
* </ul>
*/
public class AddEventRefAction extends UWCalAddEventRefAction {
/** This is the routine which does the work.
*
* @param request Needed to locate session
* @param form Action form
* @return String forward name
*/
public String doAction(HttpServletRequest request,
UWCalActionForm form) throws Throwable {
final SyncManager manager = new SyncManagerFactory().
createSyncManager(SyncManagerFactory.BASIC);
final int eventId = form.getEventId();
final GUID guid = new GUID(eventId + "[EMAIL PROTECTED]");
final SyncEvent event = new SyncEvent(guid, new byte[0],
SyncEvent.UNKNOWN);
manager.getLock(event);
final String result = super.doAction(request, form);
manager.unlock(event);
return result;
}
}
Index: DelEventAction.java
====================================================================
/*
* ____.
* __/\ ______| |__/\. _______
* __ .____| | \ | +----+ \
* _______| /--| | | - \ _ | : - \_________
* \\______: :---| : : | : | \________>
* |__\---\_____________:______: :____|____:_____\
* /_____|
*
* . . . i n j a h i a w e t r u s t . . .
*
*
*
* ----- BEGIN LICENSE BLOCK -----
* Version: JCSL 1.0
*
* The contents of this file are subject to the Jahia Community Source License
* 1.0 or later (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.jahia.org/license
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the rights, obligations and limitations governing use of the contents
* of the file. The Original and Upgraded Code is the Jahia CMS and Portal
* Server. The developer of the Original and Upgraded Code is JAHIA Ltd. JAHIA
* Ltd. owns the copyrights in the portions it created. All Rights Reserved.
*
* The Shared Modifications are Jahia View Helper.
*
* The Developer of the Shared Modifications is Jahia Solution S�rl.
* Portions created by the Initial Developer are Copyright (C) 2002 by the
* Initial Developer. All Rights Reserved.
*
* ----- END LICENSE BLOCK -----
*/
package org.jahia.suite.calendar.webApp.client;
import org.jahia.suite.calendar.framework.model.SyncEvent;
import org.jahia.suite.calendar.framework.model.GUID;
import org.jahia.suite.calendar.framework.SyncManager;
import org.jahia.suite.calendar.calServer.SyncManagerFactory;
import edu.rpi.cct.uwcal.webclient.UWCalDelEventAction;
import edu.rpi.cct.uwcal.webclient.UWCalActionForm;
import javax.servlet.http.HttpServletRequest;
/**
* Action to delete an event
* <p>Request parameters:<ul>
* <li> eventId</li>.
* </ul>
* <p>Forwards to:<ul>
* <li>"doNothing" for guest mode.</li>
* <li>"success" deleted ok.</li>
* </ul>
* <p>Errors:<ul>
* <li>org.ucal.calendar.message.deleted.events - when
* event is deleted - 1 parameter: count</li>
* <li>org.ucal.calendar.message.deleted.locations - when
* location is deleted - 1 parameter: count</li>
* <li>org.ucal.calendar.message.nosuchevent</li>
* </ul>
*/
public class DelEventAction extends UWCalDelEventAction {
/** This is the routine which does the work.
*
* @param request Needed to locate session
* @param form Action form
* @return String forward name
*/
public String doAction(HttpServletRequest request,
UWCalActionForm form) throws Throwable {
final SyncManager manager = new SyncManagerFactory().
createSyncManager(SyncManagerFactory.BASIC);
final int eventId = form.getEventId();
final GUID guid = new GUID(eventId + "[EMAIL PROTECTED]");
final SyncEvent event = new SyncEvent(guid, new byte[0],
SyncEvent.UNKNOWN);
manager.getLock(event);
final String result = super.doAction(request, form);
manager.unlock(event);
return result;
}
}
Index: EditEventAction.java
====================================================================
/*
* ____.
* __/\ ______| |__/\. _______
* __ .____| | \ | +----+ \
* _______| /--| | | - \ _ | : - \_________
* \\______: :---| : : | : | \________>
* |__\---\_____________:______: :____|____:_____\
* /_____|
*
* . . . i n j a h i a w e t r u s t . . .
*
*
*
* ----- BEGIN LICENSE BLOCK -----
* Version: JCSL 1.0
*
* The contents of this file are subject to the Jahia Community Source License
* 1.0 or later (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.jahia.org/license
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the rights, obligations and limitations governing use of the contents
* of the file. The Original and Upgraded Code is the Jahia CMS and Portal
* Server. The developer of the Original and Upgraded Code is JAHIA Ltd. JAHIA
* Ltd. owns the copyrights in the portions it created. All Rights Reserved.
*
* The Shared Modifications are Jahia View Helper.
*
* The Developer of the Shared Modifications is Jahia Solution S�rl.
* Portions created by the Initial Developer are Copyright (C) 2002 by the
* Initial Developer. All Rights Reserved.
*
* ----- END LICENSE BLOCK -----
*/
package org.jahia.suite.calendar.webApp.client;
import org.jahia.suite.calendar.framework.model.SyncEvent;
import org.jahia.suite.calendar.framework.model.GUID;
import org.jahia.suite.calendar.framework.SyncManager;
import org.jahia.suite.calendar.calServer.SyncManagerFactory;
import edu.rpi.cct.uwcal.webclient.UWCalEditEventAction;
import edu.rpi.cct.uwcal.webclient.UWCalActionForm;
import javax.servlet.http.HttpServletRequest;
/**
* Action to edit an Event
*
* <p>Request parameters<ul>
* <li>"updateEvent=anything" means we should try to update the current
* event in form.editEvent.</li>
* <li>"eventId=nnn" id of event to fetch for editing.</li>
* </ul>
*.
* <p>Forwards to:<ul>
* <li>"doNothing" for guest mode/invalid id or non-existing
event.</li>
* <li>"edit" to edit the event.</li>
* <li>"success" changes made.</li>
* </ul>
*
* <p>Errors:<ul>
* <li>org.ucal.calendar.error.noaccess - when user has insufficient
* access (tries to edit public event)</li>
* </ul>
*
* <p>Messages:<ul>
* <li>org.ucal.calendar.message.deleted.locations - when location is
* deleted</li>
* <li>org.ucal.calendar.message.added.locations - when location is
* added</li>
* </ul>
*/
public class EditEventAction extends UWCalEditEventAction {
/** This is the routine which does the work.
*
* @param request Needed to locate session
* @param form Action form
* @return String forward name
*/
public String doAction(HttpServletRequest request,
UWCalActionForm form) throws Throwable {
final SyncManager manager = new SyncManagerFactory().
createSyncManager(SyncManagerFactory.BASIC);
final int eventId = form.getEventId();
final GUID guid = new GUID(eventId + "[EMAIL PROTECTED]");
final SyncEvent event = new SyncEvent(guid, new byte[0],
SyncEvent.UNKNOWN);
manager.getLock(event);
final String result = super.doAction(request, form);
manager.unlock(event);
return result;
}
}
Index: EventAction.java
====================================================================
/*
* ____.
* __/\ ______| |__/\. _______
* __ .____| | \ | +----+ \
* _______| /--| | | - \ _ | : - \_________
* \\______: :---| : : | : | \________>
* |__\---\_____________:______: :____|____:_____\
* /_____|
*
* . . . i n j a h i a w e t r u s t . . .
*
*
*
* ----- BEGIN LICENSE BLOCK -----
* Version: JCSL 1.0
*
* The contents of this file are subject to the Jahia Community Source License
* 1.0 or later (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.jahia.org/license
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the rights, obligations and limitations governing use of the contents
* of the file. The Original and Upgraded Code is the Jahia CMS and Portal
* Server. The developer of the Original and Upgraded Code is JAHIA Ltd. JAHIA
* Ltd. owns the copyrights in the portions it created. All Rights Reserved.
*
* The Shared Modifications are Jahia View Helper.
*
* The Developer of the Shared Modifications is Jahia Solution S�rl.
* Portions created by the Initial Developer are Copyright (C) 2002 by the
* Initial Developer. All Rights Reserved.
*
* ----- END LICENSE BLOCK -----
*/
package org.jahia.suite.calendar.webApp.client;
import org.jahia.suite.calendar.framework.model.SyncEvent;
import org.jahia.suite.calendar.framework.model.GUID;
import org.jahia.suite.calendar.framework.SyncManager;
import org.jahia.suite.calendar.calServer.SyncManagerFactory;
import edu.rpi.cct.uwcal.webclient.UWCalEventAction;
import edu.rpi.cct.uwcal.webclient.UWCalActionForm;
import javax.servlet.http.HttpServletRequest;
/**
* Action to set up an event for display.
* <p>Request parameters<ul>
* <li>"eventId" id of event.</li>
* </ul>
* <p>Forwards to:<ul>
* <li>"doNothing" when request seems wrong.</li>
* <li>"showEvent" event is setup for viewing.</li>
* </ul>
*/
public class EventAction extends UWCalEventAction {
/** This is the routine which does the work.
*
* @param request Needed to locate session
* @param form Action form
* @return String forward name
*/
public String doAction(HttpServletRequest request,
UWCalActionForm form) throws Throwable {
final SyncManager manager = new SyncManagerFactory().
createSyncManager(SyncManagerFactory.BASIC);
final int eventId = form.getEventId();
final GUID guid = new GUID(eventId + "[EMAIL PROTECTED]");
final SyncEvent event = new SyncEvent(guid, new byte[0],
SyncEvent.UNKNOWN);
manager.getLock(event);
final String result = super.doAction(request, form);
manager.unlock(event);
return result;
}
}