public HttpResponseMessage <JsonQueryResult> Get( [FromUri(Name = "designmode")] bool isInDesignMode = false, string id = null, string ns = null, string alias = null ) { using (Profiler.Measure("FormController.Get")) { // Get the entityRef EntityRef formRef = WebApiHelpers.MakeEntityRef(id, ns, alias); long formId; try { formId = formRef.Id; } catch (ArgumentException) { throw new FormNotFoundException(); } EntityData formEntityData = _formControllerRequestHandler.GetFormAsEntityData(formId, isInDesignMode); var context = new EntityPackage(); context.AddEntityData(formEntityData, "formEntity"); return(new HttpResponseMessage <JsonQueryResult>(context.GetQueryResult())); } }
public HttpResponseMessage <JsonQueryResult> GetDefaultForm( string id = null, string ns = null, string alias = null, [FromUri(Name = "designmode")] bool isInDesignMode = false, [FromUri(Name = "forcegenerate")] bool forceGenerate = false ) { // Get the entityRef EntityRef typeRef = WebApiHelpers.MakeEntityRef(id, ns, alias); var entityType = ReadiNow.Model.Entity.Get <EntityType>(typeRef); return(Helper.GetDefaultFormForType(entityType, isInDesignMode, forceGenerate)); }
public HttpResponseMessage <JsonQueryResult> GetGenerateForm( string id = null, string ns = null, string alias = null, [FromUri(Name = "designmode")] bool isInDesignMode = false ) { using (Profiler.Measure("TypeController.GetGenerateForm")) { // Get the entityRef EntityRef entityRef = WebApiHelpers.MakeEntityRef(id, ns, alias); return(Helper.GetGeneratedFormForType(entityRef, isInDesignMode)); } }
public HttpResponseMessage <JsonQueryResult> Get( string id = null, string ns = null, string alias = null, [FromUri(Name = "designmode")] bool isInDesignMode = false, [FromUri(Name = "forcegenerate")] bool forceGenerate = false ) { using (Profiler.Measure("InstanceController.Get")) { // Get the entityRef EntityRef entityRef = WebApiHelpers.MakeEntityRef(id, ns, alias); var entityType = ReadiNow.Model.Entity.Get(entityRef).EntityTypes.First().Cast <EntityType>(); return(Helper.GetDefaultFormForType(entityType, isInDesignMode, forceGenerate)); } }
public IHttpActionResult GetFormCalculationDependencies(string id = null, string ns = null, string alias = null) { using (Profiler.Measure("FormController.GetFormCalculationDependencies")) { try { // Get the entityRef EntityRef formRef = WebApiHelpers.MakeEntityRef(id, ns, alias); var response = _formControllerRequestHandler.GetFormCalculationDependencies(formRef); return(Ok(response)); } catch (Exception ex) { EventLog.Application.WriteError(ex.ToString()); return(InternalServerError()); } } }
public HttpResponseMessage <JsonQueryResult> ClearFormsCache([FromBody] string[] formIds) { if (formIds != null) { foreach (var formRef in formIds.Select(id => WebApiHelpers.MakeEntityRef(id, "", ""))) { long formId; try { formId = formRef.Id; } catch (ArgumentException) { throw new FormNotFoundException(); } _formsCache.Remove(formId); } } return(new HttpResponseMessage <JsonQueryResult>(HttpStatusCode.OK)); }