コード例 #1
0
 public ActionResult GetFieldOptionsStore()
 {
     return(Json(new
     {
         results = (from c in Enums.Get <BindingFieldOptions>().AsQueryable()
                    select new
         {
             OptionName = Enum.GetName(typeof(BindingFieldOptions), c),
             OptionValue = (int)c
         }
                    )
     }));
 }
コード例 #2
0
 public ActionResult GetConnectorTypeStore()
 {
     return(Json(new
     {
         results = (from c in Enums.Get <ConnectorType>().AsQueryable()
                    select new
         {
             ConnectorTypeName = Enum.GetName(typeof(ConnectorType), c),
             ConnectorType = (int)c
         }
                    )
     }));
 }
コード例 #3
0
 public ActionResult GetSystemTypeStore()
 {
     return(Json(new
     {
         results = (from c in Enums.Get <ConnectorSystemType>().AsQueryable()
                    select new
         {
             ConnectorSystemTypeName = c.ToString(),
             ConnectorSystemType = (int)c
         }
                    )
     }));
 }
コード例 #4
0
 public ActionResult GetOutboundMessageTypes()
 {
     return(Json(new
     {
         results = (from c in Enums.Get <OutboundMessageTypeEnum>().AsQueryable()
                    select new
         {
             OutboundMessageTypeName = c.ToString(),
             OutboundMessageTypeID = (int)c
         }
                    )
     }));
 }
コード例 #5
0
 public ActionResult GetConnectorTypes()
 {
     return(Json(new
     {
         connectorTypes = (from c in Enums.Get <ConnectorTypeEnum>().AsQueryable()
                           select new
         {
             ConnectorTypeName = c.ToString(),
             ConnectorTypeID = (int)c
         }
                           )
     }));
 }
コード例 #6
0
 public ActionResult GetXtractTypes()
 {
     return(Json(new
     {
         xtractTypes = (from c in Enums.Get <XractTypeEnum>().AsQueryable()
                        select new
         {
             XtractTypeName = c.ToString(),
             XtractTypeID = (int)c
         }
                        )
     }));
 }
コード例 #7
0
 public ActionResult GetFtpTypes()
 {
     return(Json(new
     {
         results = (from c in Enums.Get <FtpTypeEnum>().AsQueryable()
                    select new
         {
             FtpTypeName = c.ToString(),
             FtpTypeID = (int)c
         }
                    )
     }));
 }
コード例 #8
0
 public ActionResult GetAccountPrivileges()
 {
     return(Json(new
     {
         results = (from c in Enums.Get <AccountPrivilegesEnum>().AsQueryable()
                    select new
         {
             AccountPrivilegeName = c.ToString(),
             AccountPrivilegeID = (int)c
         }
                    )
     }));
 }
コード例 #9
0
 public IActionResult GetLogTypeEnum()
 {
     return(Ok(Enums.Get <LogTypeEnum>()));
 }
コード例 #10
0
 public IActionResult GetSystemInstanceStatusEnum()
 {
     return(Ok(Enums.Get <SystemInstanceStatusEnum>()));
 }
コード例 #11
0
 public IActionResult GetServerOSEnum()
 {
     return(Ok(Enums.Get <ServerOSEnum>()));
 }
コード例 #12
0
 public IActionResult GetApplicationCategoryEnum()
 {
     return(Ok(Enums.Get <ApplicationCategoryEnum>()));
 }
コード例 #13
0
 public IActionResult GetApplicationStageEnum()
 {
     return(Ok(Enums.Get <ApplicationStageEnum>()));
 }
コード例 #14
0
 public IActionResult GetApplicationOriginEnum()
 {
     return(Ok(Enums.Get <ApplicationOriginEnum>()));
 }
コード例 #15
0
 public IActionResult GetCharacteristicDefinition()
 {
     return(Ok(Enums.Get <CharacteristicDefinition>()));
 }
