Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Code Block
    FormsService service = ...;
    FormTypeQuery query = service.CreateFormTypeQuery(null);
    FormTypeFeed themesformTypes = service.Query(query);
    foreach (ThemeEntryFormTypeEntry formType in formTypes.Entries)
    {
            Console.WriteLine("Form Type: " + formType.Title.Text);
    }

...

This will embed the form instance in your page inside an <iframe/>. 

How do I get the url to return the form instance

...

embed java script?

First get a hold of the corresponding FormTypeEntry and then get the url as shown in the snippet below:

...

Code Block
<ns:form xmlns:ns="http://www.frevvo.com/schemas/_lvxDAF_vEd2bxNL8keLevQ" 
 
         name="FormTypeAtomTest"> 
    <A>TestA</A>
    <B>TestB</B>
    <C>2013-06-30</C>
</ns:form> 

FormsService service = ...; 
NameValueCollection nvc = new NameValueCollection();
nvc.Add("_formTz", "Asia/Kolkata");


using (FileStream docStream = File.Open(@"C:\temp\_data2.xml", FileMode.Open))
{
      string id = "_LIAtYHC3EeKVINiYeE5iPA!_qrSmgInoEeKOdqjLR19yFQ!test1"; 
      FormTypeEntry formType = service.GetFormType(id);
      FormEntry form = formType.CreateFormEntry(nvc, docStream);
}

Note
  • The method FormTypeEntry.CreateFormEntry(NameValueCollection, Stream) is only available in .Net Client API version 5.1 Patch 3 or later.
  • See this documentation for more information about available URL parameters.

...

Now you have a new form named My Purchase Order Form and you have the purchase order element added to the Data Source pane in the Designer. Using the designer, expand the Data Source pane and click the plus button to auto-generate the form controls (note that the API will be expanded to support auto generating controls).

I added a DocumentType from a Schema to my FormType

...

. Why do I see two

...

DocumentTypes?

Every FormType always has 1 default DocumentType that cannot be removed. This is the DocumentType managed by  and updated when controls from the palette are added or removed from the form. For this DocumentType the Delete() method will fail (you can check whether a DocumentType can be deleted or not using the entry's ReadOnly property).

...

Code Block
    FormTypeEntry ft = ...;
    ft.DeployState = DeployState.Production;
    // or
    ft.DeployState = DeployState.Development;

How

...

do I copy a form?

Copying entails inserting an existing entry into a feed. The key difference between this case and a regular feed insert() is that the entry being inserted already has an id: this will trigger a copy.

...