/// <summary>
        /// Build the server files for the specified template.
        /// </summary>
        /// <param name="template">The template for which support files will be built.</param>
        /// <param name="flags">Indicates what types of support files to build.</param>
        public void BuildSupportFiles(Template template, HDSupportFilesBuildFlags flags)
        {
            if (template == null)
            {
                throw new ArgumentNullException("template", @"Local.Services.BuildSupportFiles: the ""template"" parameter passed in was null");
            }
            using (HotDocs.Server.Application app = new HotDocs.Server.Application())
            {
                hdsi.HDServerBuildFlags hdBuildFlags = 0;
                if ((flags & HDSupportFilesBuildFlags.BuildJavaScriptFiles) != 0)
                {
                    hdBuildFlags |= hdsi.HDServerBuildFlags.BuildJavaScriptFiles;
                }
                if ((flags & HDSupportFilesBuildFlags.BuildSilverlightFiles) != 0)
                {
                    hdBuildFlags |= hdsi.HDServerBuildFlags.BuildSilverlightFiles;
                }
                if ((flags & HDSupportFilesBuildFlags.ForceRebuildAll) != 0)
                {
                    hdBuildFlags |= hdsi.HDServerBuildFlags.ForceRebuildAll;
                }
                if ((flags & HDSupportFilesBuildFlags.IncludeAssembleTemplates) != 0)
                {
                    hdBuildFlags |= hdsi.HDServerBuildFlags.IncludeAssembleTemplates;
                }

                app.BuildSupportFiles(template.GetFullPath(), template.Key, hdBuildFlags);
            }
        }
Exemple #2
0
        private void BuildSupportFiles(IServices svc)
        {
            Template template = Util.OpenTemplate("d1f7cade-cb74-4457-a9a0-27d94f5c2d5b");

            try
            {
                HDSupportFilesBuildFlags flags = HDSupportFilesBuildFlags.BuildJavaScriptFiles;
                flags |= HDSupportFilesBuildFlags.BuildSilverlightFiles;
                flags |= HDSupportFilesBuildFlags.ForceRebuildAll;
                flags |= HDSupportFilesBuildFlags.IncludeAssembleTemplates;
                svc.BuildSupportFiles(template, flags);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }

            // Try building support files with a "null" template.
            try
            {
                svc.BuildSupportFiles(null, HDSupportFilesBuildFlags.BuildJavaScriptFiles);
                Assert.Fail();                 // Should have thrown exception.
            }
            catch (ArgumentNullException)
            {
                Assert.IsTrue(true);
            }
            catch (Exception)
            {
                Assert.Fail();
            }
        }
