1 17 package org.jahia.services.version; 18 19 import org.jahia.registries.ServicesRegistry; 20 21 24 public class JahiaSaveVersion { 25 26 private boolean staging; 27 private boolean versioning; 28 private int versionID; 29 30 private ServicesRegistry sr = ServicesRegistry.getInstance(); 31 32 35 public JahiaSaveVersion (boolean staging, boolean versioning, int versionID) 36 { 37 this.staging = staging; 38 this.versioning = versioning; 39 this.versionID = versionID; 40 } 41 44 45 public JahiaSaveVersion (boolean staging, boolean versioning) 46 { 47 this.staging = staging; 48 this.versioning = versioning; 49 this.versionID = sr.getJahiaVersionService().getCurrentVersionID(); 50 } 51 52 public int getVersionID() { return versionID; } 53 54 public int getWorkflowState() { return staging?2:1; } 55 56 public boolean isCurrent() 57 { 58 return (!staging); 59 } 60 61 public boolean isStaging() 62 { 63 return (staging); 64 } 65 66 public boolean isVersioned() 67 { 68 return (versioning); 69 } 70 71 public String toString() 72 { 73 return new String ("[SAVE:staging="+staging+", versioning="+versioning+", versionID="+versionID+"]"); 74 } 75 76 77 } | Popular Tags |