4D v14.3GET DOCUMENT PROPERTIES |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
GET DOCUMENT PROPERTIES
GET DOCUMENT PROPERTIES
The GET DOCUMENT PROPERTIES command returns information about the document whose name or pathname you pass in document. After the call:
You have created a documentation database and you would like to export all the records you created in the database to documents on disk. Because the database is regularly updated you want to write an export algorithm that create or recreate each document on disk if the document does not exist or if the corresponding record has been modified after the document was saved for the last time. Consequently, you need to compare the date and time of modification of a document (if it exists) with its corresponding record. For illustrating this example, we use the table whose definition is shown below: Rather than saving both a date and time values into each record, you can save a “time stamp” value which expresses the number of seconds elapsed between an arbitrary anterior date and time (in this example we use Jan, 1st 1995 at 00:00:00) and the date and time when the record was saved. In our example, the field [Documents]Creation Stamp holds the time stamp when the record was first created and the field [Documents]Modification Stamp holds the time stamp when the record was last modified. The Time stamp project method listed below calculates the time stamp for a specific date and time or for the current date and time if no parameters are passed: [ ` Time stamp Project Method Note: Using this method, you can encode dates and times from the 01/01/95 at 00:00:00 to the 01/19/2063 at 03:14:07 which cover the long integer range 0 to 2^31 minus one. Conversely, the Time stamp to date and Time stamp to time project methods listed below allow extracting the date and the time stored into a time stamp: ` Time stamp to date Project Method For ensuring that the records have their time stamps correctly updated no matter the way they are created or modified, we just need to enforce that rule using the trigger of the table [Documents]: // Trigger for table [Documents] Once this is implemented in the database, we have all we need to write the project method CREATE DOCUMENTATION listed below. We use of GET DOCUMENT PROPERTIES and SET DOCUMENT PROPERTIES for handling the date and time of creation and modification of the documents. ` CREATE DOCUMENTATION Project Method |
PROPERTIES
Product: 4D
HISTORY
Created: 4D v6 SEE ALSO
Document creator ARTICLE USAGE
4D Language Reference ( 4D v14 R3) Inherited from : GET DOCUMENT PROPERTIES ( 4D v11 SQL Release 6) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||