Exemplo n.º 1
0
        public BlobDataReturn SaveFile(string propid, int blobdataid, string caption)
        {
            BlobDataReturn ret = new BlobDataReturn();

            if (_Context.Request.Files.Count > 0)
            {
                BlobDataParams blobDataParams = new BlobDataParams();
                blobDataParams.postedFile = _Context.Request.Files[0];
                blobDataParams.propid     = propid;

                blobDataParams.Blob.BlobDataId = blobdataid;
                blobDataParams.Blob.Caption    = caption;

                var SvcDriver = new CswWebSvcDriver <BlobDataReturn, BlobDataParams>(
                    CswWebSvcResourceInitializer: new CswWebSvcResourceInitializerNbt(_Context, null),
                    ReturnObj: ret,
                    WebSvcMethodPtr: CswNbtWebServiceBinaryData.saveFile,
                    ParamObj: blobDataParams
                    );

                SvcDriver.run();
            }

            return(ret);
        }
Exemplo n.º 2
0
        public Stream getBlob(string jctnodepropid, string nodeid, int blobdataid, string usenodetypeasplaceholder, string uid, string date)
        {
            BlobDataReturn ret = new BlobDataReturn();

            BlobDataParams blobDataParams = new BlobDataParams();

            blobDataParams.appPath                  = _Context.Request.PhysicalApplicationPath;
            blobDataParams.propid                   = jctnodepropid;
            blobDataParams.nodeid                   = nodeid;
            blobDataParams.Blob.BlobDataId          = blobdataid;
            blobDataParams.usenodetypeasplaceholder = usenodetypeasplaceholder.ToString();
            blobDataParams.date = date;

            var SvcDriver = new CswWebSvcDriver <BlobDataReturn, BlobDataParams>(
                CswWebSvcResourceInitializer: new CswWebSvcResourceInitializerNbt(_Context, null),
                ReturnObj: ret,
                WebSvcMethodPtr: CswNbtWebServiceBinaryData.getBlob,
                ParamObj: blobDataParams
                );

            SvcDriver.run();


            MemoryStream mem     = new MemoryStream();
            BinaryWriter BWriter = new BinaryWriter(mem);

            BWriter.Write(ret.Data.data);
            mem.Position = 0;

            WebOperationContext.Current.OutgoingResponse.Headers.Add("Content-Disposition", "attachment;filename=\"" + ret.Data.Blob.FileName + "\";");
            WebOperationContext.Current.OutgoingResponse.Headers.Add(HttpResponseHeader.ContentType, ret.Data.Blob.ContentType);

            return(mem);
        }
Exemplo n.º 3
0
        public NodePropImageReturn saveCaption(BlobDataParams Request)
        {
            NodePropImageReturn ret = new NodePropImageReturn();

            var SvcDriver = new CswWebSvcDriver <NodePropImageReturn, BlobDataParams>(
                CswWebSvcResourceInitializer: new CswWebSvcResourceInitializerNbt(_Context, null),
                ReturnObj: ret,
                WebSvcMethodPtr: CswNbtWebServiceBinaryData.saveCaption,
                ParamObj: Request
                );

            SvcDriver.run();

            return(ret);
        }
Exemplo n.º 4
0
        public BlobDataReturn clearBlob(BlobDataParams Request)
        {
            BlobDataReturn ret = new BlobDataReturn();

            var SvcDriver = new CswWebSvcDriver <BlobDataReturn, BlobDataParams>(
                CswWebSvcResourceInitializer: new CswWebSvcResourceInitializerNbt(_Context, null),
                ReturnObj: ret,
                WebSvcMethodPtr: CswNbtWebServiceBinaryData.clearBlob,
                ParamObj: Request
                );

            SvcDriver.run();

            return(ret);
        }
Exemplo n.º 5
0
        public NodePropImageReturn getImageProp(BlobDataParams req)
        {
            NodePropImageReturn ret = new NodePropImageReturn();

            req.date = req.date ?? string.Empty;

            var SvcDriver = new CswWebSvcDriver <NodePropImageReturn, BlobDataParams>(
                CswWebSvcResourceInitializer: new CswWebSvcResourceInitializerNbt(_Context, null),
                ReturnObj: ret,
                WebSvcMethodPtr: CswNbtWebServiceBinaryData.getImageProp,
                ParamObj: req
                );

            SvcDriver.run();

            return(ret);
        }
Exemplo n.º 6
0
        public BlobDataReturn getText()
        {
            BlobDataReturn ret = new BlobDataReturn();

            if (_Context.Request.Files.Count > 0)
            {
                BlobDataParams req = new BlobDataParams()
                {
                    postedFile = _Context.Request.Files[0]
                };

                var SvcDriver = new CswWebSvcDriver <BlobDataReturn, BlobDataParams>(
                    CswWebSvcResourceInitializer: new CswWebSvcResourceInitializerNbt(_Context, null),
                    ReturnObj: ret,
                    WebSvcMethodPtr: CswNbtWebServiceBinaryData.getText,
                    ParamObj: req
                    );

                SvcDriver.run();
            }

            return(ret);
        }
Exemplo n.º 7
0
 public BlobDataReturn()
 {
     Data = new BlobDataParams();
 }