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); }
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 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 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); }