예제 #1
0
 public ComplexOutput(string Identifier, string Title, string Abstract, ComplexFormat Format)
     : base(Identifier, Title, Abstract)
 {
     this.Format = Format;
     Formats     = new List <ComplexFormat>();
     this.Formats.Add(Format);
     //maximumMegabytes = -1;
 }
예제 #2
0
 public ComplexOutput(SerializationInfo info, StreamingContext ctxt)
     : base(info, ctxt)
 {
     Formats = (List <ComplexFormat>)info.GetValue("formats", typeof(List <ComplexFormat>));
     Format  = (ComplexFormat)info.GetValue("format", typeof(ComplexFormat));
     //maximumMegabytes = (int)info.GetValue("maximumMegabytes", typeof(int));
     Value = (byte[])info.GetValue("Value", typeof(byte[]));
 }
예제 #3
0
 public ComplexInput(SerializationInfo info, StreamingContext ctxt)
     : base(info, ctxt)
 {
     Formats          = (List <ComplexFormat>)info.GetValue("Formats", typeof(List <ComplexFormat>));
     Format           = (ComplexFormat)info.GetValue("Format", typeof(ComplexFormat));
     maximumMegabytes = (int)info.GetValue("maximumMegabytes", typeof(int));
     Value            = (byte[])info.GetValue("Value", typeof(byte[]));
     asReference      = (bool)info.GetValue("asReference", typeof(bool));
     Reference        = (string)info.GetValue("Reference", typeof(string));
     Method           = (string)info.GetValue("Method", typeof(string));
     Header           = (Dictionary <string, string>)info.GetValue("Header", typeof(Dictionary <string, string>));
     Body             = (string)info.GetValue("Body", typeof(string));
     BodyReference    = (string)info.GetValue("BodyReference", typeof(string));
     BodyAsReference  = (bool)info.GetValue("BodyAsReference", typeof(bool));
 }
예제 #4
0
 public ComplexInput(string Identifier, string Title, string Abstract, ComplexFormat Format)
     : base(Identifier, Title, Abstract)
 {
     this.Format = Format;
     Formats     = new List <ComplexFormat>();
     Formats.Add(this.Format);
     maximumMegabytes = -1;
     Method           = "GET";
     asReference      = false;
     Reference        = null;
     Header           = new Dictionary <string, string>();
     Body             = null;
     BodyReference    = null;
     BodyAsReference  = false;
 }
예제 #5
0
        public override bool Parse(string str, ProcessDescription processDescription)
        {
            if (String.IsNullOrEmpty(str))
            {
                return(false);
            }

            string[] tokens = str.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
            if (tokens.Length != 1)
            {
                throw new ExceptionReport("One identifier is mandatory when requesting a raw data output but "
                                          + tokens.Length + " were found.",
                                          ExceptionCode.InvalidParameterValue, "RawDataOutput");
            }

            string[] kv = str.Split(new char[] { '@' }, StringSplitOptions.RemoveEmptyEntries);
            if (kv.Length > 0)
            {
                OutputData outputData = processDescription.GetProcessOutputParameter(kv[0]);
                if (outputData == null)
                {
                    throw new ExceptionReport(String.Format("The output {0} is not a valid output for the process {1}",
                                                            kv[0], processDescription.Identifier), ExceptionCode.InvalidParameterValue, "rawDataOutput");
                }

                ComplexOutput output = outputData.asComplexOutput();
                if (output == null)
                {
                    throw new ExceptionReport(String.Format("Only ComplexOutputs can be requested as rawDataOutput but {0} is a {1}",
                                                            kv[0], outputData.GetType().ToString()), ExceptionCode.InvalidParameterValue, "rawDataOutput");
                }

                Identifier = kv[0];
                Format     = output.Format; // default format
                Format.ParseValue(str);
                if (output.Formats.Find(delegate(ComplexFormat cf) { return(cf.Equals(Format)); }) == null)
                {
                    throw new ExceptionReport(string.Format("Requested format for the output {0} is not supported", kv[0]),
                                              ExceptionCode.InvalidParameterValue, kv[0]);
                }
            }

            return(false);
        }
