0% found this document useful (0 votes)
7 views

Tutorial 22 - Document Generation

Uploaded by

homadi.99
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Tutorial 22 - Document Generation

Uploaded by

homadi.99
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

SOClass Modular Version

22 - Document generation

Subject Advanced tutorials


Version ADK 233
Issue date 08/07/2005
Beneficiaries Developers
File Tutorial 22 - Document generation.doc
Status Final
Checked by Asycuda World - Lyon competence center
Copyrights United Nations Conference on Trade and Development
Developer Guide
Version ADK 233
22 - Document generation

Table of contents

1. OBJECTIVE......................................................................................................... 2
2. BASE DOCUMENT............................................................................................. 2
3. DOCUMENT TO CREATE................................................................................ 2
3.1. LOGICAL DESCRIPTION OF THE DOCUMENT (SHARED PART)............................. 2
3.2. VISUAL REPRESENTATION (CLIENT PART)........................................................ 2
3.3. SERVER IMPLEMENTATION .............................................................................. 2
4. DOCUMENT GENERATION SERVER RULE .............................................. 2
4.1. DESCRIPTION OF THE RULE .............................................................................. 2
4.2. ADDING THE RULE ........................................................................................... 2
5. PROPERTIES FILES.......................................................................................... 2
5.1. BUSINESS UNIT ................................................................................................ 2
5.2. BINDER AND DOCUMENT LIBRARY ................................................................. 2
5.3. MODULE PROPERTIES FILES ............................................................................. 2
5.3.1. un.asytutorialAdv.properties ..................................................................... 2
5.3.2. un.asytutorialAdv.tutorial22.person.properties file .................................. 2
5.3.3. un.asytutorialAdv.tutorial22.child.properties file ..................................... 2

United Nations Conference on Trade and Development Page 1 of 21


Developer Guide
Version ADK 233
22 - Document generation

Figures
FIGURE1 - THIS IS AN EXAMPLE OF FIGURE........................................................................... 2
FIGURE2 - PERSON DOCUMENT............................................................................................. 2
FIGURE3 - CHILD DOCUMENT VISUAL REPRESENTATION ...................................................... 2

Source code
SOURCE 1 - THIS IS AN EXAMPLE OF SOURCE CODE ................................................................ 2
SOURCE 2 - C_CHILD FILE ..................................................................................................... 2
SOURCE 3 - DEFINITION OF THE MAIN DATA MODEL OF THE DOCUMENT IN THE D_CHILD
CLASS 2
SOURCE 4 - DEFINITION OF THE DATA MODEL FOR THE CHILDREN DESCRIPTION IN THE
DS_CHILD CLASS ................................................................................................................ 2
SOURCE 5 - CREATING THE TABLE IN THE VISUAL PAGE VP_CHILD ....................................... 2
SOURCE 6 - ABSTRACT OF THE S_CHILD CLASS ..................................................................... 2
SOURCE 7 - SERVER RULE, SR_CREATECHILD: GENERATE THE CHILD DOCUMENT ................ 2
SOURCE 8 - ADDING THE SERVER RULE IN S_PERSON.JAVA FILE............................................ 2
SOURCE 9 - ASYTUTORIALADV_CREATE.XML FILE MODIFICATIONS ....................................... 2
SOURCE 10 - BUSINESS UNIT DECLARATION IN THE INSTALL_SRC.XML FILE ............................ 2
SOURCE 11 - ABSTRACT OF THE INSTALL_SRC.XML FILE ......................................................... 2
SOURCE 12 - UN.ASYTUTORIALADV.PROPERTIES ..................................................................... 2
SOURCE 13 - DEFINITION OF A SERVER BINDER PROPERTY ....................................................... 2
SOURCE 14 - UN.ASYTUTORIALADV.TUTORIAL22.PERSON.PROPERTIES FILE MODIFICATION ... 2
SOURCE 15 - UN.ASYTUTORIALADV.TUTORIAL22.CHILD.PROPERTIES FILE ............................. 2

United Nations Conference on Trade and Development Page 2 of 21


Developer Guide
Version ADK 233
22 - Document generation

How to read this document


This symbol indicates advice and recommendations. Information on best
practices and recommended procedures related to the current topic is
contained here.

Keyword Definition

This symbol indicates a warning. Information on common pitfalls or dangers


associated with the current topic is contained here.

This symbol indicates an example to further illustrate the current topic.