Exemple #3
0
 /// <summary>
 /// This method does nothing in the case of HotDocs Cloud Services because the template package already contains all
 /// of the interview runtime ("support") files required to display an interview for the template. These files are built
 /// by HotDocs Developer at the time the package is created, and Cloud Services does not have the ability to re-create them.
 /// </summary>
 /// <param name="template">The template for which support files will be built.</param>
 /// <param name="flags">Indicates what types of support files to build.</param>
 public void BuildSupportFiles(Template template, HDSupportFilesBuildFlags flags)
 {
     if (template == null)
     {
         throw new ArgumentNullException("template", @"Cloud.Services.BuildSupportFiles: the ""template"" parameter passed in was null");
     }
     // no op
 }
 /// <summary>
 /// <c>BuildSupportFiles</c> generates (or regenerates) the supporting javascript files and Silverlight DLLs
 /// for the supplied <c>template</c>
 /// </summary>
 /// <param name="template">An instance of the Template class, for which the supporting javascript files and
 /// Silverlight DLLs will be generated</param>
 /// <param name="flags">A set of flags to control whether javascript or SilverLight files will be generated,
 /// as well as whether to build files for templates included with an assemble instruction.</param>
 public void BuildSupportFiles(Template template, HDSupportFilesBuildFlags flags)
 {
     if (template == null)
     {
         throw new ArgumentNullException("template", @"WebService.Services.BuildSupportFiles: the ""template"" parameter passed in was null");
     }
     using (Proxy client = new Proxy(_endPointName))
     {
         string templateId    = GetRelativePath(template.GetFullPath());
         string templateKey   = template.FileName;
         string templateState = null;
         client.BuildSupportFiles(templateId, templateKey, flags, templateState);
         SafeCloseClient(client, null);
     }
 }
        /// <summary>
        /// Build the server files for the specified template.
        /// </summary>
        /// <param name="template">The template for which support files will be built.</param>
        /// <param name="flags">Indicates what types of support files to build.</param>
        public void BuildSupportFiles(Template template, HDSupportFilesBuildFlags flags)
        {
            if (template == null)
                throw new ArgumentNullException("template", @"Local.Services.BuildSupportFiles: the ""template"" parameter passed in was null");
            using (HotDocs.Server.Application app = new HotDocs.Server.Application())
            {
                hdsi.HDSupportFilesBuildFlags hdBuildFlags = 0;
                if ((flags & HDSupportFilesBuildFlags.BuildJavaScriptFiles) != 0)
                    hdBuildFlags |= hdsi.HDSupportFilesBuildFlags.BuildJavaScriptFiles;
                if ((flags & HDSupportFilesBuildFlags.BuildSilverlightFiles) != 0)
                    hdBuildFlags |= hdsi.HDSupportFilesBuildFlags.BuildSilverlightFiles;
                if ((flags & HDSupportFilesBuildFlags.ForceRebuildAll) != 0)
                    hdBuildFlags |= hdsi.HDSupportFilesBuildFlags.ForceRebuildAll;
                if ((flags & HDSupportFilesBuildFlags.IncludeAssembleTemplates) != 0)
                    hdBuildFlags |= hdsi.HDSupportFilesBuildFlags.IncludeAssembleTemplates;

                app.BuildSupportFiles(template.GetFullPath(), template.Key, hdBuildFlags);
            }
        }
 /// <summary>
 /// <c>BuildSupportFiles</c> generates (or regenerates) the supporting javascript files and Silverlight DLLs 
 /// for the supplied <c>template</c>
 /// </summary>
 /// <param name="template">An instance of the Template class, for which the supporting javascript files and 
 /// Silverlight DLLs will be generated</param>
 /// <param name="flags">A set of flags to control whether javascript or SilverLight files will be generated, 
 /// as well as whether to build files for templates included with an assemble instruction.</param>
 public void BuildSupportFiles(Template template, HDSupportFilesBuildFlags flags)
 {
     if (template == null)
         throw new ArgumentNullException("template", @"WebService.Services.BuildSupportFiles: The ""template"" parameter passed in was null.");
     using (Proxy client = GetProxy())
     {
         string templateId = GetRelativePath(template.GetFullPath());
         string templateKey = template.FileName;
         string templateState = null;
         client.BuildSupportFiles(templateId, templateKey, flags, templateState);
         SafeCloseClient(client, null);
     }
 }
 public void BuildSupportFiles(Template template, HDSupportFilesBuildFlags flags)
 {
     throw new NotImplementedException();
 }
 public void BuildSupportFiles(Template template, HDSupportFilesBuildFlags flags)
 {
     throw new NotImplementedException();
 }
 /// <summary>
 /// This method does nothing in the case of HotDocs Cloud Services because the template package already contains all 
 /// of the interview runtime ("support") files required to display an interview for the template. These files are built
 /// by HotDocs Developer at the time the package is created, and Cloud Services does not have the ability to re-create them.
 /// </summary>
 /// <param name="template">The template for which support files will be built.</param>
 /// <param name="flags">Indicates what types of support files to build.</param>
 public void BuildSupportFiles(Template template, HDSupportFilesBuildFlags flags)
 {
     if (template == null)
         throw new ArgumentNullException("template", @"Cloud.Services.BuildSupportFiles: the ""template"" parameter passed in was null");
     // no op
 }
 /// <summary>
 /// Call BuildSupportFiles on HotDocs Server via web services.
 /// </summary>
 /// <param name="templateID"></param>
 /// <param name="templateKey"></param>
 /// <param name="buildFlags"></param>
 /// <param name="templateState"></param>
 public void BuildSupportFiles(string templateID, string templateKey, HDSupportFilesBuildFlags buildFlags, string templateState)
 {
     base.Channel.BuildSupportFiles(templateID, templateKey, buildFlags, templateState);
 }