예제 #6
0
        public override bool Parse(XmlNode node, ProcessDescription processDescription)
        {
            if (node == null)
            {
                return(false);
            }

            XmlNamespaceManager nsmgr = Utils.CreateWPSNamespaceManager(node.OwnerDocument);

            XmlNodeList childs = node.SelectNodes("ows:Identifier", nsmgr);

            if (childs.Count != 1)
            {
                throw new ExceptionReport("One identifier is mandatory when requesting a raw data output but " + childs.Count + " were found.",
                                          ExceptionCode.InvalidParameterValue, "wps:RawDataOutput/ows:Identifier");
            }
            Identifier = childs[0].InnerText;
            OutputData outputData = processDescription.GetProcessOutputParameter(Identifier);

            if (outputData == null)
            {
                throw new ExceptionReport(String.Format("The output {0} is not a valid output for the process {1}",
                                                        Identifier, processDescription.Identifier), ExceptionCode.InvalidParameterValue, "rawDataOutput");
            }

            ComplexOutput processOutput = outputData.asComplexOutput();

            if (processOutput == null)
            {
                throw new ExceptionReport(String.Format("Only ComplexOutputs can be requested as rawDataOutput but {0} is a {1}",
                                                        Identifier, outputData.GetType().Name), ExceptionCode.InvalidParameterValue, "rawDataOutput");
            }

            Format = processOutput.Format;
            Format.ParseValue(node);
            return(true);
        }
예제 #7
0
        public override bool Parse(XmlNode node, ProcessDescription processDescription)
        {
            if (node == null) return false;

            XmlNamespaceManager nsmgr = Utils.CreateWPSNamespaceManager(node.OwnerDocument);

            XmlNodeList childs = node.SelectNodes("ows:Identifier", nsmgr);
            if (childs.Count != 1)
                throw new ExceptionReport("One identifier is mandatory when requesting a raw data output but " + childs.Count + " were found.",
                    ExceptionCode.InvalidParameterValue, "wps:RawDataOutput/ows:Identifier");
            Identifier = childs[0].InnerText;
            OutputData outputData = processDescription.GetProcessOutputParameter(Identifier);
            if (outputData == null)
                throw new ExceptionReport(String.Format("The output {0} is not a valid output for the process {1}",
                    Identifier, processDescription.Identifier), ExceptionCode.InvalidParameterValue, "rawDataOutput");

            ComplexOutput processOutput = outputData.asComplexOutput();
            if (processOutput == null)
                throw new ExceptionReport(String.Format("Only ComplexOutputs can be requested as rawDataOutput but {0} is a {1}",
                    Identifier, outputData.GetType().Name), ExceptionCode.InvalidParameterValue, "rawDataOutput");

            Format = processOutput.Format;
            Format.ParseValue(node);
            return true;
        }
예제 #8
0
 public OutputDefinitionType(SerializationInfo info, StreamingContext ctxt)
     : base(info, ctxt)
 {
     Identifier = (string)info.GetValue("Identifier", typeof(string));
     Format     = (ComplexFormat)info.GetValue("Format", typeof(ComplexFormat));
 }
예제 #9
0
 public ComplexOutput(string Identifier, string Title, string Abstract, ComplexFormat Format)
     : base(Identifier, Title, Abstract)
 {
     this.Format = Format;
     Formats = new List<ComplexFormat>();
     this.Formats.Add(Format);
     //maximumMegabytes = -1;
 }
예제 #10
0
 public OutputDefinitionType(SerializationInfo info, StreamingContext ctxt)
     : base(info, ctxt)
 {
     Identifier = (string)info.GetValue("Identifier", typeof(string));
     Format = (ComplexFormat)info.GetValue("Format", typeof(ComplexFormat));
 }
예제 #11
0
 public bool Equals(ComplexFormat format)
 {
     return(Utils.StrICmp(mimeType, format.mimeType) &&
            Utils.StrICmp(encoding, format.encoding) &&
            Utils.StrICmp(schema, format.schema));
 }
