示例#1
0
// コンストラクタ

		protected HatomaruActionBase(HatomaruXml model, AbsPath path){
			myModel = model;
			myUserPath = path;
			myPath = path;
			myResponse = new NormalResponse(model, myPath);
			GetHtml();
		}
示例#2
0
// コンストラクタ
		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();
		}
示例#3
0
		protected HatomaruGetAction(HatomaruXml model, AbsPath path) : base(model, path){}
		public UnsupportedMediaTypeResponse(HatomaruXml source, AbsPath path) : base(source, path, 415, "Unsupported Media Type"){}
示例#5
0
		/// <summary>
		/// エラーメッセージを指定して ErrorResponse を作成します。
		/// </summary>
		protected ErrorResponse(HatomaruXml source, AbsPath path, int errorCode, string message) : this(source, path, errorCode){
			myMessage = message;
		}
示例#6
0
		protected ErrorResponse(HatomaruXml source, AbsPath path, int errorCode) : base(source, path){
			myStatusCode = errorCode;
		}
示例#7
0
// コンストラクタ
		public HatomaruPostAction(HatomaruXml model, AbsPath path, HttpRequest req) : base(model, path){
			myRequest = req;
		}
示例#8
0
// コンストラクタ

		protected HtmlRefAction(HatomaruXml model, AbsPath path) : base(model, path){}
示例#9
0
// コンストラクタ

		/// <summary>
		/// コメントを見るアクションのインスタンスを開始します。
		/// </summary>
		public ViewComment(HatomaruXml model, AbsPath path, AbsPath commentToPath) : base(model, path){
			myCommentToPath = commentToPath;
			myPath = myCommentToPath.Combine(CommentPath);
		}
示例#10
0
		/// <summary>
		/// データソースとAbsPathを指定して、HatomaruResponse のインスタンスを開始します。
		/// 通常はこのコンストラクタを使用します。
		/// </summary>
		public NormalResponse(HatomaruXml source, AbsPath path) : base(source){
			myPath = path;
		}
示例#11
0
		/// <summary>
		/// データソースを指定して、NoCacheResponse のインスタンスを開始します。
		/// </summary>
		public NoCacheResponse(HatomaruXml source, AbsPath path) : base(source, path){
		}
示例#12
0
// コンストラクタ

		protected PartialDiaryAction(HatomaruXml model, AbsPath path) : base(model, path){}
示例#13
0
		public NotFoundResponse(HatomaruXml source, AbsPath path, string message) : base(source, path, 404, message){}
示例#14
0
		public NotFoundResponse(HatomaruXml source, AbsPath path) : this(source, path, "Not Found"){}
示例#15
0
		public ForbiddenResponse(HatomaruXml source, AbsPath path) : base(source, path, 403, "Forbidden"){}
示例#16
0
		/// <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;
		}
示例#17
0
		public ForbiddenResponse(HatomaruXml source, AbsPath path, string message) : base(source, path, 403, message){}
示例#18
0
// コンストラクタ

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

		}
示例#19
0
// コンストラクタ

		public ReputationView(HatomaruXml model, AbsPath path) : base(model, path){}
示例#20
0
// コンストラクタ

		protected ReputationAction(HatomaruXml model, AbsPath path) : base(model, path){
		}