<%-- #RevizeProperties USE REVIZE MENU (DOCUMENT PROPERTIES) TO EDIT DATA BELOW: status=edit options= server=localhost:8080 projectName=plugins label=calendar_calendar_delete location=calendar_app/calendar_lists/calendar_calendar_delete.jsp version=21 docType=template subType=unique moduleName= fieldName= channels=revize| description= --%><%-- #BeginRZ-PageHeader --%> <%@ page language="java" %> <%@ include file = "/util/setup_editlist_header.jsp" %> <%-- #EndRZ-PageHeader --%> Delete Mapping Records <%-- ___________________________________________________________________________________ In frame version filename was: calendar_calendar_delete.jsp This Edit Page deviates from standard Revize editform as follows: ___________________________________________________________________________________ --%> <%@ include file="/plugins/calendar/calendar.version_include.jsp" %><% //----- Page specific JSP code LOADING = "Updating Database..."; String groupid = StringUtils.getParameter(request,"groupid"); String calendarid = StringUtils.getParameter(request,"calendarid"); String fromurl = StringUtils.getParameter(request,"fromurl"); if (fromurl.length() == 0) debug = true; %><%@ page import = "java.util.Vector, contentimporter.Importer" %><% String calidsDeletedMsg = ","; String eventsDeletedMsg = ","; String mappingsDeletedMsg = ","; Vector calidsDeleted = new Vector(); Vector eventsDeleted = new Vector(); Vector mappingsDeleted = new Vector(); //----- If no groupid, assume calendarid passed if (groupid.length() == 0) calidsDeletedMsg += calendarid + ","; //----- Scan calendar tables if groupid specified else { String filter = "calendar_names.groupid=" + groupid; rz.listsetup("calendar_names", "noemptylistmessage", filter, ""); while ( rz.listnext() ) { if (rz.listindex < 0) break; rz.fetch("calendar_names","_recordid"); calidsDeleted.addElement(new Integer(rz.content)); calidsDeletedMsg += rz.content + ","; } } //----- Scan events table for events belonging to any deleted calendar // TODO: use filter for better performance rz.listsetup("calendar_events", "noemptylistmessage", "", ""); while ( rz.listnext() ) { if (rz.listindex < 0) break; //----- If event belongs to a deleted calendar, add to delete list rz.fetch("calendar_events", "calendarid"); if (calendarid.indexOf("|" + rz.content + "|") != -1) { eventsDeleted.addElement(new Integer(rz.recordid)); eventsDeletedMsg += rz.recordid + ","; } } //----- Scan mapping table for deleted events // TODO: use filter for better performance rz.listsetup("calendar_mapping", "noemptylistmessage", "", ""); while ( rz.listnext() ) { if (rz.listindex < 0) break; rz.fetch("calendar_mapping", "_recordid"); if (eventsDeletedMsg.indexOf(","+rz.content+",") != -1) { mappingsDeleted.addElement(new Integer(rz.content)); mappingsDeletedMsg += rz.content + ","; } } //----- Delete, Calendar, Event and Mapping records Importer importer = new Importer(); if (calidsDeleted.size() > 0) importer.delete( rz.webspace, "calendar_names", calidsDeleted ); if (eventsDeleted.size() > 0) importer.delete( rz.webspace, "calendar_events", eventsDeleted ); if (mappingsDeleted.size() > 0) importer.delete( rz.webspace, "calendar_mapping", mappingsDeleted ); %><%-- //-------------------------------------------------------------------------------\\ Following script, link and style tags just for DW reference, They are NOT published. Javascript functions run from homepage; CSS cloned from the homepage during setup(). --%><% if (false) { %> <% //-------------------------------------------------------------------------------// } %><%-- @@no-source-format@@ /***************************************************/ /**/ .RZhidden class hides elements in browser /**/ /**/ ...BUT allows DW to show in design view... /**/ /**/ /* Following css does not get published */ /**/ /**/ --%><% if (false){ /**/ /**/ %><% } /**/ /**/ /* Following IS published for Browsers */ /**/ /**/ /* use marker to test CSS priority */ /**/ /**/ %><%-- /**/ /***************************************************/ @@no-source-format@@ --%> <%-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * DELETE standard javascript include file after the body tag (if shown above); it is included in the section for edit pages and not used on templates. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --%> <%if(false){%>
NOTE: blocks with class=RZhidden show with this background in DW only; they are hidden when page displays in browser unless changed by javascript or other CSS.
<%}%> <%@ include file="/plugins/calendar/calendar.loading_layer_include.jsp" %>

Debug Mode caused pause on this URL

Calendars recordid's Deleted:  <%=calidsDeletedMsg.substring(1).replace('|',',')%>
Event recordid's Deleted:  <%=eventsDeletedMsg.substring(1)%>
Mappings recordid's Deleted:  <%=mappingsDeletedMsg.substring(1)%>
 
nexturl=.../calendar_app/index.html with #hash containing
current settings: calendar name, date, view, css file