Source 1 -
This is an example
of source code Source code.

Phase 1 Phase 2 Phase 3

Figure1 - This is an example of figure

United Nations Conference on Trade and Development Page 3 of 21


Developer Guide
Version ADK 233
22 - Document generation

1. Objective
In this document you will learn
 How to generate a document with a server rule

Required element
 Knowledge on server rules

The objective of this tutorial is to explain how to generate a document automatically with a
server rule.
To do this, two documents must be created:
• The original document: for convenience, this one will be created by replicating the
last basic tutorial (use the replicator tool on the Tutorial 9 document)
• The document to generate: this one has to be created entirely. It will be another
representation of the original document.

United Nations Conference on Trade and Development Page 4 of 21


Developer Guide
Version ADK 233
22 - Document generation

2. Base document
In this part, the original document is described. This document is the one used in “basic
tutorials”, defining a person and his children.
To create it, use the “replicator” tool to copy the “un.asytutorialAdv.tutorial9” and define
this document as the “un.asytutorialAdv.tutorial22.Person” document.
A server rule will be added to the document further.

Figure2 - Person document

United Nations Conference on Trade and Development Page 5 of 21


Developer Guide
Version ADK 233
22 - Document generation

3. Document to create
In this part, the document to generate is described. Despite of the limited usage of this new
document (containing the same information, but presented in a different way), it is the
opportunity to present a new component: the “KTable” component.
This table component will be used to show the children of a person.

Figure3 - Child document visual representation

United Nations Conference on Trade and Development Page 6 of 21


Developer Guide
Version ADK 233
22 - Document generation

3.1. Logical description of the document (shared part)


One important file is the constant file:

Source 2 -
C_Child file package un.asytutorialAdv.tutorial22.Child;

import so.kernel.core.Operation;

