frevvo v10.2 is no longer supported. Please visit frevvoLatest for our current Cloud Release. Earlier documentation is available too.
On this page:
In v9.1 and later frevvo's "Applications" are known as "Projects," and "Themes" are known as "Styles." The API objects and methods still use the words application, 'app', and theme.
The direct method for an existing user: See the C# code snipped below:
FormsService service = new FormsService("http://localhost:8082", "yourappname"); service.Login("myuser", "mypassword"); UserEntry user = service.GetUser(“myuser”); // interact with frevvo service.Logout();
Note that when you login, the .NET client API initializes a local security token based on your credentials. It does not actually make a call however, until you make your first request. At that time, the forms service will attempt to authorize you based on your token. In the above example, the first call is for the user entry.
This method allows you to login as any of the existing tenant users provided you can pass in the tenant's admin user and password. This is useful when you want to login using the same user that is logged into your project without having to know their password.
IDictionary<string, string> customParams = new Dictionary<string, string>(); customParams.Add("autoLogin", "true"); FormsService service = new FormsService("http://localhost:8082", "yourappname"); service.LoginAs( "myuser", "tenantAdminUserName@myTenantName", "tenantAdminPassword", false, null, null, null, null, customParams); UserEntry user = service.GetUser(“myuser”); // interact with frevvo service.Logout();
When your tenant is configured with the Delegating Security Manager, you can use the loginAs() method to automatically create new/virtual users.
IDictionary<string,string> customParams = new Dictionary<string, string>(); customParams.Add("autoLogin", "true"); //customParams.Add("updateNonDesigners", "true"); //if user is not a frevvo.Designer, this must be set for user to be officially 'created' otherwise user is truly virtual/temporary string[] roles = { "frevvo.Designer" }; FormsService service = new FormsService("http://localhost:8082", "yourappname"); service.LoginAs( "newUserName", "tenantAdminUserName@myTenantName", "tenantAdminPassword", true, roles, //optional param – may be null. Specified roles will be created if necessary. When null, a non-designer user (able to participate in workflows but not create workflows/forms) will be created if necessary. "newUserFirstName", //optional param – may be null "newUserLastName", //optional param – may be null "newUserEmailName@EmailServer.com", //optional param – may be null customParams); UserEntry user = service.GetUser("newUserName"); // interact with frevvo service.Logout();
When you login, the .NET client API initializes a local security token based on the supplied credentials. It does not actually make a call however, until the first request is executed. At that time, the forms service will attempt to authorize the user based on the provided token. In the above examples, the first call is for the user entry.
How do I get the list of all projects for the current user?
FormsService service = ...; ApplicationQuery query = service.CreateApplicationQuery(null); ApplicationFeed apps = service.Query(query); foreach (ApplicationEntry app in apps.Entries) { Console.WriteLine("App: " + app.Title.Text); // ... }
All references to Themes have been removed in version 5.3. This example does not pertain to frevvo 5.3 or later.
FormsService service = ...; ThemeQuery query = service.CreateThemeQuery(null); ThemeFeed themes = service.Query(query); foreach (ThemeEntry theme in themes.Entries) { Console.WriteLine("Theme: " + theme.Title.Text); }
FormsService service = ...; FormTypeQuery query = service.CreateFormTypeQuery(null); FormTypeFeed formTypes = service.Query(query); foreach (FormTypeEntry formType in formTypes.Entries) { Console.WriteLine("Form Type: " + formType.Title.Text); }
The code snippet below prints the name of all forms in the appEntry application:
ApplicationEntry app = ...; // find the right application FormTypeFeed formTypes = app.FormTypeFeed; foreach(FormTypeEntry formType in formTypes.Entries) { Console.WriteLine("Form Type: " + formType.Title.Text); }
SchemaQuery query = service.CreateSchemaQuery(null); SchemaFeed schemas = service.Query(query); foreach (SchemaEntry schema in schemas.Entries) { Console.WriteLine("Schema: " + schema.Title.Text); }
The code snippet below prints the name of all schemas in the appEntry application:
ApplicationEntry app = ...; // find the right application SchemaFeed schemas = app.SchemaFeed; foreach (SchemaEntry schema in schemas.Entries) { Console.WriteLine("Schema: " + schema.Title.Text); }
FormsService fs = ....; ApplicationQuery query = fs.CreateApplicationQuery(null); ApplicationFeed apps = fs.Query(query); ApplicationEntry app = apps.CreateEntry(); app.Title.Text = "My First App"; app = apps.Insert(app);
At this point you have to manually filter the entries in an ApplicationFeed. See the following snippet:
FormsService fs = ....; ApplicationQuery query = fs.CreateApplicationQuery(null); ApplicationFeed apps = fs.Query(query); foreach(ApplicationEntry app in apps.Entries) { if( app.Title.Text == "My First App" ) return app.Id.Uri; }
ApplicationEntry app = ...; // find the right application app.Delete();
First get a hold of the corresponding UserEntry for the desired user, and then use the users ApplicationFeed.
string fileName = ....; UserEntry user = ....; MediaFileSource source = new MediaFileSource(fileName, ApplicationFeed.MEDIA_SOURCE_TYPE); ApplicationFeed apps = user.ApplicationFeed; ApplicationEntry app = apps.CreateEntry(); app.MediaSource = source; app = apps.Insert(app);
string fileName = ....; string appName = ....; FormsService formsService = ....; MediaFileSource source = new MediaFileSource(fileName, ApplicationFeed.MEDIA_SOURCE_TYPE); ApplicationQuery query = formsService.CreateApplicationQuery(null); ApplicationFeed apps = formsService.Query(query); ApplicationEntry app = apps.CreateEntry(); app.MediaSource = source; app = apps.Insert(app);
String filename = ...; ApplicationEntry app = ...; // find the right application app.Title.Text = appName; app.Update();
The method ApplicationEntry.Update() is only available in .Net Client API version 5.1 Patch 3 and later.
FormsService formsService = ....; ApplicationEntry entry = ....; string fileName = ....; Stream contentStream = formsService.QueryContent(entry.Content); //if the Application needs to be written to a file: using (FileStream fileStream = File.Create(fileName)) { contentStream.CopyTo(fileStream); }
After I found a ApplicationEntry for the first time can I get the entry directly?
If you have an entry id you can retrieve the entry directly.
string appId = ...; FormsService fs = ....; ApplicationEntry app = fs.GetApplication(appId);
First get a hold of the corresponding FormTypeEntry, then get the form URL as shown in the snipped below:
FormTypeEntry formType = ...; // find the correct formtype entry string formTypeUrl = formType.FormTypeEmbedLink.AbsoluteUri;
Then using the URL in formTypeUrl above you can generate the following script tag in your html page:
<script type="text/javascript" src="{formTypeUrl}"></script>
This will embed the form in your page inside an <iframe/>.
First get a hold of the corresponding FormTypeEntry, then get the formType URL as shown in the snipped below:
FormTypeEntry formType = ...; // find the correct formtype entry string designerUrl = formType.FormTypeEditorEmbedLink.AbsoluteUri;
Then using the designerUrl above you can generate the following script tag in your html page:
<script type="text/javascript" src="{designerUrl}"></script>
This will embed the form designer in your page inside an <iframe/>.
How do I get the URL to the form submissions so it can be embedded in my HTML pages?
First get a hold of the corresponding FormTypeEntry, then get the form URL as shown in the snipped below:
FormTypeEntry formType = ...; // find the correct formtype entry string formSubmissionsUrl = formType.SubmissionsEmbedLink.AbsoluteUri;
Then using the formSubmissionsUrl above you can generate the following script tag in your html page:
<script type="text/javascript" src="{formSubmissionsUrl}"></script>
This will embed the submissions view in your page inside an <iframe/>.
First get a hold of the corresponding FormTypeEntry, then get the form instance URL as shown in the snippet below:
FormTypeEntry formType = ....; NameValueCollection nvc = null; Uri formInstanceUri = formType.CreateFormInstance(nvc); string formInstanceUrl = formInstanceUri.AbsoluteUri;
Then using the formInstanceUrl above you can generate the following iframe tag in your html page:
<iframe src="{formInstanceUrl}"/>
This will embed the form instance in your page inside an <iframe/>.
First get a hold of the corresponding FormTypeEntry and then get the URL as shown in the snippet below:
FormTypeEntry formType = ...; // find the correct formtype entry NameValueCollection nvc = new NameValueCollection(); nvc.Add("_data", "{TextArea3:TestTestTest}"); Uri formInstanceEmbedUri = formType.CreateFormInstanceEmbed(nvc, null); String formInstanceUrl = formInstanceEmbedUri.AbsoluteUri;
Then using the formInstanceUrl above you can generate the following script tag in your html page:
<script type="text/javascript" src="{formInstanceUrl}"></script>
This will embed the form instance in your page inside an <iframe/>.
This is often needed when you need to relate a frevvo form with another concept your application (e.g. you application has the concept of a report that has an associated frevvo form). In this case you will store the form id somewhere and when needed fetch the form entry to embed it in your page, delete it, etc.
Here is how you get the for a form entry (in fact any entry):
FormTypeEntry formType = ...; // find an entry string formTypeId = formType.Id.Uri;
Here you can associate the formtype id with your application objects and retrieve the corresponding entry at any time as follows:
string formtypeId = "...."; FormTypeEntry formtype = service.GetFormType(formtypeId);
By calling the delete method on the FormTypeEnty.
FormTypeEntry formType = ...; formType.Delete;
First you have to get a hold of the form feed from an existing application. See How do I get the list of all forms for a given application?.
FormsService service = ...; ApplicationEntry app = ...; // find an application FormTypeFeed formtypes = app.FormTypeFeed; FormTypeEntry formtype = formtypes.CreateEntry(); formtype.Title.Text = name; formtype.Summary.Text = description; formtype = formtypes.Insert(formtype);
When inserting the original formtype variable will not' be updated and the updated entry will be returned by the Insert method.
The only difference between creating a new form and creating a new one based on an existing form is that instead of using the entry created by calling 'ftFeed.createEntry()' you will be using an existing form entry. Find an existing form entry, update its name and description and use that entry to insert into a feed. Do not override the entry id otherwise the insert will fail.
FormsService service = ...; ApplicationEntry app = ...; // find an application FormTypeFeed formtypes = app.FormTypeFeed; FormTypeEntry template = ...; // find template formtype entry // modify key template properties template.Title.Text = name; template.Summary.Text = description; FormTypeEntry formtype = formtypes.Insert(template);
Use the code below to create a form instance:
FormsService service = ...; string id = "_LIAtYHC3EeKVINiYeE5iPA!_qrSmgInoEeKOdqjLR19yFQ!test1"; FormTypeEntry formType = service.GetFormType(id); FormEntry form = formType.CreateFormEntry();
FormsService service = ...; string id = "_LIAtYHC3EeKVINiYeE5iPA!_qrSmgInoEeKOdqjLR19yFQ!test1"; FormTypeEntry formType = service.GetFormType(id); FormEntry formEntry = formType.CreateEditingFormEntry();
The method FormTypeEntry.CreateEditingFormEntry is only available in .Net Client API version 5.1 Patch 3 and later.
FormTypeEntry formType = ...; FormEntry formEntry = formType.CreateEditingFormEntry(); //make edits to form formEntry.SubmitEdit();
The method FormEntry.SubmitEdit is only available in .Net Client API version 5.1 Patch 3 and later.
FormTypeEntry formType = ...; FormEntry formEntry = formType.CreateEditingFormEntry(); //make edits to form formEntry.SubmitEdit(false);
The method FormEntry.SubmitEdit is only available in .Net Client API version 5.1 Patch 3 and later.
First get a hold of the corresponding FormTypeEntry and then specify the _formActionDocs parameter as true when creating the FormEntry.
FormTypeEntry formTypeEntry = ...; // find the correct formtype entry // request all data come back as part of the submit response NameValueCollection linkParams = new NameValueCollection(); linkParams.Add("_formActionDocs", "true"); linkParams.Add("_data","{FirstName:TestA,LastName:TestB}"); FormEntry formEntry = formTypeEntry.CreateFormEntry(linkParams);
The _formActionDocs parameter is only supported by .Net Client API version 5.1 Patch 3 and later.
FormEntry formEntry = ...; // created with the _formActionDocs param set to true IList<MultipartContentElement> responseData = formEntry.SubmitInstance(); foreach (MultipartContentElement part in responseData) { string dispositionType = part.ContentDispositionType; string name = part.Name; string contentType = part.ContentType; string contentTransferEncoding = part.ContentTransferEncoding; string data = part.DataPayload; }
This example uses a special parameter named _data. The value carries a formatted string containing the form values, as shown below.
FormsService service = ...; NameValueCollection nvc = new NameValueCollection(); nvc.Add("_data", "{A:TestA,B:TestB}"); string id = "_LIAtYHC3EeKVINiYeE5iPA!_qrSmgInoEeKOdqjLR19yFQ!test1"; FormTypeEntry formType = service.GetFormType(id); FormEntry form = formType.CreateFormEntry(nvc);
This example uses an XML document. The document structure contains the form values which are to be applied, as shown below.
<ns:form xmlns:ns="http://www.frevvo.com/schemas/_lvxDAF_vEd2bxNL8keLevQ" name="FormTypeAtomTest"> <A>TestA</A> <B>TestB</B> </ns:form> FormsService service = ...; using (FileStream docStream = File.Open(@"C:\temp\_data.xml", FileMode.Open)) { string id = "_LIAtYHC3EeKVINiYeE5iPA!_qrSmgInoEeKOdqjLR19yFQ!test1"; FormTypeEntry formType = service.GetFormType(id); FormEntry form = formType.CreateFormEntry(docStream); }
<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); }
<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> <p0:form xmlns:p0="http://www.frevvo.com/schemas/_RErWMNR6EeKYJfUGgkkEjg"> <Section518> <Name>test1</Name> </Section518> </p0:form> FileStream customerDataXml = new FileStream(file1_path,FileMode.Open); FileStream signText = new FileStream(file2_path, FileMode.Open); FormsService service = ...; NameValueCollection nvc = new NameValueCollection(); nvc.Add("_formTz", "Asia/Kolkata"); string id = "_LIAtYHC3EeKVINiYeE5iPA!_qrSmgInoEeKOdqjLR19yFQ!test2"; FormTypeEntry formType = service.GetFormType(id); FormEntry formEntry = formTypeEntry.CreateFormEntry(nvc, new MediaFileSource(customerDataXml, "customer", "application/xml"), new MediaFileSource(signText, "form", "application/xml")); customerDataXml.Dispose(); signText.Dispose();
Suppose you have a form with controls named A and B. Further, suppose the form is initially empty, and you wish to programmatically set the control values to TestA and TestB respectively. First you have to get a hold of the form instance (see 'How do I create a form instance?).
FormEntry form = ...; ControlEntry controlA = form.FindControlEntry("A"); controlA.Value = "TestA"; ControlEntry controlB = form.FindControlEntry("B"); controlB.Value = "TestB";
Objects, of any kind, that are part of a workflow cannot access the list of controls for the workflow. Attempted access of FormTypeEntry.ControlTypeFeed, FormTypeEntry.ControlTypeFeedLink, FormEntry. ControlFeed, or FormEntry.ControlFeedLink will result in a NotSupportedException.
First you have to get a hold of the form instance (see 'How do I create a form instance?). When you are finished editing your form, you may submit it as follows:
FormEntry form = ...; SubmissionEntry submission = form.Submit();
First you have to get a hold of the form instance (see 'How do I create a form instance?).
FormEntry form = ...; SubmissionEntry submission = form.Submit(); using (Stream file = File.OpenWrite("C:\temp")) { submission.PrintFormInstance(file); }
Printing objects of any kind that are part of a workflow is not supported and will result in a NotSupportedException.
First you have to get a hold of the form instance (see 'How do I create a form instance?).
FormEntry form = ...; form.Save();
Suppose you saved a form as in the above example. Now, suppose you want to resume working on the form. When you save a form, it becomes available for retrieval via the task feed.
string userName = "someUserName"; FormsService service = ...; UserEntry userEntry = service.GetUser(userName); //NOTE: there may be multiple entries in the TaskFeed list. The last entry in the list is the most recently added item. TaskEntry taskEntry = userEntry.TaskFeed.Entries[0] as TaskEntry; FormEntry form = taskEntry.CreateFormInstance();
You can upload XSD schemas using the following code. Note that if the xsd being uploaded consists of multiple files you must upload the dependencies one by one making sure you start with the one without any dependencies, i.e. only upload schemas when all its dependencies are already uploaded.
// Need an application to upload a schema ApplicationEntry app = ....; // create a mediasource to the xsd file string fileName = "\path\to\myschema.xsd"; MediaFileSource source = new MediaFileSource (fileName, SchemaFeed.MEDIA_SOURCE_TYPE); // create a SchemaEntry SchemaFeed schemas = app.SchemaFeed; SchemaEntry newSchema = schemas.CreateEntry (); // set the entry's media source newSchema.MediaSource = source; // perform the upload newSchema = schemas.Insert (newSchema);
You can list all the DocumentType's contained in a SchemaEntry by using the following code. Why would you want to do that? You use Schema DocumentType's to add to FormType's so controls can be auto-generated from it.
SchemaEntry schema = ....; // got the schema somehow (maybe uploaded, maybe you queried the existing schemas) DocumentTypeFeed docTypes = schema.DocumentTypeFeed; foreach( DocumentTypeEntry docType in docTypes.Entries ) { Console.WriteLine(docType); }
Let's say I have a purchase order xsd and would like to auto generate a form for it. Let's say that I already uploaded the xsd and have a SchemaEntry at hand.
ApplicationEntry app = ...; // SchemaEntry schema = ... ; // go the schemaentry somehow DocumentTypeFeed xsdDocTypes = schema.DocumentTypeFeed; DocumentTypeEntry xsdDocType = null; foreach(DocumentTypeEntry current in xsdDocTypes.Entries) { if( current.Title.Text == "http://myschema.com#purchaseorder" ) srcDocType = current; } // create an empty form FormTypeFeed fts = app.FormTypeFeed; FormTypeEntry ft = fts.CreateEntry(); ft.Title.Text = "My Purchase Order Form"; ft = fts.Insert(ft); // Create a FormType DocumentTypeEntry based on the xsd one DocumentTypeFeed ftDocTypes = ft.DocumentTypeFeed; DocumentTypeEntry ftDocType = ftDocTypes.CreateEntry(xsdDocType); // add the schema DocumentType to the form ftDocType = ftDocTypes.Insert(ftDocType);
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).
Every FormType always has 1 default DocumentType that cannot be removed. This is the DocumentType managed by frevvo 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).
The following code will remove all FormType DocumentTypes that were added from Schema:
FormTypeEntry ft = ...; DocumentTypeFeed docTypes = ft.DocumentTypeFeed; foreach(DocumentTypeEntry docType in docTypes.Entries ) { if( !docType.ReadOnly ) docType.Delete(); // not read-only so this must be from schema }
FormTypeEntry ft = ...; ft.DeployState = DeployState.Production; // or ft.DeployState = DeployState.Development;
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.
FormTypeEntry entry = ...; FormTypeFeed targetFeed = ...; FormTypeEntry copy = targetFeed.CreateEntry(); copy.Id = entry.Id; copy.Title.Text = "My copy"; copy = targetFeed.Insert(copy);
The updates listed here are only available in .net client API version 5.2 or later.
There are three options when uploading a project for a user: Insert, Copy or Replace:
string fileName = ....; UserEntry user = ....; // If an entry with the same id already exists, it will be replaced. // Otherwise, the archive will be uploaded with the same id. ApplicationEntry entry = user.ApplicationFeed.UploadAndReplaceApplication(fileName); // If an entry with the same id already exists, it will be copied. // Otherwise, the archive will be uploaded with the same id. ApplicationEntry entry = user.ApplicationFeed.UploadAndCopyApplication(fileName); // If an entry with the same id already exists, it will be copied. // Otherwise, the archive will be uploaded with a new id. ApplicationEntry entry = user.ApplicationFeed.UploadAndInsertApplication(fileName);
FormTypeEntry fe = TestApplication.FormTypeFeed.CreateEntry(); fe.ElementName = "test"; TestApplication.FormTypeFeed.Insert(fe);.
fe.ElementName = "TemporaryForm"; fe.Update();
There are three options when uploading a workflow or form: Insert, Copy or Replace:
string fileName = ....; bool isForm = ....; ApplicationEntry appEntry = ....; // If an entry with the same id already exists, it will be replaced. // Otherwise, the archive will be uploaded with the same id. FormTypeEntry entry = appEntry. FormTypeFeed.UploadAndInsertFormType(filename, isForm); // If an entry with the same id already exists, a copy will be made. // Otherwise, the archive will be uploaded with the same id. FormTypeEntry entry = appEntry.FormTypeFeed.UploadAndCopyFormType(filename, isForm); // If an entry with the same id already exists, it will be replaced. // Otherwise, the archive will be uploaded with the same id. FormTypeEntry entry = appEntry.FormTypeFeed.UploadAndReplaceFormType(filename, isForm);
When the _formActionDocs parameter is set, the SubmitInstance call will return a list of MultiPartContentElement objects that contain the submission documents.
FormTypeEntry formTypeEntry = ....; // request all data come back as part of the submit response NameValueCollection linkParams = new NameValueCollection(); linkParams.Add("_formActionDocs", "true"); FormEntry formEntry = formTypeEntry.CreateFormEntry(linkParams); IList<MultipartContentElement> responseData = formEntry.SubmitInstance(); foreach (MultipartContentElement part in responseData) { string dispositionType = part.ContentDispositionType; string name = part.Name; string contentType = part.ContentType; string contentTransferEncoding = part.ContentTransferEncoding; string data = part.DataPayload; }
The updates listed here are only available in .net client API version 5.3 or later.
Note the Themes api was removed and replaced by the Styles api in frevvo 5.3. All references to Themes have been removed in frevvo 5.3.
string scriptFileName = ....; ApplicationEntry appEntry = ....; appEntry.SetScript(scriptFileName);
ApplicationEntry appEntry = ....; appEntry.DeleteScript();
ApplicationEntry appEntry = ....; Stream scriptStream = appEntry.GetScript(); string contentString = new StreamReader(scriptStream).ReadToEnd();
string styleFileName = ....; bool doReplace = ....; StyleFeed feed = TestUser.StyleFeed; StyleEntry entry = feed.UploadStyle(styleFileName, doReplace);
string styleId = ....; FormsService service = ....; StyleEntry entry = service.GetStyle(styleId); entry.Delete();
There are two ways to get the list of Styles for a current user. You can use the UserEntry.StyleFeed:
UserEntry testUser = ....; StyleFeed userStyleFeed = testUser.StyleFeed; foreach (StyleEntry entry in userStyleFeed.Entries) { Console.WriteLine("Style: " + style.Title.Text); }
Or you can Query via the FormsService class:
FormsService service = ....; StyleQuery query = service.CreateStyleQuery(); StyleFeed styles = service.Query(query) as StyleFeed; foreach (StyleEntry style in styles.Entries) { Console.WriteLine("Style: " + style.Title.Text); }
FormTypeEntry formTypeEntry = ....; formTypeEntry.Style = "blue"; formTypeEntry.Update();
There are three options when uploading a workflow or form: Insert, Copy or Replace. You can use a Stream or a file path location when uploading.
string fileName = ....; bool isForm = ....; ApplicationEntry appEntry = ....; // If an entry with the same id already exists, it will be replaced. // Otherwise, the archive will be uploaded with the same id. FormTypeEntry entry = appEntry. FormTypeFeed.UploadAndInsertFormType(filename, isForm); // If an entry with the same id already exists, a copy will be made. // Otherwise, the archive will be uploaded with the same id. FormTypeEntry entry = appEntry.FormTypeFeed.UploadAndCopyFormType(filename, isForm); // If an entry with the same id already exists, it will be replaced. // Otherwise, the archive will be uploaded with the same id. FormTypeEntry entry = appEntry.FormTypeFeed.UploadAndReplaceFormType(filename, isForm); Stream appStream = ....; bool isForm = ....; ApplicationEntry appEntry = ....; // If an entry with the same id already exists, it will be replaced. // Otherwise, the archive will be uploaded with the same id. FormTypeEntry entry = appEntry. FormTypeFeed.UploadAndInsertFormType(appStream,isForm); // If an entry with the same id already exists, a copy will be made. // Otherwise, the archive will be uploaded with the same id. FormTypeEntry entry = appEntry.FormTypeFeed.UploadAndCopyFormType(appStream, isForm); // If an entry with the same id already exists, it will be replaced. // Otherwise, the archive will be uploaded with the same id. FormTypeEntry entry = appEntry.FormTypeFeed.UploadAndReplaceFormType(appStream, isForm);
string signaturePictFile = ....; string signatureXmlFile = ....; string sectionFormXmlFile = ....; string miscFile = ....; FormTypeEntry formTypeEntry = ....; // existing form type from feed Stream wetSig = File.OpenRead(scriptStream); Stream sigXml = File.OpenRead(signatureXmlFile); Stream formXml = File.OpenRead(sectionFormXmlFile); Stream miscFile = File.OpenRead(miscFile); FormEntryBuilder fbe = new FormEntryBuilder(formTypeEntry); fbe.Document("form", formXml); fbe.WetSignature("controlTypeId", wetSig); fbe.DigitalSignature(sigXml); fbe.Attachment("controlTypeId", miscFile); fbe.Data("Name", "some name"); // builds up _data fbe.Parameter("_formTz", "America/New_York"); // adds URL param fbe.FormActionDocs(true); // set _formActionDocs param to return Submission Doc Set FormEntry formEntry = fbe.CreateFormEntry(); IList<MultipartContentElement> responseData = formEntry.SubmitInstance(); foreach (MultipartContentElement part in responseData) { string dispositionType = part.ContentDispositionType; string name = part.Name; string contentType = part.ContentType; string contentTransferEncoding = part.ContentTransferEncoding; string data = part.DataPayload; }
The updates listed here are only available in .net client API version 6.1.2 or later.
FormsService myFormsService = ....; FormTypeEntry publicFormType = ....; //may be created by any user as long as //visibility is Visibility.PublicTenant FormEntryBuilder fbe = new FormEntryBuilder(publicFormType); fbe.Document("form","form.xml");fbe.WetSignature(sigControlId, "signature.png"); fbe.DigitalSignature("DigitalSignatures.xml"); fbe.Data("Name","Dudley"); fbe.Data("Description","DooWright"); FormEntry formEntry = fbe.CreateFormEntry(test2UserService);
The filename attribute for stream-based methods for digital/wet signatures and documents is required. Methods without the filename parameter are deprecated.
/// Add a Document to this builder from a given stream public FormEntryBuilder Document(string partName, Stream inputStream, string contentType, string fileName)
This method deprecates the previous method:
public FormEntryBuilder Document(string partName, Stream inputStream, string contentType)
/// Add a wet signature image to this builder from a given stream public FormEntryBuilder WetSignature(string id, Stream inputStream, string contentType, string fileName)
This method deprecates the previous method:
public FormEntryBuilder WetSignature(string id, Stream inputStream, string contentType)
/// Add an xml signature to this builder from a given stream public FormEntryBuilder DigitalSignature(Stream inputStream, string contentType, string fileName)
This method deprecates the previous method:
public FormEntryBuilder DigitalSignature(Stream inputStream, string contentType)
FormTypeEntry fte = ….; //Get Raw Link AtomLink rawLink = fte.GetFormTypeLink(null);
ApplicationEntry testApplication = ....; SchemaEntry testSchema = ....; string zipFileName = "\path\to\myschema.zip"; testSchema = testApplication.SetupSchemaZip(zipFileName, "rootXSDFileName.xsd", "schemaName-optional ");
ApplicationEntry testApplication = ....; SchemaEntry testSchema = ....; string xsdFileName = "\path\to\myschema.xsd"; testSchema = testApplication.SetupSchema(xsdFileName, "schemaName-optional");
ApplicationEntry testApplication = ....; SchemaEntry testSchema = ....; string fileName = "\path\to\myschema.xsd"; MediaFileSource source = new MediaFileSource(fileName, SchemaFeed.MEDIA_SOURCE_TYPE); testSchema = testApplication.SetupSchema(source, "schemaName-required");
The updates listed here are only available in .net client API version 6.1.5 or later.
The users csv upload is available through the .net client api in frevvo v6.1.5. Here is the code snippet:
Stream userCsvData = // Obtain a stream to your user csv file – ex: FileStream. FormsService service = // Obtain form service logged in as tenant admin user UserQuery userFeedQuery = service.CreateUserQuery(null); UserFeed userFeed = service.Query(userFeedQuery); stringnotificationEmailAddress = // some email address userFeed.UploadUsersCsv(userCsvData, notificationEmailAddress); //now check for the email with results
To get the users csv data from frevvo:
Stream is = userFeed.GetUsersCsv();
You can specify who receives an email reporting the upload status when it is done through the API. The email is sent to the "notificationEmailAddress" that is passed in the API. The email may say something like this if there are errors during the upload:
Validation occurred with errors. Users data NOT loaded. Refer to attached CSV data file for validation and/or loading result details.
The attached file, results.csv, will contain the details.
Ensure the form/workflow submissions you are trying to access has either the userid or Roles that the user is a member of in "Who can view submissions" ACL.
LDAP, SAML, and SAML Azure Security Managers provide a built-in admin login directly to frevvo, which is helpful if your security manager logins should become inaccessible and you need to access frevvo. This built in admin is automatically enabled from the API when using SAML, but for LDAP it needs to be explicitly enabled by setting the custom property "backdoorLogin" to true in the loginAs call. This will allow the API to login in the same way a built in admin can login using /frevvo/web/admin/login.
service.loginAs("loginAsUser", "adminuser@tenant"), "????", true, null, null, null, null, Map.of("backdoorLogin", "true"));