/**
         * Return the template model for the given form type. Serves the template out of the cache, if cached; fetches it
         * fresh and caches it otherwise. If form types are restricted and the given form type is not allowed, throw an error
         */
        public FormInstance getTemplateInstance(int formID)
        {
            if (restrictFormTypes && !allowedFormTypes.Contains(formID))
            {
                throw new SystemException("form ID [" + formID + "] is not an allowed form type!");
            }

            FormInstance template = templateCache[formID];

            if (template == null)
            {
                template = CompactInstanceWrapper.loadTemplateInstance(formID);
                if (template == null)
                {
                    throw new SystemException("no formdef found for form id [" + formID + "]");
                }
                templateCache.Add(formID, template);
            }
            return(template);
        }
Example #2
0
        /// <summary> Return the template model for the given form type. Serves the template out of the cache, if cached; fetches it
        /// fresh and caches it otherwise. If form types are restricted and the given form type is not allowed, throw an error
        /// </summary>
        public virtual FormInstance getTemplateInstance(int formID)
        {
            if (restrictFormTypes && !allowedFormTypes.contains((System.Int32)formID))
            {
                throw new System.SystemException("form ID [" + formID + "] is not an allowed form type!");
            }

            FormInstance template = templateCache.get_Renamed((System.Int32)formID);

            if (template == null)
            {
                template = CompactInstanceWrapper.loadTemplateInstance(formID);
                if (template == null)
                {
                    throw new System.SystemException("no formdef found for form id [" + formID + "]");
                }
                templateCache.put((System.Int32)formID, template);
            }
            return(template);
        }
 public ExtWrapAnswerData(CompactInstanceWrapper instance, int dataType, IAnswerData val)
 {
     this.val      = val;
     this.dataType = dataType;
 }
Example #4
0
 public ExtWrapAnswerData(CompactInstanceWrapper enclosingInstance, int dataType)
 {
     InitBlock(enclosingInstance);
     this.dataType = dataType;
 }
Example #5
0
 private void  InitBlock(CompactInstanceWrapper enclosingInstance)
 {
     this.enclosingInstance = enclosingInstance;
 }