?? deletescheduledreportaction.java
字號:
/*
* Copyright (C) 2003 Erik Swenson - eswenson@opensourcesoft.net
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
* Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
package org.efs.openreports.actions.schedule;
import com.opensymphony.xwork.ActionContext;
import com.opensymphony.xwork.ActionSupport;
import org.efs.openreports.ORStatics;
import org.efs.openreports.objects.ReportSchedule;
import org.efs.openreports.objects.ReportUser;
import org.efs.openreports.providers.*;
public class DeleteScheduledReportAction
extends ActionSupport
implements SchedulerProviderAware, DateProviderAware
{
private SchedulerProvider schedulerProvider;
private DateProvider dateProvider;
private String command;
private String scheduleName;
private String name;
private String startDate;
private String scheduleTypeName;
public String execute()
{
try
{
ReportUser reportUser =
(ReportUser) ActionContext.getContext().getSession().get(
ORStatics.REPORT_USER);
ReportSchedule reportSchedule =
schedulerProvider.getScheduledReport(reportUser, scheduleName);
name = reportSchedule.getReport().getName();
startDate = dateProvider.formatDate(reportSchedule.getStartDate());
scheduleTypeName = reportSchedule.getScheduleTypeName();
if (command == null || command.length() < 1)
{
return INPUT;
}
if (command.equalsIgnoreCase("delete"))
{
schedulerProvider.deleteScheduledReport(
reportUser,
scheduleName);
}
}
catch (Exception e)
{
addActionError(e.getMessage());
return INPUT;
}
return SUCCESS;
}
public void setSchedulerProvider(SchedulerProvider schedulerProvider)
{
this.schedulerProvider = schedulerProvider;
}
public String getCommand()
{
return command;
}
public void setCommand(String command)
{
this.command = command;
}
public String getScheduleName()
{
return scheduleName;
}
public void setScheduleName(String scheduleName)
{
this.scheduleName = scheduleName;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
public String getScheduleTypeName()
{
return scheduleTypeName;
}
public void setScheduleTypeName(String scheduleTypeName)
{
this.scheduleTypeName = scheduleTypeName;
}
public String getStartDate()
{
return startDate;
}
public void setStartDate(String startDate)
{
this.startDate = startDate;
}
public void setDateProvider(DateProvider dateProvider)
{
this.dateProvider = dateProvider;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -