// コンストラクタ protected HatomaruActionBase(HatomaruXml model, AbsPath path){ myModel = model; myUserPath = path; myPath = path; myResponse = new NormalResponse(model, myPath); GetHtml(); }
// コンストラクタ public BbsPostAction(HatomaruXml model, AbsPath path, HttpRequest req) : base(model, path, req){ string[] fragments = path.GetFragments(BasePath); if(model is HatomaruBbs){ if(fragments.Length > 1 && fragments[0].Equals(BbsViewArticle.Id)){ int articleId = fragments[1].ToInt32(); myTargetArticle = Bbs.GetArticle(articleId); } } else { myTargetArticle = new Article(); myTargetArticle.CommentTo = path.RemoveLast(CommentPath); } myResponse = new NoCacheResponse(Model, path); GetHtml(); }
protected HatomaruGetAction(HatomaruXml model, AbsPath path) : base(model, path){}
public UnsupportedMediaTypeResponse(HatomaruXml source, AbsPath path) : base(source, path, 415, "Unsupported Media Type"){}
/// <summary> /// エラーメッセージを指定して ErrorResponse を作成します。 /// </summary> protected ErrorResponse(HatomaruXml source, AbsPath path, int errorCode, string message) : this(source, path, errorCode){ myMessage = message; }
protected ErrorResponse(HatomaruXml source, AbsPath path, int errorCode) : base(source, path){ myStatusCode = errorCode; }
// コンストラクタ public HatomaruPostAction(HatomaruXml model, AbsPath path, HttpRequest req) : base(model, path){ myRequest = req; }
// コンストラクタ protected HtmlRefAction(HatomaruXml model, AbsPath path) : base(model, path){}
// コンストラクタ /// <summary> /// コメントを見るアクションのインスタンスを開始します。 /// </summary> public ViewComment(HatomaruXml model, AbsPath path, AbsPath commentToPath) : base(model, path){ myCommentToPath = commentToPath; myPath = myCommentToPath.Combine(CommentPath); }
/// <summary> /// データソースとAbsPathを指定して、HatomaruResponse のインスタンスを開始します。 /// 通常はこのコンストラクタを使用します。 /// </summary> public NormalResponse(HatomaruXml source, AbsPath path) : base(source){ myPath = path; }
/// <summary> /// データソースを指定して、NoCacheResponse のインスタンスを開始します。 /// </summary> public NoCacheResponse(HatomaruXml source, AbsPath path) : base(source, path){ }
// コンストラクタ protected PartialDiaryAction(HatomaruXml model, AbsPath path) : base(model, path){}
public NotFoundResponse(HatomaruXml source, AbsPath path, string message) : base(source, path, 404, message){}
public NotFoundResponse(HatomaruXml source, AbsPath path) : this(source, path, "Not Found"){}
public ForbiddenResponse(HatomaruXml source, AbsPath path) : base(source, path, 403, "Forbidden"){}
/// <summary> /// この HatomaruXml からリンクする HatomaruXml のリストを取得します。 /// </summary> public HatomaruXml[] GetChildren(){ XmlNodeList nodes = Document.DocumentElement.GetElementsByTagName(HatomaruActionBase.MenuitemElement); HatomaruXml[] result = new HatomaruXml[nodes.Count]; for(int i=0; i < nodes.Count; i++){ XmlElement elem = nodes[i] as XmlElement; string linkSource = elem.GetAttribute("src"); result[i] = GetDataByPathString(linkSource); } return result; }
public ForbiddenResponse(HatomaruXml source, AbsPath path, string message) : base(source, path, 403, message){}
// コンストラクタ /// <summary> /// 鳩丸データのデータソースの FileInfo と XmlDocument を指定して、HatomaruData のインスタンスを開始します。 /// </summary> protected HatomaruXml(HatomaruManager manager, FileInfo f, XmlDocument doc) : base(manager, f){ myDocument = doc; // ロード済み myMetaData = Document.DocumentElement[MetaName]; if(myMetaData == null) return; XmlElement title = myMetaData[TitleName]; if(title != null) myBaseTitle = title.InnerText; XmlElement desc = myMetaData[DescName]; if(desc != null) myDescription = desc.InnerText; XmlElement keywords = myMetaData[KeywordName]; if(keywords != null) myKeywords = keywords.InnerText; XmlElement topicSuffix = myMetaData[TopicSuffixName]; if(topicSuffix != null) myTopicSuffix = topicSuffix.InnerText; XmlNodeList styles = myMetaData.GetElementsByTagName(StyleName); foreach(XmlNode x in styles){ XmlElement e = x as XmlElement; if(x == null) continue; string linkHref = e.GetAttribute("href"); string linkTitle = e.GetAttribute("title"); linkHref = '/' + linkHref.TrimStart('/'); LinkItem s = new LinkItem(linkHref, linkTitle); myStyles.Add(s); } // 親 XML を取得 XmlNodeList indexes = myMetaData.GetElementsByTagName(IndexXmlName); if(indexes.Count > 0){ string indexXmlName = Util.GetAttributeValue(indexes[0], IndexXmlRefAttrName); if(!string.IsNullOrEmpty(indexXmlName)) myParentXml = GetDataByPathString(indexXmlName); } else if(!manager.RootXmlFile.FullName.Equals(f.FullName)){ myParentXml = manager.RootXml; } }
// コンストラクタ public ReputationView(HatomaruXml model, AbsPath path) : base(model, path){}
// コンストラクタ protected ReputationAction(HatomaruXml model, AbsPath path) : base(model, path){ }