예제 #12
0
        public override bool Parse(string str, ProcessDescription processDescription)
        {
            if (String.IsNullOrEmpty(str)) return false;

            string[] tokens = str.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
            if (tokens.Length != 1)
                throw new ExceptionReport("One identifier is mandatory when requesting a raw data output but "
                    + tokens.Length + " were found.",
                    ExceptionCode.InvalidParameterValue, "RawDataOutput");

            string[] kv = str.Split(new char[] { '@' }, StringSplitOptions.RemoveEmptyEntries);
            if (kv.Length > 0)
            {
                OutputData outputData = processDescription.GetProcessOutputParameter(kv[0]);
                if (outputData == null)
                    throw new ExceptionReport(String.Format("The output {0} is not a valid output for the process {1}",
                        kv[0], processDescription.Identifier), ExceptionCode.InvalidParameterValue, "rawDataOutput");

                ComplexOutput output = outputData.asComplexOutput();
                if (output == null)
                    throw new ExceptionReport(String.Format("Only ComplexOutputs can be requested as rawDataOutput but {0} is a {1}",
                        kv[0], outputData.GetType().ToString()), ExceptionCode.InvalidParameterValue, "rawDataOutput");

                Identifier = kv[0];
                Format = output.Format; // default format
                Format.ParseValue(str);
                if (output.Formats.Find(delegate(ComplexFormat cf) { return cf.Equals(Format); }) == null)
                    throw new ExceptionReport(string.Format("Requested format for the output {0} is not supported", kv[0]),
                        ExceptionCode.InvalidParameterValue, kv[0]);
            }

            return false;
        }
예제 #13
0
 public OutputDefinitionType(string name)
     : base(name)
 {
     Identifier = null;
     Format = new ComplexFormat(null, null, null);
 }
예제 #14
0
 public OutputDefinitionType(string name)
     : base(name)
 {
     Identifier = null;
     Format     = new ComplexFormat(null, null, null);
 }
예제 #15
0
 public ComplexInput(SerializationInfo info, StreamingContext ctxt)
     : base(info, ctxt)
 {
     Formats = (List<ComplexFormat>)info.GetValue("Formats", typeof(List<ComplexFormat>));
     Format = (ComplexFormat)info.GetValue("Format", typeof(ComplexFormat));
     maximumMegabytes = (int)info.GetValue("maximumMegabytes", typeof(int));
     Value = (byte[])info.GetValue("Value", typeof(byte[]));
     asReference = (bool)info.GetValue("asReference", typeof(bool));
     Reference = (string)info.GetValue("Reference", typeof(string));
     Method = (string)info.GetValue("Method", typeof(string));
     Header = (Dictionary<string, string>)info.GetValue("Header", typeof(Dictionary<string, string>));
     Body = (string)info.GetValue("Body", typeof(string));
     BodyReference = (string)info.GetValue("BodyReference", typeof(string));
     BodyAsReference = (bool)info.GetValue("BodyAsReference", typeof(bool));
 }
예제 #16
0
 public ComplexInput(string Identifier, string Title, string Abstract, ComplexFormat Format)
     : base(Identifier, Title, Abstract)
 {
     this.Format = Format;
     Formats = new List<ComplexFormat>();
     Formats.Add(this.Format);
     maximumMegabytes = -1;
     Method = "GET";
     asReference = false;
     Reference = null;
     Header = new Dictionary<string,string>();
     Body = null;
     BodyReference = null;
     BodyAsReference = false;
 }
예제 #17
0
 public bool Equals(ComplexFormat format)
 {
     return Utils.StrICmp(mimeType, format.mimeType)
         && Utils.StrICmp(encoding, format.encoding)
         && Utils.StrICmp(schema, format.schema);
 }
예제 #18
0
 public ComplexOutput(SerializationInfo info, StreamingContext ctxt)
     : base(info, ctxt)
 {
     Formats = (List<ComplexFormat>)info.GetValue("formats", typeof(List<ComplexFormat>));
     Format = (ComplexFormat)info.GetValue("format", typeof(ComplexFormat));
     //maximumMegabytes = (int)info.GetValue("maximumMegabytes", typeof(int));
     Value = (byte[])info.GetValue("Value", typeof(byte[]));
 }