001/** 002 * Copyright 2005-2016 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.rice.krad.rules.rule.event; 017 018import org.kuali.rice.krad.document.Document; 019 020import java.util.ArrayList; 021import java.util.List; 022 023/** 024 * This class represents the save event that is part of an eDoc in Kuali. This could be triggered when a user presses the save 025 * button for a given document or it could happen when another piece of code calls the save method in the document service. This 026 * event does not trigger sub-events for validation. 027 * 028 * 029 */ 030public class SaveOnlyDocumentEvent extends SaveDocumentEvent { 031 /** 032 * Constructs a SaveOnlyDocumentEvent with the specified errorPathPrefix and document 033 * 034 * @param document 035 * @param errorPathPrefix 036 */ 037 public SaveOnlyDocumentEvent(String errorPathPrefix, Document document) { 038 this("creating save event using no generated events for document " + getDocumentId(document), errorPathPrefix, document); 039 } 040 041 /** 042 * Constructs a SaveDocumentEvent with the given document 043 * 044 * @param document 045 */ 046 public SaveOnlyDocumentEvent(Document document) { 047 this("", document); 048 } 049 050 /** 051 * @see org.kuali.rice.krad.rules.rule.event.KualiDocumentEventBase#KualiDocumentEventBase(java.lang.String, java.lang.String, org.kuali.rice.krad.document.Document) 052 */ 053 public SaveOnlyDocumentEvent(String description, String errorPathPrefix, Document document) { 054 super(description, errorPathPrefix, document); 055 } 056 057 /** 058 * This overridden method returns an empty list always 059 * 060 * @see org.kuali.rice.krad.rules.rule.event.SaveDocumentEvent#generateEvents() 061 */ 062 @Override 063 public List<KualiDocumentEvent> generateEvents() { 064 return new ArrayList<KualiDocumentEvent>(); 065 } 066 067 068}