public virtual void Reject() { var action = SavingAction.Create(this); action.Reject(); action.Execute(); }
public virtual void Publish() { var action = SavingAction.Create(this); action.Publish(); action.Execute(); }
public virtual void Approve() { var action = SavingAction.Create(this); action.Approve(); action.Execute(); }
public virtual void CheckIn() { var action = SavingAction.Create(this); action.CheckIn(); action.Execute(); }
public void UndoCheckOut(bool forceRefresh = true) { var action = SavingAction.Create(this); action.UndoCheckOut(forceRefresh); action.Execute(); }
public virtual void SaveSameVersion() { var action = SavingAction.Create(this); action.SaveSameVersion(); action.Execute(); }
public static Node CreateFromTemplate(Node target, Node template, string name) { var newNode = template.MakeTemplatedCopy(target, name); VersionNumber version = null; //compute new version number according to the versioning //and approving settings in the target folder var gc = newNode as GenericContent; if (gc != null) { version = SavingAction.ComputeNewVersion(gc.ApprovingMode == ApprovingType.True, gc.VersioningMode); } else { //TODO: handle non-GenericContent scenarios } if (version != null) { newNode.Version = version; } newNode.Template = template; return(newNode); }
//==================================================== Versioning & Approving ==================================================== private void VersionSetup() { if (this.Id == 0) { this.Version = SavingAction.ComputeNewVersion(this.HasApproving, this.VersioningMode); } }
private static SavingAction CreateForNode(Node node) { var savingAction = new SavingAction { Node = node, VersioningMode = VersioningMode.None, HasApproving = false }; return(savingAction); }
public static bool HasUndoCheckOut(GenericContent node) { if (HasForceUndoCheckOutRight(node)) { return(false); } var s = SavingAction.Create(node); return(s.ValidateAction(StateAction.UndoCheckOut) == ActionValidationResult.Valid); }
private static SavingAction CreateForNode(Node node) { var savingAction = new SavingAction { Node = node, VersioningMode = VersioningMode.None, HasApproving = false }; return savingAction; }
private static SavingAction CreateForGenericContent(GenericContent genericContent) { var mode = VersioningMode.None; switch (genericContent.VersioningMode) { case VersioningType.MajorOnly: mode = VersioningMode.Major; break; case VersioningType.MajorAndMinor: mode = VersioningMode.Full; break; } var savingAction = new SavingAction { Node = genericContent, VersioningMode = mode, HasApproving = genericContent.HasApproving }; return savingAction; }
private static SavingAction CreateForGenericContent(GenericContent genericContent) { var mode = VersioningMode.None; switch (genericContent.VersioningMode) { case VersioningType.MajorOnly: mode = VersioningMode.Major; break; case VersioningType.MajorAndMinor: mode = VersioningMode.Full; break; } var savingAction = new SavingAction { Node = genericContent, VersioningMode = mode, HasApproving = genericContent.HasApproving }; return(savingAction); }
public virtual void Save(SavingMode mode) { var action = SavingAction.Create(this); switch (mode) { case SavingMode.RaiseVersion: action.CheckOutAndSaveAndCheckIn(); break; case SavingMode.RaiseVersionAndLock: action.CheckOutAndSave(); break; case SavingMode.KeepVersion: action.SaveSameVersion(); break; default: throw new NotImplementedException("Unknown SavingMode: " + mode); } action.Execute(); }
public static bool HasReject(GenericContent node) { var s = SavingAction.Create(node); return(s.ValidateAction(StateAction.Reject) == ActionValidationResult.Valid); }
public static bool HasCheckIn(Node node) { var s = SavingAction.Create(node); return(s.ValidateAction(StateAction.CheckIn) == ActionValidationResult.Valid); }