/// <summary> /// Возвращает страницы Wiki по запросу /// </summary> /// <returns></returns> protected override object MainProcess() { var page = new WikiPage { Code = Code, Title = Title ?? "", Text = Text ?? "" }; foreach (var parameter in Context.Parameters) { if ( parameter.Key.ToUpper() != "CODE" && parameter.Key.ToUpper() != "TEXT" && parameter.Key.ToUpper() != "TITLE" ) { page.Propeties[parameter.Key] = parameter.Value; } } var success = WikiSource.Save(page); if (!success) { throw new Exception("Вы не имеет прав на редактирование страницы. Страница заблокирована."); } return(WikiSource.Get(null, Code).First()); }
/// <summary> /// Возвращает страницы Wiki по запросу /// </summary> /// <returns></returns> protected override object MainProcess() { if (PageVersion != null) { return(WikiSource.GetWikiPageByVersion(Code, PageVersion)); } return(WikiSource.Get(Usage, Code.SmartSplit(false, true, ',').ToArray()).ToArray()); }
/// <summary> /// processing of execution - main method of action /// </summary> /// <returns> </returns> protected override object MainProcess() { var file = WikiSource.LoadBinary(Code, WithData); if (null == file) { throw new Exception("file not found"); } var filedesc = new FileDescriptor(); filedesc.NeedDisposition = AsFile; filedesc.LastWriteTime = file.LastWriteTime; filedesc.MimeType = file.MimeType; filedesc.Data = file.Data; filedesc.Length = (int)file.Size; return(filedesc); }
/// <summary> /// Возвращает найденные дескрипторы /// </summary> /// <returns></returns> protected override object MainProcess() { var type = WikiObjectType.None; if (Files) { type = type | WikiObjectType.File; } if (Pages) { type = type | WikiObjectType.Page; } if (string.IsNullOrEmpty(Search)) { Search = "*"; } return(WikiSource.Find(Search, Start, Count, type).ToArray() ); }
/// <summary> /// Сохраняет файл в Wiki /// </summary> /// <returns></returns> protected override object MainProcess() { var srcname = _file.FileName; var ext = Path.GetExtension(srcname); var mime = MimeHelper.GetMimeByExtension(ext); var binobj = new WikiBinary(); binobj.Code = Code; binobj.Title = string.IsNullOrWhiteSpace(Title) ? Code : Title; binobj.MimeType = mime; var data = new byte[_file.ContentLength]; using (var s = _file.InputStream) { s.Read(data, 0, (int)s.Length); } binobj.Data = data; WikiSource.SaveBinary(binobj); return(true); }
/// <summary> /// Возвращает страницы Wiki по запросу /// </summary> /// <returns></returns> protected override object MainProcess() { return(WikiSource.CreateVersion(Code, Comment)); }
/// <summary> /// Играет роль хэш-функции для определенного типа. /// </summary> /// <returns> /// Хэш-код для текущего объекта <see cref="T:System.Object"/>. /// </returns> /// <filterpriority>2</filterpriority> public override int GetHashCode() { return(WikiRenderVersion * 10000 + WikiSerializer.GetHashCode() * 100 + WikiSource.GetHashCode() * 10); }
/// <summary> /// Возвращает страницы Wiki по запросу /// </summary> /// <returns></returns> protected override object MainProcess() { return(WikiSource.RestoreVersion(Code, Version)); }
/// <summary> /// override if Yr action provides 304 state and return Last-Modified-State header /// </summary> /// <returns> </returns> protected override DateTime EvalLastModified() { return(WikiSource.GetVersion(Code, WikiObjectType.File)); }
/// <summary> /// /// </summary> /// <returns></returns> protected override object MainProcess() { return(WikiSource.GetLock(Code)); }
/// <summary> /// Возвращает страницы Wiki по запросу /// </summary> /// <returns></returns> protected override object MainProcess() { return(WikiSource.GetVersionsList(Code)); }
/// <summary> /// /// </summary> /// <returns></returns> protected override object MainProcess() { return(WikiSource.Releaselock(Code)); }
/// <summary> /// ¬озвращает страницы Wiki по запросу /// </summary> /// <returns></returns> protected override object MainProcess() { return(WikiSource.Exists(Code.SmartSplit(false, true, ',').ToArray()).ToArray()); }