The Document Editor tool on the Xpoda platform allows you to view and edit documents on your forms and save the history of changes made.
Thanks to the version management feature, you can publish your documents and access previous versions.
Appearance in Toolbox | Appearance in Free Form | Appearance in Responsive Form |
Compatibility
Free Form | Responsive Form | Mobile |
Properties of the Document Editor tool;
Type (Field Type): Shows the field type of the added form tool. The value here cannot be changed.
Name (Field Name): The added form tool is given a name. In the actions to be used in the form, the field name defined here is used as the Document Editor field name.
Help Text: On the client side, the informative text to be displayed when the mouse hovers over the Document Editor form tool is written.
Height / Width: Adjust the height and width of the form tool.
From Left / Top: Adjust the position of the form tool from left and top.
Display: Makes the Form widget not visible on the Client screen.
Example
In order to add the file to be displayed on the Document Editor form tool, let's first create the relevant form screen.
Open a new form with Free Form property. To do this, click on the new Form icon marked with a red frame in the picture below.
Select the Free Form option from the window that opens.
When Free Form is selected, a new form screen named Form_1 will be created.
Select the form named Form_1, then edit the form properties on the right side of the screen as follows.
Select the Properties field shown with number 1. Then enter DE_FILE_UPLOAD in the Table Name field shown with number 2. Finally, select the Form option from the Type field.
When the Type property of the forms is selected as ‘Form’, a new table is created under the XPODA database in SQL with the name written in the Table Name property.
When a record is made on the client side via the relevant form, this record is added directly to the table specified in the Table Name field.
The form we created is opened with Free Form and Form properties.
Let's drag 1 TextBox, 1 Add File and 1 Button tool from the form tools section on the left side and add them to our form.
Let's select the labels in order and name them in the Text field in the properties section according to the example in the picture. After completing the naming, press Enter.
To edit the properties of the form tools, select each form tool in turn and then make the necessary adjustments according to the example in the picture. After completing the naming in the Name field, press Enter.
When the Save button is clicked on the Client screen, let's add an action to the Save button to save the data entered in the fields on the screen to the table. Select the Save button, then select the actions section. Click on Add New Action field.
From the options;
Type of Action: When clicked.
Operation: Save option.
Then save the action.
The recorded action will look like the picture.
After completing the necessary adjustments, let's save the project and then switch to the client screen by clicking the Run button.
On the client screen, the last saved version of the project is displayed. If you switch to the client screen without saving the project, the last changes cannot be displayed on the screen. |
Since the Type value of the form is selected as ‘Form’, after the project is saved, a new table will be created in the XPODA database with the field names and data types added to the screen, with the name written in the Table Name field. |
The image of the form on the client screen will be as follows.
First, let's create an Excel (.xlsx) and a Word (.docx) file to be used as an example. These files can contain any content for testing purposes.
Let's create an Excel (.xlsx) file with the content and column structure specified in the image below.
Set the file name as STOCK_LIST.
Let's create a Word (.docx) file with the content specified in the image below.
Set the file name as STOCK.
Upload the created Excel and Word files to the form with the Add File tool on the form.
To create a new record on the Client screen, enter the desired information in the File Subject field. To add a file, click on Select File in the Add File field and after selecting the Excel (.xlsx) file named STOCK_LIST from the window that opens, click on the Save button to create our record.
Create a new record by selecting the Word (.docx) file named STOCK from the Add File field.
In order to view and edit the added files via the Document Editor tool, let's open a new form with the Free Form feature. To do this, click on the new Form icon marked with a red frame in the image below.
In the window that opens, select Free Form.
When Free Form is selected, a new form screen named Form_2 will be created.
Select the form named Form_2, then edit the form properties on the right side of the screen as follows.
Select the Properties field shown with number 1. Then select the Report option from the Type field shown with number 2.
Since it is not desired to create a table under the XPODA database in SQL, the Type property of the relevant form is selected as ‘Report’.
Let's drag 1 List, 1 TextBox and 1 Document Editor tool from the form tools section on the left side and add them to our form.
For the Textbox tool shown with number 2,
Select Label and type Record Guid in the Text field in the properties section. After completing the naming, press Enter.
Then select the TextBox tool and type Guid in the Name field in the properties section. After completing the naming, press Enter.
In order to display the file information we have added in Form_1 in the list tool in the form named Form_2, first select the list tool. Then type our query in the SQL Query field in the properties section on the right side. Below is a sample SQL query for this purpose:
SELECT
DE_FILE_UPLOAD.UserTableID,
DE_FILE_UPLOAD.FileSubject AS [File Subject],
XPODA_FILES.FileName,
XPODA_FILES.RecordGuid AS Record,
XPODA_FILES.FileID AS [|FileID]
FROM DE_FILE_UPLOAD WITH (NOLOCK)
LEFT OUTER JOIN dbo.XPODA_FILES WITH (NOLOCK) ON DE_FILE_UPLOAD.UserTableID = XPODA_FILES.TableID
AND DE_FILE_UPLOAD.FormTypeID=XPODA_FILES.FormTypeID
AND DE_FILE_UPLOAD.ProjectID=XPODA_FILES.ProjectID
Files uploaded with the Add File tool are automatically stored in the XPODA_FILES table by the system. Therefore, the XPODA_FILES table must be included in the query created to list the file information. |
The files in the XPODA_FILES table are displayed in the Document Editor tool through the RecordGuid field in the XPODA_FILES table. Therefore, a column containing the RecordGuid information should be added to the relevant query and an alias should be given to this column. In the query above, the line XPODA_FILES.RecordGuid AS Record has been added for this purpose. |
On the client side, when the form named Form_2 is opened, the list must first be triggered so that the query result we have added can be displayed in the list.
To add the action that triggers the list tool when the form is opened, double click on Form_2 and then select the actions section. Click on Add New Action field.
From the options;
Type of Action: When the form is opened.
Operation: Select Update Value.
Value Area: GridListe_1.
Then save the action.
The recorded action will look like the picture.
Finally, save the project and then click the Run button to switch to the client screen.
The display of the list on the client screen will be as follows.
When a row is selected from the list, let's first transfer the RecordGuid information (the data in the Record column in the picture above) from the selected row to the TextBox field on the form so that the file in the related row can be displayed on the Document Editor.
For this operation, first select the list, then select the actions section. Click on Add New Action field.
From the options;
Type of Action: When the row is selected.
Operation: Select Update Value.
Value Area: Let's select the Guid option.
SQL Query: SELECT ‘$PRecord$’.
Then save the action.
The recorded action will look like the picture.
Finally, let's save the project and then switch to the client screen by clicking the Run button.
When a row is selected from the list, the image on the client screen of passing the RecordGuid information to the TextBox field will be as shown below.
When the RecordGuid information is filled in the TextBox field, let's trigger the Document Editor tool to display the selected file in the Document Editor tool with this information.
To do this, first select the TextBox tool, then select the actions section. Click on Add New Action field.
From the options;
Type of Action: On Value Change.
Operation: Select Update Value.
Value Area: DocumentEditor_1.
Then save the action.
The recorded action will look like the picture.
Finally, save the project and then click the Run button to switch to the client screen.
The image on the client screen will be as shown below. When a selection is made from the list, the file in the corresponding row will be displayed in the Document Editor tool.
Supported File Types:
|
The file displayed in the Document Editor tool can be modified using the Document Editor tool. |
Example Usage:
Amount column was added to the file displayed in the Document Editor tool and changes were made on the file.
Save the changes made with CTRL + S key combination.
The changes made are saved with the CTRL + S key combination. |
Then, to publish our new version with these changes, click on the Publish button on the top right corner of the tool. In the Publish Document window that opens, give a name to the final version of the saved document and then click on the Publish button to publish our file.
When the process is completed successfully, a message like the one below will be displayed on the top right of the screen.
The new version of our document is ready and viewable for everyone.
After making changes to the file, if the Publish operation is performed without using the CTRL + S key combination, the changes will not be saved. In this case, the version before the modification will be published again and when the file is viewed, the version before the modification will be shown. |
If the CTRL + S key combination is used after making changes to the file but Publish is not performed, the file will be displayed as it was before the changes.
For this reason, in order to save the changes made on the file, first save the operations with the CTRL + S key combination and then publish the file with the Publish button.
After the Publish operation is completed, when the relevant row is selected again from the list, the file will be displayed with the latest changes.
Add a new row to the file and then save the file with CTRL + S key combination.
Then click on the Publish button. In the Publish Document window that opens, let's name the final version of the saved document STOCK EXCEL 3 and then publish our file by clicking the Publish button.
The new version of our document is ready and viewable for everyone.
Changes made to the file are stored in the XPODA_FILES_VERSION table along with the version number. |
When the Show Document History button on the top right corner of the Document Editor tool is clicked, the Version History pop-up window opens to access the registration history of the Excel (.xlsx) document and view the previous versions published.
The line with the phrase Current Version indicates the most recently published version.
When an old version line is reached, by clicking on “Open Version” with the mouse, the old version is opened in the same window as Read-Only and cannot be changed.
Document Editor Actions;
The actions that can be used for the Document Editor form tool are explained in detail in the following articles:
1-Document Viewed: This action is an action used only in the Document Editor tool. With this action, when a document is viewed, any other action you want can be executed.
Let's add an action that displays a message when the document is viewed.
To do this, first select the Document Editor tool, then select the actions section. Click on the Add New Action field.
From the options that come up;
Type of Action: Document viewed.
Operation: Let's select the Show Message option.
Message Title: Let's write Information.
Message Content: Let's write Document viewed!
Message Type: Select the Information option.
Then save the action.
The recorded action will look like the picture.
Finally, let's save the project and then switch to the client screen by clicking the Run button.
The image on the client screen will be as shown below. When a selection is made from the list and the file is viewed in the Document Editor tool, an information message will appear.
2-Document Published (When the document is published): This action is used only in the Document Editor tool. After the changes made on the document are saved with the CTRL + S key combination, the Publish action is performed. With this action, you can make another action run when publish is done.
This action currently does not fully fulfill the desired operation. In the new versions, improvements will be made on this feature.