Ejemplo n.º 1
0
 public ModuleDefinitionModel(ModuleDefinition moduleDefinition)
 {
     Name = moduleDefinition.Name;
     DisplayName = moduleDefinition.DisplayName;
     Views = moduleDefinition.Views.Where(v => v.ViewType == ViewType.Public).Select(v => new ModuleViewModel
     {
         Name = v.Name,
         DisplayName = v.DisplayName
     }).OrderBy(v => v.DisplayName).ToList();
 }
Ejemplo n.º 2
0
        public ModuleDefinition Clone(bool cloneViews, bool cloneInstances)
        {
            var clonedModule = new ModuleDefinition(Name, DisplayName, Description, CmsType, null);

            if (cloneViews)
                clonedModule.Views = new List<ModuleView>(Views);
            if (cloneInstances)
                clonedModule.Instances = new List<ModuleInstance>(Instances);

            return clonedModule;
        }
Ejemplo n.º 3
0
        public DataProviderResponse PostModuleData(ModuleDefinition module, Dictionary<string, string> parameters, string data)
        {
            var httpRequest = (HttpWebRequest)WebRequest.Create("http://bur-sd-web-01.medseek.com/webservices/scriptlibrary/CODX/?siteid=10307");
            httpRequest.Method = "POST";
            httpRequest.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";

            // Create post data
            var postData = new StringBuilder();

            foreach (var parameter in parameters)
            {
                if (postData.Length > 0)
                    postData.Append("&");

                postData.Append(parameter.Key.ToLower() + "=" + HttpUtility.UrlEncode(parameter.Value, Encoding.UTF8));
            }

            postData.Append("&siteid=" + HttpUtility.UrlEncode("10307", Encoding.UTF8));
            postData.Append("&moduledata=" + HttpUtility.UrlEncode(data, Encoding.UTF8));

            var postDataEncoded = Encoding.UTF8.GetBytes(postData.ToString());

            //  Add post data to request stream
            using (var streamWriter = httpRequest.GetRequestStream())
            {
                streamWriter.Write(postDataEncoded, 0, postDataEncoded.Length);
            }

            // Get post response
            var httpResponse = (HttpWebResponse)httpRequest.GetResponse();

            var receiveStream = httpResponse.GetResponseStream();
            var encode = Encoding.GetEncoding("utf-8");
            var readStream = new StreamReader(receiveStream, encode);

            var newData = readStream.ReadToEnd();

            return new DataProviderResponse(newData, null);
        }
Ejemplo n.º 4
0
 private void LoadGlobalAdminModuleData()
 {
     var view = new ModuleView("globaladmin", "AdminListView", "List View", "An Admin List View", Core.ViewType.Admin);
     var module = new ModuleDefinition("globaladmin", "Global Administration", "Global Administration", CmsType.Convert, new List<ModuleView>() { view });
     Modules.Add(module.Name, module);
 }
Ejemplo n.º 5
0
 public DataProviderResponse GetModuleData(ModuleDefinition module, Dictionary<string, string> parameters)
 {
     // TODO: Get data from Convert on Demand service
     return new DataProviderResponse("Convert on Demand Data - Placeholder", null);
 }
Ejemplo n.º 6
0
 public DataProviderResponse PostModuleData(ModuleDefinition module, Dictionary<string, string> parameters, string data)
 {
     return new DataProviderResponse(RequestDispatcher.Get<ConvertServiceResponse>(new ConvertServiceRequest() { Parameters = parameters, Data = data }));
 }