コード例 #16
0
        public override void ExecuteResult(ControllerContext context)
        {
            ValidationEventHandler validator = delegate(object sender, ValidationEventArgs e)
            {
                // TODO : validating the schema.  Does this matter?
            };

            XNamespace ns    = "DAV:";
            string     input = new StreamReader(context.HttpContext.Request.InputStream).ReadToEnd();
            XDocument  doc   = XDocument.Parse(input);

            doc.Validate(_schemas, validator);

            int depth = -1;

            if (context.HttpContext.Request.Headers["Depth"] == null)
            {
                _depth = Headers.Depth.One; //If not specified, RFC4918 says anticipate "Infinity".
                // Also says Infinity may be disallowed for performance, so covert to 1
            }
            else if (Int32.TryParse(context.HttpContext.Request.Headers["Depth"], out depth))
            {
                if (depth == 0)
                {
                    _depth = Headers.Depth.Zero;
                }
                else if (depth == 1)
                {
                    _depth = Headers.Depth.One;
                }
                else
                {
                    throw new ArgumentOutOfRangeException("Header DEPTH has an invalid value.  Expected values are \"0\", \"1\", or \"Infinity\".");
                }
            }
            else
            {
                _depth = Headers.Depth.One; //probably said infinity, but we do 1 for performance
            }

            string   _path      = context.HttpContext.Request.Path;
            XElement xlPropFind = doc.Elements(ns + "propfind").FirstOrDefault();

            if (xlPropFind != null)
            {
                XElement node = null;

                // Return specific properties
                if ((node = xlPropFind.Element(ns + "prop")) != null)
                {
                    // A list of requested properties
                    List <PropertyName> properties = (from p in node.Descendants()
                                                      select new PropertyName(p.Name.NamespaceName, p.Name.LocalName)).ToList();
                    IEnumerable <IHierarchyItem> items = _engine.GetResources(new List <string>()
                    {
                        _path
                    }, properties, _depth);

                    FillOutProperties(items, properties);

                    XNamespace davNS       = XNamespace.Get("DAV:");
                    XElement   multistatus = new XElement(davNS + "multistatus", new XAttribute(XNamespace.Xmlns + "D", davNS));

                    // Each resource is a different "DAV:response" line
                    foreach (IHierarchyItem item in items)
                    {
                        XElement response = new XElement(davNS + "response"
                                                         , new XElement(davNS + "href", item.Path));

                        // each status is unique within the response/resource
                        foreach (PropertyValue.Status status in Enums.Get <PropertyValue.Status>())
                        {
                            if (item.Properties.Count(r => r.Value.PropertyStatus == status) > 0)
                            {
                                XElement propstat = new XElement(davNS + "propstat",
                                                                 from p in item.Properties.Where(p => p.Value.PropertyStatus == status)
                                                                 join pr in properties on p.Key equals pr
                                                                 select new XElement(davNS + "prop",
                                                                                     new XElement(XNamespace.Get(p.Key.Namespace) + p.Key.Name,
                                                                                                  p.Value.Value) //property
                                                                                     )                           //end prop
                                                                 , new XElement(davNS + "status", StatusCodes.GetHttpCode((int)status))
                                                                 );                                              //end propstat

                                response.Add(propstat);
                            }
                        }

                        multistatus.Add(response);
                    }


                    context.HttpContext.Response.StatusCode = 207;
                    context.HttpContext.Response.AppendHeader("Content-Type", "application/xml");
                    using (StreamWriter sw = new StreamWriter(context.HttpContext.Response.OutputStream))
                    {
                        sw.Write(multistatus.ToString());
                    }
                }

                // Retrieve all property names
                else if ((node = xlPropFind.Element(ns + "propname")) != null)
                {
                }
                // Retrieve "allprop"
                else if ((node = xlPropFind.Element(ns + "allprop")) != null)
                {
                    // search for the "include"
                }
            }
        }