コード例 #1
0
ファイル: RQKosModel.cs プロジェクト: jbunzel/MvcRQ_git
 public RQKosBranch(string majClassID, string serviceId, RQKosFormat.FormatEnum format)
     : this(majClassID, serviceId)
 {
     if (this._service == "rqld")
     {
         this._formatPreprocessor = new RQKosFormat(format);
     }
 }
コード例 #2
0
        private RQKosFormat.FormatEnum GetFormat()
        {
            System.Net.Http.Formatting.IContentNegotiator       negotiator = this.Configuration.Services.GetContentNegotiator();
            System.Net.Http.Formatting.ContentNegotiationResult result     = negotiator.Negotiate(typeof(RQKosBranch), this.Request, this.Configuration.Formatters);
            if (result != null)
            {
                RQKosFormat.FormatEnum format = RQKosFormat.FormatEnum.undefined;

                switch (result.MediaType.MediaType)
                {
                case "application/turtle":
                    throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.NotAcceptable));

                //format = RQKosFormat.FormatEnum.turtle;
                //break;
                case "text/turtle":
                    throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.NotAcceptable));

                //format = RQKosFormat.FormatEnum.turtle;
                //break;
                case "application/rdf+n3":
                    throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.NotAcceptable));

                //format = RQKosFormat.FormatEnum.turtle;
                //break;
                case "text/rdf+n3":
                    throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.NotAcceptable));

                //format = RQKosFormat.FormatEnum.turtle;
                //break;
                case "application/rdf+xml":
                    format = RQKosFormat.FormatEnum.rdf;
                    break;

                case "text/rdf":
                    format = RQKosFormat.FormatEnum.rdf;
                    break;

                default:
                    throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.NotAcceptable));
                    //format = RQKosFormat.FormatEnum.undefined;
                    //break;
                }
                return(format);
            }
            else
            {
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.NotAcceptable));
            }
        }
コード例 #3
0
ファイル: RQKosModel.cs プロジェクト: jbunzel/MvcRQ_git
 public RQKosModel(string itemID, string serviceID, RQKosFormat.FormatEnum format)
     : this(itemID, serviceID)
 {
     RQKosSet.FormatPreprocessor = new RQKosFormat(format);
 }