public interface C_Child {

/**
* Definition of the Constant data
*
*/

// Status
public static final String ST_NULL = null;
public static final String ST_CREATED = "Created";

// Operation name
public static final String OP_CREATE = Operation.CREATE_OPERATION_NAME;
public static final String OP_VIEW = Operation.VIEW_OPERATION_NAME;
public static final String OP_DELETE = Operation.DELETE_OPERATION_NAME;

// Operation identificator
public static final int OI_CREATE = Operation.CREATE_OPERATION_ID;
public static final int OI_VIEW = Operation.VIEW_OPERATION_ID;
public static final int OI_DELETE = Operation.DELETE_OPERATION_ID;

/**
* Data Model.
*/
// Key
public final static String INSTANCE_ID = "INSTANCE_ID";
public static final String CBD = "CBD"; // child Birth date
public static final String CFN = "CFN"; // child first name
public static final String CHD = "CHD"; // Segment Child
public final static String FNA = "FNA"; //First name
public final static String IDE = "IDE"; //Segment identity
public final static String LNA = "LNA"; //Last name

// Task Rule Constant


public static final String CRITERIA = "CRITERIA";

// Data name

// End of the definition of the Constant data

The Data Object Model of this document looks like the one of the original document. In
fact, fields have been removed to keep a refine vision of a person and his children.

Source 3 -
Definition of the …
main data model of /**
the document in the * Definition of the Data Model
*/
D_Child class public void define_DataModel() {

key(INSTANCE_ID); // Key data

United Nations Conference on Trade and Development Page 7 of 21


Developer Guide
Version ADK 233
22 - Document generation

DataSet ide = seg(IDE); //identity


ide.add(FNA); //first name
ide.add(LNA); //last name

//Child numbered sub-document


numberedItm(CHD, new DS_Child());

define_DataInformation();
// End of the definition of the Data Model
}

Source 4 -
Definition of the …
data model for the /**
children description * Definition of the Data Model
*/
in the DS_Child public void define_DataModel() {
class add(CFN); // Child name
add(CBD); // Child birth date

define_DataInformation();
// End of the definition of the Data Model
}

3.2. Visual representation (client part)


In this part, a new component is presented: the “KTable” component. It is not a typical
“elffield” component. Consequently, new methods are used to add the component to the
page and to define the facet. Moreover, this component is linked to a numbered item of the
DOM
Each line of the table is binded with tow elements of the numbered item. So, each line
needs two “VisualFacet” elements. The visual facet class is used for non elfField objects.
Then, for the table itself, a global VisualFacet is needed: the “VisualFacetJTableSDS”,
binding a table with a numbered SubDataSet.

Source 5 -
Creating the table …
in the visual page public class VP_Child extends ElfVisualPage implements C_Child {
VP_Child
// Definition of controls
transient private ElfField fld_FirstName = elfFieldPool.getElfField();
transient private ElfField fld_LastName = elfFieldPool.getElfField();
transient private KTable tbl_Children = new KTable();

public VP_Child() { … }

public void initVisualPage() { … }

public void initVisualControls() {


// Add labels
add(20, 20, 150, 20, lng("First name"));
add(20, 50, 150, 20, lng("Last name"));
add(20, 80, 150, 20, lng("Children"));

United Nations Conference on Trade and Development Page 8 of 21


Developer Guide
Version ADK 233
22 - Document generation

// Add controls
add(170, 20, 150, 20, fld_FirstName, lng("First name"));
add(170, 50, 150, 20, fld_LastName, lng("Last name"));

JScrollPane sp = new JScrollPane(tbl_Children);


add(sp);
sp.setBounds(20, 110, 400, 200);
}

public void initFacets() {


D_Child doc = (D_Child) getDocument();

addFacetText(fld_FirstName, ds(IDE).de(FNA), "X30");


addFacetText(fld_LastName, ds(IDE).de(LNA), "X30");

String[] columnNames = { lng("Name"), lng("Birth date") };


String[] dataNames = { CFN, CBD };
VisualFacet[] visualFacet =
{ new VisualFacetJTextField(doc.ds(CHD),
new JTextField()),
new VisualFacetJDateNew(doc.ds(CHD),
new JTextField(), "yyyy-MM-dd")
};
createTable(tbl_Children, columnNames, dataNames, CHD, visualFacet);
}

private void createTable(JTable table, String[] columnNames, String[] dataNames,


String dataSetName, VisualFacet[] visualFacet) {
KNumberedSubDataSet sds = (KNumberedSubDataSet)
getDocument().ds(dataSetName);
DataField d = new DataField("TMP", sds);
table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
table.setBackground(new Color(255, 255, 255, 255));
addVisualFacet(new VisualFacetJTableSDS(d, table, columnNames, dataNames,
visualFacet, true, false));

// Define visual properties of the table


TableColumnModel tableColumnModel = table.getColumnModel();
tableColumnModel.setColumnMargin(2);
TableColumn tableColumn = tableColumnModel.getColumn(0);
tableColumn.setPreferredWidth(250);
table.setOpaque(false);
}

public JTable getChildrenTable() {


return tbl_Children;
}

public void initRules() {


}

/**
* Retrieves a property string in the current working language.
*
*/
public static String lng(String property) {
return so.i18n.IntlObj.createMessage("TutorialAdv", property);
}
}

United Nations Conference on Trade and Development Page 9 of 21


Developer Guide
Version ADK 233
22 - Document generation

3.3. Server implementation

The server class must define a create operation. This operation will be used in the server
rule generating the document.

Source 6 -
Abstract of the package un.asytutorialAdv.tutorial22.Child.server;
S_Child class
import so.kernel.core.Operation;
import so.kernel.core.Operations;
import so.kernel.server.ConnectionManager;
import so.kernel.server.DPP;
import so.kernel.server.GCFServerBinder;
import so.kernel.server.OperationFactory;
import so.kernel.server.Server;
import un.asytutorialAdv.tutorial22.Child.C_Child;

public class S_Child extends GCFServerBinder implements C_Child {

/**
* Name of the resource table identifier for the Customs database tables
*/
public static final String PERSON_TAB = "TUTORIALADV_PERSON_TAB2";

public static final String CHILD_TAB = "TUTORIALADV_CHILD_TAB2";

/**
* Name of the identifier for the database link URL. The actual name will be
* loaded from the resource file.
*/
public static final String DB_URL_PROPERTY = S_Child.class.getName() +
"#TUTORIALADV_TUTORIAL22_DataBaseURL";

/**
* Name of the database identifier for the user name. The actual name will
* be loaded from the resource file.
*/
public static final String DB_USR_PROPERTY = S_Child.class.getName() +
"#TUTORIALADV_TUTORIAL22_DataBaseUser";

/**
* Name of the database identifier for the user password. The actual name
* will be loaded from the resource file.
*/
public static final String DB_PWD_PROPERTY = S_Child.class.getName() +
"#TUTORIALADV_TUTORIAL22_DataBasePassword";

/**
* Constructor
*
*/
public S_Child() {
super();
}

/**
* Creation of the Document Processing Path
*/
protected DPP createDPP() {
DPP dpp = new DPP();

dpp.add(ST_NULL, OP_CREATE, ST_CREATED);


dpp.add(ST_CREATED, OP_VIEW, ST_CREATED);

return dpp;
}

United Nations Conference on Trade and Development Page 10 of 21


Developer Guide
Version ADK 233
22 - Document generation

/**
* Define binders
*/
public void defineBinder() {
TC_Child tc = new TC_Child(this, getConnectionManager(0));
addServerRule(tc);

// Create the document processing path


setDPP(createDPP());
}

/**
* Define the universe of operations
*/
protected Operations createValidOperations() {
setDefaultOperationFlag(FIND);
Operations ops = super.createValidOperations();

// Create operation
Operation op_Create = OperationFactory.makeCreateOperation(OI_CREATE,
OP_CREATE);
ops.add(op_Create);

// View operation
Operation op_View = OperationFactory.makeViewOperation(OI_VIEW, OP_VIEW);
ops.add(op_View);

// Delete operation
Operation op_Delete = OperationFactory.makeDeleteOperation(OI_DELETE,
OP_DELETE);
ops.add(op_Delete);

return ops;
}

/**
* Database initialisation
*/
public void initializeDatabase() {
ConnectionManager manager = createConnectionManager(DB_URL_PROPERTY,
DB_USR_PROPERTY, DB_PWD_PROPERTY);
if (manager == null) {
System.err.println("TutorialAdv database not found");
}
}

static protected String getPERSON_TAB() {


return Server.getString(S_Child.class, PERSON_TAB);
}

static protected String getCHILD_TAB() {


return Server.getString(S_Child.class, CHILD_TAB);
}

The two tables used in the child document need two table connectors. These one are not
presented here because they are very similar to the one of the Person document (table
connectors presented in basic tutorials).

United Nations Conference on Trade and Development Page 11 of 21


Developer Guide
Version ADK 233
22 - Document generation

4. Document generation server rule


The generation of the new document is done with a server rule from the original document.

4.1. Description of the rule


The generation of a document is done by launching a create operation on the binder of the
document to create.
• Creating an operation runner, enabling the execution of an operation on a binder.
• Starting the desired operation by specifying the binder name and the operation
name. The binder name is the one corresponding to the document to create. To be able
to change the value of the binder name without changing the source code of the server
rule, the binder name is saved in a property variable of the original document server
binder. To get the value of this property, use the “getProperty()” method of the current
server binder with the name of the property needed. The value of the property is defined
in a property file (see section 5.1).
• Filling the document. When the operation is started, it is possible to fill the
document as needed.
• Committing the operation (or canceling it). Every operation has to be committed to
validate the database process.

Source 7 -
Server rule, package un.asytutorialAdv.tutorial22.Person.server;
SR_CreateChild:
generate the child import java.util.Enumeration;
document import so.kernel.core.DataSet;
import so.kernel.core.Document;
import so.kernel.core.KNumberedSubDataSet;
import so.kernel.core.KernelEvent;
import so.kernel.core.interfaces.DocumentInterface;
import so.kernel.server.GCFServerEvent;
import so.kernel.server.OperationRunner;
import so.kernel.server.ServerBinder;
import so.kernel.server.ServerRule;
import un.asytutorialAdv.tutorial22.Child.C_Child;
import un.asytutorialAdv.tutorial22.Person.C_Person;

public class SR_CreateChild extends ServerRule implements C_Person {

/**
* Constructor
*
* @param serverbinder
*/
public SR_CreateChild(ServerBinder serverbinder) {
super(serverbinder);
}

/**
* Application of the rule
*
* @param kernelevent
*/

United Nations Conference on Trade and Development Page 12 of 21


Developer Guide
Version ADK 233
22 - Document generation

/**
* Application of the rule
* @param kernelevent
*/
protected void apply(KernelEvent kernelevent) {
GCFServerEvent event = (GCFServerEvent) kernelevent;
UserTransactionEnvironment ute = event.getUserTransactionEnvironment();
DataSet doc =ute.getFinalDocument().ds(DocumentInterface.NORMAL_ID);

OperationRunner or = new OperationRunner(ute);


or.setSlave(true);

//Fill the child document


Document new_doc = or.start(getServerBinder().getProperty("Child"),
C_Child.OP_CREATE);

// Define the person


new_doc.ds(C_Child.IDE).de(C_Child.FNA).tryToSetContent(
doc.ds(IDE).de(FNA).getContent());
new_doc.ds(C_Child.IDE).de(C_Child.LNA).tryToSetContent(
doc.ds(IDE).de(LNA).getContent());

// Define the children


KNumberedSubDataSet doc_child = (KNumberedSubDataSet) doc.ds(CHD);
KNumberedSubDataSet new_doc_child= (KNumberedSubDataSet) new_doc.ds(CHD);
for (Enumeration enum = doc_child.getAllElements(); enum.hasMoreElements();) {
DataSet child_elem = (DataSet) enum.nextElement();
DataSet new_child_elem = new_doc_child.addDocument();
new_child_elem.de(CFN).tryToSetContent(child_elem.de(CFN).getContent());
new_child_elem.de(CBD).tryToSetContent(child_elem.de(CBD).getContent());
}
if (!or.commit(C_Child.OP_CREATE)) {
or.rollback();
setError(doc, "Impossible to create Child", event);
}
}

/**
* Retrieves a property string in the current working language.
*
*/
public static String lng(String property) {
return so.i18n.IntlObj.createMessage("TutorialAdv", property);
}
}

4.2. Adding the rule


This rule must now be added to the original document. This is done in the S_Person class.
This rule is launched when the operation “create” is committed on the first document.

Source 8 -
Adding the server …
rule in public void defineBinder() {
S_Person.java file …
// Create the Child document
addServerRule(new SR_CreateChild(this), OE_REGISTER);

// Create the document processing path


setDPP(createDPP());
}

protected Operations createValidOperations() {

United Nations Conference on Trade and Development Page 13 of 21


Developer Guide
Version ADK 233
22 - Document generation

int commitEventsBefore[] = { OE_UPDATE_CONJOINT };


int commitEventsAfter[] = { OE_REGISTER };

setDefaultOperationFlag(FIND);
Operations ops = super.createValidOperations();

Operation op_Create = OperationFactory.makeCreateOperation(OI_CREATE,


OP_CREATE, commitEventsBefore, commitEventsAfter);

ops.add(op_Create);


}

United Nations Conference on Trade and Development Page 14 of 21


Developer Guide
Version ADK 233
22 - Document generation

5. Properties files
We have to prepare all configuration files.

In this chapter you will learn

