1 17 18 19 20 package org.apache.lenya.cms.cocoon.acting; 21 22 import java.util.HashMap ; 23 import java.util.Map ; 24 25 import org.apache.avalon.framework.parameters.Parameters; 26 import org.apache.cocoon.environment.Redirector; 27 import org.apache.cocoon.environment.SourceResolver; 28 import org.apache.lenya.cms.rc.FileReservedCheckInException; 29 30 31 34 public class ReservedCheckinAction extends RevisionControllerAction { 35 48 public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String src, Parameters parameters) throws Exception { 49 super.act(redirector, resolver, objectModel, src, parameters); 50 51 HashMap actionMap = new HashMap (); 52 53 boolean backup = true; 54 if (parameters.getParameter("backup", "true").equals("false")) backup = false; 55 log.debug("Backup: " + backup); 56 57 try { 58 getRc().reservedCheckIn(getFilename(), getUsername(), backup); 59 } catch (FileReservedCheckInException e) { 60 actionMap.put("exception", "fileReservedCheckInException"); 61 actionMap.put("filename", getFilename()); 62 actionMap.put("checkType", e.getTypeString()); 63 actionMap.put("user", e.getUsername()); 64 actionMap.put("date", e.getDate()); 65 getLogger().warn(e.getMessage()); 66 67 return actionMap; 68 } catch (Exception e) { 69 actionMap.put("exception", "genericException"); 70 actionMap.put("filename", getFilename()); 71 actionMap.put("message", e.getMessage()); 72 getLogger().warn("The document " + getFilename() + " couldn't be checked in"); 73 74 return actionMap; 75 } 76 77 return null; 78 } 79 } 80 | Popular Tags |