Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* This library is part of OpenCms -
* the Open Source Content Management System
*
* Copyright (c) Alkacon Software GmbH (http://www.alkacon.com)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* For further information about Alkacon Software, please see the
* company website: http://www.alkacon.com
*
* For further information about OpenCms, please see the
* project website: http://www.opencms.org
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.opencms.ui.apps.scheduler;
import org.opencms.file.CmsResourceFilter;
import org.opencms.main.CmsIllegalArgumentException;
import org.opencms.main.CmsLog;
import org.opencms.main.CmsRuntimeException;
import org.opencms.monitor.CmsMemoryMonitor;
import org.opencms.notification.CmsContentNotificationJob;
import org.opencms.relations.CmsExternalLinksValidator;
import org.opencms.relations.CmsInternalRelationsValidationJob;
import org.opencms.scheduler.CmsScheduledJobInfo;
import org.opencms.scheduler.jobs.CmsCreateImageSizeJob;
import org.opencms.scheduler.jobs.CmsDeleteExpiredResourcesJob;
import org.opencms.scheduler.jobs.CmsHistoryClearJob;
import org.opencms.scheduler.jobs.CmsImageCacheCleanupJob;
import org.opencms.scheduler.jobs.CmsPublishJob;
import org.opencms.scheduler.jobs.CmsStaticExportJob;
import org.opencms.scheduler.jobs.CmsUnsubscribeDeletedResourcesJob;
import org.opencms.search.CmsSearchManager;
import org.opencms.ui.A_CmsUI;
import org.opencms.ui.CmsVaadinUtils;
import org.opencms.ui.Messages;
import org.opencms.ui.components.OpenCmsTheme;
import org.opencms.ui.components.fileselect.CmsPathSelectField;
import org.opencms.util.CmsStringUtil;
import java.util.Locale;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
import org.apache.commons.logging.Log;
import org.restlet.engine.util.StringUtils;
import com.vaadin.data.Validator;
import com.vaadin.data.fieldgroup.BeanFieldGroup;
import com.vaadin.data.util.converter.Converter;
import com.vaadin.server.FontAwesome;
import com.vaadin.shared.ui.combobox.FilteringMode;
import com.vaadin.ui.AbstractField;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Component;
import com.vaadin.ui.FormLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.themes.ValoTheme;
/**
* Form used to edit a scheduled job.
*/
public class CmsJobEditView extends VerticalLayout {
/**
* Validator for the cron expression field.
*/
public class CronExpressionValidator implements Validator {
/** Serial version id. */
private static final long serialVersionUID = 1L;
/**
* @see com.vaadin.data.Validator#validate(java.lang.Object)
*/
public void validate(Object value) throws InvalidValueException {
CmsScheduledJobInfo info = new CmsScheduledJobInfo();
// Job name may be needed in exception
try {
info.setJobName(m_fieldJobName.getValue());
} catch (CmsRuntimeException e) {
throw new InvalidValueException(e.getLocalizedMessage(A_CmsUI.get().getLocale()));
}
String stringValue = (String)value;
try {
info.setCronExpression(stringValue);
} catch (CmsIllegalArgumentException e) {
throw new InvalidValueException(e.getLocalizedMessage(A_CmsUI.get().getLocale()));
}
}
}
/**
* Validator for the Java class name field.
*/
public class JobClassValidator implements Validator {
/** Serial version id. */
private static final long serialVersionUID = 1L;
/**
* @see com.vaadin.data.Validator#validate(java.lang.Object)
*/
public void validate(Object value) throws InvalidValueException {
CmsScheduledJobInfo info = new CmsScheduledJobInfo();
String stringValue = (String)value;
// Job name may be needed in exception
try {
info.setJobName(m_fieldJobName.getValue());
} catch (CmsRuntimeException e) {
throw new InvalidValueException(e.getLocalizedMessage(A_CmsUI.get().getLocale()));
}
try {
info.setClassName(stringValue);
} catch (CmsIllegalArgumentException e) {
throw new InvalidValueException(e.getLocalizedMessage(A_CmsUI.get().getLocale()));
}
}
}
/**
* Validator for the job name.
*/
public class JobNameValidator implements Validator {
/** Serial version id. */
private static final long serialVersionUID = 1L;
/**
* @see com.vaadin.data.Validator#validate(java.lang.Object)
*/
public void validate(Object value) throws InvalidValueException {
CmsScheduledJobInfo info = new CmsScheduledJobInfo();
String name = (String)value;
try {
info.setJobName(name);
} catch (CmsIllegalArgumentException e) {
throw new InvalidValueException(e.getLocalizedMessage(A_CmsUI.get().getLocale()));
}
}
}
/**
* Converts null values to an empty string for the input widgets.