 Prepare properties files for deployment.

Properties files that will be modified


install_src.xml \server\som
prop.xml \server\som
asytutorialAdv_create.xml \server\som\db
asytutorialAdv_insert.xml \server\som\db
un.asytutorialAdv.properties \server\som\config
un.asytutorialAdv.tutorial22.child.properties \server\som\config
un.asytutorialAdv.tutorial22.person.properties \server\som\config

The install_src.xml file is in folder:


un\asytutorialAdv\server\src\un\asytutorialAdv\server\som
Install_src.xml is used to create the som file by using ant som command in server
directory (see Installation Guide for details).
During the module deployment, som file is used by mast tool to install the module on the
ASYCUDA server.
So we need to modify the install_src.xml to prepare our document installation.
We will create database declaration, Business Unit, Binder and Document Library shortcut
within <system> XML tag.

Notice that we declare two files used for database automatic installation.
• asytutorialAdv_create.xml for the automatic creation of the tables in the
database.
• asytutorialAdv_insert.xml for the automatic insertion of records in the
tables.
These files are located in:
un\asytutorialAdv\server\src\un\asytutorialAdv\server\som\db

United Nations Conference on Trade and Development Page 15 of 21


Developer Guide
Version ADK 233
22 - Document generation

In this part, the modifications of the xml file for the database creation are presented. Two new
tables are defined, used for the “child” document.

Source 9 -
<create>
asytutorialAdv_cre
…………
ate.xml file <table name="TUTORIAL22_PERSON_TAB">
modifications <column name="INSTANCE_ID" type="INTEGER" null="false"/>
<column name="IDE_FNA" type="VARCHAR" size="35"/>
<column name="IDE_LNA" type="VARCHAR" size="35"/>
<column name="IDE_MNA" type="VARCHAR" size="35"/>
<column name="IDE_BDA" type="TIMESTAMP"/>
<column name="IDE_PIC" type="LONGVARBINARY"/>
<column name="IDE_SEX" type="INTEGER"/>
<column name="IDE_FLG" type="INTEGER"/>
<column name="JOB_JBC" type="INTEGER"/>
<column name="COO_ADR" type="VARCHAR" size="50"/>
<column name="COO_CPO" type="VARCHAR" size="6"/>
<column name="COO_TEL" type="VARCHAR" size="20"/>
<column name="COO_CIT" type="VARCHAR" size="25"/>
<column name="USR_LOG" type="VARCHAR" size="20"/>
<column name="USR_PWD" type="VARCHAR" size="20"/>
<column name="CJT_INSTANCE_ID" type="INTEGER"/>
<primary_key>
<column name="INSTANCE_ID"/>
</primary_key>
</table>

<table name="TUTORIAL22_CHILD_TAB">
<column name="INSTANCE_ID" type="INTEGER" null="false"/>
<column name="RNK" type="INTEGER" null="false"/>
<column name="CHD_NAM" type="VARCHAR" size="35"/>
<column name="CHD_BDA" type="TIMESTAMP"/>
</table>

<table name="TUTORIAL22_PERSON_TAB2">
<column name="INSTANCE_ID" type="INTEGER" null="false"/>
<column name="IDE_FNA" type="VARCHAR" size="35"/>
<column name="IDE_LNA" type="VARCHAR" size="35"/>
<primary_key>
<column name="INSTANCE_ID"/>
</primary_key>
</table>

<table name="TUTORIAL22_CHILD_TAB2">
<column name="INSTANCE_ID" type="INTEGER" null="false"/>
<column name="RNK" type="INTEGER" null="false"/>
<column name="CHD_NAM" type="VARCHAR" size="35"/>
<column name="CHD_BDA" type="TIMESTAMP"/>
</table></create>

United Nations Conference on Trade and Development Page 16 of 21


Developer Guide
Version ADK 233
22 - Document generation

5.1. Business unit


In this e-document, we will use a business unit called “BUtutorialAdv”. The business unit
is declared within <system> XML tags

Source 10 -
business unit
declaration in the <BU name="BUasytutorialAdv">Advanced tutorial</BU>
install_src.xml file

The Business Units on a document could be defined manually filling this file or using the
ASYCUDA client application. The defined Business Units will be added automatically in
ASYCUDA environment with the appropriated rights if they are defined in the
install_src.xml file.

5.2. Binder and Document Library


Binder is usually situated after business unit definition within <system> XML tags.

Binder A server side class that manages the binding of the


document and the database and the Document
Processing Path. It defines the document server binder
business logic that, for security and architectural
reasons, has to be executed on the server. It
encompasses server rules attached to operations, and
table connectors.

Shortcut is usually situated after binder tags definition within <DL> XML tags.

Document The holder of shortcuts to applications bound to the


library system. Users will view those shortcuts according to
their user permissions.

Shortcut has a sense only if a binder is defined.


Although there are no particular difficulties in this file, one specific point is advanced, the
possibility to make an operation accessible by programming and invisible for the user. To
do so, it is necessary to set a full access on the binder and restrict the accessible operations
in the library.

United Nations Conference on Trade and Development Page 17 of 21


Developer Guide
Version ADK 233
22 - Document generation

Source 11 -
Abstract of the …
install_src.xml file <BU name="BUasytutorialAdv">asytutorialAdv BU</BU>

<binder name="B_TUT22_PERSON" status="">
<field name="server"
value="un.asytutorialAdv.tutorial22.Person.server.S_Person"/>
<field name="dom"
value="un.asytutorialAdv.tutorial22.Person.D_Person"/>
<field name="client"
value="un.asytutorialAdv.tutorial22.Person.client.DC_Person"/>
<access bu="BUasytutorialAdv">
<full/>
</access>
</binder>

<binder name="B_TUT22_CHILD" status="">


<field name="server"
value="un.asytutorialAdv.tutorial22.Child.server.S_Child"/>
<field name="dom" value="un.asytutorialAdv.tutorial22.Child.D_Child"/>
<field name="client"
value="un.asytutorialAdv.tutorial22.Child.client.DC_Child"/>
<access bu="BUasytutorialAdv">
<full/>
</access>
</binder>
<DL>
<folder name="TutorialAdv" icon="">
<access bu="BUasytutorialAdv">
<full/>
</access>

<folder icon="" name="Tutorial 22 - Document Generation">
<access bu="BUasytutorialAdv">
<full/>
</access>
<item name="Person" icon="">
<field name="binder" value="B_TUT22_PERSON"/>
<field name="skin"
value="un.asytutorialAdv.tutorial22.Person.client.VD_Person"/>
<access bu="BUasytutorialAdv">
<full/>
</access>
</item>
<item name="Child" icon="">
<field name="binder" value="B_TUT22_CHILD"/>
<field name="skin" value="un.asytutorialAdv.tutorial22.Child.client.VD_Child"/>
<access bu="BUasytutorialAdv">
<operation name="View"/>
<operation name="Find"/>
<operation name="Delete"/>
</access>
</item>
</folder>
</folder>
</DL>
</system>
</module>

United Nations Conference on Trade and Development Page 18 of 21


Developer Guide
Version ADK 233
22 - Document generation

5.3. Module properties files


These files are situated in:
un\asytutorialAdv\server\src\un\asytutorialAdv\server\som\conf
ig

5.3.1. un.asytutorialAdv.properties
This file is common to all the reference tables of the module.

Source 12 -
un.asytutorialAdv.p …
roperties @include un.asytutorialAdv.tutorial22.Person.properties
@include un.asytutorialAdv.tutorial22.Child.properties

To be able to generate the document “child” from the document “person”, its binder name is
needed. This value is set in the “person” document properties file as a property of the server
binder of the “person” document.
A server binder property is defined as follow:

Source 13 -
Definition of a
server binder <package>.<module>.<document>.server.S_XXX#<property name>=<value>
property

5.3.2. un.asytutorialAdv.tutorial22.person.properties file


Here is how the person property is defined:

Source 14 -
un.asytutorialAdv.t
utorial22.Person.pr un.asytutorialAdv.tutorial22.Person.server.S_Person#TUTORIALADV_TUTORIAL22_DataB
operties file aseURL=$[un.asytutorialAdv_URL]
un.asytutorialAdv.tutorial22.Person.server.S_Person#TUTORIALADV_TUTORIAL22_DataB
modification aseUser=$[un.asytutorialAdv_User]
un.asytutorialAdv.tutorial22.Person.server.S_Person#TUTORIALADV_TUTORIAL22_DataB
asePassword=$[un.asytutorialAdv_Password]

un.asytutorialAdv.tutorial22.Person.server.S_Person#TUTORIALADV_PERSON_TAB=TUT
ORIAL22_PERSON_TAB
un.asytutorialAdv.tutorial22.Person.server.S_Person#TUTORIALADV_CHILD_TAB=TUTOR
IAL22_CHILD_TAB

un.asytutorialAdv.tutorial22.Person.server.S_Person$attached_finder#CONJOINT=un.asytu
torialAdv B_TUT22_PERSON

United Nations Conference on Trade and Development Page 19 of 21


Developer Guide
Version ADK 233
22 - Document generation

un.asytutorialAdv.tutorial22.Person.server.S_Person#Child=un.asytutorialAdv
B_TUT22_CHILD

5.3.3. un.asytutorialAdv.tutorial22.child.properties file


In this part is presented the property file of the generated document. This document uses the
same database as the “person” document but uses new tables.

Source 15 -
un.asytutorialAdv.t un.asytutorialAdv.tutorial22.Child.server.S_Child#
utorial22.Child.pro TUTORIALADV_TUTORIAL22_DataBaseURL= $[un.asytutorialAdv_URL]
perties file un.asytutorialAdv.tutorial22.Child.server.S_Child#
TUTORIALADV_TUTORIAL22_DataBaseUser= $[un.asytutorialAdv_User]
un.asytutorialAdv.tutorial22.Child.server.S_Child#
TUTORIALADV_TUTORIAL22_DataBasePassword=$[un.asytutorialAdv_Password]

un.asytutorialAdv.tutorial22.Child.server.S_Child#
TUTORIALADV_PERSON_TAB2=TUTORIAL22_PERSON_TAB2
un.asytutorialAdv.tutorial22.Child.server.S_Child#
TUTORIALADV_CHILD_TAB2=TUTORIAL22_CHILD_TAB2

Now you can compile and deploy your module with Ant tools.

United Nations Conference on Trade and Development Page 20 of 21

You might also like