Upload
others
View
0
Download
0
Embed Size (px)
Citation preview
Sentences Users
Guide
Sentencesreg Version 40
A publication of Lazysoft Ltd
Web wwwsentencescom
Email supportsentencescom
Copyright copy 2000-2014 Lazysoft Ltd All rights reserved
The information in this document is subject to change without notice and does not represent a
commitment on the part of Lazysoft Ltd No part of this document may be reproduced stored or
transmitted in any form or by any means electronic or mechanical for any purpose without the
express written permission of Lazysoft Ltd
The software described in this document is supplied subject to a License Agreement and all use
of the software is subject to the terms of the agreement Lazysoft Ltd accepts no liability for any
damages incurred directly or indirectly from any errors omissions or discrepancies between the
software and the information contained in this document
Sentences is a registered trademark of Lazysoft Ltd
LazyView is a trademark of Lazysoft Ltd
IBM AS400 DB2 DB2 Universal iSeries pSeries xSeries zSeries Lotus and WebSphere are
registered trademarks of International Business Machines IBM Corporation
Microsoft Windows Windows XP Windows Vista Windows 7 SQL Server Internet
Information Server (IIS) Internet Explorer Microsoft Office Microsoft Word Microsoft Excel
Microsoft Outlook Microsoft Sharepoint and Microsoft Access are trademarks or registered
trademarks of Microsoft Corporation
Oracle and Java are registered trademarks of Oracle Corporation andor its affiliates
Adobe the Adobe logo PostScript and the PostScript logo are either registered trademarks or
trademarks of Adobe Systems Incorporated in the United States andor other countries
The Tomcat Web server redistributed with Sentences and the Xalan XSLT Stylesheet Processor
and the Xerces XML Parser incorporated in Sentences were developed by the Apache Software
Foundation (httpwwwapacheorg) Copyright copy 1999-2000 The Apache Software Foundation
All rights reserved Please see the accompanying text files in the Licenses subdirectory for full
details of the copyright and warranty limitations for Apache Software Foundation products
InstallAnywhere is a registered trademark of Flexera Software Ltd
Linux is a registered trademark of Linus Torvalds
SAP Crystal Reports is a registered trademark of SAP AG in Germany and other countries
All other product names used may be trademarks or registered trademarks of their respective
owners
Document Information
Last Updated September 2014 ndash Build 191
Table of Contents
Overview 17
Introducing Sentences 17 Key features 17 Whats new in Sentences Version 40 18 How to use this guide 19
Document conventions 19 Your comments 20
Chapter 1 21
Configuring Sentences 21
Sentences editions and components 21 Additional components 21
Sentences licensing 22
Configuration files 22 Personal Edition environments 22 Enterprise Edition evaluation and testing environments 22
Security 24 Enterprise Edition production environments 24 Web servers not using Java Enterprise standards 25 Sentences installation directories 25 Server properties 29 Virtual directories 36 About the ImageURLBase parameter 36 Support for configuring other environments 37 Configuring server utilities 37
The lazystart script file 37 Using the classpath argument 38 Sentences client configuration 39
Java Runtime Environment 39 Java browser plugins 39 Javascript helper library lazyDeployJavajs 40 Applet configuration 40 Sentences applet parameters 42 Additional optional parameters 43 Web Start Configuration 44
User-defined parameters 46 Format of user-defined parameters 46 Pre-defined names 47 User Parameters 47 Referring to user-defined parameters 47 User-defined parameters in the Client API 47 User-defined parameters in triggers 47 User-defined parameters in query expressions 47
Monitoring server activity 47 Shutting down and restarting the Sentences server 47 Backing up and restoring your data 49
Online backup 49 Preparing to run online backup 49 Using the online backup command 50 Restoring your data from an online backup 50 Exporting the database for backup 51 Copying chapters for backup 51
Using trace files 51 Sentences log files 52
Running the Sentences client 52 Starting the Sentences client 52 Java Runtime Environment Plug-in 53 Security and certificate acceptance 53 Using the Java Console tool 54
Activating the Java Console on Windows systems 54 Activating the Java Console on Unix Linux systems 54
Errors reported at the Sentences client 54 Contacting Technical Support 56
Security considerations 57 Automatic check of HTML page host 57 Using database views for enhanced security 57
Sentences user security reference 57 Users and roles 57
Anonymous access to Sentences 59 Creating a new role 59 Creating a new user 62 Resetting a locked user 63
System Administrator Lockout 63 Privileges 64
Combining chapters example 65 The current user 65 Combining chapters example continued 66
User security parameters 66 The Serverproperties file 66 Client properties 66
Servlet access to Sentences 67 URL patterns and Servlets available in Sentences 67 Sentences servlets and web server security 68 Enabling and disabling servlet access 69
Uninstalling Sentences 69
Chapter 2 71
Introducing the associative model 71
Entities and associations 71 Entities and values 73
Types and instances 73 Comparing the relational model and the associative model 74
Structural comparisons 75
LazyView - Using Sentences to view relational databases 76 LazyView chapters 76 Relational schema and Sentences schema 76 Representing relational structures in Sentences 76
Relational tables and columns 76 Views 77 Tables and views with no primary key 77 Tables with a foreign key 78 Defining your own foreign keys 79 Tables with composite keys 80 Tables with self-referencing columns 80 Tables representing subtypes 80 Tables representing additional information 80
LazyView chapter setup 81 Installing a JDBC driver 81 Indexing the relational database 81 Java memory and stack requirements 81 Adding a LazyView chapter to a profile 81
Dynamic and static LazyView chapters 82 Optional connection properties 83 Using an existing LazyView chapter 83 Copying an existing LazyView chapter 83
Creating a mapping definition 84 Select tables and columns 85 SubsetSubtype choices 87 New and existing Sentences schema conflicts 87 Filtering mappings 89 Resolving conflicts 89 Summary of schema to generate 91 Processinghellip 92
Creating and Editing Translation Lists 93 Creating a new Translation List 93 Editing a Translation List 94
Importing or updating static data 95 Recorded updates 97 Selecting date columns to limit incremental data updates 98 Creating and assigning limiting queries for a data import 98 Memory requirements and timeouts 100
Combining databases 100 Making entity types equivalent 100 Display name queries 100
Viewing existing definitions 101 Checking for schema changes 101
Using LazyView to view data 101 Performance 101 Large database fields 102
LazyView Query Optimisation 102 Optimisation Queries 102
LazyView reference 104 LazyView parameters in the Serverproperties file 104
Chapter 3 107
Sentences database design 107
Database modelling in Sentences 107 Database design skills 107 Choosing entity association or value types 107 Creating verbs for association types 108 Modelling one-to-many association types 108 Iterative design and prototyping 108 Designing for change 108 Modelling behaviour common to multiple types 109 Using instance-specific association types 109 Using chapters and profiles 109
Sentences user interface design options 109 Using the Sentences Explorer and Dataform interface 110 Using custom Dataforms 110 Using applets in HTML pages and using JSPs 110 Using an XML-based user interface 111 Using the Sentences client API 111 Using the Sentences HTML5 Interface 111
Chapter 4 113
The Sentences Quick Tour 113
About tree displays in Sentences 113
The Sentences Explorer quick tour 114 The Explorer Menu bar 114
The Explorer Toolbar 115 Copying and Pasting 115 Finding data 116 Sentences Explorer tooltips 116 Tree displays in the Sentences Explorer 116 Nodes and icons 116 Schema and data pane features 117 Schema and data pane icons 117 Expand node and collapse node buttons 118 Sentences Explorer drill-down 118 Sentences Explorer tabs 118 The schema pane 119 Finding schema 120 The Core types folder 120 The Core queries folder 121 The All types folder 121 The All queries folder 121 The data and properties pane 121 The Status bar 122 Divider bar 123 Shortcut keys 123 Display Session Options 123 Support information 125 Explorer shortcut menus 127
The Dataform quick tour 128 Different kinds of Dataform 128 Title bar 129 Dataform tabbed pages 129 Labels and fields 129 Ellipsis button and picker lists 130 Dataform shortcut menus 130
The Query Editor quick tour 131 Query Editor menu bar 132 Query Editor toolbar 132 Query Editor icons 132 Query pane 133 Schema pane 133 Results pane 133 Query Editor status bar 133 Query Editor divider bars 134
The Message Log 134
Chapter 5 135
Working with Sentences 135
Profiles and chapters 135 Data and schema updates 135 Chapter file locations 136 System chapters 136 The Profiles database and the Profiles profile 136 Using multiple profiles 137 Profile and chapter commands 137 Profile and chapter constraints 137 The Open Profile dialog 138 Creating a new profile 138 Creating a new profile with the profile wizard 138 The Edit Profile dialog 142 Using the Edit Profile dialog 142
Chapters 143 Changes chapters 143 Generate Core types automatically 143 Determine if child associations are present 143 Saving a profile 144 Deleting a profile 144 Working with chapters 144 Add chapter 144 New chapter 145 Naming chapter files 145 Rename 145 Properties 146 Checking chapters used for changes 146 Deleting a chapter 146 Password-protected chapter files 146 To set a password 146 To change a password 147 To delete a password 147 To enter a password 147 Password-protected files and the Personal Edition 148
Sentences user security 148 Logging into Sentences 148 Changing your password 148 Changing to a different user 149 User Preferences 149
Available User Preferences 149
Deploying profiles and chapters 151 Schema and data visibility 152 Exporting and importing databases 152 Benefits of exporting a database 152 Database export and internal identifiers 152 Default export behaviour 153 To export a database 153 Export command option switch 153 To import a set of chapters 154 Import command option switches 155 Visibility of imported profiles 155 Visibility of imported profiles using the -renumber option 156 Limitation on parameters with Import command on Windows 156 Importing a database export file from a previous version 156 Transferring the profiles database 156 Export command troubleshooting 157 Copying chapter files 158 Restrictions on copying chapter files 158 Chapter format 158 Changing chapter file block size (single chapter export and import) 158 ExportChapter command 159 ImportChapter command 159
Using the Sentences Explorer 159 Delayed display of inverse associations 159 Display order of instances 159 Refreshing the display 160 Determining if child associations are present 160 Hiding the data pane 160 Sandbox Modes 161 Transaction Visibility 162 Browsing transactions 163
Database components 164 Entity types and entities 164 Creating entity types 164 Creating entities 165 Size of entity and value instances 165 Value types and datatypes 166 Defining value types with datatypes 167 Impact of changing a datatype 167 Visibility of value instances 168 Behaviour of value types and values 168 Creating value instances 169 Association types and associations 169 Creating association types 169 Schema and data change visibility 169 Source verb and target 170 Source 170 Verb 170 Target 170 Inverse verb 170 Page 171 Cardinality 171 Cardinality rules and data display 171 Singular inverse 171 Symmetric 172 Display ordering 172 Instance options 172 Schema Pages 172 Metatypes 174 Using metatypes 174 Creating associations 174 Deleting types and instances 174 Impact of deleting dialog 174 Implicit deletion 175 Renaming types and instances 176 Inactive Instances 176
Locating data in the Sentences Explorer 178 Demand loading of data 178 The More prompt 178 The Positioner and Filter tools 179 The Positioner tool 180 The Filter tool 181 Pattern matching with the Filter tool 181 Using Filtering and Positioning tools together 182 Reloading data 183 Stopping data retrieval 183 The Stop button 183 Sorting and sequencing 184 Sequencing association types 184 Sequencing multiple instances 185
Properties 185 General properties page 186
Display in Core types folder 187 Instance options 187 Instance name creation options 187
Datatype properties page 189 Instances are values 189 Assigning datatypes 190
String datatypes 190 Numeric datatypes 191 International considerations for the currency datatype 192 Date and time datatypes 192 International considerations for date and time datatypes 193
Format properties page 194 Presentation 194 Picker 196 Style 196 Display width 198 Table column width 198 Display height 198 Format options 198 Presentation of date formats 199 Presentation of time formats 199 Restore Default settings button 199
Presentation properties page 200 Display Name Query properties page 201 Subsets properties page 202
Comparison of subsets and supertypes 203 Dataform behaviour with subsets and supertypes 204 Subsets of association types 204 Viewing subset type instances 204
Supertypes properties page 205 Using supertypes with association types 206
Equivalence properties page 206 Triggers properties page 206 Description properties page 207 Custom Dataform properties page 208 State Domains properties page 209 Business Rules properties page 209 Diagram Images properties page 210 Default Sorting properties page 211 Dataform (Navigation) properties page 212 Dataform Filter properties page 213 Retrieval Methods properties page 213 Association Type properties page 213 Target Parameters properties page 214 Derived target properties page 215 Retrieval Methods properties page 216 Operations on instances 217
Supersedes 218 Instance equivalence 218 Instance-specific association types 219
Business rules 220 Introduction 220 Domains and states 221 Effector queries 226 Effector query parameters 226 Effector triggers 227 Business rules 227 Business rules reference 230 Browsing state domains 231 Browsing business rules 231
The Sentences Dataform 232 Dataform Layout Systems 232 Dataform Page Layout System 232
Dataform Section Layout System 233 Dataform Field Formatting 234 The base Dataform and the default Dataform 235 Create and update Dataforms 235 The create Dataform 235 The update Dataform 236 Parent Dataforms and child Dataforms 237 Creating an association in the Dataform 237 Association type targets and metatype targets 238 Dataform shortcut menu 238 Selecting targets in the Dataform 239 Creating an entity instance in the Dataform 239 Targets with duplicate names 240 Targets that are subsets 240 Changing the target in a Dataform 240 Instance specific Dataforms 240 Picker list initial selection 240 Business rules and states 241 Display names 241 Table and list buttons 241 Creating a custom Dataform 241 Refresh button on custom Dataforms 243 Custom Dataform restrictions 243 Selecting a custom Dataform 243 Custom Dataforms with subsets and supertypes 244
The Dataform applet 244 Dataform applet code example 245 Applet parameters for the Dataform applet 245
The Picker applet 248 Picker applet code example 249 Applet parameters for the Picker applet 250
The Query applet 251 Query applet code example 252 Applet parameters for the Query applet 253
Using colours in Sentences applets 253 Sentences and external formats 255
Using triggers when you import data 255 CSV Import 255 CSV Import and supertypes and subsets 256 Structure of CSV files 256 CSV Import rules 256 Cardinality rules and triggers with CSV import 257 Running CSV Import 257 To import a CSV file on Windows platforms 257 To import a CSV file on Unix Linux platforms 257 CSV Export 258
Server Process Scheduler 258 Access to the Scheduler 258
Scheduled Process Lists 258 Server Processes 258
Execute Query Process 259 Set Entity Type Name Creation Seed Process 259 Update Static LazyView Data Process 259 Replace Data Chapter Process 260 Backup Database Process 260
Schedule Plans 260
Managing Scheduled Process Lists 261 Manually running a Scheduled Process List 261 Viewing Scheduled Process List Progress 261
Chapter 6 263
Advanced techniques 263
Sentences and Java technology 263 Transaction processing in Sentences 264
Sentences Explorer based updates 264 Dataform based updates 265 Updates in parent and child Dataforms 265
Dataform tabbed pages with subsets and supertypes 265 Dataform appearance with Supertypes 266 Dataform example with Subsets 269
Target parameters 270 Conference room example 271 Allowed products example 274 Limitations of the Target Parameters mechanism 275
Creating database views using profiles and chapters 275 Database views example 275
Creating Candidate Lists 277 Item Candidates 277 Value Candidates 278
Filtering Dataform Tables 283 Limitations 283
Server Text Documents 283 Configuration 284
Chapter 7 287
Sentences queries 287
Introducing the Query Editor 287 New in version 4 287 Starting the Query Editor 288 The Query Editor window 289 General query properties dialog 290 Database queries 290 Building the request tree 290 Binding Nodes 296 Selection Sort and Derived type nodes 297 Derived types and derivations 299 Specific derived type targets 304 Using expressions in queries 304 Required nodes 316 Renaming request nodes 317 Hidden Nodes 318 Transitive closure and recursive closure 319 Query Parameters 323 Attaching Subset Queries 325 Using parameters in subset queries 325 Sentences query execution process 325 Additional expression capabilities 325 The expression and function editors 336 Update Queries 343
Creating and deleting instances 343 Firing triggers 345 Requesting a state change 346 Adding a message action 346
Adding an email action 347 Grouping instances 348 Sandbox mode 348
Grouping results 349 Reporting using SAP Crystal Reports 350
Display name queries 351 Creating a display name query 351 Display names in Sentences 352
Custom Dataforms 353 Page Nodes 354 Query node Properties dialog 355
Statistics and Graphical Output 362 Adding statistics to your query 362 Making your query into an X-Y chart 363 Making your query into a pie chart 364 Making your query into a distribution chart 365
The Query Editor and XML 367 XML properties dialog 367 Node name considerations for XML output 370 Create an XML DTD from a query 370 Export query results as XML 371 Export XSL stylesheet 371 View query results as XML 372 Example stylesheets 372
Exporting query results as CSV data 374 Running CSV Export 374
Chapter 8 377
Sentences and XML 377
Introducing XML 377 XML Terminology 377
XML Support in Sentences 378 Export Sentences schema to XML 379 XML data input and output methods 380
Using the Query Editor 381 Using Servlets 381 Using command line tools 387 Using the Sentences API 388
Sentences XML conventions 389 Use content not attributes 389 Associations appear as child elements 389 Mixed content is not allowed 390 Derived element type names 390 Split multiple lines 390 Allow the action attribute 391 Include Sentences IDs 391 Combining simple elements 391 Using Element IDs 391
Setting XML options in the Query Editor 392
Chapter 9 393
Sentences diagrams 393
The Diagram Editor 393 Diagram Editor components 393 Diagram Editor preferences 394 Diagram elements 396 Diagram element types 396
Adding diagram elements 396 Deleting diagram elements 397 Moving diagram elements 397 Consistency with Sentences Explorer 397 Adding Query Results 398
Exporting and importing diagrams 398 Printing 398
Chapter 10 401
Customising Sentences 401
Sentences API overview 401 Sentences API 401 Comparing the Sentences Client API and Server API 402 Example code and online documentation 402 Program build and execution 402 API packages 403 Class hierarchy 403
Triggers 404 Server-side triggers 404 Triggers and the Sentences API 405 Installing a trigger 405 Attaching a trigger 405 Trigger threading issues 408 Trigger invocation 408 Trigger actions 408 Customised validation (rules) 408 Customised actions 409 Using triggers with import and export 409
Custom datatypes API 409 Custom datatypes API 410 Installing a custom datatype 410 Custom datatypes and import and export 411 Removing custom datatypes 411
Adding custom Help topic pages 411 Help button display 411 Creating Help topic pages 412 Creating a Help topic mapping file 412
Localisation notes 414 Localising Sentences system text 414 Translating Sentences application text 415
Chapter 11 416
Worked examples 416
The Human resources example application 416 The Employee entity type 416 The Group company entity type 417 The Project entity type 417
CSV Import example 417 Preparing a profile for the example CSV Import 418 Importing the example CSV files 419 Viewing the imported data 419 Adding image data 420 Viewing additional data 421 Restoring the original Human Resources profile 422 Repeating the CSV Import example 422
Derivations example 422 Setting up the Order Entry example application 423
Starting the Order Entry example application 423 Order Entry base Dataform and custom Dataform 424 The Order Entry query 428 The Picker applet for the Order Entry example 432 Using the Picker applet to enter and update orders 432 Design assumptions used in the Order Entry example application 433 Restoring the original Human Resources profile 434
Trigger examples 434 Example trigger classes 434 Loading the example triggers 434 Viewing enabled triggers 435 Attaching triggers and editing trigger assignments 435 Refuse Update trigger example 436 Email Address trigger example 439 Auto Number trigger example 442 Disabling the example triggers 449
Custom datatype example 450 About datatype classes 450 Loading the custom datatype example 450 Custom datatype example TelecomsNumber 451 Using the example custom datatype 451
Client API example 455 Preparing to run the demonstration 455 Using the Salary Update example 455 Enabling Sentences Client API connections 456 Setting up the demonstration profile 456 Creating a command file 456 Demonstrating the Salary Update example 457 Restoring the original Human Resources example application 458
Integration with Microsoft Office applications 458 Creating Mail merge letters from Sentences data 458 Creating Mail merge emails from Sentences data 460 Creating Microsoft Outlook Contacts from Sentences data 462 Creating Sentences data from an Outlook Contacts folder 465 Copying Excel Data to and from Sentences 467
Integration with Crystal Reports 467
Appendix A 469
Menus and Commands summary 469
Sentences Explorer menus 469 Sentences Explorer function keys 472
Dataform function keys 472
Query Editor menus 473 Query Editor function keys 474 Diagram Editor menus 475
Diagram Editor function keys 476
Appendix B 477
Statistics and analysis 477
Viewing Sentences statistics 477 Message statistics 478 User statistics 478 Open profile statistics 478 Chapters statistics 480 Detailed chapter statistics 480 Memory usage summary 483 Scheduled process status 484
Chapter file analysis 484 Server request statistics 485
Glossary 487
17
Introducing Sentences
Overview
Overview
Welcome to the Sentences Users Guide This Overview chapter describes
bull the key features of Sentences
bull new features introduced in this version
bull how to use the rest of this guide
Unless otherwise noted in the text this Users Guide describes the Sentences
Enterprise Edition If you are using the Sentences Personal Edition please refer to the
Personal Edition Supplement which describes the differences between the Personal
and Enterprise editions of Sentences You can find a copy of the Personal Edition
Supplement in the DocUserDocuments folder of your Sentences installation
Introducing Sentences
Sentencesreg produced by Lazysoft is a database management system offering rapid web-
based business solutions Sentences is based on the associative model of data developed
in Java and is optimised for intranet and internet use Sentences is available in the
following editions
bull Sentences Enterprise Edition a commercial multi-user edition
bull Sentences Personal Edition a non-commercial single-user edition for evaluation
purposes only
Sentences offers unparalleled ease of development and speed of deployment for Web
based business solutions The Sentences Enterprise Edition runs on a Web server as a
Java servlet with client access through a conventional Web browser running a Java applet
Alternative client access is possible using XML for example from HTML forms The
Sentences Personal Edition runs as a stand-alone Java application that does not require a
separate server process
Key features
The main features of Sentences include
bull the associative database engine which provides a multi-user transactional capability for
the Sentences database (see Chapter 2 Introducing the associative model and Chapter
6 Advanced techniques)
bull configurable chapters and profiles allowing the flexible configuration of schema and
data (see Chapter 5 Working with Sentences)
bull support for XML as a means of exchanging data with other systems (see Chapter 8
Sentences and XML)
bull the Sentences Explorer for the creation and maintenance of associative schemas and for
browsing searching and selecting data (see Chapter 5 Working with Sentences)
bull the Sentences Dataform user interface for the entry and maintenance of data (see
Chapter 5 Working with Sentences)
bull a powerful associative query capability (see Chapter 7 Sentences queries)
bull Java APIs for the creation of custom-code Java applications (see Chapter 10
Customising Sentences)
18
Whats new in Sentences Version 40
Overview
Whats new in Sentences Version 40
Version 40 of Sentences includes new functionality and enhances some of the previously
existing features
bull LazyView
LazyView allows Sentences to query browse and import data from any data source that
has a JDBC driver This includes all modern relational databases Mapping the data
sourcersquos meta-data into an associative schema is automated but allows fine-grain tuning
of how the mapping is performed Both data and schema may be periodically refreshed
Corresponding data types in different databases may be made equivalent in Sentences and
their instances aggregated This functionality allows seemingly disparate data sources
including relational databases to be combined and viewed or queried as a whole
bull User Security
Sentences now has a User Security Model for managing users and their privileges
bull Business Rules Engine
Sentences now includes a rule-driven engine for describing and enforcing an applications
behaviour
Schema in the database can be given one or more domain to describe its states Rules can
be created to either prevent certain state changes or act upon a change from one state to
another
Effector Queries can be triggered by a state change or rule These specialised queries
allow the user to add update and delete data send messages or emails and fire Triggers
bull Queries
The existing Query Engine has been enhanced and extended to provide update
functionality to support Business Rules and additional functions for data manipulation
and cleansing
A new tool for composing expressions within the query editor has been developed to
make authoring easier and more productive
In addition a query can be attached to a type that defines a friendlier name to display in
place of uninformative data such as a name in place of a unique ID These are called
Display Name Queries bull Sandbox Mode
Sentences now includes Sandbox functionality to enable the user to make data and
schema changes and then discard those changes when they have finished experimenting
bull Transaction Visibility Mode
Sentences now includes the ability to set a Visibility Timestamp which sets a point in
time in the past to view the state of the current profile This has no impact on
performance
bull Server Process Scheduler
Sentences now includes a process scheduler This provides the ability to create lists of
tasks to be executed at regular intervals including updates to static LazyView data
execution of queries (with the ability to save the output) and starting an online backup
bull Automatic entity name generation
Sentences now includes the ability to generate entity names from the current timestamp
an incrementing ID or a Globally Unique Identifier as well as the existing generation
through the Sentences trigger functionality
19
How to use this guide
Overview
bull Inactive instances
Sentences allows you to conveniently hide obsolete or inactive data during data entry
whilst retaining the data for historical records and reporting purposes The inactive status
can be set or cleared individually or en masse using an update query
How to use this guide
For a rapid introduction to Sentences see the Sentences Tutorial which is available as a
printed book a PDF file and directly from the Help menu
If you are responsible for installing Sentences please see the Sentences Installation Guide
If you are responsible for configuring and deploying Sentences read Chapter 1
Configuring Sentences
If you are new to Sentences and the associative model of data you should start by reading
Chapter 2 Introducing the associative model If you have worked with other database
products you should find the first part of Chapter 3 Database modelling in Sentences
useful as well Continue with Chapter 4 The Sentences Quick Tour and Chapter 5
Working with Sentences Refer to other chapters as necessary
If you have used earlier versions of Sentences you should first look at the section Whats
new in Sentences Version 40 in this chapter If you have not used Sentences Version
30 or later you should also read Chapter 5 Working with Sentences Chapter 7
Sentences queries and Chapter 8 Sentences and XML Chapter 9 Sentences
diagrams
If you are an experienced application developer read the second part of Chapter 3
Sentences user interface design options You should then look at Chapter 6 Advanced
techniques Chapter 10 Customising Sentences and Chapter 11 Worked examples
You may also want to consult the Doc and Examples directories of your Sentences
installation for additional online information for developers
At the end of this guide there is an Appendices section which contains lists of menus and
commands information on server statistics and a Sentences glossary A copy of this
Users Guide and of the Sentences Tutorial are available as Adobe Acrobat PDF files in the
DocUser Documents directory of your Sentences installation An online Help system
and an online copy of the Tutorial are accessible from the Sentences Help menu
Document conventions
Sentencesrsquo product documentation uses the following phrases
bull Type in means to enter data with your keyboard
bull Press means press a key on your keyboard
bull Click means move your mouse pointer over a button or other item on the screen and
press once on the primary button on your mouse (usually the left button if you are right-
handed)
bull Double-click means move your mouse pointer over a button or other item on the screen
and press twice rapidly on the primary button on your mouse (usually the left button if
you are right-handed)
bull Right-click means move your mouse pointer over a button or other item on the screen and
press once on the secondary button on your mouse (usually the right button if you are
right-handed)
bull Shortcut menu means the pop-up context menu displayed when you right-click (click
with the secondary button) on an object
This document uses the following typographical conventions
20
Your comments
Overview
bull Names of menus commands dialogs and fixed elements in Sentences are shown in
boldface font For example
the All Types folder
the Expand node command on the View menu
the Properties toolbar button
bull Names of actual files and directories are shown in monospaced font For example
the Human resources datachap file
The monospaced font is also used for examples of batch file HTML XML javascript
and Java code and for commands to be entered at a command prompt
bull When a command line or a line of code in a batch file HTML file or Java file cannot be
displayed on one line in this book the symbol sect is used to indicate that the line has been
split for display in this book only You should type in the lines of code in this book as one
line in the file or command
bull All user-created schema and data elements in examples of the Sentences database
(association types entity types associations and entities) are shown in a sans serif font
The verb of an association type or association is shown in sans serif italics Nested
associations are enclosed in parentheses for greater clarity
For example
Person
Project
Person assigned to project
(Louise East assigned to Pisces) starting date 25th March 2000
The sans serif font is used for the data and schema items you create in examples of the
Sentences database and for error messages that are displayed in the Message Log
Your comments
We welcome your comments on this Users Guide Please let us know how it has helped
your work with Sentences or how you would like to see it improved in the future
Please email your comments to supportsentencescom
21
Sentences editions and components
Configuring Sentences
Chapter 1
Configuring Sentences
This chapter explains how to set-up and configure a Sentences installation It is
designed primarily for system administrators The topics covered in this chapter
include
bull licensing
bull configuring Sentences
bull shutting down and restarting the Sentences server
bull backing up and restoring your data
bull security considerations
bull servlet access to Sentences
bull uninstalling Sentences
For information on system requirements and installation procedures please see the
Sentences Installation Guide
Sentences editions and components
Sentences is available in an Enterprise Edition and in a Personal Edition The Enterprise
Edition has two software components a server and a client The server component (the
Sentences server) runs as a Java servlet under a Web Application Server The Web
Application Server must be running a compatible servlet container (previously known as a
servlet engine) in order to run the Sentences server You need to have the appropriate
level of authorisation for your system in order to install Sentences
The client component (the Sentences client or Sentences applet) runs as a Java applet
in a Web browser or as a Java Web Start application and communicates with the server
using HTTP over TCP IP It is also possible to configure Sentences to use the secure
HTTPS protocol
More information is available from supportsentencescom
You must install an appropriate version of the Java runtime Plug-in for your browser
either before running the Sentences client or when it is first run on each machine but
apart from this there is no installation on the client
You can run the Enterprise Edition in Web mode with the server and client on different
machines or in local mode with the server and client on the same physical machine (see
Running the Enterprise Edition on a single computer)
The Personal Edition is a stand-alone Java application that does not require a separate
server process The Personal Edition cannot communicate with other clients or servers
and is designed for evaluation use on one computer only It is not licensed for commercial
use of any kind
The Personal Edition can be downloaded from wwwsentencescom If you are using the
Personal Edition please make sure you read the Personal Edition Supplement which can be
found in the DocUserDocuments folder of your Sentences installation
Additional components
There are two additional optional components to the Sentences Server
22
Sentences licensing
Configuring Sentences
For information about the requirements and installation of each of these additional
components please see the Sentences Installation Guide For information about using each
of these components please see the separate guides provided in the
ltSentences_homegtDocUserDocuments directory
LazyView
The Sentences LazyView tool enables you to view external data alongside data from
Sentences chapters in one integrated view External data can include one or more
relational databases and MS-Excel spreadsheets
To enable the LazyView component you must have a suitable Sentences License
Application Suite
The Sentences Application Suite is a set of modular applications that introduce Sentences
features and showcase its potential The applications within the suite centre on core
business functions and use both the native Sentences Explorer interface and additional
custom HTML and applet interfaces
The Application Suite component is not installed by default It can be included during
installation by selecting the Custom install option
Sentences licensing
Sentences Enterprise Edition is supplied in accordance with a license agreement which
governs your use of the product Please see your license agreement for further details
The Sentences license file now is version-specific Only a Version 40 license will
activate Sentences Version 40 The license file contains the encrypted Initial System
Administrator password See System Administrator passwords for details
Sentences Personal Edition is distributed free of charge for evaluation purposes only The
Personal Edition is not licensed for any commercial use whatsoever You must have a
License file to run Sentences For more details see the Sentences Installation Guide
Personal Edition users should refer to the Personal Edition Supplement
Please see wwwsentencescom for more details about obtaining the Sentences Personal
Edition
Configuration files
Personal Edition environments
The Sentences Personal Edition runs as a Java application and does not require a separate
Web server The start-up properties for the Personal Edition are set in the
Serverproperties and Applicationproperties files For further information please
see the Personal Edition Supplement
The available memory default locale and locations of supporting libraries (for example
Java Database Connectivity libraries used in LazyView) are configured in the lazystartbat
or lazystartsh script See the section on Configuring server utilities for details as the same
file is used for starting the Personal Edition and running personal edition utilities such as
database backup data import and data export
Enterprise Edition evaluation and testing environments
The Sentences Version 40 installer installs the Tomcat Web server to host Sentences as a
Web application according to the guidelines of the Java Enterprise Edition specification
This is intended as a lightweight minimalist test server for evaluation and testing
To facilitate this Sentences 40 introduces a small desktop application ldquoSentences
Launcherrdquo This is intended for use as a Test environment rather than Production It
23
Configuration files
Configuring Sentences
allows you to start and stop the Tomcat Web Application Server and launch the Sentences
Explorer Client locally using Java Web Start or open the welcome html web page
It is also possible to run the Tomcat Web Server as a service on Windows or other
platforms More information is available from supportsentencescom
Tomcat memory configuration
By default the Tomcat Test server is set up to use a default of 512MB system memory
The amount of memory (Java Heap) can be changed in the Server properties dialog or by
editing the catalinabat catalinash file directly in the tomcat installation The file
is located under the Sentences installation directory
ltinstallation dirgtTomcat4bincatalinabat (or catalinash)
To modify the maximum memory allocated edit the file and alter the line
SET JAVA_OPTS=-Xmx512m ndashXms512m ndashXss1m ndashshowversion
The example shows 512 MB allocated to increase the available memory to 2GB you
would alter the line to read
SET JAVA_OPTS=-Xmx2048m ndashXms2048m ndashXss1m ndashshowversion
Tomcat locale configuration
By default the Tomcat Test server is set up to use the default locale of the machine it is
installed on To change the default locale that Tomcat (and Sentences) will use you can
add the following parameters
SET JAVA_OPTS=-Xmx512m ndashXms512m ndashXss1m ndashshowversion sect
-Dusercountry=ltcountry codegt sect
-Duserlanguage=ltlanguage codegt -Dusertimezone=lttimezone codegt
This should be entered on a single line
For example a user in Chicago might change the line to read
SET JAVA_OPTS=-Xmx512m ndashXms512m ndashXss1m ndashshowversion -Dusercountry=US sect
-Duserlanguage=en -Dusertimezone= AmericaChicago
Tomcat port configuration
The Sentences tomcat server is configured to listen for server requests (from the
Sentences applet to the Sentences servlet) on a specific port number and to listen for
shut- down requests on a different specific port number By default these port numbers
are 8090 and 8095 respectively During installation users who select the Custom
installation option can specify alternative port numbers to be used by the Sentences
server
If you need to change the port numbers used by the Sentences test server you must edit
the references to port numbers in specific files listed below If you have installed the
Applications Suite there are additional references that must be edited You must always
shut down the Sentences server before making any changes to the port numbers and
restart it afterwards for the changes to have effect
bull References to the shut-down port for all installations
References to the shut-down port number are in
ltSentences_homegtTomcat4confserverxml
bull References to the request listener port for all installations
References to the request listener port number are in
ltSentences_homegtTomcat4confserverxml
24
Configuration files
Configuring Sentences
bull Additional references to the request listener port for installations with the
Application Suite
Additional references to the request listener port number are in
ltSentences_homegtresourcescreateAppSuiteChaptersxml
ltSentences_homegtresourcescreateAppSuitexml
ltSentences_homegtTomcat4webappsIdeasWEB-INFwebxml
ltSentences_homegtTomcat4webappsCASWEB-INFwebxml
Security
When you first run the Sentences Launcher application you may be asked to confirm
some security checks depending upon your Operating System and system configuration
On Windows executing the Sentences Launcher application may invoke the User
Account Control mechanism that will prompt you to confirm running the application
On Windows executing the Sentences Launcher application may also invoke a dialog
from the Firewall program asking to grant access to the Java Runtime Environment
Enterprise Edition production environments
When installing Sentences into a production Web Application Server you will use the
Java Enterprise Edition standard Web Archive (WAR file) for the Sentences application
The Java Enterprise Edition standard enables convenient deployment of Web
Applications that are packaged into a single WAR file A default Sentenceswar file is
included in the Sentences installation
25
Configuration files
Configuring Sentences
A single environment entry included in the Sentences web application webxml file needs
to be configured to tell Sentences where to locate the Sentences Serverproperties file
For detailed information please see the Sentences Installation Guide All server
configuration is stored in the Serverproperties file See below for details This
environment entry can either be specified in the webxml file or set in your Web
Application Server Management Application
Other customisations of the WAR file may include
the addition of Java Database Connectivity libraries (JDBC jar files) for use with
LazyView
the addition of static or dynamic web application pages for a customised web
application that includes embedded Sentences applets
Web servers not using Java Enterprise standards
If you wish to install Sentences into a Web server that does not use the Java Enterprise
Edition standards you will need to create a directory structure that includes a
WebApplication directory and a Server directory under your ltSentences_homegt
location The web server needs to define a virtual directory that is set to this
WebApplication directory We recommend using the mapping name Sentences
The WebApplication directory needs to contain all the files that are accessed by the
Sentences client including those listed above under the webappsSentences directory
The Server directory needs to contain all the files that are accessed by the Sentences
server including those listed above under the webappsSentencesWEB-INF directory
It will need to be able to read the ldquoenvironment entryrdquo that specifies the location of the
Sentences Serverproperties file
Sentences installation directories
There are two separate locations for files in a Sentences installation program files and
data files You are prompted for these tow locations during installation
Prior to Sentences Version 40 Sentences Trace files were kept with the program files
These are now located by default along side the chapter data directory The Java process
running the Sentences server must have permission to create read and write files in both
the Chapters directory and the Trace directory
If the Trace directory does not exist the Java process running the Sentences server must
have permission to create it
The following list shows the directories created by the installation procedure for the
Sentences Enterprise Edition with descriptions of the directories and files which are
important for Sentences users The initial installation of Sentences includes all the
directories and files required for Tomcat 41 a J2EE compliant Web server An
exhaustive description of the directories and files required by Tomcat is beyond the scope
of this Users Guide
In this guide the term ltSentences_homegt refers to the main Sentences server program
installation directory This is the directory selected during installation and specified in the
InstallPath parameter in the Serverproperties file The default location for the
Sentences server installation directory on Windows platforms is CProgram FilesLazySentences40
The default location for the Sentences server installation directory on Unix or Linux
systems is usrlocalLazySentences40
26
Configuration files
Configuring Sentences
All the data files required by a default installation of Sentences including the files
required by optional components are in the ltSentences_datagt directory and its
subdirectories This directory is also specified during installation The default location for
ltSentences_datagt on Windows platforms is CSentencesData40
The default location for ltSentences_datagt on Unix Linux systems is usrlocalLazySentencesData40
The default locations for Sentences chapters (referred to in this guide as
ltSentences_chaptersgt) for Sentences images (referred to in this guide as
ltSentences_imagesgt) and for Sentences trace files (referred to in this guide as
ltSentences_tracegt) are subdirectories of ltSentences_datagt
The ltSentences_chaptersgt location is the first directory listed in the ChapterPathList
parameter in the Serverproperties file
bull ltSentences_chaptersgt
The default location for the Sentences chapters directory on Windows platforms is
CSentencesData40Chapters
The default location for the Sentences chapters directory on Unix Linux platforms is
usrlocalLazySentencesData40Chapters
During the installation procedure you can choose a different location for the chapters
parent directory You can specify additional directories for chapters in the
ChapterPathList and choose different directories for the SystemChapterPath and
TempChapterPath properties in the Serverproperties file (see The Serverproperties
file ) This directory is used by the Sentences server and is not accessed directly by Web
users Make sure that the file system security permissions for this directory are set so that
the Java process running the Sentences server is able to create read and write files within
the Chapters directory
By default the chapters directory contains the system chapters Metaschemachap
Schedulerchap and Profileschap which are used internally by Sentences and which
must not be changed The system chapter Profileschap has a special status in all
Sentences sessions as it is used to store profiles and other configuration data It must not
be used as a changes chapter for user updates
The Examples subdirectory of the chapters directory contains the chapter files for the
Human resources example application and further subdirectories containing chapter
files for the Application Suite examples if these are installed
bull ltSentences_tracegt
The default location for the Sentences trace file directory on Windows is CSentencesData40Trace
The default location for the Sentences images directory on Unix Linux platforms is usrlocalLazySentencesData40Trace
This is the physical location in which the server trace files are stored When diagnosing
any problems the trace files are useful in providing information on the server activity
The location is also used to store the outcome of LazyView activity when creating a
LazyView Mapping or updating the static data for a LazyView
This directory is the default location for any Sentences server trace files It is referenced
by the TracePath property in the Serverproperties file The file system security
permissions for this directory must allow the servlet container process create read and
write access to files within the directory If the trace directory does not exist the
Sentences servlet attempts to create it You must either create the directory manually or
27
Configuration files
Configuring Sentences
set the file system security permissions for the directory containing the trace directory to
allow the servlet process to create it
A trace file is created each time the Sentences server starts You can delete these files
manually when they are no longer required
bull ltSentences_imagesgt
The default location for the Sentences images directory on Windows is CSentencesData40Images
The default location for the Sentences images directory on Unix Linux platforms is
usrlocalLazySentencesData40Images
This is the physical location in which any images referenced in your Sentences database
can be stored This directory is used by the Web server to deliver images to clients and for
this reason it has a virtual directory mapping in Tomcat (ImagesforSentences)
bull ltSentences_homegt
This is the main Sentences program installation directory This directory contains server
administration scripts and batch files the Serverproperties file the Sentences license
file (SentencesLicensetxt) and the small application to facilitate the Tomcat Test
server
Server administration scripts include
Database backup and restore scripts
Chapter and Profile import and export scripts
XML data import and export scripts
Other diagnostic scripts
bull ltSentences_homegtDatatypes
This directory is the default location for any custom datatypes It is referenced by the
DatatypePath property in the Serverproperties file Any custom datatypes that are
compiled into Java archive (JAR) files which are placed in this directory are
automatically available to Sentences
bull ltSentences_homegtDoc
This directory contains extensive Sentences documentation for application developers and
users You can access detailed information on the Sentences API and also access the
Sentences Tutorial and Sentences Users Guide by opening the file indexhtml in your
Web browser
bull ltSentences_homegtExamplesChapters
This directory contains backup copies of the system chapter Profileschap and the
chapter files for the Human resources example application
bull ltSentences_homegtExamplescom
bull ltSentences_homegtExamplesCSVImport
bull ltSentences_homegtExamplesDerivations
bull ltSentences_homegtExamplesExistingDatatypes
bull ltSentences_homegtExamplesHTML
bull ltSentences_homegtExamplesJars
This group of subdirectories contains various files that are referred to in Chapter 11
Worked examples
The ExamplesExistingDatatypes subdirectory contains the source code for the
datatypes included in Sentences
28
Configuration files
Configuring Sentences
The ExamplesHTML directory contains examples of HTML pages for the Dataform applet
(see ldquoThe Dataform appletrdquo) the Picker applet (see ldquoThe Picker appletrdquo) and the Query
applet (see ldquoThe Query appletrdquo)
bull ltSentences_homegtLicences
This directory contains the text of the Sentences License Agreement
(SentencesLicenseAgreementtxt) and the text of the license agreements pertaining to
software produced by the Apache Software Foundation and included with Sentences The
Sentences License file that is needed to activate Sentences is not placed in this directory
but in ltSentences_homegt
bull ltSentences_homegtresources
This directory contains image resources javascript libraries and additional JAR files that
might be needed for a server process such as a JDBC library
This directory also contains the lazystartbat file and lazystartsh files These files
contain scripts for invoking the Sentences server-side utilities For more information see
The lazystart script filerdquo
This directory also contains script files that can be used to import the chapter and profile
definitions for the optional Sentences component Sentences Application Suite Usually
these chapter and profile definitions are created as part of the installation process
However if you install the Sentences server on the IBM i you need to run these scripts
You can also run these scripts if you have restored the default profiles database by
copying the Profileschap file from ltSentences_homegtExamplesChapters
bull ltSentences_homegtStylesheets
This directory contains sample XSL stylesheets used to transform XML data exported
from Sentences Additional XSL and XSLT files required for your Sentences applications
should be added to this location or to a sub-directory of it If you change the location of
the files in this directory you must update the StylesheetURLBase property in the
Serverproperties file For more information about XSL stylesheets in Sentences see
Chapter 8 Sentences and XML
If you have installed the Application Suite this directory also includes a subdirectory
named ApplicationSuite which contains the stylesheets used by the Application Suite
examples
bull ltSentences_homegtTomcat4
This directory contains all the files and directories required for the Tomcat Web server
which conforms to the Java Enterprise specifications Sentences and the Sentences
Application Suite examples are installed as web applications under this Tomcat server
bull ltSentences_homegtTomcat4webapps
This directory includes Web archive (WAR) files for Sentences and for the Application
Suite example programs If you wish to run Sentences with any other Java Enterprise
compliant Web server you can use the WAR files from this directory
The following paragraphs describe the sub-directory structure for Sentences The pattern
of sub-directories for each of the Application Suite examples are similar
bull ltSentences_homegtTomcat4webappsSentences
This is the top-level directory for Sentences It contains all the files that need to be
accessed by the Sentences client such as the Sentencesjar archive file and
launchhtml start page If you create any customised message files they must be put into
this directory as well as into the WEB-INFclasses sub- directory This directory contains
29
Configuration files
Configuring Sentences
the example Swiss German messages file Messages_de_CHproperties (see
Localisation notes )
If you create any customised Help topic HTML pages you must place them along with
the Help topics mapping file in this directory (see Adding custom Help topic pages )
This is also the parent directory for Sentences online Help and online Tutorial
bull ltSentences_homegtTomcat4webappsSentencesWEB-INF
This is the directory for all the files that need to be accessed by the Sentences server This
directory has two sub-directories classes for individual Java files and lib for Java
archive files
bull ltSentences_homegtTomcat4webappsSentencesWEB-INFclasses
This directory contains individual Java code class files that need to be accessed by the
Sentences server
If you create any customised message files they must be put into this directory as well as
into the webappsSentences parent directory This directory contains the example Swiss
German messages file Messages_de_CHproperties (see Localisation notes )
bull ltSentences_homegtTomcat4webappsSentencesWEB-INFlib
This directory contains compiled Java code archive files (JAR files) that need to be
accessed by the Sentences server These include the SentencesServerjar file and any
JDBC jar files to support LazyView chapters Older versions of Java may require the
XML parser libraries such as xalanjar xercesjar and xml-apisjar Or you may
wish to use different XML parser libraries in which case you include them here
bull ltSentences_homegtTriggers
This directory is the default location for any triggers It is referenced by the TriggerPath
property in the Serverproperties file Any triggers that are compiled into Java archive
(JAR) files which are placed in this directory are automatically available to Sentences
bull ltSentences_homegtUninstaller
This directory contains files used for uninstalling Sentences
Server properties
Sentences Server has many configurable properties that govern the available functionality
and the way it behaves These properties are stored in a file called Serverproperties in
the installation directory
Sentences 40 introduces the ability for a System Administrator to be able to edit most of
these properties from a Sentences Client (The JDBC configuration is not included To
change these the user will still have to manually edit the Serverproperties text file and
restart the server) Where applicable these properties are changed with immediate effect
This allows an Administrator more flexibility and removes the need to restart the server
for many properties For example the Administrator can change the level of trace file
logging temporarily to debug a production issue
Some properties cannot be changed without restarting the server These are indicated
below
To change the Server Properties follow these steps
1 Log into Sentences as a System Administrator
2 Select the Server Propertieshellip item from the File menu in the Sentences
Explorer
3 Modify the properties you wish to change and select OK or cancel
30
Configuration files
Configuring Sentences
Server Properties have been grouped into seven areas Installation Profile Security
Troubleshooting Email LazyView and Java Heap The last group concerns the amount
of memory allocated to Java Processes on the server
List entries should be separated by the path separator for this platform ie on
Windows or on Unix
Installation properties
All properties on the Installation tab are physical locations on the server and will not be
changed dynamically This is why a ldquolive valuerdquo is shown (if different from the currently
set value) The new value will only be used when the server is restarted
bull Chapter Path List
This property stores a list of locations for your Sentences chapters as fully-qualified
directory pathnames The entries in this list refer to the location you selected for
ltSentences_datagt during Sentences installation The default entries in this list are as
follows
ltSentences_datagtChapters (for user-created chapters)
ltSentences_datagtChaptersExamples (for the Human resources example chapters)
ltSentences_datagtChaptersExamplesApplicationSuite (for the Application Suite
example files - not listed if the Application Suite is not installed)
You can add additional locations for chapter files to this property setting by entering
fully-qualified pathnames Separate the entries with the appropriate delimiter character for
your system (a colon for UnixLinuxMac OS X and a semi-colon for Windows) If
you type in more than one location for this property then Sentences uses the first entry as
the default location
bull System Chapter Path
The location used to store the system chapters Metaschemachap Schedulerchap and
Profileschap If no location is given the first location in the Chapter Path List will be
used
bull Temporary Chapter Path
The location used to store temporary chapters such as query chapters If no location is
given the first location in the Chapter Path List will be used
bull Image Path
The location used to store relative images references for Image Datatypes This defaults to
a sibling folder next to the first chapter location
bull Backup Path
This property stores the location of the directory for any backup files created by the
Online Backup procedure (see Online backup )
bull Trace Path
The location used to store server trace files This defaults to a sibling folder next to the
first chapter location
bull Statistics Path
This property specifies the directory location in which statistics files are placed Statistics
files have the name format Statisticsxxxtxt (where xxx represents a timestamp)
31
Configuration files
Configuring Sentences
There is no default setting for this property If this property is not set statistics files are
not created
bull Trigger Path
The location used to store Java Archive files containing User defined Server Triggers
bull Datatype Path
The location used to store Java Archive files containing User defined Datatypes
bull Default Image URL Base
The server will use this Image URL Base when no other has been specified from the
client The XML Export process uses this Image URL base when automatically
generating XSL Stylesheets
bull Stylesheet URL Base
The location used to store XSL Stylesheets
bull Text Document Path
This property stores the location of textual documents that can be imported into
Sentences For example txt or pdf files The TextDocumentPath property will
default to a subdirectory called Text next to your first Chapters directory and Trace
directory
bull Install Path
This property stores the location of your Sentences directory The InstallPath property
is set from your response to the installation prompts This location is known as
ltSentences_homegt This property can only be modified by editing the
Serverproperties file directly
Profile properties
bull Profile Timeout
The inactive timeout period in seconds for opened profiles
bull Pending Timeout
The inactive timeout period in seconds for pending data results
bull Chapter Timeout
The time period in seconds after which an update will time out waiting to lock a chapter
bull Backup Timeout
The time period in seconds after which a backup process will time out waiting to lock a
chapter
bull Cache Size
The maximum amount of memory in megabytes to use to cache data from all chapter
files combined
bull Visibility Cache Limit
The maximum size of the visibility caches This is the sum of the known visible objects
known hidden objects and known committed transactions
bull New Chapter Block Size
The default blocksize in kilobytes to use for a new chapter
bull New Temp Chapter Block Size
32
Configuration files
Configuring Sentences
The default blocksize in kilobytes to use for a new temporary chapter
bull Minimum Transaction Memory
The amount of free memory in megabytes that a server update will insist on before
starting to carry out transaction updates
bull Statistics Poll Interval
This property specifies the time interval in seconds for which the number of server
requests is recorded The default setting for this property is 300
bull Hidden Request Buffer Size
The default buffer size used for hidden forwardinversedata request results when used in
derived type and derivation expressions This is used for very large databases
bull Maximum Effector Messages
The maximum number of messages generated by an Effector Query before we curtail
reporting to the client (to avoid overwhelming the client)
bull Maximum SMTP Emails
The maximum number of simple emails generated by an Effector Query
bull Preempt Interesting Associations For Large Databases
This property should be set to true for large databases where the process of determining
whether each instance has child associations is expensive Setting this property to true
will pre-emptively determine whether there are many triple pages to search (gt100) and if
so assume there are children Only when the user actually expands the instance do they
discover if it has child associations This property can only be modified by editing the
Serverproperties file directly
bull XML Parser Class
This property sets the class name of the XML parser used by Sentences when importing
XML documents whenever a parser other than the default is required The default parser
is orgapachexercesparserSAXParser
This property can only be modified by editing the Serverproperties file directly
Security properties
The Security properties do not include access flags for Servlets for the Personal Edition
bull Client Api Access
Grant access to user-written programs using the Sentences client API URL Pattern ApiServer
bull Statistics Access
Grant access to Sentences server statistics URL Pattern Statistics
bull Chapter Statistics Access
Grant access to Sentences chapter statistics URL Pattern Chapter
bull DTD Access
Grant access to Generation of XML DTDs URL Pattern DTD
bull XML Schema Access
Grant access to Generation of XML Schemas URL Pattern Schema
33
Configuration files
Configuring Sentences
bull XML Access
Grant access to XML output from a saved query URL Pattern XML
bull Import XML Access
Grant access to XML import using a saved query URL Pattern ImportXML
bull Backup Access
Grant access to Online Backup URL Pattern Backup
bull Anonymous Login allowed
Allow end users to log on anonymously as Public
bull Maximum login attempts before lockout
The maximum number of failed attempts an end user is allowed before the account is
locked
bull Minimum length of a password
The minimum length of a new password
bull Default User Roles
A list of the Roles to assign any new Users separated by semicolons
Troubleshooting properties
bull Maximum log size
The maximum size in megabytes of a log file (used for robust journaling) before it is
closed and a new file opened
bull Business Rules Disabled
Disable all Business Rules functionality
bull Debug Business Rules
Log detailed troubleshooting information for Business Rules
bull Disable Scheduler
Disable the Server Process Scheduler This does not prevent a user manually triggering a
process list to be run The Scheduler is enabled by default
bull Check Value Visibility
Values can have an additional check made to determine whether they should be visible If
they are not the target of an association then they can be hidden This check is very
expensive to perform and not required in most applications If it is required it can be
enabled with this property This additional check is disabled by default
bull Trace Level
Trace Level is a set of bit flags that determine which server events are logged to the server
trace file Simply add together the numbers for the types of tracing that you want to
appear in the file
Value Meaning
0 Only major events are logged
34
Configuration files
Configuring Sentences
Value Meaning
1 Profile operations are logged
2 A one-line summary of every request is logged
4 Requests from clients to update data are logged without the prior
requestresult pairs but including the results
8 Requests from clients to update data are logged including both prior
requestresult pairs and full results
16 All server update actions are logged whether they came directly from a
client or from some other server function provided that triggers are
being run
32 Requests from clients to read data are logged without their results
64 Data returned to clients is logged
128 Association checks made by the standard system rule are logged
256 A one-line summary of Client Parameters are logged This is only
available if a one-line summary is requested (2)
Email properties
bull SMTP Host
The host name or address of the SMTP server
bull SMTP Username
The username for the SMTP account
bull SMTP Password
The password for the SMTP account
bull Notify end user of SMTP failures
Notify the end user if there is a failure to send email
bull Valid From List
A List of valid email addresses that the server can send SMTP email from separated by
semi-colons
LazyView properties
The LazyView Properties are only displayed if the License File includes LazyView
functionality
bull Log SQL
Output the SQL being generated for LazyView
bull Multiline Text Threshold
The minimum size of Relational Text Column for which a Sentences text field is set to be
multi-line
35
Configuration files
Configuring Sentences
bull Cache Timeout
The time period in seconds after which a cached dynamic LazyView object will be
discarded and re-read A value of zero indicates cached objects will never timeout
bull Maximum result set cache size
The maximum number of open cursored results sets to hold against each RDBMS
bull Query Timeout
The time period in seconds after which a JDBC query times out and stops when browsing
data dynamically or executing a query in a dynamic LazyView profile
bull Import Timeout
The time period in seconds after which a JDBC query times out and stops during a static
LazyView data import
bull Dynamic Snapshot Limit
The maximum number of results to obtain in any dynamic request to an RDBMS Zero
indicates no limit For very large databases this significantly improves performance by
avoiding creating a cursor over a large result set Note Caution should be used with this
feature as any queries will also have their input limited to this amount which will lead to
incorrect aggregate values
bull Disable In Clause Optimisation
This flag indicates whether to disable the optimisation of Select statements that use an IN
clause to improve dynamic Lazy View performance This property can only be modified
by editing the Serverproperties file directly
Java heap properties
The Java Heap properties will only change when the server is restarted These properties
are convenient when using the Personal Edition or the Tomcat Test environment
If you have deployed Sentences to a Web Application Server then the Java Heap available
will be dependent on the settings of your Server The Server Process Java Heap value is
relevant for any server utility programs that are run when the Sentences Server is stopped
bull Tomcat Java Heap
The size in megabytes of memory to use for the main Sentences Server process running in
Tomcat If you are using Tomcat you can set how much Heap is available to the server
here If you are not using Tomcat then you will need to configure the memory allocation
in your chosen Servlet Container The Tomcat Java Heap property is not applicable to the
Personal Edition
bull Server Processes Java Heap
The Server Processes Heap Size is used when running other exclusive server processes
such as exporting a database This is also the value used by the Personal Edition
Specialist properties
There are several properties that are not accessible from the User Interface because they
make fundamental changes to the way that the system works or are rarely used but
important They are set by editing the Serverproperties file in the installation directory
when the server has been stopped
bull DataformLayoutSystem=[Sections|Pages]
36
Configuration files
Configuring Sentences
This property can be set to Sections or Pages and defaults to the former Page layout
was the original system by which fields were organised in Dataforms The more
sophisticated Sections Layout system replaces it If Pages have been used extensively in
an existing Sentences profile then this property allows the user to revert to that layout
system
bull ShowSetQueries=[true|false]
This property (which defaults to false) allows the Set Query functionality to be exposed
This would be useful when upgrading an existing profile that made use of Set queries
when converting them to request based queries
bull DisableDemandPagingQueryOptimisation=[true|false]
This property (which defaults to false) allows the system administrator to temporarily turn
off the demand paging optimisation for queries on large datasets
Virtual directories
When you install Sentences with the default Tomcat Web server Tomcat creates virtual
directories for two specific locations ltSentences_imagesgt (by default this is
SentencesData40Images) and for the Web application directory (by default this is
ltSentences_homegtTomcat4webappsSentences)
The jnlp files or javascript refer to the ltSentences_imagesgt location by using the
ImageURLBase parameter with the name the name ImagesForSentences (see About the
ImageURLBase parameter)
If you use Sentences with any Web server other than the default Tomcat Web server you
must create virtual directories on your Web server for these two locations Please refer to
the documentation for your Web server for instructions on how to do this
Note The documentation for some Web servers (for example the Apache HTTP server)
refer to virtual directories as aliases
If you want to allow users to access the Sentences Users Guide and Sentences Tutorial you
can also create a virtual directory for their location on the server which is
ltSentences_homegtDocUserDocuments
About the ImageURLBase parameter
The Sentences Enterprise Edition client is a Web-based application that does not use the
local file system This means that references to external files such as image files need to
be resolved to fully qualified (absolute) URLs
Image instances are defined in the Sentences database using a string representation of the
appropriate file name or URL Any full URL entered is referenced independently of the
ImageURLBase parameter Any non-URL file name entered is combined with the value of
ImageURLBase to create a full URL
As part of the Sentences initial installation the Images subdirectory created in the
ltSentences_datagt location you chose is automatically configured as a virtual directory
named ImagesForSentences The ImageURLBase parameter is set to refer to this virtual
directory
In general for the Enterprise Edition when the value of ImageURLBase starts with
images from the default location must be served by the same Web server which is serving
Sentences That Web server must serve the images in response to a request of the form
httplthostnameportnumbergtltImageURLBasegtltimage namegt where hostname and
portnumber are derived from the codebase from which the Sentences applet JAR file is
loaded
37
Configuration files
Configuring Sentences
Where ImageURLBase does not start with the default image location can be served by
any URL In this case images must be readable on the client using a URL of the form
ImageURLBaseimage name For the Enterprise Edition this kind of configuration typically
uses a second web server as the default image source and ImageURLBase takes the form
httpimageWebHost imageVirtualDirectory where imageWebHost is the host with
optional port specifier and imageVirtualDirectory is a logical name mapped by the
web server to the images directory
Support for configuring other environments
Lazysoft Technical Support maintains the list of currently supported configurations for
Sentences and can advise you on setting up your environment
For further information please contact supportsentencescom
Configuring server utilities
Server utility programs including database backup restore import and export all use a
common script to start lazystartbat or lasystartsh This enables the memory
allocation locale and supporting java libraries to be configured in one file
The lazystart script file
The ltSentences_homegtresources directory contains the lazystart script file (named
lazystartbat on Windows systems and lazystartsh on UnixLinus systems) This
file contains a script used for starting various Sentences server-side utilities such as
Import and Export which require explicitly specified Java classpaths The lazystart
script file uses variables to simplify the specification and modification of Java classpaths
If you want to change any of these variables you may edit the lazystart script file
Always use a plain text editor to edit the file and always save the file as plain text
The commands and variables listed in the file are as follows
bull SENTENCES_HOME
This variable stores the location of your Sentences home directory The default value is
taken from the location you selected when you installed Sentences
bull LAZY_JAVA_HOME
This variable stores the location of the Java home directory used by Sentences
The default value is taken from the Java Virtual Machine location you selected when you
installed Sentences
bull Classpath elements
This section is used to set the classpath used in the Java execution command Please see
the section Using the classpath argument below for more detailed information
The classpath setting includes the JAR files used by Sentences Enterprise Edition which
in the default installation of Sentences are in the
ltSentences_homegtTomcat4webappsSentencesWEB-INFclasses directory and they
are
SentencesServerjar
xalanjar
xercesjar
xml-apisjar
The JAR files used by Sentences Personal Edition are all in the ltSentences_homegt
directory and they are
SentencesPEjar
xalanjar
38
Configuration files
Configuring Sentences
xercesjar
xml-apisjar
If you move or delete any of these JAR files from the default installation of Sentences
with Tomcat you must edit this section of the lazystart script file to use the changed
paths
The script also includes several other mandatory jar files and then dynamically adds any
jar or zip file present in the resources directory This way you can include a java
library by simply placing it in the resources directory
bull JVM_OPTS
This property sets Java Virtual Machine options for server-side utilities such as the Java
memory parameters The memory parameters are in the format -Xmx512m ndashXms512m
where -Xmx specifies the maximum system memory that can eventually be used (shown
here with the example value 512m meaning 512MB) and -Xms specifies the initial amount
of memory to be allocated
The stack parameter is usually needed on the Windows operating system where the
default is not large enough for complex Sentences Schema The value of ndashXss1m is also
the default on Linux Unix systems and sspecifies a 1 MB stack
For more information refer to the appropriate Java documentation from Oracle If you
chose the Custom installation option the default settings are taken from the values you
specified during installation
By default Java will use the default locale of the machine it is installed on To change the
default locale that the utilities will use you can add the following parameters
SET JAVA_OPTS=-Xmx512m ndashXms512m ndashXss1m ndashshowversion sect
-Dusercountry=ltcountry codegt sect
-Duserlanguage=ltlanguage codegt -Dusertimezone=lttimezone codegt
This should be entered on a single line
For example a user in Chicago might change the line to read
SET JAVA_OPTS=-Xmx512m ndashXms512m ndashXss1m ndashshowversion -Dusercountry=US sect
-Duserlanguage=en sect
-Dusertimezone= AmericaChicago
The ndashshowversion parameter displays the version of java in the output
Using the classpath argument
The term classpath has two uses and this may cause some confusion CLASSPATH is an
operating system environment variable and -classpath (abbreviated -cp) is a command-
line argument for Java
bull -classpath (or -cp)
Whenever a Java program is run the Java Virtual Machine must find all the classes which
are required or the program fails Classes are found using the classpath which specifies a
list of JAR files and directories to be searched for class definitions
Oracle recommend setting a classpath on the Java command line using the -cp or -
classpath arguments and this recommendation is followed in the lazystart program
bull CLASSPATH
If a classpath is not supplied on the command line Java programs use the environment
variable CLASSPATH instead In some cases start programs for Java may include this
setting on the classpath used to run Sentences Loading some publicly available JAR files
can lead to the Sentences server failing to start depending on the installed JAR files and
on how the CLASSPATH for Sentences is determined (typically this is controlled by your
servlet container configuration) To avoid these problems Lazysoft recommends that the
39
Configuration files
Configuring Sentences
you should not set the system wide variable CLASSPATH for users who run the Sentences
server
Sentences client configuration
There are several Clients to the Sentences Server The Server provides several Java
Servlets for different purposes For example there is an XML servlet and an XMLSchema
servlet that can be accessed to provide a CrystalReports ldquoclientrdquo with XML data to be
rendered into a Crystal Report The XML servlet can also be used to transform the
retrieved data into html utilising any javascript libraries to render graphs tag clouds etc
Most clients however will be end users or power users requiring a rich user interface
Sentences provides several Java Applets that can be used embedded into html web pages
or used as stand-alone desktop applications using the Java Web Start technology
All Java Applets require the user to log in unless the applet parameters and server are set
up to allow anonymous access
Java Runtime Environment
Java Applets require a Java Runtime Environment to be installed on the client machine
This is available for a large range of platforms The Java Runtime installation also
includes Browser plugins that enable the browser to display java applets embedded in
web pages We recommend the latest version of the Java Runtime Environment be
installed on client machines
You can manually install the Java Runtime Environment from the Oracle Web site
appropriate to your browser and platform
httpjavacomendownloadtestjavajsp
By default the Sentences web application contains a welcome page that detects the
browser and operating system of the client and any installed JRE If the JRE is not
installed or requires upgrading to the minimum required version then the page will either
redirect the user or show instructions on how to install the latest JRE
If a suitable version of the JRE is installed and the browser plugin is enabled then the
welcome page includes a link to launch the Sentences client as a desktop application
Upon first launch a desktop shortcut will be created that can be used without the need for
a browser next time
If you have developed your own application and embedded Sentences applets into it then
you will have created a ldquohomerdquo page which can use the same detection of browser
platform and JRE to assist new users of your application
See the launchhtml webpage for an example of how to use the javascript library to
detect the browser platform and JRE in your own web pages and launch Sentences as a
desktop application See the DataformApplethtml webpage in the ExamplesHTML
installation directory for an example of how to use the javascript library to detect the
browser platform and JRE in your own web pages and embed Sentences applets in the
HTML
Java browser plugins
Please note that if you intend to use both the 32-bit and 64-bit versions of a browser then
you will need to install both versions of the Java Runtime Environment The 32-bit
version of a browser can only detect and use the 32-bit version of Java Runtime
Environment Similarly the 64-bit version of a browser can only detect and use the 64-bit
version of Java Runtime Environment
It is possible to disable Java plugins in each of the browsers and in the Java Control Panel
Different versions of JRE have different options for enabling and disabling these plugins
Please consult the Oracle website for details
40
Configuration files
Configuring Sentences
httpjavacomendownloadhelpenable_browserxml
Javascript helper library lazyDeployJavajs
Sentences includes a javascript library to assist in the detection of Java and both the
launching of a Java Web Start Sentences Application or the embedding of a Sentences
Applet in a web page
This javascript library has been adapted from the javaDeployjs library developed by
Sun Microsystems and Oracle
The javascript library can be used to detect whether a suitable version of Java is available
and if not then prompt the user to download and install one or if not possible then direct
them to the Oracle website The library means that you do not have to write separate code
for different Operating Systems 32-bit or 64-bit Operating systems or the many different
browser clients available All Enterprise environments can be dealt with A known
exception at the time of writing is Safari on Windows which cannot detect the Java
plugin
Applet configuration
When embedding a Sentences Applet into a web page the javascript library can be used
to write the appropriate html for the given browser
The javascript library must be referenced in the html usually in the ltheadgt section For
example
ltscript type=textjavascript src=resourceslazyDeployJavajsgtltscriptgt
In this example we use the JQuery javascript library to detect when the html document is
ready so that library must be referenced as well
ltscript type=textjavascript src=resourcesjquery-latestjsgtltscriptgt
You can use any javascript library you wish for this purpose The following script is an
example of an embedded Sentences Dataform Applet
41
Configuration files
Configuring Sentences
The final component needed in the html is the elemet that the java applet will be rendered
into The first parameter to the writeAppletHTML method ldquosentencesAppletrdquo is the id of
the element Below is part of the ltbodygt html that includes a div element with an id
sentencesApplet This can be any name you give but different applets on the same page
must have unique ids
The second parameter to the writeAppletHTML method is a list of general parameters to
define which of the Sentences Applets to render and what its size in the html it should be
The code property defines which Sentences Applet is displayed
bull Dataform applet
code lsquocomsentencesdataformDataformAppletclassrsquo
The Dataform applet displays a dataform for a single instance or a blank ldquocreaterdquo
dataform for the specified Entity Type in the specified Profile
bull Diagram applet
code lsquocomsentencesguidiagramDiagramAppletclassrsquo
The Diagram applet displays either a saved diagram the results of a query or a blank
diagram
bull Picker applet
code lsquocomsentencesguipickerPickerAppletclassrsquo
lth1gtEmployee Detailslth1gt
lth2gtBarney Norrislth2gt
ltdiv id=sentencesAppletgtltdivgt
ltpgt
The above is an example of a Dataform applet embedded within an HTML page
ltscript type=textjavascriptgt
$(document)ready(function()
deployJavawriteAppletHTML(sentencesApplet
Applet Parameters
codecomsentencesdataformDataformAppletclass
archiveSentencesjar
width700
height500
Application Specific parameters
ProfileHuman resources
EditOptiondata
FixedProfileno
LazyTypeEmployee
LazyInstanceBarney Norris
EnablePickersyes
SaveButtonTextSubmit changes
ImageURLBaseImagesForSentences
Bordernone
ColourwindowFFFFEE
ColourmenuFFFFEE
ColourmenuText000000
ColourtextText000000
ColourtextHighlight6666AA
ColourtextHighlightTextFFFFFF
ColourcontrolDDEEFF
ColourcontrolText000000
ColourcontrolHighlightFFFFFF
ColourcontrolLtHighlightAAAAAA
ColourcontrolShadowDDDDDD
ColourcontrolDkShadow555555
ColourscrollbarEEEEEE
)
)
ltscriptgt
42
Configuration files
Configuring Sentences
The Picker applet displays a list of instances for the user to viewedit in a dataform They
may also be able to create new instances
bull Query applet
code lsquocomsentencesdataformQueryParameterAppletclassrsquo
The Query applet displays a form to enter the parameters for a given query and then
displays the query results
bull Sentences Explorer applet
code lsquocomsentencesmainSentencesclassrsquo
This is the main applet for the Sentences Explorer Client
The third parameter to the writeAppletHTML method is a list of parameters specific to
each of these applets For more information on each of these see The Dataform applet
The Picker applet - and The Query applet An example of the Diagram applet is
included in the examplesHTML directory of the installation
The Sentences Explorer applet uses the following common applet parameters
Sentences applet parameters
bull Profile
The Profile parameter defines the default profile opened when the Sentences applet is
started You can change the value of this parameter to the name of the default profile for
your installation The name of the profile must not contain any special characters that
need to be represented by escape sequences in HTML If the Profile parameter is not
specified then Sentences will offer the user a list of profiles that they are allowed to open
The user can also cancel from this list and create a new profile to work with if allowed
bull FixedProfile
The FixedProfile parameter can have the values yes or no When the FixedProfile
parameter is set to yes the Open Profile Delete Profile and Edit Profile options in the
Explorer File menu are not available This creates a profile with limited database access
for end-users
Note You can restrict a users ability to change parts of the database by using a
combination of the FixedProfile and EditOption parameters and by specifying
changes chapters in the Edit Profile dialog (see Using the Edit Profile dialog )
Note If Sentences is deployed with Java Web Start technology the local JNLP file can be
edited and this parmeter could be altered so there are two other mechanisms for setting
this parameter on a per-user and per-roll basis See ldquoUsers and Rolesrdquo for details
bull EditOption
The EditOption parameter specifies what parts of the database can be edited by users
The possible values are schema query data and none
Parameter value Editing actions allowed
Schema allows the user to edit schema queries and data
Query allows the user to edit queries and data
Data allows the user to edit data
None no editing actions allowed
43
Configuration files
Configuring Sentences
The settings for this parameter are not case-sensitive If no setting is given for this
parameter the default setting is none The setting in the jnlp file or javascript supplied
with Sentences is schema
If the EditOption parameter is set to data or none users can create edit and execute
queries but they cannot save any changes they make to queries
Note If Sentences is deployed with Java Web Start technology the local JNLP file can be
edited and this parmeter could be altered so there are two other mechanisms for setting
this parameter on a per-user and per-roll basis See ldquoUsers and Rolesrdquo for details
bull FontSize
The FontSize parameter specifies the font size to use in the Sentences Explorer (default
11 for Windows) This is intended for use on large monitors with large resolution where
the text size may be too small for adequate viewing during for example a presentation
Font sizes larger than 16 are not recommended
bull ImageURLBase
The ImageURLBase parameter specifies the URL base for the location of image files This
can either be a full format URL (for example
httpwwwanywebsiteaddresscomImages) or a relative URL Whatever is specified
in this parameter is prefixed to the image file names to allow Sentences to locate and
display images By default this is ImagesForSentences which is a relative URL
referring to the Images subdirectory you chose during installation For further details
about this parameter (see About the ImageURLBase parameter)
Note You can add further parameters at this point in the code (see Additional optional
parameters)
Additional optional parameters
You can add any of the following parameters to your HTML script
bull ServletPort
The Sentences applet attempts to connect to the Sentences servlet using the host name and
port from which it was downloaded If the applet was downloaded from a URL that
included an explicit port number that port number is used for the servlet port If the
applet was downloaded from a URL that did not include an explicit port number the
servlet port defaults to 80 which is the default port for HTTP If the applet needs to
access the Sentences servlet on a different port you must specify that port number with
the ServletPort parameter See also Starting the Sentences client
bull ServletContext
The Sentences applet requires a servlet context to connect to the Sentences servlet The
servlet context is the part of the URL after the host name and port The default value is
Sentences If the Sentences servlet is configured on a different context this must be
specified using the ServletContext parameter for example
ltparam name=ServletContext value=servletgt
See also Starting the Sentences client
bull RequestSize
Sets the number of data items retrieved from the Sentences database for each request If
more items exist Sentences displays the More prompt in the data pane The default
value for RequestSize is 500
44
Configuration files
Configuring Sentences
bull LookandFeel
Sets the appearance of the Sentences client applet The possible settings are Default
Windows Metal Nimbus and Motif Not all of these possible settings are supported on
all platforms The supported settings depend on those supported by the version of Java
installed
bull UserText
This parameter specifies an optional text string that is added to transactions as userText
This can be referred to by triggers
bull ProfilesProfileVisible
This parameter determines whether the system profile Profiles is visible to users in the
Open Profiles dialog The possible values are Yes and No The default setting is No (see
The Profiles database and the Profiles profile)
Web Start Configuration
The Java Web Start technology uses a Java Network Launching Protocol (JNLP) file to
define how the Sentences Client is to be configured in a similar way to the way a Java
Applet is configured
One advantage of the JNLP configuration over HTML applet configuration is that it is
browser-independent Whilst the Sentences Server can be run with any version of Java
above Version 16 the client Web Start must use Version 7 to benefit fully from the
advantages of Web Start
The lazyDeployJavajs javascript library can be used to render the appropriate html for
the given browser and provide either a link that will launch the Sentences Explorer Client
as a Java Web Start application or instructions on how to install a suitable Java Runtime if
required
The lazyDeployJavajs javascript library must be referenced in the html usually in the
ltheadgt section For example
ltscript type=textjavascript src=resourceslazyDeployJavajsgtltscriptgt
In this example we use the JQuery javascript library to detect when the html document is
ready so that library must be referenced as well
ltscript type=textjavascript src=resourcesjquery-latestjsgtltscriptgt
You can use any javascript library you wish for this purpose The following script is an
example of creating a link (or Java installation instructions)
The final component needed in the html is the elemet that the java applet will be rendered
into The first parameter to the writeLaunchHTML method ldquolaunchInfordquo is the id of the
element Below is part of the ltbodygt html that includes a div element with an id of
launchInfo This can be any name you give but different elements linking to different
client configurations on the same page must have unique ids
ltscript type=textjavascriptgt
$(document)ready(function()
deployJavawriteLaunchHTML(launchInfo)
)
ltscriptgt
45
Configuration files
Configuring Sentences
ltjnlp href=sentjnlpgt
ltinformationgt
lttitlegtSentences Explorer 40lttitlegt
ltvendorgtLazysoft Ltdltvendorgt
lticon href=resourcessentencesgifgt
ltdescriptiongtSentences Enterprise Edition V40150EEltdescriptiongt
ltshortcut online=falsegt
ltdesktopgt
ltshortcutgt
ltinformationgt
ltupdate check=backgroundgt
ltresourcesgt
ltjava version=170+ href=httpjavasuncomproductsautodlj2se
java-vm-args=-Xss1mgt
ltjar href=Sentencesjar main=true download=eagergt
ltresourcesgt
ltapplet-desc
name=Sentences Explorer V40150EE
main-class=comsentencesmainSentencesgt
ltparam name=ServletProtocol value=httpgt
ltparam name=ServletPort value=8090gt
ltparam name=FixedProfile value=nogt
ltparam name=EditOption value=Schemagt
ltparam name=ImageURLBase value=ImagesForSentencesgt
ltapplet-descgt
ltsecuritygt
ltall-permissionsgt
ltsecuritygt
ltjnlpgt
If a suitable version of the Java Runtime Environment is available then the generated
URL link will use the broswer plugin to launch a Java Web Start application according to
the JNLP file ltsentences_homegtTomcat4webappsSentencessentjnlp
The jnlp file contains parameters to customise and configure the particular client
behaviour and defaults (see below) If you wish to set up several different jnlp files then
alternatives to the default can be passed in as a second parameter to the writeLaunchHTML
method
The following JNLP configuration file is the example that is installed to launch Sentences
with the default settings It is the file located at ltsentences_homegtTomcat4webappsSentencessentjnlp
The JNLP file has an XML format The items in bold will differ depending upon the
installation Here are details of its contents
The name of the file must be included in the root jnlp element as a href attribute
bull information
The information element is used to describe the Web Start Application These can be
customised for specific application requirements The icon and title are used when a
desktop shortcut is created
ltscript type=textjavascriptgt
$(document)ready(function()
deployJavawriteLaunchHTML(launchInfo myJNLPjnlp)
)
ltscriptgt
ltdiv class=headinggtSentences Explorer Clientltdivgt
ltdiv id=launchInfogt
ltpgt
46
User-defined parameters
Configuring Sentences
bull update
The update element is used to indicate the preferences for how application updates should
be handled by the JNLP Client The default is to check for a new version in the
background
bull resources
The resources element is used to indicate which version of the java runtime environment
is required and which Java archive files are needed to run the client For the Sentences
Client only the Sentencesjar file is required
The java-vm-args attribute is used to specify aguments for the client to use If more
memory or stack is required or a different locale it can be added here The default value
is -Xss1m
The memory parameters are in the format -Xmx512m ndashXms512m where -Xmx specifies the
maximum system memory that can eventually be used (shown here with the example
value 512m meaning 512MB) and -Xms specifies the initial amount of memory to be
allocated
The stack parameter is usually needed on the Windows operating system where the
default is not large enough for complex Sentences Schema The value of ndashXss1m is also
the default on Linux Unix systems and sspecifies a 1 MB stack
For more information refer to the appropriate Java documentation from Oracle If you
chose the Custom installation option the default settings are taken from the values you
specified during installation
By default Java will use the default locale of the machine it is installed on To change the
default locale that the utilities will use you can add the following parameters
-Dusercountry=ltcountry codegt
-Duserlanguage=ltlanguage codegt
-Dusertimezone=lttimezone codegt
For example a user in Chicago might use
-Dusercountry=US -Duserlanguage=en -Dusertimezone= AmericaChicago
bull applet-desc
The ltapplet-descgt xml element is used to describe the Sentences client defaults and
configuration These are the same as the applet parameters described in the ldquoSentences
applet parametersrdquo and ldquoAdditional optional parametersrdquo With the exception that the
main-class=rdquocomsentencesmainSentencesrdquo parameter is used in place of the code
lsquocomsentencesmainSentencesrsquo parameter
User-defined parameters
You can add your own parameters to the HTML startup pages for Sentences applets and
for servlet access These parameters can be referred to using the Client API triggers and
query expressions
These parameters can also be added to the Applicationproperties file for use with
Sentences Personal Edition
Format of user-defined parameters
The name and value of a user-defined parameter are specified in the same way as other
parameters in the JNLP file or javascript
When using a jnlp file the a user-defined parameter is defined as follows
ltparam name=ClientParameter1 value=UserParamName=UserParamValuegt
47
Monitoring server activity
Configuring Sentences
When using the javascript library a user-defined parameter is defined as follows
ClientParameter1rsquoUserParamName=UserParamValuersquo
The list of parameters are separated by commas
In the Sentences Personal Edition user-defined parameter is defined in the
Applicationproperties file on a single line as follows
ClientParameter1=UserParamName=UserParamValue
Pre-defined names
User-defined parameters use pre-defined names which must be in the form
ClientParameter1 ClientParameter2 and so on These names are not case-sensitive
and there is no practical limit to the number of parameters that can be added The pre-
defined parameter names must be used in sequence with no omissions For example if you
used the sequence of names ClientParameter1 ClientParameter2 ClientParameter4
only the first two entries would be recognised as ClientParameter3 is missing from this
sequence
User Parameters
The name part of the user parameter (UserParamName in the example above) is not case
sensitive Any characters except the equals sign (=) and the double quote () may be used
in parameter names
Sentences ignores any leading or trailing spaces in parameter names If any duplicate
parameter names are used Sentences processes the first one and ignores all the others
Missing values in user parameters are treated as null values
Referring to user-defined parameters
You can refer to user-defined parameters using the Sentences Client API triggers or
query expressions
User-defined parameters in the Client API
The Sentences Client API includes getClientParameter and setClientParameter
methods For more information on using the Sentences API see Sentences API overview
Note Detailed information for programmers about the Sentences API is available in the
online documentation installed with Sentences starting in the file
ltSentences_homegtDocapihtml The Javadoc files for the Sentences API can be found
in ltSentences_homegtDocjavadoc
User-defined parameters in triggers
A getClientParameter method is available to Sentences triggers For more information
on triggers see Triggers
User-defined parameters in query expressions
You can use the GetClientParameter method in query expressions For more details see
ldquoUsing user-defined parametersrdquo
Monitoring server activity
You can use the Sentences statistics servlet to monitor server activity For more
information see Appendix B ldquoStatistics and analysisrdquo
Shutting down and restarting the Sentences server
Sentences operates in three modes Sentences Personal Edition is a single-user desktop
application that you run and exit as any other desktop application
48
Configuring Sentences
Certain processes require exclusive access to the Sentences database You must shut
down the Sentences server before performing any of the following actions and restart the
server when the action is complete Certain processes require exclusive access to the
Sentences database You must shut down the Sentences server before performing any of
the following actions and restart the server when the action is complete
import a CSV file
export a profile
import a set of chapters
install a trigger or custom datatype
make changes to the Serverproperties file or Applicationproperties file
install a new SentencesLicensetxt license file
The steps required for shutting down and restarting the Sentences server vary with the
Sentences edition you are using as described in the table below
When you are usinghellip restart the server as followshellip
Sentences Personal Edition Shut down and restart the Sentences PersonalEdition
Sentences Enterprise Edition local
mode
Stop and restart the Sentences Web Application in
your Web Application Server If you are using Tomcat
you can use the Sentences Launcher application to
stop Tomcat You do not need to close the Sentences
client but if you do not you must refresh the profile
after you restart the server
Sentences Enterprise Edition Web
mode
make sure no users are connected to the Webserver
and then restart the Sentences web Application
Users should either close and restart the Sentences
client or refresh the profile
49
Backing up and restoring your data
Configuring Sentences
Backing up and restoring your data
It is always good practice to keep a backup copy of all your data The data in your
Sentences database is stored in chapter files which can be backed up in a number of
ways You should also back up the system chapter Profileschap which records
information about the profiles in your database and the Schedulerchap which contains
any scheduled server processes It is good practice to keep an independent record of the
profiles in your database and of the chapters used in each profile
Sentences offers you a number of ways to back up your Sentences database which are
explained in the following sections
Online backup
Online backup is not available in the Sentences Personal Edition
Online backup is a command line procedure that creates a backup file from all your
chapter files and profiles and uses journalling to maintain data integrity during the backup
procedure You can run online backup without the need to shut down the Sentences
server Online backup may be initiated by automated procedures
Online backup preserves the complete record of all the updates made to your chapters
When you restore your data from an online backup the resulting chapters are exact
duplicates of the original chapters
You can run online backup from any system that can communicate with your Sentences
server using HTTP If you wish to limit access to running the backup program you must
use the security mechanisms of your Web server to do so
The backup client communicates with a Backup servlet on the server With the default
installation of Sentences using Tomcat this servlet has the servlet name Backup and is
accessed locally using the URL httplocalhost8090SentencesBackup (see
Servlet access to Sentences ) When using any other Web server installation the
administrator must configure the Backup servlet in the same way as all other sentences
servlets The classname of the backup servlet is comsentencesbackupBackupServlet
The backup command script file (Backupbat on Windows or Backupsh on Linux
Unix) in the Sentences installation directory assumes that the command is being executed
on the same machine as the server and that the default Sentences configuration is being
used and uses the URL httplocalhost8090SentencesBackup to connect to the
servlet
Note If you chose Custom installation when you installed Sentences and specified a
different port number for Tomcat HTTP access then that port number is used rather than
8090
If you have installed Sentences into another Web server you need to edit the Backupbat
or Backup shell script to set the -url parameter to the appropriate value
Preparing to run online backup
Before you can run online backup you must verify or edit two settings in the
Serverproperties file
You must define the destination for the backup files in the BackupPath
parameter This path cannot be changed when the procedure is run By default
this parameter is not set
You must ensure that access has been granted to the Backup servlet in the
servlets section the appropriate entry must read BackupAccess=true
50
Backing up and restoring your data
Configuring Sentences
This is the default setting
For more details see The Serverproperties file
Using the online backup command
The Sentences server must be running when you run the online backup command
To perform an online backup open a command prompt navigate to the Sentences
installation directory and run the supplied script file On Windows systems this file is
named Backupbat and on Unix Linux systems the file is named Backupsh
You may specify a name for the backup by entering it after the command as follows Backup [-name backupname]
where backupname is an optional name used for the two files created by the backup
operation the backup file (with the extension bkp) and the journal file (with the extension
jnl)
For example if you specify the name mybackup the files created are named
mybackupbkp and mybackupjnl
If you do not specify a name the backup files are identified by a name indicating the date
and time of the backup For example if you started a back up on 15th March 2002 at
113023 the files created are named 20020315113023bkp and 20020315113023jnl
The backup operation copies all the Sentences chapter files including the system files
Profileschap and Schedulerchap The backup process copies each file in turn to the
backup file and records any changes to files that take place during the backup process to
the journal file This ensures that the combination of the backup file and the journal file
represent an accurate record of your database at the end of the backup process
Restoring your data from an online backup
You need to have exclusive access to the Sentences server when you restore from an
online backup
To restore from an online backup open a command prompt navigate to the Sentences
installation directory and run the supplied script file On Windows systems this file is
named Restorebat and on Unix Linux systems the file is named Restoresh
The following commands are available
bull Restore -display
This produces a summary of the backup file sets that are available
bull Restore -display [backupname]
This displays the details of the backup file set with the name you specify including the
name of the server the date when the backup was made and a list of chapters and their
locations
bull Restore [-overwrite] backupname
This starts the restore process with the given backup name If the restore involves
overwriting any existing chapters (other than the profile chapter) then the procedure
displays a list of the affected files and does not perform the restore You must use the -
overwrite switch to force the procedure to overwrite files
If your installation uses multiple locations for chapter files all the locations must be
available when you run the restore process If the original locations for some files are not
available during restore copies of these files are created in available locations The
resulting files are exact duplicates of existing chapter files When all your locations later
51
Using trace files
Configuring Sentences
become available Sentences is unable to start because of these duplicate chapter files (see
Error 1267 The Sentences database is not available )
Exporting the database for backup
You can back up your data by exporting the database An exported database can later be
imported into Sentences For further details and restrictions on using export for backup
see the section Exporting and importing databases The Sentences server must be shut
down before you can export the database
Copying chapters for backup
You can back up your data by copying chapter files If you want to use a copied chapter
file in a different Sentences installation you need to create or edit a profile to use the
chapter Chapter files should not be copied while the Sentences server is running If the
server is not shut down the integrity of the copied files is not guaranteed For further
details and restrictions on copying chapters for backup see the section Deploying profiles
and chapters
Using trace files
Sentences trace files store server activity information They often contain valuable
diagnostic information that can be used to establish where an error occurred particularly
where a problem exists in client-server communication (see Errors reported at the
Sentences client )
The TraceLevel variable in the Serverproperties file determines which activities
generate messages to the trace file The basic settings are shown below
Value Meaning
0 Only major events are traced
1 Profile operations are traced
2 A one-line summary of every request is logged
4 Requests from clients to update data are logged withoutthe prior
requestresult pairs but including the results
8 Requests from clients to update data are logged including both prior
requestresult pairs and full results
16
All server update actions are logged whether they came directly from a
client or from some other server function provided that triggers are
being run
32 Requests from clients to read data are logged without their results
64 Data returned to clients is logged
128 Association checks made by the standard system rule are logged
256
A one-line summary of Client Parameters is logged This is only
available if a one-line summary of every request is logged (trace level
2)
The trace levels can be used independently or in combination simply by adding together
their numeric values for use as the server trace level
The default setting for TraceLevel is 0 (zero) which is appropriate for general use An
effective setting for monitoring server activity in more detail is 23
When TraceLevel is set above zero the size of the trace files can grow rapidly so you
must ensure that there is always enough disk space for trace file usage
Every time you start the server a new trace file is created Trace files are named
trace_nnnnntxt where nnnnn is a positive integer 12 or 13 digits in length for
example
52
Running the Sentences client
Configuring Sentences
trace_938079391280txt
The integer value used is the elapsed time in milliseconds since the Java system epoch
(midnight GMT 1st January 1970)
Sentences log files
Sentences creates a log file for every open chapter in the same directory as the chapter
file Sentences writes information about changes in a chapter file to the log file before
data changes are made to the chapter file This allows Sentences to maintain the integrity
of the chapter file You must not delete Sentences log files
Every time that a sequence of chapter actions that makes up a transaction iscompleted
Sentences ensures that the chapter file is written to disk which enables the size of the log
file to be reduced If the size of the log file reaches the limit set by the optional
MaxLogSize property in the Serverproperties file the chapter file is immediately
written to disk and the log file is truncated This means that very long transactions such as
those created by the CSV Import program can be handled without requiring excessive
amounts of disk space for the log file
When the chapter file is closed normally the log file is removed If Sentences terminates
unexpectedly then the next time that Sentences is started the log file is used to ensure the
integrity of the chapter file contents If Sentences terminated unexpectedly because of a
lack of disk space you must make more disk space available so that the chapter file can
be recovered correctly
The log file name is generated by removing the chap suffix from the chapter file name
and adding a log suffix instead Log files are binary files and cannot be read directly The
Sentences administrator must make sure that there is enough disk space available for
these files
Running the Sentences client
There are several possible Clients for the Sentences Server The Server provides several
Java Servlets for different purposes For example there is an XML servlet and an
XMLSchema servlet that can be accessed to provide a CrystalReports ldquoclientrdquo with XML
data to be rendered into a Crystal Report The XML servlet can also be used to transform
the retrieved data into html utilising any javascript libraries to render graphs tag clouds
etc
Most clients however will be end users or power users requiring a rich user interface
Sentences provides several Java Applets that can be used embedded into html web pages
or used as stand-alone desktop applications using the Java Web Start technology If a Java
Web Start application is used then a desktop shortcut can be created for subsequent
launching of Sentences client independently from a browser
All Java Applets require the user to log in unless the applet parameters and server are set
up to allow anonymous access
No installation is required on a client computer other than the Java Runtime Environment
This includes the Java Plug-ins that browsers use to display the applet embedded in an
html page
Starting the Sentences client
The default Tomcat test server installation of Sentences and the default Web Archive file
for deployment to a Web Application Server are both configured with a ldquowelcomerdquo html
page launchhtml
To open this page start your Web browser and navigate to the root context of the
Sentences web application The address of your server depends on your configuration
53
Running the Sentences client
Configuring Sentences
If you are running Sentences Enterprise Edition in local mode (with the client and server
running on the same computer) the default address is
httplocalhost8090Sentences
This will be automatically redirected to the welcome page at
httplocalhost8090Sentenceslaunchhtml
If you are running the Sentences Enterprise Edition in Web mode (with the client and
server running on different computers) the default address depends on your system
configuration You need to know the following details of how your systems Web server
has been configured
The hostname (or IP address or networked server name) of the Web server
The port your Web server is listening on for Sentences HTTP connections
The servlet context for Sentences on your Web server
For example the Tomcat Web server as configured by the Sentences installer uses the
name Sentences as the servlet context and is configured to listen for Sentences requests
on port 8090
If you wish to identify the Sentences server by its IP address you would specify the
address in the URL For example if the IP address is 123123123123 the URL for
accessing Sentences would be
http1231231231238090Sentences
If the Sentences server you wish to specify is a computer named myserver on a local
network the URL for accessing Sentences would be
httpmyserver8090Sentences
If the Sentences server you wish to specify is a computer named servermyispcom on a
distant network the URL for accessing Sentences would be
httpservermyispcom8090Sentences
All of the above assumes that the Web server for Sentences is listening on port 8090
which is the default port with which Tomcat is installed If the default HTTP port of 80 is
used the port number (8090 in the examples above) does not need to be specified See
ldquoAdditional optional parametersrdquo for details of how to configure the ServletPort and
ServletContext parameters for the Sentences client
Java Runtime Environment Plug-in
Before you can run the Sentences client you must have the Java Standard Edition
Runtime Environment (JRE) installed and enabled
The launchhtml page uses a javascript library to detect whether the client machine has a
suitable JRE installed It will be able to automatically install or upgrade the JRE version
or give the user instructions on how to do this
If the client machine has a suitable JRE then a link will be provided to launch the
Sentences client using Java Web Start technology This will install a shortcut to the
desktop for future use without a browser This does not prevent the user from using the
link each time if they wish
Security and certificate acceptance
Application digital certificates
The Sentences Personal Edition and the Sentences Test Server application are both
digitally signed to authenticate that the software is genuinely from Lazysoft Ltd
54
Running the Sentences client
Configuring Sentences
On Windows the User Account Control mechanism may prompt you to confirm running
the application You may also be asked to confirm access through the firewall to the Java
Runtime Environment
Java Applet Security
The first time you access a Sentences client either as an applet or an application you must
accept the digital certificate for Sentences The Java Runtime Environment (JRE) displays
a warning dialog You will be asked to confirm that you wish to run the application
Depending upon the Operating System you may be offered the ability to ldquoAlways trust
content from this publisherrdquo which we recommend so that you are not asked to confirm
each time you run the application
Using the Java Console tool
Useful debugging information is displayed in the Java console tool
Activating the Java Console on Windows systems
To display the Java console tool each time you start Sentences start the Java Control
Panel from the Windows Control Panel The Advanced tab expand the Java Console
item and select Show console Click OK or Apply The next time you start Sentences in a
browser the separate Java Console messages window is displayed
Activating the Java Console on Unix Linux systems
You can display the Java Console on Unix Linux systems by entering a command at a
shell prompt or by entering a URL in a Web browser
Using a shell prompt type in the following command
usrjavabinControlPanel
where usrjava is the directory in which the JRE is installed
With a web browser use the following URL
fileusrjavaControlPanelhtml
where usrjava is the directory in which the JRE is installed
Errors reported at the Sentences client
If the connection between the Sentences server and the Sentences client is temporarily
interrupted or if the Sentences server is not readily available the client cannot
communicate properly with the server and Sentences displays an error message in the
client Message Log The most common messages are described below
Error 1222 Your server connection has expired
This error message continues Please select the Refresh command from the File menu to
continue
Sentences displays this message when the ProfileTimeout or PendingTimeout limit
configured in the Serverproperties file has been passed or when the Sentences server
has been stopped and restarted while a Dataform remained open on a client and an
attempt to save the data on an open Dataform fails
After you select the Refresh command you must re-enter any data that was on an open
Dataform
Error 1265 The Sentences server has not been found
This error message continues Please contact your administrator If you receive this
message at a Sentences client you should contact the person in your organisation who is
responsible for running the Sentences server and report this error
55
Running the Sentences client
Configuring Sentences
This message is displayed when the Sentences server cannot be found It usually means
that the server has been shutdown
If this message is displayed you must restart the Sentences server and select the Refresh
before continuing to work with Sentences (see ldquo Shutting down and restarting the
Sentences serverrdquo)
Error 1266 The Sentences server has not been found
This error message continues Please contact your administrator If you receive this
message at a Sentences client you should contact the person in your organisation who is
responsible for running the Sentences server and report this error
This message is displayed when the Sentences Servlet has not been configured correctly
for example an entry for MainServer does not exist in the webxml file
If this message is displayed you must check your servlet configuration settings (see
ldquoSentences servlets and web server securityrdquo) and then restart the Sentences server (see
ldquoShutting down and restarting the Sentences serverrdquo)
Error 1267 The Sentences database is not available
This error message continues Please contact your administrator If you receive this
message at a Sentences client you should contact the person in your organisation who is
responsible for running the Sentences server and report this error
This message is displayed when the Sentences servlet cannot start correctly The most
common causes of this error are that the Sentences servlet has stopped without shutting
down correctly or that the Sentences server has detected two or more chapter files with
the same internal identifier In both of these cases you cannot start Sentences and you
must check the trace file for more details
Sentences not shut down correctly
When a user opens a profile that uses one or more chapters on a particular file server
Sentences creates a databaselock file in each Chapters directory This file is deleted
automatically only when the Sentences server that created it is shut down If the server is
not shut down correctly the databaselock file remains and you cannot start the server
If the Sentences server has detected a databaselock file the trace file displays information
similar to the following
gtgtgtgtgt Servlet initialization error ltltltltlt
comsentencesapiexceptionsLazyServerConflictException 10016 A lock file
(databaselock) already exists in the Chapters directory CSentencesData40
Another Sentences server process or stand-alone process may be using this
database Check for other running processes If there are none remove the lock
file from your Chapters directory and re-start
If you see this trace file message you should shut down the Sentences server and then
check the chapters directory to see if a file named databaselock is present If you have
specified more than one location for your chapter files you must make sure that you
search all of the possible locations
Note A file named databaselock is always present while the Sentences server is
running
The Sentences backup command may also report the error 10016 shown above This
means that the backup process has found a databaselock file in the chapters directory
specified in the error message This error may occur even if the databaselock file is in a
chapters directory not used for the applications you are backing up
If you find one or more databaselock files present when the Sentences server is not
running you should delete them and then restart the Sentences servlet (see ldquoShutting
56
Running the Sentences client
Configuring Sentences
down and restarting the Sentences serverrdquo) You may also need to consult the
documentation for your Web server and your servlet container You must not delete a
databaselock file while the Sentences server is running
You can determine the validity of a databaselock file by checking the timestamp
indicating when the file was created If the files timestamp shows that it was created
before the last time you re-started Sentences then it can safely be deleted
Duplicate chapter files
This error is also displayed when the Sentences server detects duplicate chapter files
Duplicate files usually have different system names but are recognised as duplicates
because they have the same internal identifier
If the Sentences server has detected two or more chapter files with the same internal
identifier these files are listed in the trace file The trace file displays information similar
to the following
gtgtgtgtgt Servlet initialization error ltltltltlt
comsentencesapiexceptionsLazyDBException 10189 The chapters
CSentencesData40Human resources datachap and CSentencesData40Human
resources databchap are duplicates
Error 1268 The Sentences database is not available
This error message continues Please contact your administrator If you receive this
message you should contact the person in your organisation who is responsible for
running the Sentences server and report this error
This message is displayed when there has been an attempt to access functionality that has
been disabled in the Serverproperties file For example if you have disabled access to
XML output by setting XMLAccess=false in the Serverproperties file this message is
returned if you attempt XML access In addition the trace file contains a message such as
Access to XML is forbidden
Error 1272 A connection error has occurred
This error message continues Please contact your administrator quoting the code
[codenumber] If you receive this message at a Sentences client you should contact the
person in your organisation who is responsible for running the Sentences server and
report this error quoting the code number displayed
This message is displayed when a client-server connection problem other than those
specified by errors 1265 1266 1267 or 1268 occurs The code quoted is a HTTP
response code that describes the error that has occurred HTTP error codes are widely
documented including on a number of Web sites and administrators should check this
documentation for help in identifying the cause of the problem
This error is also displayed at the client if the SentencesLicensetxt file is missing or
corrupted
Contacting Technical Support
If the recovery information given for the error messages listed above does not resolve
your problem or if you receive a different error message you should contact
supportsentencescom
Before contacting Technical Support please review the configuration information in this
chapter and make sure you have access to the following files
Serverproperties launchhtml
senthtml
and that you also have access to any trace files
57
Security considerations
Configuring Sentences
Security considerations
You should be aware of the security implications of running applications over the Web or
over internal systems using Web communications protocols There are a number of ways
in which Sentences helps you to minimise any security risks These include an automatic
check of the HTML page host using different profiles for different users and limiting
access to Sentences servlets Security considerations for servlets are discussed in
ldquoSentences servlets and web server securityrdquo You can also set passwords to protect
chapter files (see ldquo Password-protected chapter filesrdquo)
Automatic check of HTML page host
To enhance the security of Web-based access to the Sentences server Sentences
automatically checks that the web page has been loaded from the same server as the
Sentences applet used by the client
Error 1403 The Sentences client must be loaded from the same host
as its HTML page
This error message is displayed if Sentences finds that the web page has not been loaded
from the server on which the Sentences servlet is running
Using database views for enhanced security
An additional level of security is afforded by changing the combination of chapters in
different profiles as described in Creating database views using profiles and chaptersrdquo
You can create different html start pages for different users or groups of users to open
different profiles and each would have the FixedProfile parameter set to True This
would prevent users from accessing a profile they were not entitled to use
In addition you can use the security features of your operating system or web server (or
both) to limit user access to each of these html files by granting or denying
permissions or by requiring a password
Sentences user security reference
This section gives reference information that may be useful for system designers system
administrators and user administrators
Version 40 of Sentences introduces a User Security Model Whilst those familiar with
User Security will be familiar with the terminology used there are several subtle
differences between User Security partially defined by SQL standards and those in
Sentences
Sentences uses a Role based system where Users are granted abilities through Built-in and
Custom Roles Privileges are granted to Roles not Users Users are given Roles This
abstraction makes the maintenance of Users easier and more efficient
Users and roles
There is only one built-in User in the system System Administrator is the only user who
has the ability to perform any function There is only one System Administrator and
System Administrator privileges cannot be granted to any other user
User Entities have the names used to authenticate with The also have the following
associations
bull (User display name Text)
This is the name displayed in the client rather than the username used to log in with
58
Sentences user security reference
Configuring Sentences
bull (User password Password)
bull (User locked Yes)
Whether the user has been locked out This can be either because of too many incorrect
login attempts or set manually by a User Administrator
bull (User last profile Profile)
The last profile used by the user is stored for use next time they use Sentences If the
client does not specify a default profile then the last profile used by the user is loaded
bull (User force password change Yes)
When creating a new User or resetting the User they are automatically forced to change
their newly assigned password The User Administrator can manually set or unset this
association
Associations inherited from Role
bull (Role role Role)
Any number of Roles can be assigned to the User As Roles can be assigned to other
Roles hierarchies of Roles can be created
bull (Role description Role)
Each Role can be given a description Users inherit this association which can then be
used if the User represents an Application rather than an individual
bull (Role fixed profile Profile)
Each Role can specify a profile which is the only profile that is available to the users with
that Role They will not be prompted to choose a profile and their Sentences Explorer will
not include menu items to change edit create or delete profiles
bull (Role edit option Edit Option)
Each Role can be given an Edit Option
The edit option specifies what parts of the database can be edited by users The possible
values are Schema Query Data and None
The settings for this parameter are not case-sensitive If no setting is given for this
parameter the default setting is Schema
If the edit option is set to Data or None users can create edit and execute queries but
they cannot save any changes they make to queries
The built-in Roles are
bull Profile Editor
A Profile Editor can view create drop and alter any Profile
bull Chapter Editor
A Chapter Editor can view create and alter any Chapter
Edit Option Editing actions allowed
Schema allows the user to edit schema queries and data
Query allows the user to edit queries and data
Data allows the user to edit data
None no editing actions allowed
59
Sentences user security reference
Configuring Sentences
bull Schema Editor
A Schema Editor can create drop and alter any Type or Query
bull Data Editor
A Data Editor can insert delete and update any Instances
bull Sandbox User
A Sandbox User can use the Sentences Sandbox functionality for testing purposes
bull Scheduler
A Scheduler User can manage server processes to be run at scheduled times and dates
bull Transaction Visibility User
A Transaction Visibility User can set a Timestamp that determines the visibility of
committed transactions
bull User Administrator
The User Administrator Role allows access to Manage Users and Roles
When new Users are created they are assigned a default set of Roles These defaults can
be customised See the User Security Reference section for details
Only the System Administrator or User Administrators (Users with the User
Administrator Role) can Administer Users This is done either by opening the Profiles
Profile or from the File menu by selecting Administer Usershellip
bull Public
The Public Role allows anonymous access to Sentences
Anonymous access to Sentences
By default Sentences requires users to authenticate themselves with a user name and
password in order to use the system There is however a mechanism available to allow
anonymous login This has to be enabled on the server before any requests by a client will
be granted See the User Security Reference section for details of how to enable
anonymous login on the server
Each client needs to specify the anonymous login as a parameter See the Client
properties section for details
If a client has requested anonymous login and the server is set to allow it then the user
will automatically be logged in with the role of Public The privileges assigned to Public
can be changed in the same way as any other Role
Creating a new role
It is likely that you will wish to create several roles for groups of Users to give them
access to one or more Sentences Profile The access may be read-only or grant them the
ability to make data or schema updates
Roles can be organised into a hierarchy so that basic abilities can be layered and built up
To create a new Role follow these steps
1 In the Sentences Explorer select Administer Users hellip from the File menu
If the menu option is disabled this could be because you have editors open All
editors must be closed before you can change to the Profiles Profile where Users
are administered
The menu item will also be disabled if you are not logged in as a user with the
User Administrator Role
60
Sentences user security reference
Configuring Sentences
2 Once the Profiles Profile has open select the Role Entity Type in the schema
pane and open a Dataform by selecting Default Dataform from the View menu
3 You must enter a Name for the Role
4 You may optionally add any other Roles that you wish this Role to inherit from
5 You may optionally enter a description for this Role
6 You may optionally enter preferences for this Role
7 You may optionally select an Edit Option and Fixed Profile for this Role
8 Select the Privileges tab
9 You may add individual profiles or select All Profiles to the View profile list
10 You may select whether or not users with this role can create or drop (delete)
profiles
11 You may add individual profiles or select All Profiles to the Alter profile list
12 You may select whether or not users with this role can create chapters
13 You may add individual chapters or select All Chapters to the Alter Chapter list
14 You may select whether or not users with this role can use the Transaction
Visibility functionality
15 You may select whether or not users with this role can use the Sandbox
functionality
16 To set schema and data privileges on one of the Profiles from the View profile
list (including the All Profiles item) select it and either double click it to open its
child dataform
61
Sentences user security reference
Configuring Sentences
17 The first page of the child dataform is for Schema Privileges You may select
whether the user can create and drop types
18 You can add individual types to the list of types that can be altered This includes
two built-in items for All Entity Types and All Association Types
19 You may select whether the user can create and drop queries
20 You can add individual queries to the list of queries that can be altered This
includes the built-in item for All Queries
62
Sentences user security reference
Configuring Sentences
21 The second page of the child dataform is for Instance Privileges
22 There are three lists for granting permission to Insert Delete and Update
individual instances or you can select the built-in item All Instances
23 Apply and close the child dataform and save the New Role Dataform
Creating a new user
To create a new User follow these steps
1 In the Sentences Explorer select Administer Users hellip from the File menu
If the menu option is disabled this could be because you have editors open All
editors must be closed before you can change to the Profiles Profile where Users
are administered
The menu item will also be disabled if you are not logged in as a user with the
User Administrator Role
2 Once the Profiles Profile has open select the User Entity Type in the schema
pane and open a Dataform by selecting Default Dataform from the View menu
3 You must enter the identifier that the user will use to log in into the User field
Note that this is different to the name displayed in Sentences
4 The default Roles assigned to new users will be displayed You can add or
remove any roles for this user
5 If this user represents an application you may enter a description
6 The privileges tab is the same as for Roles It is possible to define specific
privileges here but usually privileges are assigned via the role(s) that are
assigned to the user See the previous section for how to assign individual
privileges
7 Select the User tab
8 You must enter a display name for the user
9 All other properties can be left with their default values
10 Select save to save the new user
11 Once you save the user a dialog will open for you to enter the initial password
for that user This will be a one-time password and the user will be forced to
change it when they first log in
63
Sentences user security reference
Configuring Sentences
12 You may choose to generate a random password by selecting the Generate
Random button
13 Ensure that you make a note of the password as it will not be visible in the
system afterwards
Resetting a locked user
If a user fails to log in more than the allowed number of times (See the User Security
Reference section for details) they will be locked out
A User Administrator can unlock a user This clears the locked flag and allows you to
specify a new one-time password and force the user to change password when they next
log in
To reset a User follow these steps
1 In the Sentences Explorer select Administer Users hellip from the File menu
If the menu option is disabled this could be because you have editors open All
editors must be closed before you can change to the Profiles Profile where Users
are administered
The menu item will also be disabled if you are not logged in as a user with the
User Administrator Role
2 Once the Profiles Profile has open select the User Entity Type in the schema
pane and then locate the user in the data pane and select them
3 Open the context menu for the user and select Reset User The Reset user dialog
will be opened
4 Enter a new one-time password or generate a random password by selecting the
Generate Random button Ensure that you make a note of the password as it will
not be visible in the system afterwards
5 Select Reset
6 The user will be unlocked given the new password and have the force password
change property set to yes
System Administrator Lockout
If any Sentences User forgets their password and locks themselves out the System
Administrator can reset their password If the System Administrator forgets their
password the following mechanism allows them to reset without having to re-create the
entire Profiles database
The mechanism allows the System Administrator to enter the original password that is
encrypted into the Licence file and force a new password to be set This is only possible
with physical control over the installation The trigger for this reset action is to place an
64
Sentences user security reference
Configuring Sentences
empty text file in the system chapter directory (or the first chapter location if one is not
specified) with the name resetadminpassword
The procedure is to
1 Shut down the server
2 Create the empty text file named resetadminpassword and place it in the
system chapter directory
3 Start the server again
4 Log in as System Administrator with the password encrypted in the license file
5 Enter a new password when prompted
6 The resetadminpassword file will be removed automatically
Privileges
Relational Database Standards for Security use a set of privileges to grant access to view
update and delete schema and data Sentences follows this standard where appropriate but
includes some additional functions specific to the Sentences database architecture
Privileges exist to
View individual Profiles
View all Profiles
Create Profiles
Drop Profiles
Alter individual Profiles
Alter all Profiles
Create Chapters
Alter individual Chapters
Alter all Chapters
Allow transaction visibility
Allow sandbox mode
For each individual Profile granted View privileges (or all Profiles) there are Further
Schema and Data Privileges
Schema Privileges exist to
Create Types
Drop Types
Alter individual types
Alter all Entity Types
Alter all Association Types
Create Queries
Drop Queries
Alter individual Queries
65
Sentences user security reference
Configuring Sentences
Alter all Queries
Data Privileges exist to
Insert individual Instances
Insert all Entities
Insert all Associations
Delete individual Instances
Delete all Entities
Delete all Associations
Update individual Instances
Update all Entities
Update all Associations
See the section on creating a new Role for details of how to set these privileges
A userrsquos view of an associative database is defined by the profile that they are using A
profile defines a set of chapters and the sum of their contents is the userrsquos view A user
may have multiple profiles and a chapter may appear in zero one or many profiles As a
result of this division of a database into chapters can be used to support modular database
design
An existing mechanism for defining visibility of and access to schema and data is to
combine chapters into different profiles for different sets of users
Combining chapters example
Let us imagine you have a human resources database You wish to provide an application
for general Human Resources personnel to view employee information You also wish to
provide an application for managers to maintain employee appraisal information
You could design your database with one chapter to hold the core schema for your human
resources and another to extend that schema for sensitive appraisal information
With this modular approach you can then create two profiles The first only includes the
core schema and does not have any target chapters for changes and is thus read-only The
second profile would include both schema chapters and a data chapter as the target for
appraisal data
It is possible to use privileges to limit visibility and access of schema to achieve the same
result and you must assess which is the more appropriate for your situation A modular
design of combining chapters is easier to maintain whilst User roles and privileges allow
greater flexibility
The current user
The currently logged in user is shown in the title bar of the Sentences Explorer
Sentences Queries and the Sentences API have been extended to include functions to
retrieve the current user and evaluate whether they have been granted particular roles
This allows the database designer to adapt the behaviour to different users or roles
bull GetCurrentUserID()
This function returns the username of the currently logged in user the identifier they use
to log in with
66
Sentences user security reference
Configuring Sentences
bull GetCurrentUserName()
This function returns the display name of the currently logged in user
bull CurrentUserHasRole(ltrole namegt)
This function returns whether or not the currently logged in user has been granted the role
specified by the passed parameter
Combining chapters example continued
In the human resources example from above we would only wish team managers to have
access to appraisal information for their team The visible appraisal information could
either be filtered by manager id name or role
In this situation it is more likely that you would use Sentences Business Rules to describe
and enforce the desired behaviour See the section on Business Rules
User security parameters
The Serverproperties file
The following parameters in the Serverproperties file are used by the User Security
System
bull AnonymousLoginAllowed
You may use this truefalse property to specify whether the Server will allow requests to
log into Sentences anonymously Even if the client requests an anonymous login unless
this property is set to true anonymous logins will not be granted
bull MaxLoginAttempts
You may use this property to set the number of attempts that will be allowed before the
user is locked out The default is 3
bull MinPasswordLength
You may use this property to set the minimum number of characters to be entered as a
password The default is 9
bull DefaultRoles
You may use this property to set the Roles that a User is given when created The default
installation of Sentences has default roles Profile EditorChapter EditorSchema
EditorData Editor
If Custom Roles are created these can also be used in this list of default Roles
Client properties
The following parameters are used in the Applicationproperties file for the Personal
Edition and in the client HTML applet or JNLP configuration file for Enterprise Edition
Clients
bull AnonymousLogin
You may use this truefalse property to specify whether the Client should connect to the
server as the Public User without asking for login credentials from the user This will only
be honoured if the server has been configured to allow this
bull BackgroundColour
You may use this property to specify a background colour to be used for the Login Screen
if you are customising it for your application or set of applications For example a value
of ldquoFFFF40rdquo would make the background a Yellow background
bull LogoImage
67
Servlet access to Sentences
Configuring Sentences
You may use this property to specify a Logo to be used for the Login Screen if you are
customising it for your application or set of applications For example a value of
ldquologogifrdquo would use that GIF image
bull LogonTitle
You may use this property to specify a Title to be used for the Login Screen if you are
customising it for your application or set of applications For example a value of ldquoACME
Applicationrdquo would use that as the title
Servlet access to Sentences
In many situations the best way for users to access the Sentences server is by running the
Sentences client applet in a Web browser
It is also possible to access the Sentences server directly using a servlet A number of
different servlets are supplied with Sentences which are listed below Because of security
considerations some of these servlets are disabled when you install Sentences Security
considerations are discussed in Sentences servlets and web server security
URL patterns and Servlets available in Sentences
The following table lists of the URL patterns that correspond to various Sentences
features and shows the status of each servlet on installation The URL patterns marked as
always enabled are essential to Sentences and cannot be changed All the other URL
patterns are listed in the Serverproperties file and you can change their status by
changing the corresponding access parameter from false to true or from true to false
You should always check the Serverproperties file for an up-to-date list of theURL
patterns and servlets currently available
68
Servlet access to Sentences
Configuring Sentences
URL pattern Servlet name Enabled by default Sentences feature
MainServer Main Always Access to Sentences from
the Sentences client applet
SavedXML
XmlSavedRespon
se
Always XML export requested by
the Sentences client applet
ApiServer Main Yes Access to Sentences from
user-written programs using
the Sentences client API
Statistics Stats Yes Sentences server statistics
Chapter ChapterStats No Sentences chapter
statistics
Spatial Spatial Yes Data for the spatial view of
a Sentences chapter
DTD XmlDtd Yes
Export of XML DTDs
generated by Sentences
Schema XmlSchema Yes Export of XML Schema
generated by Sentences
XML XmlOutput Yes Export of XML documents
generated by Sentences
ImportXML XmlInput Yes Import of XML documents
Backup Backup Yes Enables online backup
Sentences servlets and web server security
The Sentences client applet is loaded from an HTML page which means that the
administrator of a Sentences Web site can apply security constraints to the relevant
HTML page to make sure that only authorized users can access Sentences data and that
each user is restricted to appropriate profiles
Users who access Sentences data using the Sentences API or the XML import and export
features do so directly by communicating with a servlet and so any security controls
applied to an HTML access page does not apply to them
Sentences addresses these security problems by introducing distinct URLs for different
kinds of database access The effects of this approach are
Individual features can be enabled or disabled by setting the corresponding access
parameter in the Serverproperties file
Web site administrators can use the security features of their web servers to place security
constraints independently on each feature in some cases down to the level of a profile or
even an individual query within a profile
Web site administrators can use web server security features to control access to the URL
patterns used by the servlets listed above In some cases such as XML export the full
URL includes a profile name and a query name which allows the administrator even
more detailed control by restricting access to specific URLs
69
Uninstalling Sentences
Configuring Sentences
For information on how to restrict access to a specific URL on your web server using
security constraints please consult your web servers documentation
Enabling and disabling servlet access
A full list of servlet access features showing which ones are enabled and which ones are
disabled on installation is given above (see URL patterns and Servlets available in
Sentences )
To enable or disable servlet access for a particular feature you must edit the
Serverproperties file
For each servlet that you want to enable you must change the corresponding access
parameter from false to true For each servlet that you want to disable you must
change the corresponding access parameter from true to false
Uninstalling Sentences
To uninstall Sentences on Windows platforms and the Tomcat Web server installed with
it use the AddRemove Programs option in the Windows Control Panel
After running the uninstall procedure you must make sure that you delete the
ltSentences_homegt directory using the Windows Explorer
You can uninstall Sentences on Unix Linux platforms by running the UninstallSentences
script which can be found in ltSentences_homegtUninstaller or by deleting the
ltSentences_homegt directory
71
Entities and associations
Introducing the associative model
Chapter 2
Introducing the associative model
This chapter is an introduction to the associative model for database designers who
want to work with Sentences More detailed information is available in the book The
Associative Model of Data by Simon Williams available from wwwsentencescom
Sentences is the first database product to implement the associative model of data
which is radically different from the relational model of data which currently
dominates the database market This chapter looks at some of the basic concepts of
the associative model including
bull entities and associations
bull values
bull types and instances
bull contrasts with the relational model
Entities and associations
The associative model of data allows you to record information about independent things
in the real world (entities) and about their interactions (associations) An entity represents
a thing in the real world that has a discrete independent existence In contrast an
association represents a link or interaction between two other things each of which may
be an entity or an association An association represents a thing in the real world which
does not have an independent existence but is always dependent on other things
Some examples of entities and associations may help you understand the differences
between them Houses people bicycles and buildings are all examples of entities
Customers husbands and headquarters are all examples of associations A person may
fulfil the role of being a customer or of being a husband but even if that role comes to an
end the person remains a person
Take an imaginary company called Medway Furniture that has its main offices in
Riverbank House Riverbank House could be designated as the headquarters of Medway
Furniture But should Medway Furniture move away or go out of business Riverbank
House would not necessarily cease to exist It would merely cease to be the headquarters
of Medway Furniture The associative model sees Riverbank
House as a building entity and Medway Furniture as a company entity but it sees
Medway Furnitures use of Riverbank House as its headquarters as an association It
would be incorrect in the associative model to represent headquarters as an entity
because it does not have the necessary quality of independent existence
Any thing in the real world that can be described in terms of a link between two other
things can be represented in the associative model as an association The sentence John
Smith is a customer of Medway Furniture describes the interaction between a person
entity called John Smith and a company entity called Medway Furniture The phrase
is a customer of describes the nature of the interaction and in the terms of the
associative model defines an association
72
Entities and associations
Introducing the associative model
Figure 2-1 A simple association
In Figure 2-1 entities are shown as ellipses and associations as arrows The diagram
illustrates that in the associative model an association has three parts The first part is
referred to as its source here John Smith and the third part is referred to as its target
here Medway Furniture The middle part of the association here is a customer of is
referred to as the verb of an association Every association in the associative model must
have this source verb target structure It is the similarity between this structure and the
subject verb object structure of a common English sentence that gives the product
Sentences its name
Similarly when John Smith orders a table from Medway Furniture this too can be
described in an association
Figure 2-2 A more complex association
The diagram in Figure 2-2 shows a more complex association and illustrates one of the
strongest features of the associative model Associations are not only links between
objects in the associative database they are objects in their own right The is a customer
of association had an entity as its source and an entity as its target while the orders
association has another association as its source In the associative model an association
may be used as the source or the target of an association as easily as an entity
Since the source or target of an association may be an association the associative model
can have many associations nested within each other to whatever depth is necessary We
can write out a list of associations of increasing complexity to illustrate this For greater
clarity subordinate associations in nested groups are enclosed in parentheses there are
commas separating the source from the verb and the verb from the target and each verb is
in italics for example (source verb target)
bull John Smith is a customer of Medway Furniture
bull (John Smith is a customer of Medway Furniture) orders 6ft mahogany dining
table
bull ((John Smith is a customer of Medway Furniture) orders 6ft mahogany dining
table) on 14th June 1999
John Smith
Is a customer of
Medway Furniture
John Smith
Medway
Furniture
6 foot
mahogany
dining table
Is a customer of
Orders
73
Entities and values
Introducing the associative model
bull (((John Smith is a customer of Medway Furniture) orders 6ft mahogany dining
table) on 14th June 1999) at price pound350
Sources and targets in the associative model are reusable This means that one association
or entity can be the source of many associations or can be the target of many
associations
Entities and values
Entities and associations are the two kinds of real world things that we want to record
information about in a database There are other things in the real world that we do not
need to record additional information about
Data items of this kind are known as values Numbers dates and times in the real world
do not have any qualifying attributes of their own and so in the associative model they
are treated as values
Look again at the last two examples of nested associations given above
bull ((John Smith is a customer of Medway Furniture) orders 6ft mahogany dining
table) on 14th June 1999
bull (((John Smith is a customer of Medway Furniture) orders 6ft mahogany dining
table) on 14th June 1999) at price pound350
The date 14th June 1999 and the price pound350 are examples of things that you do not
need to record any data about apart from the fact that they exist and so may be treated as
values
Since values by definition do not need to be defined or described by associations values
can only be used as the targets of associations and never as their sources Apart from this
restriction the behaviour of values is very much the same as the behaviour of entities
The distinction between entities and values is implemented in Sentences using the
datatypes mechanism Defining a group of data items as values in Sentences has far-
reaching consequences and in many cases the majority of data items in a database are not
values
Types and instances
So far this chapter has looked at examples of individual entities values and associations
The associative model generalises entities values and associations to entity types value
types and association types
Entity value and association types are used to develop the schema for an associative
database They are the main building blocks of associative database schema design
Any individual entity value or association is an instance of its respective type If you
create an entity type that is the source of a number of association types then any entity
that is an instance of that entity type may be the source of one or more associations that
are instances of the corresponding association types An individual entity does not need to
have all or any of the associations implied by the association types but if they do exist
they conform to the association types characteristics
The following diagram shows an example of an associative schema design
74
Comparing the relational model and the associative model
Introducing the associative model
Figure 2-3 An associative schema
This diagram shows a schema design made up of entity types value types and association
types Using the same (source verb target) notation as before this schema could be
written out as follows
Person is a customer of Company
(Person is a customer of Company) orders Product
((Person is a customer of Company) orders Product) on date Date
((Person is a customer of Company) orders Product) at price Amount
Company has headquarters at Building
(Company has headquarters at Building) pays monthly rent Amount
This schema conforms to the principles of the associative model It has six association
types two value types (Date and Amount) and four entity types Some association types
in this schema have an entity type for their source and others that have an association type
for their source The Amount value type is the target of more than one association and the
Company entity type is the source of one association type and the target of another
Comparing the relational model and the associative
model
The associative model offers a different set of building blocks for schema design from
that offered by the relational model The principal building blocks of the relational model
are relations and domains while the building blocks of the associative model are entities
types value types and association types
Relations (also referred to as tables) are sets of rows that behave in accordance with the
rules of the database model For example each row in a relation must be unique and every
column must have a distinct name Domains are sets of values from which the values in a
column may be drawn An example of a domain is days of the week
In a relational database every table must ave a defined primary key and may include
foreign keys A primary key is one or more columns whose values are such that each row
can be uniquely identified A foreign key is one or more columns that serve as a primary
key in another table Foreign keys are used as a method of linking rows together to
implement many-to-one associations If you want to model many- to-many and one-to-
Is a customer of
On date
Person
Date
Amount
Product
Company
Building
Has
headquarters at
At price
Pays monthly rent
Orders
75
Comparing the relational model and the associative model
Introducing the associative model
many associations in the relational model you must provide additional linking tables as
these types of association cannot be modelled directly
The associative model does not use keys In the associative database every entity or
association has a hidden surrogate that is assigned when it is created This is a unique
internal identifier which is never changed You can even change an entitys visible name
without affecting its underlying hidden surrogate
Because the use of surrogates has done away with the need for keys it is easy to
implement many-to-many and one-to-many associations as well as many-to-one
associations in the associative model narrowing the gap between the business model and
its implementation
Structural comparisons
The following statements are an attempt at a simple mapping of relational building blocks
to their associative counterparts These statements are generally true but there may be
exceptions in certain cases
bull A relational table that has no foreign keys among its primary keys can be modelled in an
associative database as an entity type that is the source of one or more association types
In other words an entity type that is the source of one or more association types is
equivalent to a table that has no foreign keys as primary keys It is likely that some parts
of the relations that would have appeared in columns in that table can be modelled as
association types having this entity type as their source
bull A relational table that has one or more foreign keys among its primary keys can be
modelled in an associative database as an association type
In other words an association type is equivalent to a table that has one or more foreign
keys as primary keys In a relational database data about customers would be recorded in
a Customer Table and data about shops in a Shop Table To combine data about shops
and customers in one table in the relational model you need to construct a ShopCustomer
Link Table This link table would use two foreign keys the primary keys from each of the
source tables as its own primary keys In an associative database an association type
with the (source verb target) of (Person is a customer of Shop) achieves the same
result
bull A domain in a relational database can be modelled in an associative database as a value
type which by definition has no association types Alternatively an entity type that is the
source of no association types is also equivalent to a domain
An associative database can use the same value type in many situations where a
relational database would require separate columns in different tables The simplest
example of this would be the use of dates One single Date value type can be used as the
target for associations indicating start date end date invoice date or date of birth which
would all require separate representations in the relational model Furthermore a single
instance of a date value such as 25th January 2001 would only be recorded once as
associations based on different association types could all make use of the same data
bull A column heading in a relational table can be modelled as the verb of an association
type
In other words the verb of an association type is equivalent to a column heading in a
relational table This restates what we have seen about the use of dates Column headings
in relational tables do not necessarily define the domain of the permitted values in the
column but often do give an indication of what the domain is An associative database
could easily contain a series of association types with verbs such as Start Date and End
Date all pointing to the same Date value type as their target
76
LazyView - Using Sentences to view relational databases
Introducing the associative model
bull Both the relational and associative models use datatypes as part of the definition of a
domain
Datatypes are used in relational databases to determine the kinds of entries permitted in a
domain The associative database uses a similar mechanism for similar purposes although
the internal implementation of datatypes in Sentences is very different
LazyView - Using Sentences to view relational
databases
The LazyView Tool has been re-written and whilst some of the content from the previous
LazyView Guide is relevant all necessary information is included in this guide
You can use the Sentences LazyView chapters to view data in one or more relational
database alongside data from Sentences chapters in one integrated profile
LazyView chapters
Data from a relational database is accessed using a special kind of Sentences chapter file
A LazyView chapter can be part of a profile in the same way as an ordinary chapter
although it cannot be defined as the target chapter for schema data or query changes
You can create a number of LazyView chapters that each represent a different relational
database or instance and include them all in the same Sentences profile Although you
can add data to the Sentences database which includes a LazyView chapter this data is
always written to a native Sentences chapter and never to the LazyView chapter itself
This means that any data you add is only available when viewed through the Sentences
interface It is currently never written back to the relational database and is not available
when viewing data using the relational databasersquos native interface
Relational schema and Sentences schema
Before you can model a relational database in Sentences you must have a thorough
understanding of both Sentences and the associative model and of the relational database
you are working with
Relational databases are based on tables keys columns and rows while the Sentences
associative database is based on entity and association types and instances Despite these
fundamental differences the inbuilt flexibility of the associative model means that it is
relatively straightforward to create an associative schema in Sentences that can be used to
model the schema of a relational database
This modelling is achieved by mapping entity and association types in Sentences to
columns in the relational database Much of the mapping process has been automated but
to use LazyView successfully you must have a thorough understanding of the table
structure of the relational databases you wish to use and in particular of the ways in
which tables are linked to one another by the use of foreign keys
In general the preferred way of working with LazyView is to construct a new Sentences
schema to represent the schema of an existing relational database
Representing relational structures in Sentences
The following sections suggest how to map relations in relational databases to entity types
and association types in Sentences
Relational tables and columns
In relational databases objects are typically represented by primary key columns of tables
and the attributes of objects are typically represented by the non-key columns in a table
77
LazyView - Using Sentences to view relational databases
Introducing the associative model
In Sentences an object is represented by an entity type and its attributes are represented
by association types As association types in Sentences have three elements in them the
correspondence between an association type and a non-key column is not exact
For example consider a relational table listing employees which has a primary key
column named Employee and has Department and Telephone number as non-key
columns In Sentences Employee Department and Telephone number would all be entity
types The relationships between these entity types would be represented by association
types which have the entity type representing the tablersquos primary key Employee as their
source and an entity type representing a non-key column as their target These
association types could be Employee works in department Department and Employee
has telephone number Telephone number
A Sentences association type specifies not only a source and a target but also the nature
of the association which is referred to as the association verb When mapping data from
relational tables to Sentences types it is therefore necessary to map the association verb as
well as the source and target In the case of an association which has a primary key as its
source and a non-key column as its target the association verb is mapped to the same
non-key column as the target This apparent duplication is necessary to prevent any
ambiguity
Views
Views are utilised in two main ways in a Relational Database They can be used as a read-
only subset or aggregation of data for the production of reports or analysis and they can
be used to control access and visibility of data
Views created for the purpose of inserting and updating data will generally be of no
interest to you when using LazyView to interrogate information If you do not have
access to the base table but only through a view then you may need to map that view to
obtain the data but views do not usually define a primary key or foreign keys and you
may have to specify them manually
Tables and views with no primary key
LazyView has the capacity to modify primary and foreign key definitions because this
information is not available directly available with some database connections
Note that the previous documentation on the LazyView tool stated that primary key
definitions were not available with a JDBC connection to a Microsoft Access database
Since then some JDBC Drivers do support this ability
Many relational databases allow you to construct read-only views (as simplified
selections of columns from one or more tables) which are treated as tables Unlike tables
views do not generally have primary or foreign keys defined for them and you should
create alternative key column definitions for columns in views so that they may be
mapped to types used as sources for associations
Any changes you make to these definitions in LazyView only effect the way in which
LazyView interprets the data in relational tables None of these changes is written back to
the original relational database files and the existing database definitions are not altered in
any way
It is very important that you understand the structure of the relational database and in
particular the way in which tables are related to each other before you make any changes
to the primary and foreign key definitions If you make any changes to key definitions
that contradict the logic of the relational database then the data you access with
LazyView may be meaningless
78
LazyView - Using Sentences to view relational databases
Introducing the associative model
Tables with a foreign key
In relational databases connections between tables are often represented by using the
primary key column of one table as a column in another table This is known as a foreign
key In Sentences relational columns are represented by entity types A primary key
column that is used as a foreign key in another table is mapped to one Sentences entity
type That entity type (like all entity types in Sentences) can be used as the source of
association types whose targets represent non-key columns in the table for which it is the
primary key The same entity type can be also be used as the target for an association type
when performing its function as a foreign key with the second tablersquos primary key as the
source of the association
The important difference is in the way that the association verb is mapped In cases where
the target of an association is a non-key column the association verb is mapped to the
same column as the target In cases where the target of an association is the primary key
from another table the association verb is mapped to the foreign key column in the same
table as the association source is taken from For example a relational database may have
two tables named Employees and Departments
The columns of the Departments table include
bull Department_ID (the primary key)
bull Department_name
bull Location
The columns of the Employees table include
bull Employee_ID (the primary key)
bull Employee_name
bull Department_ID_fk (a foreign key which represents the primary key in
the Departments table)
In Sentences these six columns could be represented by five entity types
bull Department_ID
bull Department_name
bull Location
bull Employee_ID
bull Employee_name
There is no need to represent the foreign key Department_ID_fk as an entity type in
Sentences
The relations in the two tables could be represented by a series of association types
including Department_ID located at Location and Employee_ID works in
Department_ID
Both of these association types use the same Sentences entity type for
Department_ID even though in one case this entity type is the source and in the other
case the target of an association
The association verb located at which links the primary key to a non-key column in the
same Departments table would be mapped to the same Location column as the Location
entity type
The association verb works in which links the primary key to a foreign key column would
be mapped to the Department_ID_fk column in the Employees table and not to the same
column as the target type (which is mapped to the Department_ID column in the
Departments column)
79
LazyView - Using Sentences to view relational databases
Introducing the associative model
There is a restriction on the use of foreign key columns You cannot create an association
in Sentences in which the source maps to a foreign key column and the target maps to a
primary key column You may only create association in which the source maps to a
primary key column and the target maps to foreign key column or to a non-key column
Defining your own foreign keys
Some relational databases may have connections between tables but they are not defined
in the Metaschema Other external data sources like an Excel Workbook may also not
contain Foreign Key Reference information In these cases it is possible to add missing to
Foreign Key references These are termed User Defined Foreign Keys Whilst you can
add edit amend and delete User Defined Foreign Keys you cannot do this with the
Foreign Keys defined in the External Data Source Metaschema
The wizard page for refining table and column choices includes a section that displays the
available Foreign Keys and allows you to create user-defined Foreign Keys
Figure 2-4 Foreign key definitions in the Mapping Wizard
Foreign Keys defined in the External Data Source Metaschema are marked with a lock
icon to indicate that they cannot be altered
To create a User Defined Foreign Key follow these steps
1 In the LazyView wizard select the Createhellip button
2 The Create Foreign Key Reference Dialog will open
3 Select the table you wish to reference The primary key of that table will be
shown
4 Select the column(s) to match the primary key from this table If the primary key
of the referenced table is compound then you must select the matching columns
in the correct order
Figure 2-5 Creating a foreign key definition
80
LazyView - Using Sentences to view relational databases
Introducing the associative model
There is a facility for the dialog to attempt to automatically match columns based on their
column and table names If the schema is named such that incorrect selections are being
made then you may uncheck the option
There are several limitations imposed when creating User Defined Foreign Keys
bull You cannot create duplicate Foreign Key References
bull You cannot create a Foreign Key Reference if one exists in the opposite direction
bull The datatypes of columns must match their relevant primary key column datatypes
bull Whilst a self-referencing foreign key can be created for a table it cannot reference itself
with any of its primary key columns
Tables with composite keys
Some relational tables use a composite primary key (a key that uses more than one
column) An example of this would be an Employees table that used the two columns
Employee_ID and Department_ID as a composite key Each of these columns would be
represented in Sentences by an entity type and the composite key itself would be
represented by an association type in the format Employee_ID works in department
Department_ID Each of the non-key columns of the table would be represented by entity
types The status of each non-key column as an attribute of the composite key would be
represented by an association type which has the association type representing the
composite key as its source An example of this would be
( (Employee_ID works in department Department_ID) telephone number
Telephone number)
Tables with self-referencing columns
In some relational tables a column may represent the same data as is represented by the
primary key column For example an Employees table may contain an Employee_ID
column and a Manager_ID column to designate which manager each employee works for
The data in both of these columns is Employee_ID data as each manager is an employee
The Manager_ID column should be declared in the relational database as a foreign key
The relationship between these two columns could be represented in a Sentences schema
by defining two entity types Employee_ID and Manager_ID where Manager_ID is
defined as a subtype of Employee_ID
Tables representing subtypes
In some relational databases information about a subtype of a certain object is shown in a
separate table which has additional columns representing attributes of the subtype
In Sentences the entity type mapped to the primary key of the subtype table should be
defined as a subtype of the entity type mapped to the primary key of the original table
Tables representing additional information
In some relational databases attributes for a particular object are shown as columns in
two different tables which share the same primary key In Sentences there is no need to
define a separate entity type for the second tablersquos primary key as there is no practical
limit to the number of associations that may be created with the same source entity type
81
LazyView - Using Sentences to view relational databases
Introducing the associative model
LazyView chapter setup
This section describes the practical procedures for using LazyView
Installing a JDBC driver
To use LazyView you must install the appropriate JDBC driver software for each
relational database you wish to access and make sure that the driver is available to your
Sentences server You must also know the details of how to connect to each relational
database Generally this includes
bull Server Hosting the RDBMS (and port if not the default)
bull Database instance (if applicable)
bull Database name
bull RDBMS User Name and Password
Certain RDBM Systems allow other options such as integrated security and secondary
servers for failover
The JDBC driver is often supplied as a Java archive (JAR) file and you should place this
file in a directory that is accessible to your Sentences serverrsquos classpath
When using the default installation of Sentences Version 40 with Tomcat 41 the
suggested location for the JAR file containing your JDBC driver is
ltSentences_homegtTomcat4webappsSentencesWEB-INFlib
When using the default installation of the Sentences Personal Edition the suggested
location for the JAR file containing your JDBC driver is
ltSentences_homegtresources
You must restart the Sentences server after making any changes to the JAR files available
to it
Indexing the relational database
When you retrieve data from relational database columns using LazyView mappings to
Sentences entity and association types indexed columns show better performance than
columns without indexes We therefore recommend that if you experience slow
performance you build or rebuild the indexes for the relational database columns that you
wish to connect to with LazyView
Java memory and stack requirements
If you wish to use LazyView to access large amounts of data from a relational database
you may need to make more memory resources available to the Java
Virtual Machine For details on how to do this please see the section on the lazystart
script file in the Sentences Userrsquos Guide
Mapping a large Relational Schema can also lead to a large number of Sentences Types
being generated In order to maintain a large Schema the Java stack size may need to be
increased The default stack is 1MB for Linux Unix systems and 512KB for Windows
A stack size of 1MB is sufficient for most large Schemas and this is set explicitly when
using the Tomcat test server To change the stack used see ldquoTomcat memory
configurationrdquo ldquoConfiguring server utilitiesrdquo and ldquoWeb Start configurationrdquo
Adding a LazyView chapter to a profile
The New Profile Wizard will allow you to create a Profile that includes a LazyView
Chapter to connect to a Relational Database For details see the section on Creating a
new LazyView profile using the wizard If you have more advanced requirements then
you can manually create or edit a profile containing LazyView Chapters
82
LazyView - Using Sentences to view relational databases
Introducing the associative model
To create a LazyView chapter that represents a relational database follow these steps
1 In the Sentences Explorer select New profile or Edit profile from the File
menu
2 Start creating a chapter in the normal way by selecting New on the Edit Profile
dialog
3 Define a name and a location for the chapter and select the LazyView chapter
check box on the New file dialog and click OK
4 The Chapter will be added to the Profile and itrsquos Connection properties will be
opened in a dialog
Figure 2-6 Manually specifying LazyView chapter details
5 Select the Database Vendor and JDBC driver and then either select an existing
connection string or enter a new one Any connection strings previously used for
that Vendor in LazyView Chapters is included in the drop-down list
6 If necessary enter the user name and password that are required for
authentication with the RDBM System
7 Most of the time you will require a Dynamic Lazy View Chapter but if you
intend to import a snapshot of the data rather than connect dynamically then
select the Static mode
8 Define the chapter or chapters to be used as the target for schema data or query
changes This cannot be a LazyView chapter
9 Save the profile You may wish to give the profile a new name
The dialog will inform you if the particular JDBC Driver is not available This is usually
due to the relevant Java Archive file not being available to the server on the classpath
Once you save the profile Sentences will attempt to connect to the Relational Database
using the connection properties you have entered If there are any problems making this
connection the reason will be displayed in the Message Log For example
Error 1752 Opening connection Adventure Works rdbms
commicrosoftsqlserverjdbcSQLServerException The TCPIP connection to the
host has failed javanetConnectException Connection refused connect
Dynamic and static LazyView chapters
A Static LazyView Chapter is intended to be used for capturing a snapshot of Relational
Database data Any subsequent changes to the Relational data will not be visible so the
83
LazyView - Using Sentences to view relational databases
Introducing the associative model
data can be updated or re-imported later but the intention is that the data is mainly
referential and does not change often or for performance reasons the reference data can be
held in a local Sentences database
Most of the time you will want to use a Dynamic LazyView Chapter that connects in
real-time to a Relational Database Note that there is a cache of data in Sentences to
improve performance which can be adjusted to balance performance with timeliness
In both cases the Relational Schema will be mapped to Sentences Schema but with a
Static LazyView the data (or a subset of the data) will be imported into a standard
Sentences Chapter file the target chapter for data changes This means that if you
subsequently change the Mode of the LazyView Chapter you must be aware of the
consequences
If the LazyView Chapter was Static and you had previously imported a snapshot of the
data then changing the Mode to Dynamic will have the effect of displaying duplicates of
everything (assuming nothing has changed since the snapshot was taken) You can then
remove the data chapter and see just the dynamic data
If the LazyView Chapter was Dynamic then changing the Mode to Static will mean that
no data will be present You will then have the option to import a snapshot of the data into
a standard Sentences Chapter
Optional connection properties
Some relational databases require that additional properties such as the name of a
database are specified when connections are made to them using a JDBC driver
You can specify these properties in a LazyView connection by appending them to the
connection string The syntax for these depends upon the Database Vendor and the
specification followed by the JDBC Driver manufacturer so consult their documentation
for details
For example to append additional connection string properties for an Oracle My SQL
connection you append
property_name1=value1ampproperty_name2=value2hellip
but for a Microsoft SQL Server connection it would be
property_name1=value1property_name2=value2hellip
Using an existing LazyView chapter
After you have created a LazyView chapter and defined the connection settings for it in
one Sentences profile you can use the chapter in another profile
You can do this by editing the profile that includes the LazyView chapter and saving it as
a new profile or by creating a new profile and selecting the LazyView chapter from the
Add chapter dialog list
The Connection properties dialog for the LazyView chapter is only available after you
save the profile to which you have added it
Copying an existing LazyView chapter
To copy an existing Lazy View Chapter follow these steps
1 In the Sentences Explorer select External Data Sourceshellip from the Tools
menu
2 If there are more than one LazyView Chapters included in the profile then select
the one you wish to copy
3 Click on the Copy LazyView Chapterhellip button
84
LazyView - Using Sentences to view relational databases
Introducing the associative model
4 A Copy LazyView Chapter dialog opens and you can amend any of the
properties including a new name for the copied chapter
5 Click OK to make a copy and refresh the profile
Creating a mapping definition
Once you have a Profile containing a LazyView Chapter you are able to start the
Mapping Wizard to create a mapping definition This definition will be saved with the
LazyView Chapter It will include
o Your selection of which Catalogs Schema Tables and Columns you wish to
map
o Any alternative naming or alternative datatypes for generated Sentences Schema
to remove unwanted duplication and facilitate reuse of the same Sentences
Schema where appropriate
o Choices where the primary key of a table is the entire foreign key to another
table (The choices are whether to represent this as a subset or a subtype)
Your profile will need a target for schema changes to be able to create a Mapping and
generate the resulting Sentences Schema
If the LazyView Chapter is operating in Static Mode then you will be able to specify a
limit to the number of rows to import on any one table Your profile will need a target for
data changes to be able to import a snapshot of the data
Depending upon the size of the Relational Database Schema it may take a while to make
your selections and choices You can save the definition at any point in the Wizard and
return to it later
To create a new Mapping Definition follow these steps
1 In the Sentences Explorer select External Data Sourceshellip from the Tools
menu
2 If the dialog informs you of restrictions due to a lack of target schema chapter or
target data chapter you can click the Edit Profile button to make the appropriate
changes
3 You will not be able to continue if there are no LazyView Chapters included in
the profile
4 If there is more than one LazyView Chapter in the profile then select which one
you would like to create a Mapping Definition for Otherwise just that LazyView
Chapter will be shown
5 If there is no existing Mapping Definition for that LazyView Chapter then select
Create Mapping Definition to open the Wizard
6 If there is an existing Mapping Definition then select Re-create Mapping
Definition You will be asked if you wish to use the existing definition as a
starting point or create a completely new one from scratch
7 The Introduction Page of the wizard outlines the steps to be taken Select Next
and wait for the available Relational schema to be read
8 The first page shows three lists Catalogs Schema and TablesViews From here
you can select the items you wish to map If you are unsure you can proceed to
the next step to see more details and remove items later
9 Select Next The second page shows the selected Tables and Views on the left
hand side and when you select each one the column and foreign key details are
shown on the right hand side See the screenshot below
85
LazyView - Using Sentences to view relational databases
Introducing the associative model
Select tables and columns
10 The list of tables and views on the left allows you to
Look at View definitions
See whether a table or view has a defined Primary Key
See whether any of the columns or keys are invalid
Select or deselect individual tables and views
Select All None or Only Tables
Figure 2-7 The LazyView Mapping Wizard ndash Selecting tables and columns
11 The Selected TableView columns on the right allows you to
Alter the primary key sequence or assign one if there is none defined (only
mandatory fields can be assigned an alternative primary key sequence) See the
section ldquoTables and views with no primary keyrdquo for more details
Change the Sentences Datatype that this column data will be converted to For
example the database may define the table as a Timestamp but if you know that
it only contains Dates you can change the datatype to Date
Select and deselect individual columns
Select All or None of the columns in one go
The button on the end of each row and the View Sample Data button below the
table will open a dialog that shows you a preview of the data in the relational
database
86
LazyView - Using Sentences to view relational databases
Introducing the associative model
Figure 2-8 Previewing sample data from the RDBMS
You may alter the number of individual values that are returned Note that some kinds of
Relational Column Datatypes do not allow use of the Min and Max functions
12 Also shown on the right is a summary of any Foreign Key references This will display
whether the Foreign Key is available to map to an Association Type or not For
example if it links to a table that you have chosen not to map then the Foreign Key
cannot be used other than importing the raw data as a normal column (or columns)
If Foreign Keys are missing you can create and edit User-Defined Foreign Keys here to
link your tables and views See the section on defining your own foreign keys for details
13 At the bottom of this page are several options that you can choose
Use fully qualified names for Entities and Foreign Key Association Verbs
This means that the schema generated will include the Catalog and Schema
names to ensure that every Column and Foreign Key Reference is mapped to a
unique Sentences Type This is unchecked by default as it more common that
columns in different tables with the same name hold the same kind of data and
can be represented by a single Sentences Type
Convert Names to Proper Case This allows the automatic conversion to
proper case names with spaces between words from databases where the schema
names are all uppercase or Camel Case
Substitute spaces for underscores and full stops When generating Schema
names this replaces any full stops or underscores with spaces
Re-use existing Entity Types If possible reuse the same Entity Types
otherwise append a incrementing number to the name For example Date01
Date02 Date03hellip
Use NOT NULL Constraints This honours the constraint by making the
resulting Sentences Schema mandatory
Group Entity Names for Datatypes This allows two columns to be mapped to
the same Entity Type despite them not having exactly the same datatype For
example two text columns called Description but of different lengths can be
mapped to the same Entity type With this option unchecked the wizard would
insist that the columns are mapped to different Entity Types Similarly two
decimal columns with different precision can be mapped to the same Entity
Type
87
LazyView - Using Sentences to view relational databases
Introducing the associative model
List of Name Translations This allows you to select a named list of
Translations to apply to column and table names For example you might wish to
replace all occurrences of ldquoInfordquo with ldquoInformationrdquo
You can create new Translation Lists and Edit existing ones If you use a
Translation List for a mapping then the name of the list used is saved with the
mapping definition and re-used if you re-run the mapping wizard
See the section Creating and Editing Translation Lists for details of how to create and edit
Translation Lists
14 Select Next to move onto the next page If there are any invalid columns or
tables or none selected you will not be able to move to the next page
SubsetSubtype choices
15 If there are no choices to be made then the page will not be displayed and you
will be taken directly to the next page
16 This page allows you to make choices as to how the schema is mapped for two
specific scenarios Tables where the primary key is the foreign key to another
table and Columns that you may or may not wish to represent with the same
Entity Type
Figure 2-9 Choosing subsets and subtypes
17 The list shows tables where the entire primary key is a foreign key to another
table You need to use your knowledge of the data and schema to determine
which of the two kinds of relationship the tables should have because the
Relational Schema cannot record this The screenshot above shows an example
where we know that a Sales Person does not exist in its own right as a particular
type of Employee It will not necessarily remain a Sales Person throughout its
life So in this case Sales Person is a subset of Employee rather than a subtype
18 Select Next to move onto the next page
New and existing Sentences schema conflicts
19 The next page lists all the columns that you have chosen to map and informs you
of any conflicts that must be resolved before you can continue It also allows you
to perform actions on more than one Entity Type to be generated at once such as
changing all Timestamp datatypes to Date datatypes
88
LazyView - Using Sentences to view relational databases
Introducing the associative model
If we did not previously select the ldquoGroup Entity Names for Datatypesrdquo
option then we may end up with some Columns mapping to the same Entity
Type that have different Relational Datatypes In many situations we will be able
to map the different relational columns to the same Sentences Entity Type
despite having different precision and length because Sentences can
accommodate such variation
By default we map simple column data to Value Types where possible If part of
a Primary Key then the Entity Type cannot be a Value Type because it will need
to be the source of Associations So another reason an Entity Type might be in
conflict is when some columns are part of a Primary Key and others are not This
is resolved by setting all columns to generate Non-Value Types
If you are re-creating the mapping or are adding a new LazyView Chapter to an
existing Profile then there may be existing Schema with the same names as
Schema that is to be automatically generated by this wizard
There are thus two main kinds of conflict that may prevent you from continuing
Columns from different tables may be mapped to the same Entity Type in
Sentences These must have compatible datatypes
Entity Types to be generated may already exist These must also have compatible
datatypes
In addition another conflict that may prevent you from continuing is where there
are more than one mapping LazyView chapter in the profile and the target Entity
Type is already mapped in another LazyView definition
20 The filter section of the page will show if there are Entity Types to be generated
from multiple Relational Columns that have the same names but different
datatypes (or the same datatypes but different value type flags) You can filter
the list to just show these mappings by clicking the button underneath the
message
21 The filter section of the page will show if there are Entity Types to be generated
that already exist but have incompatible datatypes You can filter the list to just
show these mappings by clicking the button underneath the message
22 The filter section of the page will also show if there are Entity Types to be
generated that already exist and have mapping(s) in other LazyView definitions
It would be unsafe to delete and re-create these Entity Types as the other
mapping(s) would be broken You can filter the list to just show these mappings
by clicking the button underneath the message
89
LazyView - Using Sentences to view relational databases
Introducing the associative model
Figure 2-10 The LazyView Mapping Wizard ndash resolving mapping conflicts
Filtering mappings
There are several ways to filter the mapping columns The three kinds of conflict
mentioned above can display only the affected columns by selecting the relevant ldquoShow
the affected column(s)rdquo button
In addition you may enter a name or an SQL datatype to filter the displayed mappings If
you enter several words in the Name filter then they must all appear in either the Type to
be Generated column or the Existing Type column If you enter several words in the
SQL Datatype field then rows with the SQL Datatype containing any of them will be
selected
Finally you can select the Show All Columns button to restore the full list
Resolving conflicts
There are several ways to resolve these conflicts You need to use your knowledge of the
data and schema to determine which method(s) to use
23 It may be that two or more columns are mapped to the same Entity Type but one
will be the source of associations and others are not In this case you may set all
column mappings to generate non-value Entity Types
To do this select all the mapped columns you wish to change (by selecting the
checkboxes next to the icon on each mapping) and select the Set As Non-Value
Types button
24 It may be that two or more columns are mapped to the same Entity Type but
require different Datatypes You may look at a sample of the data by selecting
the button that opens the sample data dialog From this or other knowledge of the
data and schema you may be able to change one or more of the generated
datatypes to match thus allowing the same Entity Type to represent all columns
90
LazyView - Using Sentences to view relational databases
Introducing the associative model
To do this select all the mapped columns you wish to change (by selecting the
checkboxes next to the icon on each mapping) select the desired Datatype from the
drop-down list and select the Set Datatype button
It may be that the datatype you have selected is incompatible If so then you will receive
a warning dialog such as below
Figure 2-11 Resolving mapping conflicts
In a few cases it may be that you need to override the datatype like this For
example if you are certain that a textual field only contains numeric data
25 It may be that two or more columns are mapped to the same Entity Type but
should be distinct Entity Types In this case you may rename the Type to be
generated to have unique names You may either double click in the cell for the
Type to be generated or select it and press F2 Edit the name and press Enter
To facilitate making the Entity Type names unique this page also provides the ability to
o Prepend the selected Types with their Table names
o Add a Prefix
o Add a Suffix
o Reset the names to those originally generated
When changing the names of several columns at a time you have the option of also
renaming the Association Type verbs that are targeted on each Type at the same time
Select the Checkbox next to these options to enable this feature
26 It may be that a Type to be generated already exists but that the datatypes are not
compatible (or one is a value type and the other is not) In this case you may either
delete the pre-existing Entity Type or modify the one to be generated to match
To delete the pre-existing Entity Type(s) select all the mapped columns you wish to
delete the existing type for (by selecting the checkboxes next to the icon on each
mapping) and select the Delete Existing Schema button
Note that it is unsafe to delete pre-existing schema that was generated from a different
mapping definition to a different database because those mappings will be lost You will
be warned if such a situation exists and given the option to cancel the action
In addition to necessary conflict resolution you may also wish to modify several
column mappings at a time This page also provides the ability to
o Include or exclude several column mappings at once
o Delete all pre-existing schema that is safe to delete
91
LazyView - Using Sentences to view relational databases
Introducing the associative model
o Filter the columns shown by name
o Modify datatypes for several column mappings at once
If a relational schema designer has chosen to store a number in a character
column you may specify a Number Datatype Sentences will attempt to convert
the characters into numbers for you
If a relational schema designer has chosen to store a date or time in a character
column you may specify a Date Time or Timestamp Datatype If the date or
time format is not one of the standard ones built into Sentences then you can
define additional formats that will be used to convert a textual representation into
a date or time These additional formats are added to the Serverproperties file by
the System Administrator Here is an example set of etries
DateFormat1= ddMMyyyy
DateFormat2= dd-MM-yy
DateTimeFormat1= yyyy-MM-dd HHmmssSSSZ
DateTimeFormat2= yyyy-MM-dd HHmmssSSS
TimeFormat1=HH~mm~ss
TimeFormat2=HHmm
27 Once all conflicts have been resolved select Next to move to the next page
Summary of schema to generate
28 This page shows a tree of the Schema that is about to be generated when you
select Finish It is still possible to rename individual items in the tree by
selecting them and pressing F2
29 If you are importing a snapshot of static data then you can choose to enter a
value for the maximum number of rows to import This will limit the amount of
data and is useful if you wish to obtain a sample of the data to investigate offline
92
LazyView - Using Sentences to view relational databases
Introducing the associative model
Figure 2-12 The LazyView Mapping Wizard ndash summary page
30 Once you have reviewed the summary select Finish to generate the mapping
definition and schema and import the data if appropriate
Processinghellip
31 As the wizard generates the mapping schema and data it shows you itrsquos progress
Figure 2-13 The LazyView Mapping Wizard ndash processing page
93
LazyView - Using Sentences to view relational databases
Introducing the associative model
If data is being imported then there are additional steps in the process
32 Once complete the Results are displayed Select Close to close the wizard
Figure 2-14 The LazyView Mapping Wizard ndash results page
When types are generated the description field is populated with the catalog schema
table and column or foreign key that led to its generation
The output from a mapping are also saved to a file in the Trace directory with the name
LazyViewMapping_ltmilliseconds timestampgttxt
Creating and Editing Translation Lists
When performing the mapping from an external data source to Sentences you may wish
to automate some of the re-naming of schema For example some of the abbreviations
used in the external data source can be expanded to more meaningful names in the
Sentences Schema
To facilitate this the mapping refinement page of the LazyView wizard allows you to
specify a Translation List to use when generating the mapping You can edit these lists
and if you use a list the mapping definition remembers this if you choose to re-run the
mapping
If two translations match a particular column name then the longer more specific
translation will be used For example with ADDR_=ADDRESS_ and
DESPADDR_=DESPATCH_ADDRESS_ the latter will be used
Creating a new Translation List
From the mapping refinement page of the LazyView wizard follow these steps
1 Select the New Listhellip button The New Translation List dialog will open
2 Enter a name for the list
94
LazyView - Using Sentences to view relational databases
Introducing the associative model
3 You may enter as many translations as you wish You can specify whether each
translation is case-sensitive or not This applies to the From word or phrase not
the To word or phrase
4 You may optionally add one or more exclusions
An example would be where you may enter a translation for Id =gt Identifier
This would replace ProductId with Product Identifier and Holiday with Ho
Identifier day By making it case-sensitive Holiday would not be erroneously
replaced
This does not stop NewIdea being replaced with New Identifierea so an
exclusion for Idea could be added
5 Select Save to save the list If the name you have specified is already in use you
will be prompted to change it to a unique name Once saved that list will be set
as the Translation list to use when generating the Mapping Definition
Editing a Translation List
From the mapping refinement page of the LazyView wizard follow these steps
1 Select the Translation List you wish to edit from the drop-down list
2 Select the Edit Listhellip button The Edit Translation List dialog will open
3 You may add or delete any translations or exclusions
4 Select Save to save the changes to that Translation List or Cancel to cancel the
changes
Figure 2-15 LazyView Mapping Translation List
95
LazyView - Using Sentences to view relational databases
Introducing the associative model
Importing or updating static data
When using a Profile containing a Static LazyView Chapter you can choose to initially
import no data to simply view the schema generated If you are happy with the mapping
then you may wish to subsequently import all or part of the data If the LazyView Chapter
was originally operating in Dynamic mode and you have changed to Static mode then you
will also wish to perform an initial Import
There are several strategies when taking a static snapshot of RDBMS data You may
import the data once and never need to update it again You may wish to import a sample
of the data for experimentation You may know that only new data is added and choose to
periodically update the data or you may know that data is added changed and deleted and
need to keep a record of when those changes happened Finally you may wish to treat the
data as transient and periodically discard the previous snapshot and replace it with an
entirely new one
To accommodate these different strategies there are four types of data update that can be
performed on a Static LazyView chapter
You may already have a complete snapshot of data that you wish to update with the latest
RDBMS data This is a Standard Update in which a note is made of when there is a) no
change b) an addition or c) a target changes Any data no longer in the RDBMS data is
also deleted
You can choose to incrementally update the data without noting these changes and
without deleting any old data This is the second kind of update called an Incremental
Update In addition to this simpler and faster behaviour you can also choose to only add
data since the last update date You can specify date fields to use in each table such that
only rows with dates after the last update date are added For example a Date Created
column Each time a data update is performed the last update date is recorded
The third Replace Data update replaces all data To do this Sentences deletes the old data
chapter and creates a new blank one This update method assumes that the data is
transient This method is faster than the Standard Update method You can optionally
choose to limit the number of rows that are imported as a simple way to test the mapping
with a sample of the data For details of how to choose date columns see Selecting date
columns to limit incremental data updates
The final method Replace Limited Data is intended to import a subset of the data as
defined by a set of Sentences Queries Each set of related tables can have a Sentences
Query assigned to it which is used to limit the rows imported For details of how to create
and assign limiting queries see Creating and assigning limiting queries for a data import
96
LazyView - Using Sentences to view relational databases
Introducing the associative model
Figure 2-16 LazyView Data Update Wizard
To Import or Update the Static Data follow these steps
1 In the Sentences Explorer select External Data Sourceshellip from the Tools
menu
2 If the dialog informs you of restrictions due to a lack of target schema chapter or
target data chapter you can click the Edit Profile button to make the appropriate
changes
3 You will not be able to continue if there are no LazyView Chapters included in
the profile
4 If there is more than one LazyView Chapter in the profile then select which one
you would like to import or update data for Otherwise just that LazyView
Chapter will be shown
5 There is only a single page when importing or updating Static data
6 Select which option for updating you require
7 If you choose to completely replace the existing data then you can additionally
specify a maximum number of rows to import on any one table Again this is
intended to allow you to sample the database
8 Select Finish to start the import Progress is shown similar to that when
originally creating the mapping
Steps when updating the data
Steps when replacing the data
97
LazyView - Using Sentences to view relational databases
Introducing the associative model
9 Once imported the results are displayed Select Close to close the wizard
The output from an Update are also saved to a file in the Trace directory with the name
LazyViewUpdate_ltmilliseconds timestampgttxt
Recorded updates
For each Table we record
the instances that were unchanged
the instances that were added
For each Association mapped from a simple column or a Foreign Key reference we record
the instances that were unchanged
the instances that were added
the instances where the target was changed
We do not record when the previous target is orphaned
Any remaining instances that were not annotated as such are deleted These would be
found by using the time slider mechanism
Each time an update is performed a new Rdb Update Timestamp instance is created It
is the target of each of the three kinds of association to record these changes The Options
dialog (Select Options from the View Menu) includes a checkbox to determine whether
or not to show the Lazy View Update instances
Selecting this option will display the System Entity Type called Rdb Update
Timestamp and display the individual updates in the data pane
98
LazyView - Using Sentences to view relational databases
Introducing the associative model
Selecting date columns to limit incremental data updates
When choosing to update Static LazyView data incrementally you can choose to specify
date fields to specifically limit the new rows imported to those since the last update date
The last update date is recorded after each importupdate
To choose the date columns follow these steps
1 In the Sentences Explorer select External Data Sourceshellip from the Tools
menu
2 You will not be able to continue if there are no LazyView Chapters included in
the profile
3 If there is more than one LazyView Chapter in the profile then select which one
you would like to view the Mapping Definition for Otherwise just that
LazyView Chapter will be shown
4 Select Choose Date Columns for Updateshellip and a Dialog will open showing a
list of tables Each table will display the alternative date columns that you may
choose to limit data updates
5 You can click the Select Defaults button to automatically select columns that
have ldquomodifiedrdquo ldquoupdaterdquo or ldquocreaterdquo in their name (selected in that order)
6 You can click the Clear choices button to deselect all columns
7 You can scroll down the list of tables and manually select or deselect date
columns
8 Once you have made your choices click OK to save your choices
Figure 2-17 Choose Incremental Update date columns
Creating and assigning limiting queries for a data import
The Replace Limited Data data update choice allows you to replace the current data with
a new data chapter and import a limited ldquosubsetrdquo of the RDBMS data The data are
limited by the use of Sentences Queries for each table or set of tables
99
LazyView - Using Sentences to view relational databases
Introducing the associative model
The External Data Sources dialog provides the abililty to create and assign these
queries To view the mapped tables and their limiting queries follow these steps
1 In the Sentences Explorer select External Data Sourceshellip from the Tools
menu
2 You will not be able to continue if there are no LazyView Chapters included in
the profile
3 If there is more than one LazyView Chapter in the profile then select which one
you would like to view the Mapping Definition for Otherwise just that
LazyView Chapter will be shown
4 Select Import Limited Datahellip and the dialog in Figure 2-18 will open showing
the Database Tables and their limiting queries The button will only be enabled
for Static LazyView chapters
The dialog shows each table (and their parent tables) together with the common
type that they are rooted on their row count their limiting queries and the count
of rows that would be imported using the limiting query Both counts can be
refreshed with the Refresh row countshellip button These counts will be saved
with your choices
Figure 2-18 Choose Incremental Update date columns
5 You can edit an existing limiting query by clicking on the Edit Queryhellip button
6 You can create a new query by clicking on the Create Queryhellip button A new
query with the name ldquoltEntity Typegt SQL Limiterrdquo and if one already exists
that one will be edited instead so you canrsquot accidentally create duplicates
Creating limiting queries
Figure 2-19 Limiting query example
100
LazyView - Using Sentences to view relational databases
Introducing the associative model
A Sentences query can be created to limit the rows imported by translating the query
constraints into an SQL statement If a forward request is made mandatory this will
translate to an IS NOT NULL constraint If we add a Selection node then this will be
translated to a WHERE clause For example in Figure 2-19 we limit the countries
imported by saying the country code must be 6009 (United Kingdom) The Selection can
include all operators and functions used in Optimisation Queries If a forward or inverse
request is used that represents a foreign key then an SQL JOIN will be performed
Unlike Optimisation Queries we cannot bind to instances because there are none Instead
using a dynamic profile we need to make a note of all pertinent codes such as 6009 =
ldquoUnited Kingdomrdquo for Country Code and 0 = ldquoMalerdquo 1 = ldquoFemalerdquo for Gender Code
All tables related by foreign keys that are part of their primary key must be linked For
example CUST_CUSTOMER CUST_CRDT_CHECK and CUST_INTEREST are
related through the primary key CUST_CODE of CUST_CUSTOMER If we were to
create a limiting query for CUST_CUSTOMER so that only say Men in the UK were
sampled then we would wish to limit the other two tables at the same time in the same
way Otherwise unneeded data would be imported from the other two tables that could
never link to the CUST_CUSTOMER table
Memory requirements and timeouts
Importing or updating static LazyView data can require a large amount of memory The
performance when importing or updating data is significantly improved by ensuring
Sentences has enough available memory
For relational database tables with large amounts of data LazyView will request the data
in smaller amounts rather than all at once For such large tables this may still take a long
time depending upon the database vendor and communication speeds between the
Sentences server and the Database server
You can adjust the Import Timeout value and memory allocation See ldquoServer propertiesrdquo
for details
Combining databases
A Profile can be used to combine two or more seemingly disparate databases by including
a LazyView Chapter for each database They can be on RDBM Systems from different
Vendors on different Servers All that is needed are the privileges to read the Relational
Schema and Data
Making entity types equivalent
Sentences has the ability to mark two Entity Types as equivalent For details see the User
Guide This mechanism is of particular use when combining databases if you suspect that
two tables hold the same data It will allow you to view the data in an integral way and
identify duplicates or produce aggregate statistics and information
Display name queries
A feature introduced in V40 is the Display Name Query For Details see the section on
Display Name Queries
For data viewed through a LazyView Chapter Display Name Queries are particularly
useful when the main Entity Types such as Employee are represented by a unique
identifier rather than useful information like names If the Employees tables from two
different databases store the names in two separate ways Display Name Queries and
Entity Type equivalence can be used to form a unified list of recognisable entities rather
than identifier data
101
LazyView - Using Sentences to view relational databases
Introducing the associative model
Viewing existing definitions
The current Mapping Definition is saved with each LazyView Chapter and can be viewed
in detail from the External Data Sources Dialog
To view a Mapping Definition follow these steps
7 In the Sentences Explorer select External Data Sourceshellip from the Tools
menu
8 You will not be able to continue if there are no LazyView Chapters included in
the profile
9 If there is more than one LazyView Chapter in the profile then select which one
you would like to view the Mapping Definition for Otherwise just that
LazyView Chapter will be shown
10 Select View Mapping Definitionhellip and a Dialog will open showing the
Database Details and how the available schema has been mapped
11 The first dialog shows the Database details User Details and a table of Catalogs
You can drill-down into more details for Schema Tables and Views and
individual Columns and their properties
Checking for schema changes
The checkbox Check schema before actions on the External Data Sources Dialog will
examine both the Relational and Sentences Schema to see if there have been any changes
since the Definition was created
This includes useful information such as the creation of new Relational Tables and
changes in datatypes
The process of checking can take a long time so by default the schema is not checked
every time
Using LazyView to view data
For Static LazyView Chapters once the data is imported there is no difference in
behaviour between the snapshot data and data entered into Sentences in the usual way and
stored in Sentences Chapters The Static LazyView mechanism is another way to populate
a Sentences Database
Once set up data obtained dynamically will appear and interact with other Sentences data
as if it were stored in Sentences Chapters There are a few special situations that you need
to be aware of when using dynamic LazyView Chapters Firstly the speed of connection
and the particular RDBM System may impact the perceived performance of Sentences
and secondly some limitations that do not normally apply to Sentences will be present due
to the RDBM Systems limitations
Performance
When Sentences displays trees of data it determines whether that tree node has any
children (either forward or inverse associations) and displays a plus sign to indicate that
the tree node can be expanded Because of the differences between how Sentences and an
RDBMS retrieve data it can be quite expensive to calculate whether or not to show a plus
sign when the data is from a dynamic LazyView Chapter
See Determining if child associations are present for details of how to change whether a
Profile attempts to determine if child associations are present
See also the section on LazyView Query Optimisation below
102
LazyView - Using Sentences to view relational databases
Introducing the associative model
Large database fields
Associations in Sentences are always two-way If you can navigate from source to target
then you can navigate from target to source All Sentences datatypes can be searched and
sorted
Relational Databases have self-imposed limitations on these kinds of operation For
example you cannot perform a ldquoLikerdquo function on database columns with large datatypes
like XML You cannot even test for equality if you have an instance of XML that you
wish to find the ldquoparentrdquo of
This limitation hinders Sentences ability to show inverse associations dynamically for
such datatypes
CLOB and NCLOB (Character Large Objects)
NVARCHAR LONGVARCHAR LONGNVARCHAR
SQLXML
BLOB (Binary Large Objects)
LONGVARBINARY BINARY
LazyView Query Optimisation
Sentences queries work very efficiently with Sentences data in the chapter structures that
have been developed in tandem With a dynamic LazyView chapter the translation to the
relational schema can lead to inefficiencies simply due to the differences in data
structures
Static LazyView profiles do not have the same problem as the data is all stored in native
Sentences chapters
With a dynamic LazyView profiles a Sentences query based on an entity type will select
each instance of that Type in turn and apply selection criteria to see whether it should be
included in the results When this translates to a Relational SQL statement all instances
are returned which can take a long time In the relational world joins to other tables and
WHERE clauses limit the initial number of items returned For this reason there is a query
optimisation mechanism built into LazyView that allows an optimised Relqtional SQL
statement to be constructed for each LazyView chapter
The mechanism for this is to create a Subset of an entity type that is mapped to Relational
Schema and tell the subset that it is not a standard subset but an optimisation for a
LazyView chapter This is done by selecting the LazyView chapter that it should be used
in The Sentences query that is defined for the subset is then used to construct an SQL
statement that is used to optimise the instances returned When the subset is included in a
Query (either a normal Query or an Update Query) then the optimised SQL is passed to
the LazyView chapter to be used instead of the plain dynamically constructed SQL This
can have significant improvements on the performance
The best improvement will be seen on the data request node but this functionality is not
limited to that node
Optimisation Queries
The query used to construct SQL will be transformed by taking each request node and
applying a table join andor a predicate where clause if appropriate
Forward and Inverse Requests will lead to joins to other tables if they are the result of a
Foreign Key Mapping
Nodes set as required will translate to IS NOT NULL predicates
Nodes bound to instances will translate to equality predicates
103
LazyView - Using Sentences to view relational databases
Introducing the associative model
Nodes bound to other nodes will translate to predicates linking columns in different
tables
Selection expressions will be parsed into equivalent where clauses Only functions that
translate to an equivalent SQL function can be supported Supported functionality
Sentences Supported SQL Equivalient
AND Yes
CASE No
COALESCE Yes
CONCAT (||) Yes
CurrentUserHasRole No
DEFAULT Yes COALESCE
EXISTS Yes IS NOT NULL
Datatype Constructors No
Entity Type Constructors No
Datatype Functions No
Average Yes AVG
Count Yes
CountDistinct Yes COUNT( DISTINCT ltcolumngt)
FIRST No
LAST No
MAX MIN Yes
Median No
StdDev No
StdDevSample No
Sum Yes
GetClientParameter No
GetCurrentUserID No
GetCurrentUserName No
GetParameter No
GetState No
HasState No
IF THEN ELSE Yes CASE WHEN THEN ELSE END
LIKE Yes
NOT Yes
OR Yes
PriorResult No
VOID Yes NULL
XOR Yes (c1 AND NOT c2) OR (c2 AND NOT c1)
== Yes =
= Yes ltgt
lt gt gt= lt= Yes
- + Yes (divide multiply subtract add)
Derived Types attached to the query node that are independent from the main data request
tree will be available as references to be used in such Selection nodes
Functions that do not have an SQL equivalent such as GetCurrentUserID() will be
evaluated and used in expressions for these independent derived types If a Selection
references any other derived type then that selection will not be able to be used to form a
predicate where clause
The property dialog of a Subset used for LazyView Optimisation allows you to select the
LazyView chapter that it should be used to optimise for because there could be a choice
104
LazyView - Using Sentences to view relational databases
Introducing the associative model
It also allows you to request the actual SQL that will be executed which is useful when
developing the optimisation
LazyView reference
This section gives reference information that may be useful for system designers and
administrators
LazyView parameters in the Serverproperties file
The following parameters in the Serverproperties file are used by LazyView
bull LazyViewCacheTime
You may use this property to specify a default cache timeout for all LazyView
connections The time is defined in seconds and the default value is 10 LazyView always
checks for data in the cache before retrieving information from the database If this
parameter is set to 10 then if a requested data item is in the cache and is less than 10
seconds old the cached data is used and new data for this item is not retrieved
bull LazyViewShowSQL
You may use this property to specify whether or not the SQL statements being submitted
to the RDBMS should be output to the console This would allow for investigation of
lower level behaviour if assessing performance for example
bull LazyViewMultiLineTextThreshold
You may use this property to specify the limit at which textual columns are given a Multi
Line format in Sentences The number of characters has a default of 75 Any textual
columns less than this value will have a Single Line format
bull LazyViewResultSetCacheSize
You may use this property to specify the number of concurrent result set caches to hold
There will be an RDBMS limit to the number of open result sets allowed due to memory
constraints The default size is 1000
bull JdbcQueryTimeout
The time period in seconds after which a JDBC query times out and stops when browsing
data dynamically or executing a query in a dynamic LazyView profile The default value
is 5 seconds Setting a value of zero will disable the timeout altogether
bull JdbcImportTimeout
The time period in seconds after which a JDBC query times out and stops during a static
LazyView data import The default value is zero Setting a value of zero will disable the
timeout altogether
bull JDBC Connection Specifications
For each Database Management System Product a specification is required to form the
vendor-specific JDBC Connection Strings There are eight possible values required
1 Jdbc1=The vendor and product name
2 Jdbc1Drivers=A list of drivers (the first will be the default to use)
3 Jdbc1Protocol=the protocol up to the server or service specification
4 Jdbc1Database=the string that is immediately after the server specification
and before the database name followed by a | followed (optionally) by a string
that might mark the end of the database name If no second string is specified
then the rest of the connection string is regarded as the database name
5 Jdbc1Port=the default port number if applicable
105
LazyView - Using Sentences to view relational databases
Introducing the associative model
6 Jdbc1Service=true - if there is no serverport section and the database
name is a service system name file etc
7 Jdbc1Security=the string that is immediately before the integratedSecurity
property followed by a | followed by a string that might mark the end of the
integratedSecurity property This is only applicable to MS SQL Server
8 Jdbc1Instance=the string that is immediately before the instance name
followed by a | followed by a string that might mark the end of the instance
name If no second string is specified then the rest of the connection string is
regarded as the instance name This is only applicable to MS SQL Server
These values need to be repeated for each Database Product you wish to connect to The
second set of properties will be Jdbc2 Jdbc2Drivers Jdbc2Protocol
Jdbc2Database Jdbc2Port Jdbc2Service Jdbc2Security and Jdbc2Instance The
third set will be Jdbc3 and so on
Here are examples of two kinds of Oracle Specifications
Jdbc4=Oracle Thin
Jdbc4Drivers=oraclejdbcdriverOracleDriveroraclejdbcdriverOracleDriver
Jdbc4Protocol=jdbcoraclethin
Jdbc4Database=|
Jdbc4Port=1521
Jdbc5=Oracle OCI 8i
Jdbc5Drivers=oraclejdbcdriverOracleDriveroraclejdbcdriverOracleDriver
Jdbc5Protocol=jdbcoracleoci8
Jdbc5Database=|
Jdbc5Port=1521
Jdbc5Service=true
107
Database modelling in Sentences
Sentences database design
Chapter 3
Sentences database design
This chapter looks at database design on a more practical level and shows some of
the ways in which Sentences implements the concepts of the associative model It
follows on from Chapter 2 Introducing the associative model which described the
concepts of the associative model of data and listed some points of comparison
between the relational model and the associative model
This chapter also introduces the range of user interface design possibilities that are
available in Sentences
Database modelling in Sentences
In the schema design stage a database designer must decide which of the database
building blocks should be used to represent each element in the real-world system If you
have experience of relational database design and you are now approaching database
design in Sentences for the first time the theoretical points for comparison given in
Chapter 2 Introducing the associative model should help you choose the most suitable
associative model building blocks
Database design skills
Database design involves two activities problem analysis and schema design In the
analysis phase the structure of data in the real-world system under review - the problem
domain - is studied and recorded The analyst discovers how different data elements
relate to each other and how they may be dependent on each other If the analysis stage is
carried out accurately and thoroughly the schema design stage is usually straightforward
A thorough understanding of the real-world system is as important in the associative
model as it is in the relational model Someone skilled in relational schema design should
find that their analytical skills are equally relevant to the associative model
Choosing entity association or value types
Something modelled as an entity type must have an existence independent of other types
in the problem domain In contrast elements modelled as association types are dependent
on their sources and targets As you cannot create association types until you have first
created a number of entity types to be used as sources and targets there is a tendency to
model too many elements as entity types
As a practical test remember that every entity instance must have a name but an
association instance does not have a name If you cannot easily name instances of a given
type this suggests that this type should be modelled as an association Take care not to
model too many elements as entity types
If you are unsure about which entity type should be the source for a particular association
type it is useful to remember that associations are dependent on their source This means
that if the source entity type is deleted the association type is also deleted
Value types are a special kind of entity type Value types are used for numerical values
and similar data Any type that is configured as a value type cannot be the source of an
association type but can only be used as the target type
As with any other type of software design it is important that your schema design is a
faithful model of the real-world activities you wish to describe
108
Database modelling in Sentences
Sentences database design
Values can have an additional check made to determine whether they should be visible If
they are not the target of an association then they can be hidden This check is very
expensive to perform and not required in most applications If it is required it can be
enabled with the server property Check Value Visibility This additional check is disabled
by default See ldquoServer propertiesrdquo for details
Creating verbs for association types
The verb of an association type is used as its name and appears as its field label in the
Dataform It is important that wherever possible you use an active form of the verb rather
than a passive form You should also take care to use the singular form of the verb in an
association type name
It can be useful to include the source type name when you create an inverse verb as this
prevents ambiguity For example the association type Course start date Date could
have the inverse association Date course start date Course
If you have associations with duplicate names (duplicate verbs) either you need to revise
your structure or you need to use more precise verbs (verbs based on the target not on
the English language verb)
For a multiple Association Type you can specify a plural form to be used in Dataforms
and folders in the Data Pane The singular form will still be used for individual
association instances
Modelling one-to-many association types
You can easily model one-to-many association types in Sentences When you want to
create a one-to-many data structure model the one element as the source and the
many element as the target
Iterative design and prototyping
Although detailed data modelling is essential for the design of quality applications
Sentences is a very effective prototyping and iterative development tool You can easily
design a small scale application schema as a prototype for testing and improvement It is
good practice to type in small amounts of test data to verify your structure as you build
Sentences associations can be optional or mandatory It is generally more convenient at
the design stage to create all associations as optional After you have verified your design
you can convert optional associations to mandatory ones as required
Designing for change
You should create a schema that takes account of changes that take place in the real-
world system For example a business unit always requires a manager irrespective of the
name of the person fulfilling the role of manager Your schema should reflect this fact and
take account of possible changes of personnel Schema A (shown below) makes the role
dependent on the person fulfilling it
Schema A
Person fulfills Role
Business Unit utilises (Person fulfills Role)
Schema B (shown below) gives an alternative structure in which the role is not dependent
on the person fulfilling it
Schema B
(Business Unit utilises Role) fulfilled by Person
109
Sentences user interface design options
Sentences database design
Modelling behaviour common to multiple types
The associative model has two mechanisms that can be used to support the abstraction of
behaviour common to more than one type in a schema and to support the simultaneous
grouping and separation of instances of related types
bull Supertypes
are used for permanent groupings and indicate that all instances of the type are implicitly
instances of the supertype The reverse is not true An example of the use of a supertype
would be modelling Mammal as a supertype of Primate
bull Subsets
are used to describe a group whose membership is transitory An example is customers
with negative credit which is a subset of customers that depends on the customers
account balance
There is more information about using subsets and supertypes in Chapter 5 Working
with Sentences and in Chapter 6 Advanced techniques
Using instance-specific association types
You can define an association type that has an instance rather than a type as its source
This allows you to add an additional piece of information relating to only one instance
rather than to all the instances of a type For example in a customer relationship
management system you may wish to record the golf handicap of only one customer You
can do this in Sentences by adding an instance-specific association type for example Bill
Smith golf handicap of golf handicap
For more information see Instance-specific association types This association type
does not exist for other customers in your database
If you later decide that an instance-specific association type is relevant for other instances
of the same type you can change the associations source to the type for example to
Customer golf handicap of golf handicap In this case Sentences preserves the
original data you entered
Using chapters and profiles
A users view of an associative database is defined by the profile that they are using A
profile defines a set of chapters and the sum of their contents is the users view A user
may have multiple profiles and a chapter may appear in zero one or many profiles As a
result of this division of a database into chapters can be used to support modular database
design Profiles also define the chapters to which updates are applied (see Profiles and
chapters and Creating database views using profiles and chapters )
Sentences user interface design options
When you develop your database application using Sentences you have a number of
different user interface design options each of which has its own advantages and
drawbacks In general if you are able to devote more time to development you can
achieve a greater degree of control over the user interface It is possible that you may
want to use more than one type of interface for your Sentences application
The range of available options include
bull using the standard Sentences Explorer and Dataform interface
bull using custom Dataforms
110
Sentences user interface design options
Sentences database design
bull using the Dataform Query or Picker applets in HTML pages and using JSPs
bull using an XML-based interface
bull using the Sentences client API
bull using the Sentences End User Application Server This allows you to design an HTML5
web application interface
A range of user interface options are presented in the Application Suite examples supplied
with Sentences Enterprise Edition These are described in detail in the Application Suite
Guide
Using the Sentences Explorer and Dataform interface
The simplest user interface method for a Sentences application is to use the Sentences
Explorer (see ldquo Using the Sentences Explorerrdquo) and the base Dataform (see The
Sentences Dataform)
The advantage of this method is that it requires very little effort as you are using
Sentences as supplied The base Dataform is available as soon as you have designed your
schema and always keeps up with schema changes The drawback of this method is that
you have little or no opportunity to customise the user interface Even so this method is
suitable for many applications
Using custom Dataforms
If you want to restrict the associations presented to your application users you can use the
Query Editor to define a custom Dataform (see Creating a custom Dataform ) You can
also define a custom Dataform as the default Dataform for a type (see The base
Dataform and the default Dataform)
You can give different groups of users different default Dataforms by using different
schema chapters for the profiles of each group (see Creating database views using
profiles and chapters )
Although this method of interface design does give you a little more control than using
only the Sentences Explorer and the base Dataform using custom Dataforms does require
maintenance of your application to ensure that your custom Dataforms keep up with
schema changes
Using applets in HTML pages and using JSPs
You can deploy a Sentences Dataform a Sentences Picker and a Sentences Query using
Java applets For more information see The Dataform applet The Picker applet and The
Query applet
Each applet appears on an HTML page and you have control over the appearance of the
applet and the page Deploying an applet in this way to allows your users to view or
create or edit data in your Sentences database without giving them access to Sentences
Explorer features
You can customise your Web page interface even further by using Java Server Pages
(JSPs) JSPs allow the combination of static HTML content with dynamic information
retrieved from a Web server that differs with each page request The Sentences
Application Suite contains examples of user interfaces developed with JSPs
Developing applets and the Web pages used for their deployment does give you much
more control over user access but requires additional time and effort for creation and
maintenance
111
Sentences user interface design options
Sentences database design
Using an XML-based user interface
Sentences includes extensive support for data interchange using XML This means that
you can add and retrieve Sentences data without using the standard Sentences user
interface (see ldquoSentences and XMLrdquo)
You can use the query editor to define XML documents and XML DTDs (see The Query
Editor and XML ) and add and retrieve data using servlets (see Servlet access to
Sentences )
If you export data from Sentences in the form of XML documents you can format it with
a stylesheet and display the data on an HTML page There are a variety of commercial
tools available to make this task easier
This method of developing a user interface clearly gives you much more detailed control
over presentation but at the same time demands a much greater effort on your part and
involves the use of third-party tools You should be aware that the XML Standard is still
evolving and therefore some of the tools and technologies used with XML are still under
development
Using the Sentences client API
If you are an experienced Java programmer you can create programs to submit queries
and receive data using the Sentences client API Using the API allows you to use any
available presentation technology such as Java Server Pages (JSPs) or servlets For more
information see Chapter 10 Customising Sentences and also refer to the Javadoc
documentation in the Doc directory of your Sentences installation
This approach gives you complete control over presentation and over update logic for
your Sentences data but entails some development effort
Using the Sentences HTML5 Interface
The Sentences End User Application Server (SEUAS) currently in Beta is a client to
the Sentences Server that can be deployed as a separate web application End Users can
connect to the SEUAS from any HTML5 compliant browser without the need for any
browser plugins or a Java Virtual Machine on their client device
You can create and customise an EUA definition for each Sentences profile This
definition is used by the SEUAS to generate an application suitable for end users You
can specify which Entities Reference types and Reports are exposed to the user
About tree displays in Sentences
The Sentences Quick Tour
113
Chapter 4
The Sentences Quick Tour
This chapter explains the basic layout and appearance of the principal parts of the
Sentences client user interface the Sentences Explorer the Dataform and the Query
Editor
Detailed information about using these Sentences features can be found in Chapter
5 ldquoWorking with Sentencesrdquo Chapter 6 ldquoAdvanced techniquesrdquo and Chapter 7
ldquoSentences queriesrdquo
The topics covered in this chapter include
bull tree displays
bull the Sentences Explorer user interface
bull the Dataform user interface
bull the Query Editor user interface
bull the Message Log user interface
About tree displays in Sentences
Tree structures are a common representation of hierarchical relationships in computing
They generally comprise a number of elements or nodes that are linked together in such a
way that any node may have no more than one predecessor and any number of successors
The predecessor of a node is called its parent and successor nodes are called children
The node that is the origin of a particular tree and as such has no parent is known as the
root It is customary to place the root at the top of a tree diagram
In Sentences both the schema and the data of the database are represented in the Explorer
as tree structures Tree structures are also used in the Query Editor The tree structure is a
useful graphical metaphor of the relationships between entities and associations even
though the Sentences database is not hierarchical The structure of the Sentences database
actually resembles a net more than a tree as its component elements can be linked to each
other in multiple ways In addition associations in Sentences are not links between
different nodes in a hierarchical tree they are nodes in their own right For more
clarification on the use of entities and associations in Sentences see the section ldquoEntities
and associationsrdquo
The Sentences Explorer quick tour
The Sentences Quick Tour
114
The Sentences Explorer quick tour
Figure 4-1 The Sentences Explorer
With the Sentences Enterprise Edition the Sentences Explorer runs as either a Java applet
in a web browser or as a Desktop application (see ldquoRunning the Sentences clientrdquo ) In
the Sentences Personal Edition the Sentences Explorer runs as a stand-alone application
The Sentences Explorer has its own toolbar menubar and status bar and is divided into
two panes with the schema displayed on the left and data displayed on the right The
information in each of the panes is shown in a tree display
The following sections look at the various parts of the Sentences Explorer
The Explorer Menu bar
The Sentences Explorer menu bar provides access to a number of pull-down menusThe
menu names and the groups of commands on each menu are listed below
menu namehellip has commands abouthellip
File
Create a new profile or open edit delete and refresh existing
profiles reload data based on Positioner and Filter settings
log out or change password
Edit Edit data and view the selected itemrsquos Properties
View
Change the current Explorer display display additional
database information change user preferences and session
options
Schema Edit and build your schema create and edit Display Name
Queries
Query Use queries and work with query results
Tools
Access to tools for User administration Server configuration
External data sources Diagram editing Text file imports and
the End User Application
Help Help topics Tutorial and support information
The Sentences Explorer quick tour
The Sentences Quick Tour
115
Some menu commands are only available when certain items are selected in the Explorer
Some menu commands are not available in certain Sentences editions or may be disabled
for certain users For example if the FixedProfile parameter in the applet or jnlp
definition has been set to yes the profile commands are not available
A full list of menu commands is given in Appendix A lsquoMenus and Commands summaryrsquo
The Explorer Toolbar
The Sentences Explorer toolbar is located beneath the menu bar The toolbar buttons give
rapid access to some frequently used commands
Button Description Action
Open Profile use the Open Profile dialog to open a profile
Refresh Profile refresh the data in the current profile
Stop stop retrieving data from the server
Create entity type create a new entity type
Create association type create a new association type
Create query create a new query object
Properties
open the properties dialog for the selected entity
or association open the Query Editor for the
selected query
Cut cut the selected item
Copy copy the selected item
Paste paste the selected item
Delete delete the selected item displays the delete
impact dialog
Dataform
open the Dataform for the selected entity type or
entity instance or association instance
New tab opens a new Sentences Explorer tab on the
selected item
New tab on target
opens a new Sentences Explorer tab on the target
of the selected association
close tab closes the current tab
Positioner valuefield data entry field for the Positioner tool
Filter value field data entry field for the Filter tool
reload data
reloads data using current Positioner and Filter
conditions displays the results of a selected query
help displays help
Copying and Pasting
Any items you cut or copy from the Sentences Explorer Dataform or Query Editor are
held on the operating system clipboard and can be pasted into Sentences or other
applications However you can only paste a Sentences object into the same instance of
Sentences from which it was cut or copied If you paste a Sentences object into another
application or into another instance of Sentences you are only pasting the text
representation of the Sentences object without its unique internal identifiers
Dataform Tables can be copied (using the context menu on the first column) and pasted
into another application such as Microsoft Excel Similarly a range of cells copied from
Excel can be pasted into a Dataform Table providing the datatypes of the columns are
compatible
The Sentences Explorer quick tour
The Sentences Quick Tour
116
Finding data
For more information about locating data in the Sentences Explorer and using the
Positioner and Filter tools see the section ldquoLocating data in the Sentences Explorerrdquo
Sentences Explorer tooltips
The Sentences Explorer includes tooltips in a number of places If you position your
mouse pointer over the objects listed below you can see a brief explanation of the object
as follows
Position of mouse pointer Tooltip displayshellip
over the toolbar icons a brief explanation of the tool command
represented by the icon
over an association type in the
schema pane
the association typersquos name its cardinality
settings (see ldquoCardinalityrdquo ) and where
appropriate the LazyView connection name and
mapped column or key
over an entity type in the schema
pane
the entity typersquos name and its datatype and
where appropriate the LazyView connection
name and mapped column or key
over an entity instance in the data
pane
the name of the type and name of the instance
and the datatype of the instance (the instance
datatype is not shown if it is identical to the
name of the entity type or if it is ltNonegt)
over the profile schema tab list of the chapters used for schema data and
query changes in the current profile
over a query in the schema pane a list of the queryrsquos parameters and any default
parameter settings
Tree displays in the Sentences Explorer
The Sentences schema tree shown in the Explorer schema pane is made up of all the
entity types association types and values types in the current profile For convenience
these are displayed in the All types folder and Core types folder
The name of the profile is displayed on the schema pane tab Although it is not displayed
as the root node in the schema pane the profile is the parent of all the entity and value
types in the profile Subsequent levels open up below and to the right Moving ldquodownrdquo
the schema means moving away from the root
The data pane displays all the available instances for the association or entity type
selected in the schema pane Each instance functions as the parent node for the display of
all the associations that it takes part in as either source or target
Nodes and icons
Any instance or type displayed in the Explorer is a node in the tree display and can be the
parent of other nodes For example a node representing an entity type is the parent of all
the associations that it takes part in as either source or target
Each kind of node has its own distinctive icon In the schema pane entity types are
represented by magenta cubes value types by magenta discs and association types by
magenta arrows Yellow cubes discs and arrows represent subsets Arrows pointing down
and to the right represent forward association types in which the parent node is the source
Arrows pointing up and to the left represent inverse association types where the parent
node is the target
The Sentences Explorer quick tour
The Sentences Quick Tour
117
The shapes of the icons used in the data pane match the shapes used for the corresponding
types however they are all coloured cyan rather than magenta
Any association or association type is automatically the parent of its source and target
Source and target nodes are displayed when you double click an association type or
instance or when you select Show source and target from the shortcut menu
Yellow folders in the schema and data pane are used for collections of multiple instances
of the same type of things such as subset and supertype relations between entity types or
multiple associations
The Data Pane can display Page Nodes in the results These Pages are equivalent to the
pages generated in a Base Dataform They are a way of organising associations into
groups See ldquoUser Preferencesrdquo to turn display of Page Nodes in the Data Pane on and off
The Data Pane can display Inactive instances For details of inactive instances see
ldquoInactive instancesrdquo See ldquoUser Preferencesrdquo to turn display of Inactive instances in the
Data Pane on and off
Schema and data pane features
The schema and data pane in the Sentences Explorer share a number of commonfeatures
such as icons and tabs
Schema and data pane icons
The schema and data pane icons are shown in the following list
Icon Description
folder for groups of similar items
has subset or subtype of used for multiple associations
superset of or supertype of used for subset query used for multiple
inverse associations
has subset or subtype of also shows equivalence also shows
custom datatypes
subset of or supertype of also indicates subset query
entity type (magenta)
value type (magenta)
association type (magenta)
inverse association type (magenta)
metatype (magenta)
subset entity type (yellow)
subset value type (yellow)
subset association type (yellow)
inverse subset association type (yellow)
entity instance (cyan)
value instance (cyan)
association instance (cyan)
inverse association instance (cyan)
icon with a mark to the right indicates source of association type or
instance
icon with a mark to the left indicates target of association type or
instance
query
The Sentences Explorer quick tour
The Sentences Quick Tour
118
Expand node and collapse node buttons
The tree display in both panes of the Sentences Explorer is nested For example
association types are displayed beneath the entity type which is their source An expand
node button [plus sign (+)] is used to show that there are more nested nodes that can be
viewed The expand node button changes to a collapse node button [minus sign(-)] when
you expand the node
The expand node button is displayed in the Sentences Explorer schema pane next to type
nodes that are the sources of any association and in the data pane next to an instance that
has an association instance or an instance-specific association or where the entity type of
which it is an instance is not the source of any association type but only a target
You can double-click a type or instance to display all the associations that it is used in
either as a source or as a target
An association type that is not the source of a further association type does not show the
expand or contract symbol However you can double-click on an association type name
to display its source and target or select Show source and target from the shortcut
menu
Sentences Explorer drill-down
The tree display in both panes of the Sentences Explorer is recursive This means that you
can start navigating at any node and follow any chain of entities and associations through
the schema and data The practice of navigating through the schema and data by
selectively expanding nodes is known as ldquodrill-downrdquo Drilling down gives you
unrestricted access to data by alternative routes as you can follow chains of entities and
associations by clicking on successive source or target nodes
There is no limit to the depth that you can drill down although the data displayed
becomes repetitive at some point
Sentences Explorer tabs
Explorer tabs appear at the top of the data and schema pane The default tab for the
schema pane is the current profile which is the parent node for all the types in the schema
The name of this tab is fixed
When you position your mouse pointer over the profile schema tab Sentences displays a
list of the chapters used for schema data and query changes in the current profile
The default tab in the data pane displays the name of the type that is currently selected in
the schema pane and therefore changes with each selection If no type is selected in the
schema pane the data pane default tab displays the profile name
You can modify the display in the schema pane and the data pane by selecting a different
object to be the temporary root of the current display This can aid viewing when working
with a large database You can highlight any object and create a new view based on it or
in the case of associations and association types based on the target Each view is
displayed on a separate tab page in the schema or data paneThese views are temporary
and are not saved
The Sentences Explorer quick tour
The Sentences Quick Tour
119
Figure 4-2 Example of Sentences Explorer tabs
You can use the blue arrows on the toolbar or the Create Tab commands on theView
menu to create and remove tabs
The root tab in the schema pane always shows the name of the current profile Any
schema type can be made the root of a new tab If the selected item is an association or an
association type you can open a new explorer tab on the items target You can open as
many tabs as you need
The data pane always shows the instance data for the active schema pane selected type
When you switch between schema tabs open data pane tabs are closed and are not saved
Tabs can also be removed using the Remove Tab command which is on the tab shortcut
menu and on the View menu or by clicking the Remove Tab toolbar button You cannot
remove the original default tabs
The schema pane
The schema pane is used to develop and display the structure or schema of your
Sentences database This pane displays entity value and association types The data pane
is used to display specific information about the entity value and association instances in
your database
The Sentences Explorer quick tour
The Sentences Quick Tour
120
Figure 4-3 The Sentences Explorer Schema pane
The left-hand schema pane always shows the schema folders Core types Core queries
All types and All queries
All the types queries in your schema are always listed in the All types and All queries
folders respectively The Core types and Core queries folders are convenient ways of
displaying the most frequently used types and queries
When you select schema in the schema pane the instances are requested and displayed in
the data pane If you are not concerned with viewing the data you can hide and show the
data pane by selecting Data Pane Alt-D from the View menu
Finding schema
With large schemas the Schema Filter can be used Typing into the filter text box at the
bottom of the schema pane will limit the schema displayed as you type Unlike the
Positioner and Filter tools you cannot use wildcards but you can enter multiple words
The schema folders will have a filter icon next to them when they are not showing the
entire contents
The Core types folder
The Core types folder displays a selection of entity types most central to your schema
When you create a new profile you can choose to select the types for the Core types
folder yourself or you can allow Sentences to select the types automatically
If you allow Sentences to select types automatically then any entity type which is the
source of an association which is itself the source of a further association is displayed in
the Core types folder When you allow automatic selection for the Core types folder if
there are no association types in the current schema that are sourced from association
types then nothing is displayed in the Core types folder
If you choose to make the selection for the Core types folder manually you can select an
entity type by checking the Display in core types folder check box on the General page
The Sentences Explorer quick tour
The Sentences Quick Tour
121
of the Properties dialog Alternatively right-click on an entity type and select Display in
Core types folder from the shortcut menu
The Core queries folder
The Core queries folder displays a selection of queries most central to your schema
There is no automatic selection option for the Core queries folder You must always
choose the queries that you want to display in the Core queries folder
To display a query in the Core queries folder right-click on a query name in the schema
pane and select Display in Core queries folder from the shortcut menu
The All types folder
The All types folder contains all the entity and value types in the current profile
including those in the Core types folder You can build your database schema by adding
entity types and association types in the All types folder Association types are displayed
beneath their source entity types and inverse associations are displayed beneath their
target entity types You can use the expand node buttons to drill-down through the
schema
The All queries folder
The All Queries folder displays a list of all the queries in the current profile
You can also execute a query in the Sentences Explorer Select a query name and choose
Execute Query from the shortcut menu or from the Query menu The results are
displayed in the Explorer data pane
The data and properties pane
Figure 4-4a The Sentences Explorer Data Pane
The data pane displays the entity value and association instances that make up the data
in the database The characteristics of the entities and associations are determined by the
properties of the corresponding association types and entity types
The display of data is always nested allowing easy movement from entities to
associations In the data pane you can drill down from an entity to an association and
from there to another associated entity without any practical limit The data displayed
becomes repetitive at some point
When you select schema in the schema pane the instances are requested and displayed in
the data pane If you are not concerned with viewing the data you can hide and show the
data pane by selecting Data Pane Alt-D from the View menu
The Sentences Explorer quick tour
The Sentences Quick Tour
122
Figure 4-4b The Sentences Explorer Data Pane - Table view
If enabled in the user preferences you can view the data as a table rather than a tree of
data This limits you to viewing only singular Association Types The TableTree view is
changed by selecting the icons on the tab In the above case to the right of Group
company
Figure 4-4c The Sentences Explorer Schema Properties Pane
If enabled in the user preferences you can view the peoperties of the selected schema in
the right hand pane This allows you to quickly view and amend schema propertiesScroll
bars
The Sentences Explorer displays horizontal and vertical scroll bars automatically
whenever the amount of data to be displayed in either pane is too large for the space
available
The Status bar
The status bar is at the bottom of the Sentences Explorer window On the left-hand side is
a status indicator which displays either Workinghellip or Ready
In the centre is a display of the number of instances displayed This display does not
appear if there are more instances on the server which have not yet been loaded on to the
client In this case the Morehellip prompt is displayed at the end of the list of instances in
the data pane
The Sentences Explorer quick tour
The Sentences Quick Tour
123
On the right-hand side of the status bar is a server connection indicator The indicator next
to the server name is green when you have a valid server connection
Divider bar
The schema pane and data pane are separated by a divider bar You can drag the divider
bar to any convenient position in the Sentences Explorer Click the upper left facing
arrow to hide the schema pane and display only the data pane Click the lower right
facing arrow to hide the data pane and display only the schema pane
You may also use F8 to select the divider bar and then use the left and right arrows to
move it Use the Tab key to deselect the divider bar
Shortcut keys
Sentences windows menus and dialogs support keyboard shortcuts and accelerators The
shortcut key character is indicated with an underscore in menu listings Press Alt and the
shortcut key to use the accelerator Sentences also uses standard shortcuts On Windows
the Ctrl key and on Mac OS X the Command key ( ) are combined with the keys C V
and X for copy paste and cut respectively
Sentences specific shortcuts are
Ctrl+D default Dataform
Ctrl+P Properties dialog
Ctrl+N New Profile dialog
Ctrl+C Open Profile dialog
F6 toggle between schema and data panes
You can press the Tab key to move between fields in any Sentences window or dialog
You can use the up and down arrow keys to select menu items and you can use the Esc
key to close a menu You can use the left and right arrow keys to move the cursor in
editable fields and you can use the Home and End keys to go to the top and bottom of
lists of data Using the Page Up and Page Down keys to page through the displayed data
If there is more data in the database than Sentences can display in the current pane the
Morehellip prompt is shown Double-clicking the Morehellip prompt or pressing the Page
Down when the Morehellip prompt is highlighted retrieves more data items (see ldquoDemand
loading of datardquo )
All the available shortcut keys are listed in Appendix A lsquoMenus and Commands
summaryrsquo
Display Session Options
There are several options that you can choose from that last for the duration of the
session after which they revert back to their defaults
To view the Session Options select Session Optionshellip from the View menu or select
Optionshellip from the status bar context menu
The Sentences Explorer quick tour
The Sentences Quick Tour
124
Figure 4-5 The Session Options dialog
You may want to see which objects in your Sentences database are stored in which of
your profile chapters and you may want to be able to distinguish between different
objects that have the same display name You can do this by displaying the internal
identifiers that Sentences uses for chapters and other objects
There are three possible settings for the Options dialog None (the default) Chapter
numbers and Chapter numbers and Object IDs If you select Chapter numbers
Sentences displays a number next to each item displayed in the Sentences Explorer
representing the database chapter in which that object exists for example [2] The number
corresponds to the position of that chapter in the available chapters list in the Edit Profile
dialog
If you select Chapter numbers and Object IDs Sentences displays next to each item
displayed in the Sentences Explorer a number representing the chapter file followed by a
number representing the object in the chapter files (its surrogate) for example [22097]
The storage chapter location is significant for entities and associations but not for values
as they are stored in all the chapters in a profile For this reason Sentences displays a large
number above 32000 as the chapter number for values
The Sentences Explorer quick tour
The Sentences Quick Tour
125
Figure 4-6 Sentences Explorer view with Chapter numbers and Object IDs option
selected
The Session Options also include options for using the Sandbox functionality (see
ldquoSandbox Modesrdquo) and setting the Transaction Visibility timestamp (See ldquoTransaction
Visibilityrdquo)
Support information
You can view a list of currently set parameters and other information useful for technical
support and diagnostic purposes in the Support Information pages
To view this information select About from the Help menu and then click Support
Information The information is divided into three sections as shown in Figure 4-7
Figure 4-8 and Figure 4-9
Figure 4-7 General support information page
The Sentences Explorer quick tour
The Sentences Quick Tour
126
Figure 4-8 Client parameters information page
Figure 4-9 License information page
In the Enterprise Edition the Support Information display shows the Chapter Version
and Communications Version numbers (which are internal references for support
purposes only) a list of any client parameters that have been set (see ldquoUserdefined
parametersrdquo ) and a list of certain applet parameters if they have been set (see ldquoSentences
applet parametersrdquo ) In the Personal Edition application parameters are shown instead of
applet parameters (see the Personal Edition Supplement for details)
The Sentences Explorer quick tour
The Sentences Quick Tour
127
Explorer shortcut menus
Figure 4-10 An example of a shortcut menu
When an object is selected you can display a shortcut menu by clicking the secondary
button on your mouse or by pressing Shift + F10 on your keyboardEntity types
association types entities associations queries and parameters displayed in the Sentences
Explorer all have shortcut menus associated with them
The command options on these menus are taken from the Schema menu the View menu
and the Edit menu The keyboard shortcuts available with each command are also
displayed on the shortcut menu The commands available differ from time to time
according to the circumstances
If the selected item is a hyperlink in the data pane the shortcut menu includes a Follow
Hyperlink option
There are separate shortcut menus available for each of the system folders and for queries
The Dataform quick tour
The Sentences Quick Tour
128
The Dataform quick tour
The Dataform is Sentencesrsquo unique dynamic format for creating editing and browsing
data Dataforms are created automatically from the Sentences schema and display the
associations sourced from a type
A typical Dataform is shown in Figure 4-11
You can open the Dataform for an object by selecting Default Dataform from the
shortcut menu or by pressing Ctrl + D or by clicking the Dataform button on the toolbar
Figure 4-11 A typical Dataform
Different kinds of Dataform
Sentences can create a Dataform which automatically displays all the associations sourced
from a specified type This is known as the base Dataform You can use the Query Editor
to design and save a custom Dataform that may only display a selection of the available
associations for that type A custom Dataform can include associations that use the
specified type as their target You may define either the base Dataform or a custom
Dataform as the default Dataform for a type
For more details see ldquoThe base Dataform and the default Dataformrdquo
If a dataform contains fields which are calculated then it will by default automatically
refresh these calculations whenever a field is changed This ldquoauto-refreshrdquo function can be
turned off by unchecking the box at the bottom of the dataform
You can open a Dataform on an entity type and use it to create new associations This is
known as a Create Dataform You can also open a Dataform on any instance which can be
used to update existing associations This is known as an Update Dataform For more
details about Create Dataforms and Update Dataforms see ldquoCreate and update
Dataformsrdquo
The Dataform quick tour
The Sentences Quick Tour
129
You can often open a new Dataform from a field on an open Dataform using the shortcut
menu for the field In most cases changes you make in these Dataforms do not effect the
original Dataform For more details see ldquoParent Dataforms and child Dataformsrdquo
You can display a Dataform from the Explorer or from another Dataform and you can
also configure a Dataform to run in its own Java applet so that it can be displayed on its
own or as part of some other suitable web page For more details see ldquoThe Dataform
appletrdquo
Title bar
The Dataform title bar always displays the name of the source object of the associations
being displayed This source object may be an entity or an association On a Create
Dataform the title bar is always New xxx where xxx is the name of the entity or
association type
Dataform tabbed pages
The associations displayed on a Dataform may be distributed on two or more tabbed
pages as illustrated in Figure 4-11 If the type or instance for the Dataform has subsets or
supertypes or has an equivalent type the base Dataform has multiple pages one for each
of these related types If you create instance-specific associations they are displayed on a
separate tab when the Dataform for that instance is displayed For more information see
ldquoSubsets properties pagerdquo ldquoSupertypes properties pagerdquo and ldquoEquivalence properties
pagerdquo
The base Dataform displays the source object as an instance of its own type an instance
of any of its supertypes an instance of its superset type an instance of any of its
supersets subset types or an instance of its equivalent types simultaneously The base
Dataform creates a tabbed page for each of these types for which one or more associations
exist A custom Dataform creates tabbed pages as required for the association types
selected for it You can also add Page nodes in the Query Editor to create additional
tabbed pages on a custom Dataform (see ldquoPage Nodesrdquo )
For example the Dataform shown in Figure 4-11 above is from the Human resources
example application in which Employee is a subtype of Person and Resource is a
subset of Employee Employee Resource and Person are each the source of
association types The result is that these three related source types are each represented
by tabs on the Dataform
Further examples of the way using subsets and supertypes affects the display of the
Dataform are given in Chapter 6 ldquoAdvanced techniquesrdquo (see ldquoDataform tabbed pages
with subsets and supertypesrdquo )
Labels and fields
The Dataform displays two objects a label and a field for each of the source objectrsquos
associations The label is based on the verb of the association and the field is where you
can create or update the target for the association
The presentation format of the target field is based on the Format settings in the
Properties dialog for the target object For example a multiple association (an
association that permits more than one target for the same source) is displayed on the
Dataform with a multiple line entry field
The labels of mandatory associations are marked with an asterisk () on theDataform
Sentences does not allow you to save a Dataform if you do not supply a value for a
mandatory association
The Dataform quick tour
The Sentences Quick Tour
130
Ellipsis button and picker lists
Some Dataform fields have an ellipsis button to their right You can use this button
to select a target from a list of existing target type instances
Figure 4-12 A picker list from a Dataform ellipsis button
When you click the ellipsis button Sentences displays a picker list showing all the
available instances of the associationrsquos target Every picker dialog includes the Positioner
and Filter tools to help you select the target you need If there are more target items than
can be displayed the picker list includes the Morehellip prompt
Dataform shortcut menus
Figure 4-13 A Dataform shortcut menu
The Query Editor quick tour
The Sentences Quick Tour
131
The options in the shortcut menu from a Dataform field allow you to open additional
Dataforms to view or create instances
Sentences uses the association verb and target type names and the current target instance
name as the names of the shortcut menu options The available options include viewing a
Dataform for the current association viewing a Dataform for the current target instance
creating a new association creating or selecting a new target and deleting the current
association If the target is a hyperlink the shortcut menu includes a Follow Hyperlink
option
The Query Editor quick tour
Figure 4-14a The Query Editor
A full description of the Query Editor including details of how to create and edit queries
is given in Chapter 7 ldquoSentences queriesrdquo This current section describes the main
features of the Query Editor window
Figure 4-14b The Query Editor - Properties
The Query Editor quick tour
The Sentences Quick Tour
132
Rather than open a dialog to edit the properties of each request node the right hand pane
now contains a Schema tab and a Properties tab When you select different query nodes
the appropriate properties are displayed in the right hand properties tab Note The Query
Editor used in Sentences version 1 is now referred to as the Set Query Editor If you need
information about using set queries and the SetQuery Editor please contact
supportsentencescom
Query Editor menu bar
The Query Editor menu bar contains the following menus
Menu namehellip has commands about
Query saving a query and query properties
Edit adding request nodes derived type nodes and sort and
selection nodes
closing binding and hiding nodes editing expressions
standard editing actions query node properties
View expanding and collapsing the request or result tree
Parameter creating and using parameters
Results execute a query export a CSV file export DTD export or
view XML results export XSL stylesheet
Dataform testing a custom Dataform
Help accessing help information
Query Editor toolbar
The Query Editor has the following buttons
Button Description Action
Execute execute (run) the query
Stop stop retrieving data from the server
Save save the query
Properties
view or edit the properties for the
selected node
Cut cut the selected item
Copy copy the selected item
Paste paste the selected item
Delete
delete the selected item displays
the delete impact dialog
Dataform
display the default Dataform for the
selected item
Custom Dataform
display the custom Dataform for
the selected item
Expand Tree expand all the nodes in the tree
Collapse Tree collapse all the nodes in the tree
Expand Node expand the current node
Collapse Node collapse the current node
Query Editor icons
The icons used in the query request tree for nodes are similar to those used in the schema
pane for association entity and value types
The Query Editor quick tour
The Sentences Quick Tour
133
Similar icons are used in the query result both in the query results pane of the Query
Editor and in the Sentences Explorer Query result icons are always displayed in green to
distinguish them from database instances
Icon Name
query name
entity type node (magenta)
association type node (magenta)
value type node (magenta)
forward or inverse request node in a recursive closure loop
derived type node
page node
result entity (green)
result value (green)
result association (green)
expression
selection node
sort node
transitive closure node
Error
Query pane
The query pane occupies the top left hand side of the Query Editor window This is where
you build your query by creating a query request tree
Schema pane
The schema pane occupies the right hand side of the Query Editor window This pane
contains a copy of the contents of the All types folder from the Sentences Explorer
schema pane After you start building your query the Query Editor schema pane displays
only those types that could be used at the currently selected query node You can drag and
drop or copy and paste the entity and association types you need to use in your query
from here
Results pane
The results pane occupies the bottom left hand side of the Query Editor window When
you execute your query the results are displayed here If the query takes longer than a few
seconds then a progress panel appears to show you when the query started the duration
and how many instances have been processed so far The instances are a count of root
items even if they have subsequently been excluded from the final results but gives you
and idea of progress if you know how many items there are in total
Query Editor status bar
The status bar is at the bottom of the Query Editor window and has two parts the status
indicator which usually says Ready and an item counter
The item counter indicates the number of items in the query results set currently loaded in
the data pane which may be less than the total number in the database (see ldquoDemand
loading of datardquo )
The Message Log
The Sentences Quick Tour
134
Query Editor divider bars
There are two divider bars in the Query Editor window a horizontal bar between the
query pane and the results pane and a vertical bar between these two panes and the
schema pane
You can drag the divider bar to any convenient position in the Query Editor Click the
arrows on the divider bars to snap them to the appropriate edges of the Query
The Message Log
Sentences displays a message in the Message Log whenever it is unable to complete an
action you requested The message that Sentences displays should help you identify and
resolve the problem For example if you try and save a Dataform without giving a value
for a mandatory association field Sentences displays the Message Log with a message
reminding you to complete the mandatory field
Sentences displays the Message Log when an error occurs anywhere in Sentences
including the Explorer the Dataform and the Query Editor
You can view the Message Log at any time by selecting Messages from the View menu
Sentences messages are classified in three groups Errors Warnings and Information
and you can use the check boxes on the message log display to select which kinds of
messages you wish to see
Figure 4-15 The message log
You can copy the text of messages from the message log by using the Copy command on
the shortcut menu for the message log You can then paste the message text into another
application using the appropriate commands for your systemEditor window
Profiles and chapters
Working with Sentences
135
Chapter 5
Working with Sentences
This chapter describeshow to work with Sentences to design create and use a
database
The topics discussed in this chapter include
bull working with profiles and chapters
bull using the Sentences Explorer
bull locating data in the Explorer
bull properties datatypes and formatting
bull working with the Dataform
bull working with the Dataform Picker and Query applets
bull data exchange with external formats
Profiles and chapters
A Sentences database is highly flexible being made up of chapters which are files in
which data is stored and profiles that define which chapters are visible to usersThis
flexibility means that you can control access to certain kinds of data in your database by
excluding or including the chapter containing that data in a particular profile
Both the structural schema information and the data content of a Sentences database are
stored in chapter files User access to the database is through a profile which is a selection
of one or more of the database chapters Different users may use different profiles with a
different selection of chapters to access the same database (see ldquoCreating database views
using profiles and chaptersrdquo )
Updates and changes to the schema or data information in a database are stored in
chapters that you specify when you create or edit a profile (see ldquoUsing the Edit Profile
dialogrdquo ) Using separate chapters for schema data and query changes allows you to
separate schema information from data information in your database and to create
different views for different users and therefore this is strongly recommended For more
details see ldquoUsing multiple profilesrdquo 0 and ldquoCreating database views using profiles and
chaptersrdquo
In addition to the chapters defined as changes chapters a profile may contain other
chapters The schema and data information in these chapters is available to
Sentences and is displayed and used in the profile but any updates and changes are made
only to the defined changes chapters
All the commands concerned with managing chapters in a profile including creating
adding removing and defining changes chapters are accessed through the Edit Profile
dialog
Data and schema updates
All data or schema changes made using the Sentences client are updated to the database
as soon as they are executed This means that when you select Save or Delete in any
Sentences Explorer dialog or select Save Save amp Reset or Save amp Edit in the
Dataform your changes are applied to the database immediately
Profiles and chapters
Working with Sentences
136
You must select the Save command to save queries when you are using the Query Editor
Any Dataform that has an Apply or an Apply amp Reset button is known as a child
Dataform Changes you make in a child Dataform are only saved to the Sentences
database when the parent Dataform is saved (see ldquoParent Dataforms and child
Dataformsrdquo) In some circumstances the server may not accept the update (see
ldquoTransaction processing in Sentencesrdquo)
If you make changes in the Dataform and close the Dataform without clicking on Save
the changes you made are not saved Sentences displays a warning message if you close a
Dataform that contains unsaved selections
Chapter file locations
You can place your database chapters in one or more defined locations The possible
locations must be listed in the Serverproperties file under the ChapterPathList
property (see ldquoThe Serverproperties filerdquo) The first location listed for this property is the
location you selected for chapter files when you installed Sentences This is the default
location for all chapter files including the system chapters
The defined locations may be on one or more computers which can be accessed as local
or network drives When you create a new chapter you must specify the location from the
drop-down list in the New Chapters dialog The directory path names that appear in this
list are based on the paths as viewed from the computer running the Sentences server
System chapters
Sentences uses three system chapters Metaschemachap Schedulerchap and
Profileschap When you install Sentences these chapters are placed in the location you
specify for chapter files You can move these files to another location but if you do so
you must specify the new location under the SystemChapterPath property in the
Serverproperties file You must shut down the Sentences server before you move the
system chapters
Metaschemachap contains information that is internal to Sentences It does not contain
any user-visible or user-modifiable data You should not delete this file or attempt to
modify it in any way If this file is deleted accidentally Sentences creates a new copy of
this file when the Sentences server starts up
The Profiles database and the Profiles profile
The system chapter Profileschap contains information about all the profiles in your
Sentences installation Do not delete this file or attempt to modify it in any way If this
chapter file is deleted accidentally Sentences creates a new copy of it when the Sentences
server starts up A new copy of profileschap created by Sentences does not contain
any information about your profiles In this situation use the Edit Profile dialog to create
all the profiles you need including the example profiles included in a default Sentences
installation
Sentences includes a system profile named Profiles that is hidden from users by default
This profile contains one chapter Profileschap and constitutes a profiles database
This profile can be addressed using the Sentences API
To make this profile visible to users and to view the profiles database in the Sentences
Explorer you can set the optional applet parameter ProfileProfileVisible to Yes (see
User-defined parameters) You cannot give the name Profiles to a profile that you create
and you cannot delete the Profiles profile if it is visible
Sentences 40 extends the Profiles database and profile to include User Security details
As a User Administrator you may open the Profiles Profile to administer users by
selecting Administer Users from the Tools menu
Profiles and chapters
Working with Sentences
137
The Profiles profile now includes two additional queries The first is used to export the
Users and their privileges This can be used in conjunction with the original two queries
for exporting chapter and profile information
Another new query identifies Chapters that have been orphaned Orphaned Chapters are
no longer used by any profiles This is useful when housekeeping the chapter directories
System administrator passwords
With the introduction of a User Security model the System Administrator requires an
initial password which must be changed at first login to the system
For the Personal Edition this is hard-coded as ldquoSys Adminrdquo For the Enterprise Edition
each license file contains itrsquos initial encrypted password
If the System Administrator looses their password then the only way to regain access is to
delete the Profiles profile This will restore the original password that came with the
license file but you will loose all your chapter profile user role and privilege
information
It is advisable to use the built-in queries to regularly back-up the profiles database The
individual user passwords will not be exported in plain text
Using multiple profiles
You can create multiple profiles that use different selections of chapters from the same
database A userrsquos view of the database is defined by the sum of all data and schema
updates in the chapters of their profile and therefore different users can have different
views of a single database You can use the profile mechanism to customise different
Sentences views for different users For more details see ldquoCreating database views using
profiles and chaptersrdquo
Profile and chapter commands
The Sentences Explorer File menu includes commands for creating opening editing and
deleting profiles
Command name Action
New Profile displays an empty Edit Profile dialog
Open Profile displays the Open Profile dialog
Edit Profile displays the Edit Profile dialog with details of
thecurrent profile
Delete Profile displays the Delete Profile dialog
Refresh Profile closes and reopens the current profile
You can export a database and the profiles it contains and import the chapters that make
up the database using server commands For more details see ldquoExporting and importing
databasesrdquo
Profile and chapter constraints
You must be aware of the following constraints in the use of profiles and chapters
bull A schema definition specifies separate changes chapters for schema data and query
information Users can only save updates to the database if the definition of the current
profile includes an appropriate changes chapter For example if the profile definition does
not specify a query changes chapter users cannot save any changes they make to queries
(see ldquoChanges chaptersrdquo)
Profiles and chapters
Working with Sentences
138
bull When the FixedProfile parameter in the jnlp or javascript definition is set to ldquoyesrdquo
the profile commands on the File menu are not available and users cannot change their
Sentences profile (see ldquoSentences Applet Parametersrdquo)
bull The EditOption parameter in the jnlp or javascript definition can restrict a userrsquos
ability to change parts of the database For example when the EditOption parameter is
set to data users cannot save changes to the schema even if a Schema changes chapter is
specified in the Edit Profile dialog (see ldquoSentences Applet Parametersrdquo)
bull You cannot open or edit a profile if one or more of the chapter files used in the profile is
no longer available for example if it has been deleted from disk In this case you can
create a new profile with valid chapter files and give it the same name as the profile that is
no longer valid and this overwrites the previous invalid profile information
The Open Profile dialog
Figure 5-1 The open profile dialog
All the profiles available are shown in the Open Profile dialog The list of available
profiles is controlled by the Profileschap file on the Sentences server
You can only use one profile in any Sentences session at any time Opening a profile
closes any previous profiles However you can run more than one Sentences session at a
time
You can open the Open Profile dialog by selecting the Open Profile command on the
File menu or the Open Profile button on the Sentences Explorer toolbar
Creating a new profile
To create a new profile select New Profile from the File menu Sentences displays an
empty copy of the Edit Profile dialog See the section below for details
Creating a new profile with the profile wizard
Version 40 introduces a New Profile Wizard to assist with the repetitive task of creating a
new Profile with one data chapter and one schema chapter set as the appropriate targets
for data schema and query changes
The wizard also helps with the creation of Profiles that can dynamically or statically
connect to Relational Databases
Creating a new standard profile using the wizard
To create a new standard Profile follow these steps
Profiles and chapters
Working with Sentences
139
1 Select New Profile Wizardhellip from the File menu The New Profile wizard will
open The default choice is to create a Standard Profile so you can leave this
unaltered
2 Enter a name for the new profile
3 If you select Show Advanced to view the advanced properties you will see that
the profile name you have entered is used to generate the default name for the
schema and data chapter
4 You may optionally enter a description
5 The Core types folder displays a selection of the types in your schema The
selection of types for this folder can be manual or automatic To choose
automatic selection check the Generate core types automatically checkbox To
choose manual selection leave this checkbox unselected
6 Determining whether a tree node has any children can be quite a time consuming
process so for very large databases you have the option for a Profile to assume
that child associations are present and always show a plus sign To choose to
assume that child associations are present unselect the checkbox
7 Select Finish to create the new profile
Creating a new LazyView profile using the wizard
To create a new LazyView Profile follow these steps
1 Select New Profile Wizardhellip from the File menu The New Profile wizard will
open
2 Select External Data
3 Enter a name for the new profile
Profiles and chapters
Working with Sentences
140
If you select Show Advanced to view the advanced properties you will see that
the profile name you have entered is used to generate the default name for the
schema and data chapter
4 You may optionally enter a description
5 The Core types folder displays a selection of the types in your schema The
selection of types for this folder can be manual or automatic To choose
automatic selection check the Generate core types automatically checkbox To
choose manual selection leave this checkbox unselected
6 Determining whether a tree node has any children can be quite a time consuming
process especially for dynamic LazyView profiles For these and very large
databases you have the option for a Profile to assume that child associations are
present and always show a plus sign To choose to automatically determine
whether a tree node has any children select the checkbox
7 Select Next to progress to the next page
Profiles and chapters
Working with Sentences
141
The second page allows you to enter details of the database you wish to connect to
8 Select the Database Vendor There may be several different database versions for
each vendor
9 Enter the Server name where the database is located If you have connected
successfully to that database before then the drop-down list will contain the
server and you can select it from the list
10 Enter the Database name If you have connected successfully to that database
before then the drop-down list will contain the name and you can select it from
the list
11 For Microsoft SQL Server only you have the option of selecting Integrated
Security If so then your Windows credentials will be used to connect to the
database
12 If Integrated Security is not available or desirable then enter the username and
password that will allow you access to the database
13 By default once a LazyView Profile has been created the LazyView wizard will
be opened for you to define the mapping between relational database and
Sentences You may optionally deselect the checkbox if you do not wish to
perform the mapping immediately
If you select Show Advanced to view the advanced properties you will see that the
profile name you have entered is used to generate the default name for the Lazy View
chapter
Profiles and chapters
Working with Sentences
142
14 You may optionally change the Lazy View chapter name
15 You may optionally choose an alternative JDBC Driver
16 You may optionally change the port number used to connect to the database if it
is not the default one shown If you have connected successfully to that database
before then the drop-down list will contain the ports used previously and you
can select it from the list
17 The option choices dictate whether you would like to connect statically or
dynamically to the database For details see the LazyView - Using Sentences to
view relational databases section
18 You can click on the Test Connection button to test your connection parameters
If you do not the connection will be tested when you select Finish
19 Select Finish to create the profile and launch the LazyView Import Wizard (if
requested) or Back to return to the previous page
The Edit Profile dialog
Figure 5-2 The edit profile dialog
The Edit Profile dialog is displayed when you select either New Profile or Edit Profile
from the File menu When you select New Profile the Edit Profile dialog is displayed
with no information When you select Edit Profile the Edit Profile dialog is displayed
with the settings for the current profile
Using the Edit Profile dialog
The Edit Profile dialog is shown in Figure 5-2
bull Profile name
Enter a name for the profile in the profile name field You can refer to a named profile in
the jnlp or javascript definition for the Sentences client applet in the start up pages for
Profiles and chapters
Working with Sentences
143
other Sentences applets and when using the Sentences API Because of this you should
make sure that profile names do not include any special characters that need to be
represented by escape sequences in HTML which may not be interpreted correctly by
Sentences
Note The name Profiles is reserved for the system profiles database and cannot be used for
user-created profiles (see ldquoThe Profiles database and the Profiles profilerdquo )
bull Renaming a profile
You can change the displayed name of a profile by entering a new name in the Profile
name field Sentences does not actually rename the profile but creates a new profile with
the new name you have entered If the new name is the same as that of an existing profile
the existing profile is overwritten
If you only change the case of a profile name when you edit it this does not create a new
profile
You can reset the profile definition used on a client to be the same as the current saved
version of the profile by selecting the Refresh command on the File menu or by clicking
the Refresh button on the toolbar
bull Profile description
You can optionally enter a description for the profile that will appear in the Open Profile
dialog
Chapters
The chapters field lists all the chapters that are available in a profile (the available
chapters) The schema and data information in all the available chapters is displayed and
used in the profile
Changes to schema data or query information are saved in the specific chapters defined
for schema data and query changes
Changes chapters
Use the Edit Profile dialog to set the active chapters which Sentences uses for updating
changes to the schema data and queries of your database These are known as the
Schema changes Query changes and Data changes chapters
Although you may use the same chapter for more than one of these change chapters using
separate chapters makes it easier to create different profiles for different users
A user may save changes to the database only if the appropriate changes chapter is
defined in the Edit Profile dialog This means that if a Schema changes chapter is not
specified users cannot save changes to the database schema and if a Data changes
chapter is not specified users cannot save changes to database data If a Query changes
chapter is not specified users can create new temporary queries and run them in the
Query Editor and make temporary changes to existing queries butthey cannot save any
of these changes
Generate Core types automatically
The Core types folder displays a selection of the types in your schema (see ldquoThe Core
types folderrdquo ) The selection of types for this folder can be manual or automatic To
choose automatic selection check the Generate core types automatically checkbox To
choose manual selection leave this checkbox unselected
Determine if child associations are present
When Sentences displays trees of data it determines whether that tree node has any
children (either forward or inverse associations) and displays a plus sign to indicate that
Profiles and chapters
Working with Sentences
144
the tree node can be expanded This can be especially time consuming when using a
dynamic LazyView Chapter
For this reason you can opt for a Profile to assume that child associations are present and
always show a plus sign (unless the absence of children can be easily determined using
Metaschema)
Saving a profile
When you make any changes to a profile you can either save the changed profile or
modify the current profile to use the changed settings for your current Sentences session
only or discard all your changes
After you make any changes the OK button is available Click OK if you wish to save
your changes or use your changed setting for the current session only Sentences displays
three options in a confirmation dialog
bull Yes confirms and saves all your changes to the profile
bull No modifies the profile to use the changed settings for the current session only but does
not update the saved profile
bull Cancel returns you to the Edit profile dialog
To discard your changes click Cancel in the Edit Profile dialog
Deleting a profile
To delete a profile select the Delete Profile command from the File menu Sentences
displays the Delete Profile dialog
Highlight the profile you want to delete and click the Delete button Sentences displays a
confirmation dialog Click Yes to delete the profile
Deleting a profile does not affect the chapter files used in that profile in any way The
chapter files still exist on your hard disk and can still be used in other profiles
Working with chapters
Add chapter
Figure 5-3 The Add Chapter dialog
To add a new or existing chapter to the profile click the Add button to open the Add
Chapter dialog shown in Figure 5-3
To add an existing chapter to a profile highlight the chapter name in the Add Chapter
dialog You can use standard Windows selection techniques to select more than one
chapter from this list
Profiles and chapters
Working with Sentences
145
Click OK to add the selected chapter or chapters to the list of available chapters for the
profile To return to the Edit Profile dialog without adding chapters click the Cancel
button
The first chapter added to a profile is set as the default changes chapter for schema data
and queries Apart from this the order in which chapters are listed in a profile has no
significance
To create a new chapter click the New button This opens the New Chapter dialog
shown in Figure 5-4
New chapter
Figure 5-4 The new chapter dialog
To create a new chapter type in the name in the New Chapter dialog and click OK This
adds the new chapter to the list shown in the Add Chapter dialog You must repeat this
action for each chapter you want to create To return to the Add Chapter dialog without
adding a new chapter click the Cancel button
You can select the physical location for your new chapter from the Location dropdown
list Locations for chapter files are only listed here if you have defined them in the
ChapterPathList parameter of the Sentencesproperties file (see ldquoChapterPathListrdquo)
If the paths defined for your chapters are very long you may not be able to view the
complete path in this dialog In this case you can resize the dialog window by clicking on
its right edge and dragging to the right
To create a chapter for use by the LazyView tool to view data from a relational database
click the LazyView Chapter checkbox on the New Chapter dialog For more
information see the LazyView Guide
Naming chapter files
When you create a new chapter the name you assign to it in the New Chapter dialog is
generally used as the basis of the chapterrsquos file name on disk Chapter files on disk have
the extension chap Sentences chapter names are case sensitive
There are no restrictions on the characters that can be used in Chapter names However if
you use a character that has a special meaning in your computerrsquos file system Sentences
automatically maps that character to an alternative character when it creates the disk file
for that chapter
The Edit Profile dialog displays a chapterrsquos logical name which is stored in the system
chapter Profileschap All profiles use this chapter to look up chapter names so when a
chapter is renamed in one profile it is subsequently visible in other profiles using its new
logical name
Rename
To rename a chapter click Rename in the Edit Profile dialog and enter the new name
Like other elements in Sentences all chapter files have a unique hidden internal identifier
which never changes Sentences identifies chapter files using these internal identifiers so
Profiles and chapters
Working with Sentences
146
chapter files can be renamed and still be visible to Sentences When you rename a chapter
in the Edit profile dialog you only change the visible (logical) name of the chapter Both
the internal identifier and the disk file name of the chapter remain unchanged
Properties
Click Properties in the Edit Profile dialog to display the properties for a chapter For all
chapters Sentences displays the following information
bull Name the chapter file name
bull Chapter UID the unique internal identifier for the chapter
bull Block Size the chapter block size
bull Read-only whether or not the physical file is editable
bull Chapter Type either a LazyView or a Standard chapter
bull Chapter size the physical size of the chapter file on the server
All these fields are read only
When LazyView is installed and licensed there is an additional tabbed page which is
used to set the connection properties for the chapter For more information about the
LazyView tool which is used for viewing data from relational database tables see the
LazyView Userrsquos Guide
Checking chapters used for changes
If you position your mouse pointer over the profile schema tab in the Explorer Sentences
displays the profile name and the names of the chapters used for schema data and query
changes This is an alternative way of checking which chapters are used for changes
Deleting a chapter
If you need to delete a chapter you must first make sure that it is not used in any profile
We recommend keeping a backup copy of any chapter before you delete it You can then
delete the chapter from your disk If you delete the chapter while
Sentences is still running the chapter name is still visible in the Add Chapters dialog
until you restart Sentences
Password-protected chapter files
You can define a password to protect a chapter file Once you have assigned a password
to a chapter file it can only be accessed when the password is entered
Sentences provides a command line procedure only for setting changing and deleting
passwords This mechanism is supported by a dedicated Sentences servlet When users
wish to access a profile that includes password-protected chapter files they must first
access a specific HTML page and enter the necessary passwords before accessing the
profile
System administrators should note that the password entry HTML page is not in itself
secure and therefore server-based security measures are recommended
When you use a command line procedure that references password protected chapter files
Sentences displays a prompt requesting the password for each protected file
The Sentences API includes an interface and methods for use with password protected
chapter files
To set a password
1 Make sure the Sentences server is shut down
Profiles and chapters
Working with Sentences
147
2 Open a command prompt and navigate to the ltSentences_homegt directory and enter
the command
ChapterPassword ltchapternamegt
where ltchapternamegt is the name of an existing chapter in any one of the locations
listed in the Serverproperties file under the ChapterPathList property
3 Sentences prompts you to type in a password for the chapter and then prompts you to
type in the password a second time for confirmation
4 Sentences confirms that the password has been set with the following message
The password for chapter ltchapternamegt has been changed
To change a password
1 Make sure the Sentences server is shut down
2 Open a command prompt and navigate to the ltSentences_homegt directory and enter
the command
ChapterPassword ltchapternamegt
where ltchapternamegt is the name of an existing chapter in any one of the locations
listed in the Serverproperties file under the ChapterPathList property
3 Sentences prompts you to type in the existing password for the chapter
4 Sentences prompts you to type in a new password for the chapter and then prompts
you to type in the new password a second time for confirmation
5 Sentences confirms that the password has been set with the following message
The password for chapter ltchapternamegt has been changed
To delete a password
1 Make sure the Sentences server is shut down
2 Open a command prompt and navigate to the ltSentences_homegt directory and enter
the command
ChapterPassword ltchapternamegt
where ltchapternamegt is the name of an existing chapter in any one of the locations
listed in the Serverproperties file under the ChapterPathList property
3 Sentences prompts you to type in the existing password for the chapter
4 When Sentences prompts you to type in a new password for the chapter press Enter
without typing in anything Repeat this action when Sentences prompts you to type in the
new password a second time for confirmation
5 Sentences displays a message asking you to confirm that this action removes the
password from the specified chapter Type in y (for yes) to confirm or n for no to retain
the password
To enter a password
1 Start the Sentences server
2 Using a Web browser access the following URL
lthostnamegtltportnumbergtSentencesPasswordEntry
where lthostnamegt and ltportnumbergt are the hostname and port number respectively for
the Sentences server
Sentences user security
Working with Sentences
148
3 Sentences displays an HTML password entry page listing the files that have passwords
Type in the correct password for each file and click the Submit passwords button
The password entry page displays the names of all the chapters that have passwords You
only need to enter passwords for the chapters in a profile you wish to access
4 Sentences responds with either Password accepted or Incorrect password for each
chapter file password you enter
5 After entering the correct passwords start the Sentences Explorer and access the
profiles in the normal way
Password-protected files and the Personal Edition
The Personal Edition cannot access any Sentences chapter file that currently has a
password assigned to it
Sentences user security
Sentences requires you to log in with your username and password The functions you are
allowed to perform and the information you are allowed to view and update will depend
upon the privileges that you have been granted
A Sentences User Administrator will be able to change the privileges you have been
granted
Logging into Sentences
When you open a Sentences application you will be asked to enter your username and
password
The System Administrator will have set up a maximum number of times that you can
attempt to log in before you are locked out If you are locked out you will need to contact
a User Administrator to reset your password
The first time you log in (or the first time after your password has been reset) you may be
required to change your password
Changing your password
To change your password follow these steps
1 In the Sentences Explorer select Change Passwordhellip from the File menu
2 The Change Password dialog will appear You must enter your existing
password and then the new password twice to confirm
3 Select Change
Sentences user security
Working with Sentences
149
Changing to a different user
To change to a different user follow these steps
1 In the Sentences Explorer select Logout from the File menu
2 Enter the username and password of the user you wish to log in as
3 Select Login
User Preferences
Previous versions of Sentences allowed you to change certain preferences by editing the
parameters of in a client HTML file or the Applicationproperties file for the Personal
Edition Sentences Version 40 introduces preferences specific to each user
To change your preferences follow these steps
1 In the Sentences Explorer select Preferenceshellip from the View menu
2 Amend the available preferences and select OK or Cancel when you are finished
to change or cancel your preferences
Available User Preferences
Not all preferences will be available to all users depending upon the Edition of Sentences
and whether Functionality such as LazyView are enabled
bull Veto Welcome (General)
You may use this preference to specify whether to show the welcome screen upon start-
up This preference is only applicable and available in the Personal Edition
bull Table view of data (General)
Sentences user security
Working with Sentences
150
You may use this preference to specify whether to allow users to display results in the
data pane as a table rather than the default tree This feature is at the Beta stage for
example query results cannot be displayed as a table yet
bull Data request size (General)
You may use this preference to specify the number of results to initially show Rather
than load the entire results Sentences will show by default the first 50 results followed by
a ldquomorerdquo node
bull Executing Query Status refresh (General)
You may use this preference to specify the frequency with which the Query Editor
updates the progress of an executing query The default is every three seconds
bull Table view of data (Data Pane)
You may use this preference to specify whether or not to allow the user to change the
Data Pane between displaying a Tree of data to displaying a Table of data
bull Show pages in the data pane (Data Pane)
You may use this preference to specify whether or not to show Page Nodes in the data
pane
bull Show inactive instances in the data (Data Pane)
You may use this preference to specify whether or not to show Inactive instance in the
data pane
bull Show the properties tab in the Data Pane (Data Pane)
You may use this preference to specify whether or not to show the properties of the
selected schema in the data pane as a tab next to the data tab
bull Show the Data Tab first - and by default (Data Pane)
When the properties tab is visible (see above) you may use this preference to specify
whether or to show the properties tab or the data tab first ie to the left The left tab will
also be selected by defaultbull Automatic Foreign Key Matching (LazyView)
You may use this preference to specify whether or not to attempt to automatically match
foreign key columns to those available when creating user-defined Foreign keys in the
LazyView Mapping wizard This preference is only available if the LazyView
functionality is enabled
bull Check Relational Schema (LazyView)
You may use this preference to specify whether or not the system will check to see if the
Relational Schema has changed This will be done before viewing the current LazyView
Mapping Definition re-mapping or re-importing static data This preference is only
available if the LazyView functionality is enabled
bull Show Subsets (Schema Pane)
You may use this preference to specify whether to include Subset Metaschema
information in the Schema Pane of the Sentences Explorer
bull Show Supertypes (Schema Pane)
You may use this preference to specify whether to include Supertypes Metaschema
information in the Schema Pane of the Sentences Explorer
bull Show Equivalent Types (Schema Pane)
You may use this preference to specify whether to include Equivalent Types Metaschema
information in the Schema Pane of the Sentences Explorer
bull Show Custom Dataforms (Schema Pane)
Deploying profiles and chapters
Working with Sentences
151
You may use this preference to specify whether to include Custom Dataforms information
in the Schema Pane of the Sentences Explorer
bull Show Domains (Schema Pane)
You may use this preference to specify whether to include Business Rule Domain
information in the Schema Pane of the Sentences Explorer
bull Hide unused System Domains (Schema Pane)
You may use this preference to specify whether to hide those System Domains that do not
have Effectors in the Schema Pane of the Sentences Explorer
bull Show Business Rules (Schema Pane)
You may use this preference to specify whether to include Business Rules Metaschema
information in the Schema Pane of the Sentences Explorer
bull Include a Business Rules Schema Folder (Schema Pane)
You may use this preference to specify whether to include a Business Rules Schema
Folder in the Schema Pane of the Sentences Explorer
bull Include a State Domains Schema Folder (Schema Pane)
You may use this preference to specify whether to include a State Domains Schema
Folder in the Schema Pane of the Sentences Explorer
bull Include a System Schema Folder (Schema Pane)
You may use this preference to specify whether to include a Specialist Schema Folder in
the Schema Pane of the Sentences Explorer and the Query Editor This folder includes
schema for the End User Application definition Server Text Documents and Tag Clouds
bull Include a Transactions Schema Folder (Schema Pane)
You may use this preference to specify whether to include a Transactions Schema Folder
in the Schema Pane of the Sentences Explorer This preference is only available if the
Transaction Visibility functionality is enabled See the Transaction Visibility section for
details
Deploying profiles and chapters
You can deploy a Sentences database by moving all the chapters and profiles that make
up your database from your development environment to your deployment environment
For example you may choose to develop a Sentences database by running the Enterprise
Edition in local mode (with the server and client running on a single machine) and then
deploy your database on a live intranet or Web server
Important You must have a separate license for each server running Sentences
The two possible methods for deploying your database are exporting the database or
copying chapters
Exporting the database requires using a profile which includes all your chapters and then
reconstructing the profiles on the target system after import This method is explained
fully in the section ldquoExporting and importing databasesrdquo
Alternatively you can copy all your chapter files (chap files) from the
SentencesChapters directory on your development server to the SentencesChapters
directory on your deployment server You can then reconstruct all the profiles for your
database using the Edit Profile dialog There are some limitations and restrictions on
using this method This method is explained fully in the section ldquoCopying chapter filesrdquo
Deploying profiles and chapters
Working with Sentences
152
Schema and data visibility
You can create multiple profiles in a single database A userrsquos view of the database is
defined by the sum of all data and schema updates in the chapters of their profile and
therefore different users can have different views of a single database You can use the
profile mechanism and the delete mechanism to customise different Sentences views for
different users (see ldquoCreating database views using profiles and chaptersrdquo )
Exporting and importing databases
You can export your Sentences database using the Export command which creates a
database export file You can import the set of chapters from a database export file using
the Import command By default the Import command does not automatically recreate
the profile definitions for a database
Export and import operations are command line procedures and are normally carried out
by the administrator of the Sentences database The administrator must have at least
readwrite access to the computer running the Sentences Web server in order to carry out
export and import operations
A database export file contains all the schema and data information contained in a single
export profile including the chapter configuration We recommend using the file
extension lze to identify database export files
Export and import require exclusive access to the Sentences server and therefore you
must close down the Sentences server before you perform an import or an export
operation If you try to export or import a profile while the server is in useSentences
displays an error message Database in use
Benefits of exporting a database
In Sentences all schema and data changes including delete actions are treated as
additions to the chapter files This can have certain advantages as discussed in the section
ldquoCreating database views using profiles and chaptersrdquo
However it is possible that after a time the quantity of changes applied to a database may
make the chapter files very large and may possibly result in poorer performance
The export procedure consolidates data and schema updates and therefore exporting a
database and then importing it may enhance the performance of large databases
Database export and internal identifiers
Sentences uses unique internal identifiers for every schema and data element in the
database These identifiers are used in any links between chapters When you export and
import a database Sentences consolidates the details of schema and data updates creating
a new version of your database By default this new version of your database maintains
the existing internal identifiers and preserves cross-chapter links
Note In earlier versions of Sentences up to Version 21 Sentences automatically renumbered
all the internal identifiers when performing an import operation which meant that cross-
chapter links were not maintained In later versions from Sentences Version 22 you can force
Sentences to renumber by specifying the -renumber switch
To export a database you must specify a profile that includes all the schema and data
chapters that are relevant for an application You may use an existing profile if a suitable
one exists or create a new profile for this purpose
Deploying profiles and chapters
Working with Sentences
153
Default export behaviour
When you use the Export command Sentences checks cross-chapter references to make
sure all required chapters are included in the export profile and displays an error message
if a required chapter is not found By default if Sentences finds that any required chapters
are missing the export operation fails
You can change the default behaviour and run the export command even if some chapters
referenced by other chapters are not included by using the -force switch with the Export
command The result of using the -force switch may be that some of the data from the
original database is missing from the database export file
To export a database
Note The following command line examples use Windows system conventions
You must have write access to all the chapter files used in the database you wish to
export
To export a database
1 Choose a profile that includes all the schema and data files that are relevant to the
application database you wish to export The profile to be exported must meet these
conditions
bull the profile must contain all of the chapters holding your data or schema
bull the profile must not include the system chapters Profileschap or Metaschemachap
bull the profile should not include any other chapters supplied with Sentences such as the
Human resources chapters New chapterchap or any of the Application Suite
chapters except under special circumstances
You may use an existing profile if a suitable one exists or create a new profile for this
purpose You may find it helpful to keep a note of the names of the chapter files used in
the profile you export
2 Shut down the Sentences server
3 Open a command prompt and navigate to the ltSentences_homegt directory
Run the following command at the command prompt
cgt Export [-force] ltprofile namegt ltpathgtltexport file namegt
where ltprofile namegt is the name of a profile recognised in
the current loginchap file and ltpathgtltexport file namegt is
the full path and the name of the database export file you
want to create and [-force] is an option switch If the profile
name includes spaces some operating systems require the
name to be enclosed in quotation marks
Note If the profile you are referencing with this command includes passwordprotected
chapters Sentences prompts you for the password for each chapter concerned (see
ldquoPassword-protected chapter filesrdquo )
Export command option switch
The Export command may include the following option switch
option switch Meaning
-force The -force switch exports a profile even if Sentences finds that some
chapters referred to by other chapters in the profile are missing
Deploying profiles and chapters
Working with Sentences
154
To import a set of chapters
Carry out the following steps to import a set of chapters
1 Shut down the Sentences server
2 Make sure that no copies of any of the chapters being imported exist in any of the
chapter locations specified in the Serverproperties file If Sentences finds a chapter
with either the same name or the same internal identifier as a chapter being imported the
Import command fails
3 Open a command prompt and navigate to the Sentences server directory At the
command line prompt run the following command
cgt Import [-renumber] [-overwrite] ltpathgtltexport file namegt sect
[-location chapterNo=location ]
where ltpathgtltexport file namegt is the full path and file name for the database export
file you want to import and [-renumber] [-location] and [-overwrite] are option
switches as explained in the section ldquoImport command option switchesrdquo
During the import and export procedures Sentences displays a row of asterisks on the
command line screen Each asterisk represents 1000 lines of data that have been
processed
If the Import command fails for any reason any incomplete information is deleted If an
export or import program is interrupted by a user action the Sentences database may be
locked If you find you cannot run Sentences after a failed export or import operation
check the SentencesChapters directory to see if a file named databaselock is present
in any of your chapter file locations If you find this file delete it and then restart the
Sentences server (see ldquoShutting down and restarting the Sentences serverrdquo )
4 When the import operation ends restart the Sentences server and open a Sentences
client
Note If the profile you are referencing with this command includes password protected
chapters Sentences prompts you for the password for each chapter concerned (see
ldquoPassword-protected chapter filesrdquo )
Deploying profiles and chapters
Working with Sentences
155
Import command option switches
You may specify any of the following options by adding the appropriate switch to the
Import command If you do not specify any switch the default behaviour is as described
for the -preserve option
Option switch Meaning
-preserve Use the -preserve switch to import the set of chapters without
changing the existing internal identifiers for chapters and objects
and to maintain links between chapters
You may not use this switch with -overwrite or with
-renumber
-renumber Use the -renumber switch to import the set of chapters and change
all the internal identifiers for chapters and objects This means that
links to chapters outside the imported set of chapters are not
maintained
Import with the -renumber switch adds the definition of the exported
profile to the Profiles database so that it is automatically listed in the
Open Profiles dialog You may use this switch with -overwrite but
not with -preserve
-overwrite The -overwrite switch instructs the import program to overwrite any
existing profile with the same name as theprofile being imported
If you do not specify the -overwrite switch and a profile with the
same names as the imported profile already exists Sentences adds
a numeral to the end of the name of the imported profile
The -overwrite switch does not have any effect on existing
chapters and Sentences always adds a numeral to the names of any
imported chapters that have the same names as existing
chaptersYou may use this switch with -renumber but not with -
preserve
-location The -location switch allows you to specify the chapter directory for
the chapter files in the profile being imported You may specify
different locations for each chapter in the profile by giving a different
location for each chapter number All the locations must already be
designated in the ChapterPathList property of the
ServerProperties file You can check the chapter number of the
chapters in the profile being imported by opening the lze file in a
text editor
On Windows systems you should enclose the location specification in
quotation marks for example
ldquo1=Fchaptersrdquo
You may use this switch with any other switch
Visibility of imported profiles
When you import a set of chapters using the default setting (the -preserve option) the
exported profile may not be visible in the Open Profile dialog when you restart
Sentences This is because Sentences does not add the profile to the profiles database in
Profileschap when you use the -preserve option
If the imported profile is a new version of an existing profile the previous profile
definition is still available in the Open Profile dialog and can still be used This occurs
when you have exported a database to re-import it to the same system or to move an
application from a development system to a deployment system where it had previously
been deployed
Deploying profiles and chapters
Working with Sentences
156
If the imported profile is not a new version of an existing profile you must create the
profile definition You may do this using the Edit Profile dialog and selecting the
chapters belonging to the imported profile
If the imported profile is complex for example if you created a single profile to export all
the profiles and chapters of a large Sentences application it may be easier to use an XML
Import procedure to create the profile or profiles you need This procedure is described in
the section ldquoTransferring the profiles databaserdquo 7
Visibility of imported profiles using the -renumber option
If you import a set of chapters using the -renumber option switch Sentences adds the
exported profile to the profiles database in Profileschap and the profile is visible in the
Open Profile dialog when you restart Sentences
If a profile being imported with the -renumber switch or a chapter in the profile has the
same name as an existing profile or chapter Sentences appends a numeral to the name of
the imported profile or chapter for example My Data Chapter 1
Sentences recognises that the old and new profiles and chapters are different as they have
different internal identifiers due to the use of the -renumber switch
Limitation on parameters with Import command on Windows
If you are running the Sentences server on Windows and the command you use to import
a profile needs to include a more than eight parameters for example if you wish to
specify a large number of chapter locations you cannot use the supplied Importbat file
This is because of a limitation on the number of parameters that can be included in
Windows batch files
In this case you must enter the Java command with all the necessary parameters at a
command line There is no restriction in the number of parameters when using Linux
Unix
Importing a database export file from a previous version
Database export files from Sentences Version 22 and Sentences Version 30 may be
imported into Sentences Version 40 However you must ensure that you are using the
current releases of these versions before creating your export files (build 2232 or later or
build 3043 or later respectively) Please refer to the Sentences Installation Guide for
further details
If you need to import a database from any other version of Sentences please contact
supportsentencescom
Transferring the profiles database
When you deploy a Sentences application for the first time on a system other than the one
it was developed on you may wish to transfer the profiles database particularly if you
need to replicate the profile and chapter structure of a complex Sentences application The
procedures in this section explain how to do this
You do not need to use these procedures to update an application that already exists on
the deployment system
These procedures involve using Sentencesrsquo built-in XML Export and XML Import
commands to export the Sentences profiles database from one system and import it on
another system
To export the profiles database follow these steps
1 On the source (development) system make sure that the system profile Profiles is
visible in the Open Profile dialog If this profile is not available you must set the
optional parameter ProfilesProfileVisible in the jnlp or javascript definition to yes
Deploying profiles and chapters
Working with Sentences
157
(see ldquoAdditional optional parametersrdquo ) Note that if you make any changes to the jnlp or
javascript definition you may have to restart the Sentences server before the changes
become effective
2 Create a database export file as described in ldquoTo export a databaserdquo
3 In the Sentences Explorer select the Profiles profile
4 Open the All queries folder and highlight the query Export profiles
5 Select Results then Export XML Results from the Query menu
6 Select External for the DTD Reference option
7 Save the output to a file named for example profilesxml
As an alternative to these last three steps you can create an XML export file using the
following command line after stopping the Sentences server
ExportXML -doctype external -file ltfilenamegt Profiles ldquoExport profilesrdquo
You now have two files on the source (development) system the database exportfile and
the XML file of profile definitions
To import the profiles database follow these steps
1 Copy the two files (the database export file and the XML file of profile definitions)
from the source (development) system to the target (deployment) system or make them
available across a network
2 Make sure that none of the chapters in database export file exist on the target
(deployment) system in any directory that is on the chapter path list
3 Stop the Sentences server on the target system and import the database export file using
the default setting for the Import command as described in ldquoTo import a set of chaptersrdquo
You may optionally use the ndashlocation switch to place these chapters in different
directories
4 Start the Sentences server and use the Edit Profile dialog to create a new profile
named for example Profiles This must be the same name as the profile you used to
create the database export file This profile must contain only the system chapter
Profileschap
5 Use the Edit Profile dialog to create a second new profile This may have any name
you wish This profile must include all the chapters imported from the database export
file
This makes sure that details of all the chapters are recorded properly in the profiles
database After you have created and saved this new profile once it can be deleted
6 Stop the Sentences server
7 Copy the exported Profilesxml file from the source system to the target system
8 Open a command prompt and navigate to the ltSentences_homegt directory
9 Run the following command
ImportXML -file Profilesxml
10Re-start the Sentences server
The set of profiles exported from the source system is now visible in the Open Profile
dialog
Export command troubleshooting
The Export command checks that all referenced chapters are included in an exported
database unless you use the -force switch with the command Sentences always checks
the internal identifiers of the chapters in a profile rather than the chapter names and an
Deploying profiles and chapters
Working with Sentences
158
export command may fail even though a chapter with the correct name is in the profile
Sentences display an error message similar to the following
1734 Chapter ldquoltchapter_name_Agtrdquocontains a reference to chapter
ldquoltchapter_name_Bgtrdquo which is not in profile ldquoltprofile_namegtrdquo
If this error occurs it is likely that the original chapter referenced in the profile has been
replaced by a different chapter with the same name You can check the list of other
chapters referenced by a chapter and their internal identifiers by using the
InspectChapter command with the header option (see ldquoChapter file analysisrdquo)
Copying chapter files
You can copy chapter files (chap files) from the ltSentences_chaptersgt directory on
your development server to the ltSentences_chaptersgt directory on your deployment
server provided that both installations are using the same version of Sentences You can
then reconstruct all the profiles for your database using the Edit Profile dialog You do
not need to reconstruct the profiles if you copy the Profileschap file as well as your
application chapter files but the effect of copying the Profileschap file is to delete any
existing profile definitions on the deployment server
You must shut down the Sentences server on both the source and target Sentences
installations before copying any chapter files After you restart the Sentences server on
the target installation all the copied chapters are visible in the Add Chapters list of the
Edit Profile dialog
If you copy the Profileschap file the copied profiles are also visible in the Open
Profile dialog If you do not copy the Profileschap file you can reconstruct your
profiles using the Edit Profile dialog
Restrictions on copying chapter files
If the Sentences server detects two or more chapter files that are duplicates Sentences
does not start and instead displays an error message (see ldquoErrors reported at the Sentences
clientrdquo )
The Sentences server does not identify chapter files as duplicates by their file system
names but by their internal identifiers When you copy a Sentences chapter file the copy
has the same internal identifier as the original This means that you must take great care
when copying chapter files never to allow two copies of the same file to be accessed by
the same server at the same time
Chapter format
From time to time as improvements are made to Sentences there are changes to the
internal format of the chapter files used by Sentences You can check the chapter format
used by your version of Sentences by selecting the About command in the Help menu
Click the Support Information button for a display of additional information including
details of the current chapter format
You can copy chapter files from one version of Sentences to another as long as the
chapter format is the same in both versions If the chapter format has changed you cannot
use copied chapter files You must export a profile from the earlier version of Sentences
and import the profile into the later version For more information see ldquoExporting and
importing databasesrdquo
Changing chapter file block size (single chapter export and
import)
If you wish to change the block size of a specific chapter file you can use the
ExportChapter and ImportChapter commands Both of these commands are run from a
command line For further information about block size see ldquoBlockSizerdquo
Using the Sentences Explorer
Working with Sentences
159
Both of these commands are run on a single file The commands do not use the
ChapterPathList setting from the Serverproperties file or check for the existence of
the databaselock file You must therefore use the fully-qualified path and file name
for example
DSentencesData40ChaptersMyChapterchap
It is strongly recommended that you shut down the Sentences server before running these
commands
ExportChapter command
To export a single chapter file open a command prompt navigate to your
ltSentences_homegt directory and enter the following command
ExportChapter ltchapter filegt ltexport filegt
where
ltchapter filegt is the file name of a Sentences chapter file to be exported and ltexport
filegt is the file name of the export file to be created
After you export a single chapter file in order to change the filersquos block size you must
remove the original file from any directory that is listed in the chapter file list
ImportChapter command
To import a single chapter file open a command prompt navigate to your
ltSentences_homegt directory and enter the following command
ImportChapter [-blocksize ltblock sizegt] ltexport filegt ltchapter filegt
where
ltblock sizegt is an optional number representing the block size in KB to be used when
creating the new chapter file
ltexport filegt is the file name of an export file created by the ExportChapter
command and ltchapter filegt is the file name of a Sentences chapter file to be created
The ImportChapter command creates a Sentences chapter file that has the same internal
identifieras the original chapter file so that references to it from other files can be
retained If you wish to use the same file name as that of the chapter file that you
originally exported you must make sure that the original chapter file is removed from the
directories in the chapter path list before running the ImportChapter command
Using the Sentences Explorer
You can use the Sentences Explorer to create your schema and to browse schema and
data You can launch the Dataform to type in data and the Query Editor to create and run
a query
Delayed display of inverse associations
In order to speed up the display of data in the Sentences Explorer Sentences postpones
the download and display of inverse association data When you expand an entity instance
node that is the target of one or more association types Sentences displays a folder for
each association type Sentences does not retrieve the instances contained in these folders
until you expand the folder itself
Display order of instances
When you select an entity type or association type in the schema pane the corresponding
entity or associations are displayed in the data pane For all entity types that are not
subsets the display order of instances in the data pane is determined by the sort algorithm
of their typersquos datatype If not all the visible instance data has the same datatype
instances of the same datatype are grouped together and then ordered by the sort
algorithm of their typersquos datatype
Using the Sentences Explorer
Working with Sentences
160
For all association types that are not subsets the display order of instances in the data
pane is determined first by the sort order of their sources and then by the sort order or if
it exists by the defined sequence of their targets Inverse associations are sorted by target
first
For all entity and association types that are subsets the display order of instances in the
data pane is determined by settings of any sort nodes in the subset query If no sort nodes
exist in the subset query the display order is determined by the sort algorithm of the typersquos
datatype
All of the display rules given above apply to the top level display in the data pane When
you expand a node in the data pane the data displayed is ordered automatically by
Sentences and this ordering cannot be changed
Refreshing the display
To refresh the display of the Sentences schema click the Refresh button on the Sentences
Explorer toolbar or select the Refresh command from the File menu
Refreshing the display also resets the clientrsquos definition of the current profile To refresh
the display of data in the Sentences Explorer data pane click the Reload Data button on
the toolbar or select Reload data from the File menu
Determining if child associations are present
When Sentences displays trees of data it determines whether that tree node has any
children (either forward or inverse associations) and displays a plus sign to indicate that
the tree node can be expanded This can be especially time consuming when using a
dynamic LazyView Chapter
For this reason you can opt for a Profile to assume that child associations are present and
always show a plus sign (unless the absence of children can be easily determined using
Metaschema)
To change whether a Profile attempts to determine if child associations are present follow
these steps
1 In the Sentences Explorer select Edit Profile hellip from the File menu
2 To choose automatic detection check the Determine if child associations are
present checkbox Otherwise unselect this checkbox
To change whether a particular type attempts to determine if child associations are present
follow these steps
1 In the Sentences Explorer select the type for which you wish to change the
option
2 Select Propertieshellip from the Edit menu
3 Select the Retrieval Methods tab
4 To choose automatic detection check the Determine if child associations are
present checkbox Otherwise unselect this checkbox
Hiding the data pane
Sentences Version 40 introduces the ability to temporarily switch of the display of data
When you select a type in the left-hand Schema pane the right-hand Data pane displays
instances of that type If you are working on the schema design and not concerned with
the data at that moment it is useful to be able to hide the data pane
To toggle whether the data pane is visible or not select Data Pane from the View menu
Alternatively you may use the shortcut key combination of Alt+D
Using the Sentences Explorer
Working with Sentences
161
Sandbox Modes
Sentences 40 has added the ability to put the Sentences Client into a Data or a Full
Sandbox Mode Sandbox Modes are intended to be used to experiment with changes to
the database in a temporary environment where you can at any time revert back to the
state of the database before you switched to Sandbox Mode
You could add a new chapter to your profile and direct all changes to that chapter to
experiment and once finished you could remove the chapter again Sandbox Modes work
in the same way but the creation and removal of a temporary chapter is handled for you
You can quickly switch Sandbox mode on or off to compare the schema and data changes
you have made
Whilst in a Sandbox Mode any Simple Email Action Requests will not send emails
Instead a dialog will show the number of emails that would have been sent
bull Data Sandbox Mode
The main reason for using a sandbox will be when experimenting and refining an Update
Query or an Effector Query In this situation you may wish to repeatedly execute your
query and inspect the results after making small changes to the query In this case you can
use Data Sandbox Mode so that the changes you make to the query are permanent but the
changes to data can be discarded after you have finished refining the query
bull Full Sandbox Mode
A Full Sandbox Mode is also provided so that any changes to data or schema can be made
for experimentation and then all discarded afterwards
Access to Sandbox Mode
A User must be granted a specific privilege to be able to use Sandbox Mode There is a
Sandbox User Role or the privilege can be granted directly to a particular User See the
sections on User Privileges and Roles for details
Changing Sandbox Mode
Sandbox Mode must be enabled for each User as described above When enabled the
status bar of the Sentences Explorer and Request Query Editor will display the current
Sandbox Mode In addition the Options Dialog will include Sandbox Mode options
To change the sandbox mode in the Options Dialog follow these steps
1 In the Sentences Explorer select the Optionshellip menu item from the top View
Menu
2 The Options Dialog will open and if Sandbox Modes are enabled for the user the
dialog will include the three sandbox modes (Off Data and Full) The current
Mode will be selected
3 Select the mode you would like to change to and select OK
To change the sandbox mode from the Status Bar follow these steps
1 In the Sentences Explorer or Query Editor open the context menu for the
Sandbox Indicator The current mode will be disabled
2 Select the mode you wish to change to
Using the Sentences Explorer
Working with Sentences
162
Note that if there are open Query Editors that have unsaved changes you will be
prompted to confirm changing Sandbox Mode This is because the Schema will have to
be reloaded and any unsaved query changes will be discarded
Transaction Visibility
Sentences 40 now includes the ability to set a Visibility Timestamp to a point in the past
that is used to show the Profile at that time This function has no impact on performance
The current Transaction Visibility is displayed in the Status Bar of the Sentences Explorer
and Query Editors
Sentences 40 also includes the ability to browse the existing Transactions to identify a
point in time that you may wish to view See the Browsing Transactions section for
details
Access to Transaction Visibility
A User must be granted a specific privilege to be able to use Transaction Visibility There
is a Transaction Visibility User Role or the privilege can be granted directly to a
particular User See the sections on User Privileges and Roles for details
Changing Transaction Visibility
Transaction Visibility must be enabled for each User as described above When enabled
the status bar of the Sentences Explorer and Request Query Editor will display the current
Transaction Visibility In addition the Options Dialog will include Transaction Visibility
options
To change the Transaction Visibility in the Options Dialog follow these steps
1 In the Sentences Explorer select the Optionshellip menu item from the top View
Menu
2 The Options Dialog will open and if Transaction Visibility is enabled for the user
the dialog will include the current selection
3 Select either the current date and time or enter a new date and time and select
OK
Using the Sentences Explorer
Working with Sentences
163
The Options Dialog can also be opened from the Status bar context menu
Browsing transactions
The Sentences Explorer Schema Panel can contain a folder that allows you to browse all
the Transactions in your Schema You can also use the position and filter tools to narrow
your search
The information includes transactions that were aborted ndash these are transactions for which
a commit time is not set Most Transactions can have a description associated with them
but some perform many operations at once such as changing the properties of a Type and
can only describe themselves with the Type that was being modified ndash not all the changes
made
This is a useful tool if you are trying to find a significant event and set the Transaction
Visibility to view before and after it
Also available on the Options Dialog is a button that opens a dialog to show the
Transaction History This includes a summary of the first and last transaction timestamps
together with the number of transactions started and committed
Database components
Working with Sentences
164
The Transaction Schema Folder is displayed according to your User Preferences See the
section on User Preferences for details
Database components
The Sentences database includes both schema and data information The Sentences
database schema is built up of entity types and association types referred to collectively
as types The data in a Sentences database is built up of entities and associations which
are referred to collectively as instances Types and instances are introduced and explained
in Chapter 2 ldquoIntroducing the associative modelrdquo
You can work with types and instances in the Sentences Explorer and the Dataform and
also in the Query Editor These three mechanisms for viewing and working with
information are introduced in Chapter 4 ldquoThe Sentences Quick Tourrdquo
The next part of this chapter describes in more detail how you can work with types and
instances in the Sentences Explorer and the Dataform Working with the Query Editor is
described in Chapter 7 ldquoSentences queriesrdquo
Entity types and entities
The least complex data items in a Sentences database are entities which areinstances of
entity types Entity types are created and managed in the Sentences Explorer and entity
instances are created in the Dataform Entity types and association types are displayed in
the schema pane and entities and associations are displayed in the data pane For more
information see ldquoEntities and associationsrdquo
Creating entity types
To create an entity type you can either
bull click the Create Entity Type button on the toolbar or
bull right-click the All types folder and select the Create Entity Type command from the
shortcut menu or
bull select the Create Entity Type command on the Schema menu
You can also create entity types from the Create Association type dialog
Database components
Working with Sentences
165
Figure 5-5 The Create Entity type dialog
Each of these actions opens the Create Entity Type dialog Type in a name for the entity
type and click create The new entity type is added to the All types folderYou can create
another entity type or click Close to dismiss the dialog box
Entity types always appear under the All types folder in the schema pane Entity types
may also appear in the Core types folder (see ldquoThe Core types folderrdquo )
Entity type names can contain any standard alphanumeric characters including blanks
They should not contain any special characters as this may cause errors when evaluating
expressions in queries Make sure that the first character after a blank space is alphabetic
not numeric Entity type names are not case-sensitive
Sentences uses unique hidden identifiers for entity types (and for many other elements)
This means that you can rename an entity type or create an entity type with a duplicate
name without compromising the data in your database Sentences always prompts you to
confirm that you want to create a duplicate entity type when an entity type with the name
you are using already exists
You can optionally specify the Datatype to use at this time or later If you select a
Datatype other than the default of ltNonegt then the dialog will show you any datatype-
specific options to choose
If you enter an Entity Type name that contains one of the standard Datatypes (for example
ldquoDate Createdrdquo or ldquoPercentagerdquo) then the datatype will be automatically selected for you
Creating entities
Entity instances can only be created through the Dataform (see ldquoCreating an entity
instance in the Dataformrdquo )
Size of entity and value instances
Sentences has no specific limit on the size of items that can be stored as entity or value
instances although some datatypes do impose limitations (see for example the
ldquoNumberrdquodatatype )
You should be aware of the memory usage capabilities of your own system when
deciding to store large data items in a Sentences database It may be more practical to
store items such as large images outside the database and to create references to them
using the Hyperlink datatype (see ldquoString datatypesrdquo)
Database components
Working with Sentences
166
Value types and datatypes
Value types in Sentences represent things in the real world that you do not need to record
additional information about This includes for example dates times and numbers Value
types are created by assigning datatypes (see ldquoDatatype properties pagerdquo )
The distinction between value and non-value entity types is very important and is
discussed in the section ldquoEntities and valuesrdquo You should understand this distinction
fully before you make extensive use of datatypes in your database
In certain cases you may wish to record additional information about entities that are
defined as dates times or numbers Some data may be recorded in a numerical form
because you wish it to have a numerical presentation or to be sorted in numerical order
even though you do not need to perform any calculations on the data This happens when
you use a numerical format as the label of an entity for example as an order number or an
employee number
Value types and values are distinguished in the Sentences Explorer by disc-shaped icons
Because value types cannot be the source of an association you must not define any entity
type that you want to use as the source of an association as a value type In most cases the
majority of entity types can and should use the undefined datatype ltNonegt
The ImageData datatype
A new datatype has been added to Sentences Version 40 The existing Image datatype
allows you to specify images stored on the Sentences Server by name eg LazyImagesCarolHoffmanjpg
The new Datatype ImageData stores image data as bytes You can view images in the
dataform You can paste an image into an ImageData Dataform field from the system
clipboard and import them from relational databases using a LazyView Chapter
Default formats and presentations
When creating Entity Types and Association Types Sentences Version 40 introduces
several new default presentations for specific datatypes
Datatypes can now specify a default field width and a default format pattern The built-in
datatypes have the following defaults
Datatype Default Field Width
Date
Time
12
String
Number
Currency
Mixed Currency
Percentage
13
Hyperlink
Image
ImageData
No default variable length
Timestamp 18
ltNonegt 30
Currency C000C-000
When an Association Type is created if its source is an Association Type then Sentences
sets the source presentation automatically to Table for Associations if it is multiple and
Nested panel if singular If a specific dataform width was set then this value is used for
the table column width and the original width is set to variable so that it takes up all the
available space or the sum of the column widths if this is less
Database components
Working with Sentences
167
Deleting types and instances
Sentences Version 40 introduces two differences in the way one or more type or instance
is deleted For dynamic LazyView chapters deletion of read-only data is not relevant and
so Sentences does not attempt to determine the impact of deleting types or instances
Otherwise the process of determining the impact is broken down into smaller
components and can be cancelled or confirmed before the results are known if it is taking
a long time to determine
This is similar to how the request to execute a query can be cancelled before the results
have been determined
Subsets of subsets
Sentences Version 40 introduces the ability to have a subset of a subset which was
previously not allowed
This is required to represent some Relational Database Schema and allow subsets to have
their own State Domains
Defining value types with datatypes
Some display formatting characteristics in Sentences are associated with datatypes that
may be assigned to a type When new entity types are created they do not have a datatype
assigned to them and their datatype property is set as ltNonegt
Datatypes are assigned using the Datatypes tab on the Properties dialog (see ldquoDatatype
properties pagerdquo ) For example in order to display a number with decimal places you
must assign the Number datatype Assigning a datatype may also determine certain
behaviour characteristics for example whether or not you can perform arithmetic
calculations with the instances of a type
When you assign one of the Sentences-supplied datatypes to an entity type you can decide
whether the type should be a value type or not using the Instances are values property
If you choose to make the type a value type instances of the type have both the
formatting and the behaviour characteristics associated with value types which are
described in more detail in the following section If you choose not to make the type a
value type instances of the type have only the formatting characteristics of the datatype
and not its behaviour characteristics
When you assign a datatype to a type you should check or clear the Instances are values
checkbox according to whether or not you wish to make the type a value type (see
ldquoInstances are valuesrdquo )
If you create an entity type with the same name as one of Sentencesrsquo own datatypes for
example Date or Time Sentences automatically assigns that datatype to the type and
converts it to a value type (see ldquoDatatype properties pagerdquo )
This does not apply to the Currency datatype You can clear the Instances are values
checkbox if you do not wish the type to be a value type
Note It is possible to create a custom datatype that is not a value datatype (see ldquoCustom
datatypes APIrdquo )
Impact of changing a datatype
Changing the datatype of an entity type or changing the setting for the Instances are
values property (see ldquoInstances are valuesrdquo ) has a serious impact on the visibility of your
data Any change you make to the datatype or to the value status of instances of any
entity type is not applied to existing instances which may no longer be visible after you
make a change
Database components
Working with Sentences
168
bull If you change from any datatype to ltNonegt existing instances remain visible
bull If you change between Number and Percentage existing instances remain
visible
bull If you make any other change between datatypes existing instances are no longer visible
bull If you change the state of the Instances are values checkbox existing instances are no
longer visible
bull Instances with different datatypes are not sorted together hence a list of such instances
may not be sorted as expected
bull Calculations in queries for example for custom dataforms may rely on the type and
instance datatypes matching and be broken by instances with different datatypes
If you do need to change a datatype where a considerable amount of data exists you may
wish to recreate the effected data and all data depending on it One method of doing this
would be to export the effected data to a CSV file and then delete the data from your
database and set the correct datatype before importing the CSV file
However this method is not always reliable and should be used with great caution
Visibility of value instances
When an entity type has ltNonegt as its datatype all the instances of that type are visible
in the data pane when the entity type is selected in the schema pane When you have
created a value type by assigning a datatype only instances with the same datatype are
visible This means that if you change the datatype of a type after you create entity
instances those instances may no longer be visible depending on the new datatype
A more strict visibility constratint can be placed upon Value Instance visibility where in
addition instances of value types are only displayed in the data pane when they are used
as targets of associations in the database As this is an expensive constraint to make it is
turned off by default To turn this additional visibility constraint on change the ldquoCheck
Value Visibilityrdquo flag in the Troubleshooting tab of Server properties (see ldquoServer
propertiesrdquo for details)
Behaviour of value types and values
In general value types and value instances behave in the same way as entity types and
entity instances with the following important exceptions
bull Two instances of a value type with the same name cannot exist they are the same
instance For non-value types it is possible to have duplicate instances that istwo distinct
instances with the same name
bull Value types and value instances can only be used as the targets of association types and
associations and they can never be the source of association types or associations
bull Value instances are only visible when they are used as the targets of associations
bull Non-value instances are associated with a particular Sentences chapter but value
instances are not A value instance exists wherever there are associations that use it as
their target
bull Although the Rename command is not available on the shortcut menu for value
instances you can replace one value with another in the Dataform
bull Value types and instances are displayed in the Sentences Explorer with a discshaped
icon
Database components
Working with Sentences
169
Creating value instances
You can only create a value instance as the target of an association in a dataform You
cannot open a dataform on a value type to create value instances
Association types and associations
Association types are more complex than entity types as they require three components
source verb and target The sources and targets of association types are typically entity
or association types but the source of an association can be an entity or association
instance For more information see ldquoEntities and associationsrdquo
Creating association types
To create an association type you can either
bull click the Create Association Type button on the toolbar or
bull right-click the All types folder and select the Create Association Type command from
the shortcut menu or
bull right-click an existing entity or association type and select the Create Association Type
command from the shortcut menu or
bull right-click an existing entity or association instance and select the Create Association
Type command from the shortcut menu or
bull select the Create Association Type command on the Schema menu Each of these
actions opens the Create Association Type dialog
Figure 5-6 Create Association Type dialog
When you create an association type you must define its source verb and target and its
cardinality properties (see ldquoCardinalityrdquo ) After you have created the association type you
can alter some of these properties and define some additional properties in the Properties
dialog (see ldquoPropertiesrdquo )
Schema and data change visibility
Some changes to schema and data such as the addition of instances to a new association
type may not be automatically reflected in the data pane of the Explorer if entities of the
Database components
Working with Sentences
170
source type are being displayed As soon as you reselect the entity type or refresh the
display all changes are displayed correctly in the data pane
Source verb and target
You must define a source a verb and a target for any association type you want to create
The source of the association type must be an entity or association type or an entity or
association instance The target of the association type must be an entity or association
type The verb defines the nature of the association between the source and the target
Source
If you select an existing type or instance before you open the Create Association Type
dialog Sentences displays the selected type or instance as the source for the new
association type You can use the displayed source or select another source from the
Valid source types folder or type in the name of a new entity type
If you type in a new entity type name Sentences prompts you to confirm that you want to
create a new entity type You cannot type in a new association type as the source
The Valid source types folder displays all the types that may be used as the source of an
association type This means that value types are not displayed in this folder
Selecting an entity instance or an association instance as the source of an association type
creates an instance-specific association type which is discussed in the section ldquoInstance-
specific association typesrdquo
Verb
The verb defines the association type and describes the nature of the association between
the source and the target A precisely named verb can be very useful in schema design
You may use the same word to name the verb and the target of an association type It is
helpful to use an upper case (capitalised) name for the target and a lower case name for
the verb for example Actor award Award When you create association instances the
name of the association type verb is preserved for example David Garrick award Best
Actor
Verb names should be singular Multiple Association Types allow you to also enter a
plural form The singular form is used when referring to one instance The verb name (or
plural form) is capitalised when it is used as a field label in the Dataform
Target
You can select a target for the association type from the All types folder or you can type
in the name of a new entity type Alternatively you may select an existing metatype from
the Metatypes folder which is a subfolder of the All types folder You cannot type in the
name of a new metatype (see ldquoMetatypesrdquo )
You must always select not type in the name of an existing type If you type in a new
entity type name Sentences prompts you to confirm that you want to create a new entity
type You cannot type in a new association type as the target
Inverse verb
You need to specify an inverse verb for the association type The inverse verb expresses
the same link as the verb but as seen from the target to the source For example if the
verb of an association type is has colour then the inverse verb might be colour of
Sentences suggests a default inverse verb based on the verb you entered usually by
adding the word ldquoofrdquo You can always type in an inverse verb of your own choice instead
of the one suggested by Sentences
Database components
Working with Sentences
171
Page
Association Types can be placed on Pages These are purely used to arrange the fields in a
Dataform (see ldquoSchema Pagesrdquo)
Cardinality
The cardinality of an association type determines whether you can have zero one or
more than one associations of a given association type for one source instance You
define association type cardinality by checking the OptionalMandatory and
MultipleSingular radio buttons
The following table shows the possible combinations of these settings
Optional Manditory Multiple Singular Number of Associations
Manditory Singular One only ndash Zero not allowed
Optional Singular Zero or One
Manditory Multiple One only ndash Zero not allowed
Optional Multiple Zero or more
Cardinality rules and data display
Sentences monitors the data you type in to ensure that you conform to the cardinality
rules that you have defined for your association types If you use the Dataform to type in
data and do not complete the field for a mandatory association Sentences displays an error
message Similarly if you try and create more than one value for a singular association
Sentences displays an error message
In some situations Sentences is unable to enforce cardinality rules In these cases the data
displayed in the Sentences Explorer does not match the data displayed in the Dataform
For example if you define an association type as Multiple and create multiple
associations for a particular source and then change the definition of the association type
to Singular the database has more targets for the association than its current definition
allows
When you view this association in the Sentences Explorer all the targets in the database
are displayed because the Sentences Explorer uses an open tree structure to display data
(In this situation the Explorer does not use the associations folder normally used to group
multiple associations)
If you try and view this association using the Dataform Sentences displays an error
message
Error 1710 Singular AT (association type name) has multiple instances
This is because the Dataform has a rigid structure determined by the schema and the
schema rules If the schema rules allow only one value then only one value can be
displayed in the Dataform
Singular inverse
When you define a new association type you can also determine whether to limit the
association from the target to the source using the inverse verb (the inverse association) in
some way Use the Singular Inverse check box to ensure that the inverse association
must be singular That means that any entity or association instance may be the target for
only one association of this type The Singular Inverse property is not available for
Symmetric association types
Database components
Working with Sentences
172
Symmetric
An association type is symmetric if the relationship between source and target is always
the same in both directions The source and target must be of the same type and the target
may not be a value type For example the association type Person is married to
Person is symmetric However the association type Person is employed by Person
is not symmetric
The Symmetric check box is only available if the source and target of an association are
of the same type equivalent types related subsets or subtypes When the Symmetric
property is selected the inverse verb is not used and the inverse verb field is not editable
Display ordering
If you select the multiple option when you choose the cardinality of the association type
you can choose to display associations as sorted or as sequenced (see ldquoSorting and
sequencingrdquo )
Instance options
bull Instances may not be created
You can create an association type that does not have any instances of its own but that
may be a supertype for other related association subtypes by checking the Instances may
not be created checkbox The related association subtypes may themselves have
instances (see ldquoSubsets properties pagerdquo )
You can create some association instances and then select the Instances may not be
created checkbox on the Association type properties dialog This forces users to choose
from a limited range of instances
bull Instances may not be deleted
Check the Instances may not be deleted checkbox to prevent users from deleting any of
the instances that are created for this type
bull Duplicate instances are not allowed
Check the Duplicate instances are not allowed checkbox to prevent the creation of
duplicate instances and to ensure that all instances are unique
Schema Pages
Schema Pages can be used to arrange Association Types into Tabbed pages on a
Dataform Association Types are automatically placed on a different page if they are
sourced on a Subset or Subtype and the Dataform Tab is given that Subset or Subtype
name Schema Pages allow any arrangement of Pages and are used as the default pages
when a Custom Dataform Query is created
To create a Schema Page you can either enter a new Page Name in the Association Type
Properties General Tab or you can select the Create Pagehellip Menu Item when a type is
selected in the Schema Pane
To organise which pages all Association Types are displayed on and the order
1 Select the Type that you wish to organise Pages for in the Schema Pane and
select Organise Pageshellip from the Schema Menu
Database components
Working with Sentences
173
The Organise Pages Dialog allows you to
bull Create Delete Rename and Reorder Pages
Use the Add Delete Rename and Move buttons at the bottom of the dialog to
change the pages used for the selected Type and their order
bull Change Association Type Pages
Select one or more Association Type select a page and click the Change Page
button to move the selected Association Type(s) onto that page
bull Reorder Association Types
Using the Move Up and Move Down buttons the order of Association Types on
each Page can be altered
bull Hide Association Types
Select one or more Association Type and set or clear their ldquoHidden on dataformrdquo
property
Database components
Working with Sentences
174
Once pages exist in the Schema Pane you can also drag and drop individual Association
Types onto different pages You can also reorder pages by dragging one onto another
If there is an empty page after you have finished organising then it will not be saved
between sessions
Metatypes
Metatypes are the categories of data that appear in the schema pane You can create an
association type that uses a metatype as its target The available metatypes are Entity
type Association type Query and Custom Dataform The instances of a metatype are
the types that are defined in the current schema
Metatypes may only be used as the target of an association and not as the source An
association type that has a metatype as its target behaves in the same way as any other
association type and may be used in queries and custom Dataforms
Using metatypes
To use a metaschema type as the target of an association select a type from the
Metatypes folder The Metatypes folder is a subfolder of the All types folder in the
target area of the Create Association Type dialog You cannot type in the name of a new
metatype
Creating associations
Associations can only be created through the Dataform (see ldquoCreating an association in
the Dataformrdquo )
Deleting types and instances
You can use the Delete button on the toolbar or the Delete command on the Edit toolbar
to delete any entity or association type or instance You can delete a value type but you
cannot delete a value instance
Figure 5-7 Impact of deleting dialog for a data item
Impact of deleting dialog
Sentences displays an Impact of deletinghellip dialog which displays the items that are
affected by the delete action and prompts you for confirmation The name of the dialog
shows the name of the item you want to delete
Database components
Working with Sentences
175
Figure 5-7 shows an example of an Impact of deletinghellip dialog for a data item and
Figure 5-8 shows an example of an Impact of deletinghellip dialog for a schema item which
includes a display of the relevant part of the schema tree
Figure 5-8 Impact of deletinghellip dialog for a schema item
Internally Sentences does not physically delete any element but instead makes the
particular element invisible The delete action is recorded in the relevant changes chapter
defined in the current profile This means that you could devise an arrangement of
chapters and profiles in such a way that certain information was available in one profile
and was not available in another profile
You cannot undo Delete actions You can recreate any item that you have deleted but as
every item in Sentences has a unique internal identifier the recreated items are not
identical to the items they replace even if they share the original deleted itemrsquos name and
attributes
Implicit deletion
Sentences automatically enforces referential integrity constraints when any item is
deleted If you delete an entity instance you also delete any association that uses that
entity as its source or target and these associations are listed in the Impact of deletinghellip
window If you delete an entity type you also delete all its instances along with any
association types that use it as a source or as a target along with all the associations that
are instances of those association types
When you delete an item any other items that are dependent on it are also deleted The
following list summarises the dependencies in Sentences that are affected by a delete
action
bull An association type is dependent on its source and target whether they are types or
instances
bull An entity or association instance is dependent on its type
bull An association instance is dependent on its source and target instances
bull Instances of a subset type are dependent on the existence of the superset type
bull A schema type is dependent on another type that you have defined as its
equivalent
There is no dependency in the following cases
bull A subset type is not considered dependent on the existence of the superset type even
though instances of it are This means that you can use a type originally defined as a
subset after its superset is deleted If you delete a superset type the subset type becomes a
Database components
Working with Sentences
176
normal type and you can create instances of it You cannot re-establish a subset-superset
link after you delete the superset
bull Subtypes and supertypes are not considered to be dependent on one another
Renaming types and instances
You can rename any entity type or instance or any association type that appears in the
Sentences Explorer You can rename a value type but you cannot rename a value
instance Renaming an association type changes the verb of the association not the source
or target
The unique internal identifier of the type or instance is not affected by renaming and the
new name appears automatically wherever the type or instance is used
To rename a type or instance highlight it in the Sentences Explorer and select the
Rename command from the Edit menu or the shortcut menu Sentences displays an
editing box around the existing name You can now type in the new name When you
move to another field or press Enter your changes are saved
The Rename command is not available for value instances in the Sentences Explorer If
you need to change a value instance you must use the Dataform
Inactive Instances
During the life of an application data often becomes inactive and no longer ldquocurrentrdquo but
is still needed for historical reference More importantly the application designer may
wish to prevent the user from continuing to reference these inactive instances Sentences
provides a way to identify instances as ldquoinactiverdquo and to hide them from the user to de-
clutter the user interface and prevent their accidental use
In addition if a user does select such an inactive instance in a Dataform then Sentences
can warn them of this
To specify that an Association Type is to be used as the sourcesrsquo ldquoinactiverdquo indicator it
has an attribute on the Association Type property page in the Instance options section
Database components
Working with Sentences
177
The presence of an association instance indicates that the source (in the example above a
instance of Employee) is no longer active If there are two Association Types ndash for
example (Person inactive Flag) and (Employee inactive Flag) then either or both will
make an Employee inactive Both will have to be clear for the Employee to be active
The Data Pane will not include inactive instances by default This only applies to the root
instances When you drill down all data will be shown If the user preference is changed
to show inactive instances then they are highlighted with a suffix Inactive and the font
is in italics
The Query Editor has a ldquoShow inactive instancesrdquo checkbox for convenience to include
inactive instances in the results This is off by default and it is only the root results that
are filtered
Locating data in the Sentences Explorer
Working with Sentences
178
The Dataform pickers also default to not initially including inactive instances This can be
overridden by checking the box at the bottom
When applying a child dataform or saving a parent dataform Sentences informs the user
if they have included inactive instances Any pre-existing inactive instances are not
highlighted
Locating data in the Sentences Explorer
When you select a type in the Explorer schema pane you send a data request from your
Sentences client to the Sentences server In response the Sentences server loads and
displays data from your database in the Explorer data pane Whenever you execute a
query or use the Positioner and Filter tools you are also making a data request
Sentences does not automatically load all the available data for a type from the server and
display it in the data pane each time you make a request This is to reduce unnecessary
network traffic between the Sentences server and client
Sentences provides a number of tools to help you locate data in the Explorer which are
described in this section
Also be aware that the visibility of instances can be affected by the Transaction Visibility
mechanism (See ldquoTransaction Visibilityrdquo for details)
Demand loading of data
The number of data items loaded at each data request can be configured using the optional
applet parameter RequestSize The default value for this parameter is 50 data items You
can change this value by adding the RequestSize parameter to the jnlp or javascript
definition (see ldquoAdditional optional parametersrdquo)
The More prompt
Whenever more data than that already displayed in the data pane is available in the
database Sentences displays a special prompt in the data pane (the
Morehellip prompt) to indicate that more data items exist in the database as shown in Figure
5-9
The Morehellip prompt appears in the Explorer data pane and in the Query Editor results
pane for the top level data request (the type selected in the Explorer schema pane or the
root node of the query) and for forward and inverse associations The Morehellip prompt
Locating data in the Sentences Explorer
Working with Sentences
179
also appears in multiple association fields in the Dataform such as list boxes tables and
tree displays
When derived types or derivations are used in queries Sentences needs to calculate all
values before displaying the derived type or derivation result For this reason the Morehellip
prompt is not displayed for nodes used in calculating derived types or derivations The
Morehellip prompt is also not displayed for any node that includes the type referenced in the
derived type or derivation apart from those nodes directly between the derived type or
derivation and the root node of the query
Figure 5-9 An example of the Morehellip prompt
To load more data double-click on the Morehellip prompt displayed at the bottom of the
data pane or press the Page Down key on your keyboard
Each time you click the icon or press Page Down Sentences loads more data items
according to the number of items specified by the RequestSize parameter until all the
available data items are displayed at the client
The Positioner and Filter tools
The Sentences Explorer has two tools to help you locate data more quickly the
Positioner and the Filter These tools are located on the right hand side of the toolbar
They are also available on Picker dialogs in the Dataform
Figure 5-10 The Positioner and Filter tools
The Positioner and Filter tools each have a value entry field on the toolbar On the far
right there is the data reload button The Positioner and Filter both work only on the top
level of displayed data that is the data level that matches the type currently selected in the
schema pane
Locating data in the Sentences Explorer
Working with Sentences
180
The Positioner tool
The Positioner tool locates the first data item that matches the value you entered in the
entry field Sentences clears the data display and then displays data items starting at the
first matching data item This is not the same as the ldquoFindrdquo feature found in some other
applications
To use the Positioner tool type in a value in the entry field and press Enter or click the
Reload Data button The value you choose must be a valid value for an instance of the
current type but it does not have to be a value that exists in the database For example if
the current type allows character strings for names you can type in the value P in the
Positioner field and press Enter or click the data reload button Sentences displays names
beginning with the first item that begins with that letter as shown in Figure 5-11 The
Positioner tool does not use wildcards
Figure 5-11 Sentences Explorer display with Positioner value P
If you type in a value that does not exist the Positioner displays data starting with the
first available item after the value you entered Figure 5-12 shows the result of entering
the value Ps in the Positioner field
Locating data in the Sentences Explorer
Working with Sentences
181
Figure 5-12 Sentences Explorer display with Positioner value Ps
For associations Sentences applies the same rule to the original source entity type For
example if the current association type is ((Person customer of Store) visited on
Date) then the Position field needs a Person value since the list is ordered by Person
The Filter tool
The Filter tool locates all the data items that match the value you entered in the entry
field To use the Filter tool type in a value in the entry field and press Enter or click the
Reload Data button
Sentences clears the data display and then displays the filtered data items If there are
more items available than there is room in the data pane Sentences displays the Morehellip
prompt
Pattern matching with the Filter tool
The Filter tool is case insensitive but it does supports pattern matching with wildcards
Filter Tool Wildcard Meaning
matches any single character
matches from zero to any number of characters
| or
If you want to use any of the wildcard characters as part of your pattern you need
toldquoescaperdquo the character with a backslash as follows
Escape Characters Meaning
Represents a literal character
Represents a literal character
Represents a literal character
| Represents a literal | character
Single Backslashes are ignored
Locating data in the Sentences Explorer
Working with Sentences
182
The Filter tool searches from the start of the value stored This means that if you want to
filter using partial string that is not at the start of the stored value you should use the
asterisk wildcard before the filter term Similarly if you want to filter using partial string
that is not at the end of the stored value you should use the asterisk wildcard after the
filter term
For example and would return band hand sand and so on and and would also return
and grand and brand The filter argument profile|chapter would return any
string that contained the word profile or the word chapter By contrast the filter
argument profilechapter would only return a string that contained both the word
profile and the word chapter
Figure 5-13 shows the result of using the filter Ven
Figure 5-13 Sentences Explorer display with Filter value Ven
Using Filtering and Positioning tools together
You can use the Positioner and the Filter tools together If you type in values in both
entry fields Sentences displays entities or associations matching the Filter value starting
at the point specified by the Positioner value
Figure 5-14 shows the result of using the Positioner value M with the Filter value Ven
Compare this result to that shown in Figure 5-13 which showed the Filter being used on
its own
Locating data in the Sentences Explorer
Working with Sentences
183
Figure 5-14 Sentences Explorer display with Positioner value M and Filter value Ven
Reloading data
To restore your view to all the available data clear any values from the Positioner entry
field and the Filter entry field and click the Data Reload button If there is more data
available than can be shown Sentences displays the Morehellip prompt
If you highlight the name of a query in the schema pane you can use the Data Reload
button to display the results of the query in the data pane
Stopping data retrieval
When you request data from the Sentences server Sentences returns a number of data
items up to the limit specified in the RequestSize parameter (see ldquoAdditional optional
parametersrdquo ) Occasionally this data retrieval action may take a long time for example
because the RequestSize parameter is set to an inappropriately high value
The Stop button
You can stop the retrieval of data by clicking the Stop button on the toolbar
This button is only available while a data retrieval action is taking place and the message
Retrieving data is displayed in the data pane
This is shown in Figure 5-15
Locating data in the Sentences Explorer
Working with Sentences
184
Figure 5-15 Using the Stop button
When you click the Stop button the data retrieval action stops on the server and
Sentences displays a message in the data pane
The Stop button is available in the Sentences Explorer the Diagram Editor and the
Query Editor You can only stop a data retrieval action by using the Stop button in the
same window that started it You cannot for example use the Stop button in the Explorer
to stop a data retrieval action started in the Query Editor
Sorting and sequencing
You can sort data and schema items in Sentences The Sentences default sort algorithm
which is alphanumeric and case insensitive applies to instances of types that do not have
a defined datatype (their datatype is displayed as ltNonegt) Defined datatypes each have
their own specialised sorting algorithm which are described in the datatypes section (see
ldquoDatatype properties pagerdquo )
The Sentences sequencing feature lets you define explicit data sequences in the Sentences
Explorer and Dataform You can use sequencing with a series of association types
sourced from a particular type and with a set of instances of a multiple association type If
you change the sequence of association types in the schema pane the corresponding data
items appear in the sequence you defined when the display is refreshed
Sequencing association types
The order in which associations appear in the Default Dataform is the same as the order in
which they appear in the schema pane A change in the order of association types in the
Sentences Explorer schema pane is always reflected in the Default Dataform
The default order of association types is the order in which they were created To change
this order you can cut and paste or drag and drop an association type to a new position in
the schema pane with either the same or with a different source If you change the source
of an association type any associations of that type which exist are no longer visible
Properties
Working with Sentences
185
When you use the shortcut menu command Create Association Type or use the Create
Association Type toolbar button new association types are added to the end of the set of
existing association types for their source You can create a new association type in a
specific position by using the shortcut menu command Insert Association Type Above
This command creates a new association type and positions it above an existing selected
association type from the same source
Sequencing multiple instances
You can apply an explicit sequence to the instances of a multiple association type When
you create an association type or set its properties you can select the Multiple option
which means that you can create many instances of the association for each source By
default Sentences displays multiple association instances as sorted by their targets
according to the sort algorithm of the target type
If you select the Sequenced option in the Association Type Properties dialog the
instances of the association type are always displayed in their defined sequence which by
default is the order in which they were created You can change this sequence in the
Sentences Explorer data pane using the cut and paste options This is similar to the way
you can change the sequence of association types as described earlier
The sorting algorithm applied to a set of target entities is determined by the datatype of
their entity type (see ldquoDatatype properties pagerdquo )
Properties
Several new property pages have been added to types in Sentences Version 40 and some
include additional items
Business Rules introduce two new property pages for State Domains and Business
Rules See the Business Rules section for details
Types now have another property used to display a friendlier name in various parts of the
Sentences interface See the Display Name Query section for details
On the Retrieval Methods properties page there is an additional option for whether to
determine if child associations are present or not This means that both Entity Types and
Association Types now include a Retrieval Methods properties page See the Determining
if child associations are present section for details
The Datatype properties page now includes the new ImageData datatype The Format
properties page will be affected by default field widths and format patterns See the
Database Components section for details
Sentences Version 40 introduces the ability to have a subset of a subset which was
previously not allowed This means that the properties of a Subset have an additional
Subsets page for their subsets as well as the existing Presentation and Description pages
Subsets can have their own (and inherited) State Domains so the properties of a Subset
also include a State Domains page but not a Business Rules page
When an Associative Model is generated automatically by importing a Relational
Database Schema the description field of types is populated with the catalog schema
table and column or foreign key that led to its generation
The Mapping property page used by the previous version of LazyView is no longer
required
You can define a number of properties for entity types and association types in the
Sentences database by using the entity type and association type Properties dialogs
These dialogs have a number of tabbed pages some of which are common to both entity
types and association types as shown in the following list
Properties
Working with Sentences
186
Property Page Appears for entity types Appears for
association types
General Yes No
Datatype Yes No
Format Yes Yes
Presentation Yes Yes
Display Name Query Yes Yes
Subsets Yes Yes
Supertypes Yes Yes
Equivalence Yes Yes
Triggers Yes Yes
Description Yes Yes
Custom Dataform Yes Yes
State Domains Yes Yes
Business Rules Yes Yes
Diagram Images Yes Yes
Default Sorting Yes Yes
Association Type No Yes
Target Parameters No Yes
Derived Target No Yes
Dataform No Yes
Retreval Methods No Yes
General properties page
Figure 5-16 The General properties page
The General properties page applies only to entity types Some of these properties are
available on the Association Type properties page
Properties
Working with Sentences
187
Display in Core types folder
If you have not chosen the Generate Core types automatically option in the Edit
Profile dialog you can select an entity type to be displayed in the Core types folder by
selecting the Display in Core types folder checkbox (see ldquoThe Core types folderrdquo )
Instance options
The following options apply to instances of this type When a type is defined as a Value
type all of these properties are disabled and cannot be changed
bull Instances may not be created
You can define an entity type that does not have any instances of its own but that may be
a supertype for other related association subtypes by checking the Instances may not be
created checkbox The related entity subtypes may themselves have entity instances (see
ldquoSupertypes properties pagerdquo )
You can create some entity instances and then select the Instances may not be created
checkbox This forces users to choose from a limited range of instances For example you
could define an entity type Boolean with instances True and False and then select the
Instances may not be created checkbox
Note When Instances may not be created is selected instance names cannot be generated
automatically or by a trigger See Instance name creation options below
bull Instances may not be deleted
Check the Instances may not be deleted checkbox to prevent users from deleting any of
the instances that are created for this type
bull Instances may not be renamed
Note Instances may not be renamed does not apply to association types and does not
appear on the Properties dialog for association types
Check the Instances may not be renamed checkbox to prevent users from renaming any
of the instances that are created for this type
Note Instances may not be renamed is automatically selected if instance names are not
being created by the user The name is automatically generated using one of the methods below
bull Duplicate instances are not allowed
Check the Duplicate instances are not allowed checkbox to prevent the creation of
duplicate instances and to ensure that all instances are unique
Note The Instance Options check-boxes for association types are on the Association type
properties page The options Instances may not be renamed and Instances created by
trigger do not apply to association types
Instance name creation options
Note Instance name creation options do not apply to association types and do not appear
on the Properties dialog for association types
Note Instance name creation options do not apply to value entity types The name will
always be given by the user
Note When Instances may not be created is selected instance names cannot be generated
automatically or by a trigger
You can define an entity type that has the names of its instances generated automatically
by the system This may be used for example to automatically create invoice numbers or
order numbers in a business application
bull Instance name created by user
Properties
Working with Sentences
188
If you select this option for an entity type the user must enter a name for the Entity Type
bull Instance name created by trigger
You can define an entity type that has the names of its instances generated automatically
by a trigger This may be used for maximum flexibility when generating identifiers but
requires some programming resources The other options require no programming
knowledge
If you select this option for an entity type you cannot create new entity instances by
typing into a Dataform field You must open a Create Dataform from the entity type An
entity type that uses the Instance name created by trigger option may be the source of
association types in the same way as any other entity type
For general information on triggers see the section ldquoTriggersrdquo There is a worked
example of an Order Entry application which uses a trigger to create instance names for
orders in the section ldquoDerivations examplerdquo This worked example uses a trigger named
RenameInstance which is included in the ExampleTriggersjar file in the directory
ExamplesJars
If you use XML Import to add data instances for entity types which use the Instance
name created by trigger option you must make provision for the trigger action in your
XML data structure (see ldquoXML Import and triggersrdquo )
bull Instance name created by generating a GUID
You can define an entity type that has the names of its instances generated automatically
by a generated Globally Unique Identifier (GUID) The value of a GUID is represented as
a 32-character hexadecimal string such as
063a1d33-2189-49d3-969c-967d60e3dab5
The total number of unique keys is 2128 or 34times1038 This number is so large that the
probability of the same number being generated randomly twice is negligible
If you select this option for an entity type you cannot create new entity instances by
typing into a Dataform field You must open a Create Dataform from the entity type The
GUID is generated when you save the Dataform
bull Instance name created by incrementing ID
You can define an entity type that has the names of its instances generated automatically
by a generated ID The value of the ID starts with the one that you enter here and this is
incremented each time an entity is created
If you select this option for an entity type you cannot create new entity instances by
typing into a Dataform field You must open a Create Dataform from the entity type The
ID is generated when you save the Dataform
The ldquoseedrdquo ID can be either a whole number or an alphanumeric identifier When
incrementing the ID Sentences will take the trailing numerical part of the ldquoseedrdquo and
increment this by one A decimal point or comma will be treated as a non-numerical
character
If there is no trailing numeric part then Sentences will start with a zero If the numeric
part has leading zeros then these zeros will be retained until the number is larger than the
number of digits and then the ID will increment as normal
Some examples
1 2 3 4 5 hellip
0098 0099 0100 0100 hellip
ID0098 ID0099 ID0100 ID0100 hellip
PER PER0 PER1 PER2 PER3 hellip
1234997 1234998 1234999 12341000 12341001 hellip
Properties
Working with Sentences
189
bull Instance name created by current timestamp
You can define an entity type that has the names of its instances generated automatically
by using the current server timestamp
If you select this option for an entity type you cannot create new entity instances by
typing into a Dataform field You must open a Create Dataform from the entity type The
timestamp is generated when you save the Dataform
Datatype properties page
The Datatype properties page applies only to entity types
Figure 5-17 Selecting a datatype
Use the Datatype page of the Properties dialog to set the datatype for an entity type
Using datatypes allows for example input values to be checked for validity and
determine the range of formatting and presentation options that are available for instances
of a type and how instances are sorted
The use of datatypes also affects instance behaviour and visibility in that instances of
types that have datatypes assigned to them generally behave as values (see ldquoValue types
and datatypesrdquo ) You can prevent instances behaving as values by clearing the Instances
are values check box when you assign a datatype (see ldquoInstances are valuesrdquo ) This
allows you to make use of the formatting and presentation options associated with the
datatype without creating a value type
Value types and value instances are distinguished in the Sentences Explorer by
discshaped icons Because value types cannot be the source of association types you must
not define an entity type that you want to use as the source of an association type as a
value type For more information about values and value types and their relation to
datatypes see ldquoValue types and datatypesrdquo and ldquoImpact of changing a datatyperdquo
Instances are values
Check or clear the Instances are values checkbox to determine whether or not the type is
a value type and its instances are values This checkbox is selected by default for all
Sentences-supplied datatypes Clearing this checkbox means that instances have the
formatting and sorting characteristics associated with the datatype but the instances are
not values and the type is not a value type You may can also create your own custom
datatypes (see Chapter 10 ldquoCustomising Sentencesrdquo)
For more information about values value types and datatypes see ldquoValue types and
datatypesrdquo and ldquoImpact of changing a datatyperdquo
Properties
Working with Sentences
190
Assigning datatypes
To assign a datatype select a datatype from the drop down list on this page Depending
on the datatype selected other fields may be displayed on this page such as the
Maximum Decimal Places field for number datatypes The characteristics of each
datatype are described in the following sections
bull Undefined (displayed as ltNonegt)
If you do not assign a datatype the Datatype page displays ltNonegt as the datatype The
only presentation formats allowed are single-line or multi-line edit fields (using Tab and
Return characters)
Entity instances for types that do not have a defined datatype are limited to strings of
standard printable ASCII characters with a maximum string length of 64000 characters
Instances of types that do not have a defined datatype are sorted in a case-insensitive
alphanumeric order (that is 0hellip 9 Aa Bb hellipZz)
String datatypes
The string datatypes are Text Image Email and Hyperlink String datatypes are value
types but they do not support arithmetic operations
bull Text
In the Text datatype Tab and Return characters are allowed and therefore multiline
values can be created if the multiple line presentation method has also been selected
Multiple line values are only displayed as multiple lines in the Dataform In the Sentences
Explorer multiple line values are displayed all in one line and a semi-colon character is
used to mark the position of line breaks You can only use the multiple line presentation
method for singular associations and not for multiple associations
Instances of types that are defined with the Text datatype are sorted in a casesensitive
alphanumeric order (that is 0hellip 9 A B hellipZ a b hellipz)
Using the Hidden style for the Text datatype results in the display of asterisks on the
dataform instead of the actual text entered
bull Image
Sentences supports the display of JPEG and GIF image file formats When you type in the
location of an image file in a target field defined with the Image datatype the Dataform
displays the image The Sentences Explorer displays the file name or URL
Sentences can display any image hosted on any web server that it can access if the image
file is referenced by a full URL such as httplazysv04databasesimagesJanejpg
You cannot specify an image location using a file path
You can reference images more easily if you specify a location for all your image files
using the ImageURLBase parameter in your jnlp or javascript definition (see ldquoAbout the
ImageURLBase parameterrdquo) You could then use the file name on its own or a partial
URL For example if the ImageURLBase parameter was set to
httplazysv04databasesyou could refer to an image file simply as
imagesJanejpg
Instances of types that are defined with the Image datatype are sorted in a casesensitive
alphanumeric order (that is 0hellip 9 A B hellipZ a b hellipz)
bull Hyperlink
When you use the Hyperlink datatype the entered value is treated as a World Wide Web
Uniform Resource Locator (URL) When such a value is opened (by double clicking or
Properties
Working with Sentences
191
by selecting Follow Hyperlink from the shortcut menu) the Web page or file to which the
URL refers is displayed
The Hyperlink datatype allows Sentences to link to a variety of electronic documents
You can use any kind of URL for the Hyperlink datatype including http for Web
page addresses mailto for email addresses and file for host-specific file names If
you are using Microsoft Outlook you can use the outlook prefix to create a URL that
links to a Microsoft Outlook folder
Instances of types that are defined with the Hyperlink datatype are sorted in a
casesensitive alphanumeric order (that is 0hellip 9 A B hellipZ a b hellipz)
The Hyperlink properties includes a default Protocol which can be set to ltAutogt
mailto http https file or specified yourself This will be used if no
protocol is entered in a dataform field
bull Email
The Email datatype is a convenient specialisation of the Hyperlink datatype with the
protocol hard-coded to be mailto
Numeric datatypes
The numeric datatypes are Number Currency MixedCurrency and Percentage All of
these datatypes support standard arithmetic and comparisons Any two Number or
Percentage instances can be used in arithmetic or compared Two Currency instances can
only be used in arithmetic or compared if they represent values in the same currency
When you select Number MixedCurrency or Percentage you must define the maximum
number of decimal places as shown in Figure 5-19
Figure 5-18 Defining decimal places for a number datatype
bull Number
The Number datatype supports storage to 17 significant digits with an optional sign
character (+-) of both floating point and integer values This datatype does not support
ldquoexponent and mantissardquo style inputs (for example 123e+10) Magnitudes smaller than
1e-16 are rounded to zero Magnitudes larger than 1e+17 are rounded to 17 significant
digits Numbers which cannot be stored exactly are rounded up or down to the nearest
exactly storable value
Instances of types that are defined with the Number datatype are sorted in numerical
order
Properties
Working with Sentences
192
Figure 5-19 Selecting the currency for a Currency datatype
bull Currency
The Currency datatype supports the use of monetary values A standard international set
of three character currency codes is used for example USD GBP and EUR The
currency datatype ensures that arithmetic can only be conducted between monetary values
in the same currency For example monetary values in queries must be of the same
currency in order to be compared
When you select the Currency datatype you need to select the currency as shown in
Figure 5-19
Instances of types that are defined with the Currency datatype are sorted in numerical
order
International considerations for the currency datatype
The way currency values are displayed on your system depends on your computerrsquos
settings and on the locale settings used by the Java Runtime Environment installed on
your computer
bull MixedCurrency
The MixedCurrency datatype supports monetary values in more than one currency Each
value entry has two parts specifying the currency and the monetary value The only
arithmetical operations that are available with the MixedCurrency datatype are either
multiplication and division by a Number datatype or an arithmetical operation with
another value that has the MixedCurrency datatype
Instances of types that are defined with the MixedCurrency datatype are sorted by
currency type and then in numerical order
bull Percentage
Value instances defined with the Percentage datatype are floating-point numeric values
Instances of types that are defined with the Percentage datatype are sorted in numerical
order
Date and time datatypes
The date and time datatypes are Date Time and Timestamp Each of them has an
internal numeric representation allowing arithmetic and comparisons to be performed
correctly For arithmetic none of them supports the multiply divide or remainder
operators For comparisons earlier dates or times are considered to be less than later ones
Properties
Working with Sentences
193
International considerations for date and time datatypes
The way dates and times are displayed on your system depends on your computerrsquos
settings and on the locale settings used by the Java Runtime Environment installed on
your computer
The Sentences date and time datatypes are based on the Java formats Date and time
formats for locales other than the US are only supported by the International version of
the Java Runtime Environment
bull Date
The Date datatype represents an individual date such as September 14th 1998 The
stored value is a whole number of days since a starting date This makes it independent of
time zones and ensures that comparisons for equality can be done correctly
Sentences does allow you to enter a year using only two digits although this is not
recommended Sentences calculates the century for two digit years by assuming a century
that begins 80 years before the current date and ends 20 years after the current date
If you enter a year using only one digit or using three or four or more than four digits
Sentences accepts the year value exactly as entered Sentences does not allow negative
values for years
Sentences does not accept invalid month and day of month values including leap year
calculation
For details of arithmetic operations that are supported with the Date datatype please see
ldquoArithmetic operations with Date and Time datatypesrdquo
Instances of types that are defined with the Date datatype are sorted in chronological
order
bull Time
The Time datatype represents a time of day such as 114305 The stored value is a whole
number of milliseconds since midnight Sentences stores and displays time without any
reference to time zones or time schemes This means that a value entered as 1100AM is
always displayed as 1100AM regardless of the time zone it is displayed in
When you perform arithmetic with time values additions and subtractions wrap around
2400 For example 2300 plus two hours gives 0100 not 2500
For details of arithmetic operations that are supported with the Time datatype please see
ldquoArithmetic operations with Date and Time datatypesrdquo
Instances of types that are defined with the Time datatype are sorted in chronological
order
bull Timestamp
The Timestamp datatype represents single point in time with millisecond precision such
as 1998 September 14th at 114305 BST Timestamp values are displayed in the context
of the current time zone However this affects only the display not the stored value
For details of arithmetic operations that are supported with the Timestamp datatype
please see ldquoArithmetic operations with Date and Time datatypesrdquo
Instances of types that are defined with the Timestamp datatype are sorted in
chronological order
Properties
Working with Sentences
194
Format properties page
Figure 5-20 (The Format properties page
The Format properties page is available on the Properties dialog for both entity types
and association types This page allows you to define the input and output formats
displayed on the Dataform The options available vary according to the datatype selected
and according to whether the association type is singular or multiple
The default format of association types is inherited from the datatype of the association
typersquos target You can use settings on the Format page to override the default settings
Presentation
Presentation options define the display of fields on the Dataform The first field in a
dataform represents instances of the source type and the label for this field is the name of
that type All the other fields on the Dataform represent the targets of associations sharing
the same source and the labels for these fields are the association verbs
You can define presentation options using the Properties dialog opened on an entity type
or an association type Presentation options defined for an entity type are inherited by any
association in which the entity type is a target but can be overridden by options set for the
association type
The following table shows the presentation options that are available for the different
datatypes in Sentences
Properties
Working with Sentences
195
Datatype of Target Presentations for Singular
Association Types
Presentations for Multiple
Association Types
Currency
Date
Hyperlink
Image
MixedCurrency
Number
Percentage
Time
Timestamp
Single Line
Combo
Radio Button
Tree
Table for targets
Table for associations
Nested panel
Button for target
Button for association
Label
List
Checkbox
Tree
Table for targets
Table for associations
ltNonegt
Text
Single Line
Multiple Line
Combo
Radio Button
Tree
Checkbox
Table for targets
Table for associations
Nested panel
Label
List
Checkbox
Tree
Table for targets
Table for associations
In addition the Checkbox and Combo are supported within tables when they can be
edited
The appearance of each of these presentation methods is as follows
bull Label
The association target is represented as a non-editable field with no border and so appears
as if a label The contents can be copied
bull Single Line
The association target is represented on the Dataform by a single line editable field
bull Multiple Line
The association target is represented on the Dataform by a multiple line editable field
bull Combo
The association target is represented on the Dataform by a single line field with a drop-
down arrow that can be used to display a list of existing target instances
bull List
The association target is represented on the Dataform by a list of existing target instances
bull Tree
The association target is represented on the Dataform by a list of existing target instances
displayed as an expandable tree similar to the display used in the Explorer data pane
bull Checkbox
The association target is represented on the Dataform by a series of targets each indicated
by a small box and a text label More than one target may be selected
bull Radio Button
Properties
Working with Sentences
196
The association target is represented on the Dataform by a series of targets each indicated
by a small circle and a text label Only one target may be selected In the following
definitions the term primary association refers to an association whose source is the entity
or association instance for which the Dataform is opened
bull Table for Associations
Table for Associations displays a primary association and all singular associations whose
source is the primary association The columns display the targets of the associations
concerned and the headings are the associations types The first column heading is the
type of the target of the primary association
bull Nested panel
A Nested panel displays a primary association (similar to a Single Line presentation) and
below it all associations whose source is the primary association within a nested panel
The secondary associations could themselves have any presentation including Nested
panel
bull Table for Targets
Table for Targets displays a primary association and all singular associations whose
source is the target of the primary association The columns display the targets of the
associations concerned and the headings are the associations types The first column
heading is the type of the target of the primary association
bull Button for Target
Button for Target displays a button that opens a child dataform on the target of the
singular association and its children The right-alignment format property is honoured
bull Button for Association
Button for Association displays a button that opens a child dataform on the singular
association and its children The right-alignment format property is honouredbull Disable
in-place editing
When the presentation option is set as either Table for Associations or Table for
Targets you can edit the target value directly in the Dataform table without the need to
open a child Dataform
You can disable this feature by checking the Disable in-place editing checkbox
Picker
Some Dataform fields allow you to select target instances from a list known as a Picker
launched from the ellipsis button next to the field The Picker field allows you to choose
either the List picker or the Tree picker for selecting values A List picker displays a
simple list of instances while a Tree picker displays a list of instances that can be
expanded to display associations as in the Explorer data pane
You can also select a special Calendar picker for types defined with the Date datatype
To disable the display of a picker select None as the Picker type
Style
The table below shows the different styles (for output) that are available for different
datatypes in Sentences
In the formats for Currency and MixedCurrency the letter C represents the currency
symbol for example pound or $ and the letter I represents the three letter ISO currency code
for example GBP or USD
Properties
Working with Sentences
197
Datatype Styles
ltNonegt ltNonegt
Currency ltDefaultgt
C0C-0
C000C-000
C0C-0
C000C-000
0C
000C
0C
000C
I 0I -0
I 000I -000
I 0I -0
I 000I -000
MixedCurrency ltDefaultgt
C0C-0
C000C-000
C0C-0
C000C-000
0C
000C
0C
000C
I 0I -0
I 000I -000
I 0I -0
I 000I -000
Date ltDefaultgt
Short
Medium
Long
Full
Number ltDefaultgt
0
000
0
000
Percentage ltDefaultgt
0
000
0
000
Text ltDefaultgt
Hidden
Time ltDefaultgt
Short
Medium
Long
Full
Properties
Working with Sentences
198
Datatype Styles
Timestamp ltDefaultgt
Short
Medium
Long
Full
SDateSTime (Short Date and Short Time)
SDateMTime (Short Date and Medium Time)
SDateLTime (Short Date and Long Time)
SDateFTime (Short Date and Full Time)
Display width
The Display width parameter specifies the width of the display field for an instance in
characters The unit for this setting is based on the width of a lower-case ldquowrdquo character
and the default setting is twenty-five characters
You can only use positive numeric values This parameter is disabled if the Presentation
method is set to Radio Button or Check box
Table column width
The Table column width field allows you to set the width for the association or entity
when it appears in a table on the Dataform The unit for this setting is based on the width
of a lower-case ldquowrdquo character The default setting if no value is specified is two-thirds of
the length specified for Display width
Display height
The Display Height parameter specifies the height of the display field in rows for multi-
line entries The default setting is six rows
Format options
The following options can be selected by checking the check-boxes on the Properties
dialog Format page for association types and entity types
bull Read only on Dataform
The Read only on Dataform option defines an association or entity that cannot be altered
by the user through the Dataform This setting is useful for association types whose
values are generated automatically by customised triggers For more information see
Chapter 10 ldquoCustomising Sentencesrdquo
bull Hidden on Dataform
The Hidden on Dataform option defines an association or entity that is not displayed on
the Dataform If you select this property there is no label or field for this type on the
Dataform and therefore no access from the Dataform for this type
If you select Hidden on Dataform then Hidden in Dataform tables is also selected
automatically
bull Inverse Hidden on Dataform
The Inverse Hidden on Dataform option defines an association or entity that is not
displayed on the Dataform in the inverse direction If you select this property there is no
label or field for this type on the Dataform and therefore no access from the Dataform for
this type in the inverse direction
The default is to hide Association Types in the inverse direction
bull Hidden in Dataform tables
Properties
Working with Sentences
199
The Hidden in Dataform tables option defines an association or entity that is not
displayed in a Dataform table If you select this property there is no column for this type
in a Dataform table
If you select Hidden on Dataform then Hidden in Dataform tables is also selected
automatically
bull Right-align in Dataform fields
The Right-align in Dataform fields option defines associations or entities which are to
be displayed as right-aligned in Dataform fields
bull Right-align in Dataform tables
The Right-align in Dataform tables option defines associations or entities which are to
be displayed as right-aligned in Dataform tables
bull Allow multi-line label on Dataform
The Allow multi-line label on Dataform option allows the label of a Dataform field (the
name of the source type or the verb of an association type) to be displayed over multiple
lines
Presentation of date formats
The presentation of Date formats depends on the version of the Java runtime environment
installed on your computer The US version of Java only supports the US date format
(monthdayyear) The Internationalised version of Java supports the European date
format (daymonthyear) If you only use two digits for the year Sentences assumes a
century that begins 80 years before the current date and ends 20 years after the current
date
Presentation of time formats
The presentation of Time formats depends on the version of the Java runtime
environment installed on your computer The US version of Java only supports a 12- hour
clock format with AM or PM The Internationalised version of Java supports the 24-hour
clock format If you are using the US version of Java you can input times as for example
130PM and if you are using the Internationalized version you need to enter 1330
Restore Default settings button
The Restore Default settings button on the Format properties page allows you to reset
all the values to the defaults for the current datatype For association types the Restore
Default settings button resets all the values to the current Format settings for the
associationrsquos target which may differ from the defaults for the datatype
Properties
Working with Sentences
200
Presentation properties page
Figure 5-20a The presentation properties pages for Entity Types and Association Types
The presentation properties are used to customise the presentation of Types and Instances
in Sentences This can be in the Sentences Explorer a Dataform or XML output that has
been transformed into HTML
bull Small icon large icon
The icons specified here will be used to replace the standard icons in the Sentences
Explorer and used in any XML output You can select an image from the Image picker by
clicking on the button The available images are those in the directory of image files on
the server
bull Start of section
Note Start of section is not applicable to Entity Types
The Start of section determines whether an instance of this association should start a new
section of the XML output Each section can have a title icon and some introductory text
assigned to it
bull Section title Section icon Introductory text
Note Section title Section icon Introductory text are not applicable to Entity Types
Each section can have a title icon and some introductory text assigned to it This is
intended to be used where the child results of this item will form the section details
You can select an image from the Image picker by clicking on the button The available
images are those in the directory of image files on the server
Properties
Working with Sentences
201
Display Name Query properties page
Figure 5-20b The display name query properties page
Display name queries can be used to enhance the ldquonamerdquo of an Entity or Association by
providing an alternative based on the instances attributes A Display Name Query can use
the full power of the query mechanism to form a name This is particularly useful when
the identifier for an Entity is an ID rather than a name as when mapping relational data
into Sentences In this scenario a Display Name Query can be used to display the name
attribute of the entity and the unique ID together making the display of those instances far
more readable and intuitive
For more details on Display Name Query capabilities and how to construct them see
ldquoDisplay Name Queriesrdquo
To specify a display name query
1 Open the Display Name Query page of the Properties dialog for one type
and click on the button
2 Select the query you wish to use or ltNonegt to remove an existing display
name query and click OK
Properties
Working with Sentences
202
Subsets properties page
Figure 5-21 The subsets properties page
bull The subsets mechanism
Subsets are one of the two mechanisms that allow different types in a database to share
common features The other mechanism is Supertypes
The subset mechanism allows you to define a group of instances of a given type that
match a particular condition You may create a subset that contains all the instances of its
superset The supertype mechanism allows you to define a hierarchy of types with certain
associations common to more than one subtype
Association types sourced on supersets and supertypes are shared by the respectivesubsets
and subtypes
bull Subsets properties
The subsets mechanism in Sentences allows you to define a set of instances of an existing
type as a new type You cannot select instances to be members of a subset as subset
membership is defined by a condition that is implemented as a query You can create a
new instance which is a member of a subset by opening a create Dataform on a subset
type When you save the Dataform Sentences checks that subset instances created in this
way meet the conditions for the subset
The subset properties page includes command buttons for creating a new subset query or
for attaching an existing query to a subset definition Whenever a subset is used its
membership is determined by evaluating the condition against the membership of the
superset
You can use the subset mechanism for association types as well as entity types
A subset type has all the source and target behaviour of its superset type This means that
all association types that have the superset as their source or their target exist in the same
form for the subset A subset can be a subset of only one superset type A subset cannot
be the superset of another subset which means that Sentences does not allow subsets of
Properties
Working with Sentences
203
subsets Also a subset cannot behave as a subtype (see ldquoSupertypes properties pagerdquo ) If
subtype behaviour is required you must define the superset type as a subtype
Sentences displays the existing subsets for a type using an expandable tree display
To create a subset definition
1 Click Create to open a dialog box in which you can name the subset and then click
OK
2 Click Edit Query to open the Query Editor (see Chapter 7 ldquoSentences queriesrdquo) and
define the subset query The subset query can include a condition that restricts
membership of the subset to items that meet the condition If you do not create a subset
query all the members of the superset are members of the subset A subset that contains
all the members of its superset can be a useful tool in defining the appearance of a
Dataform (see ldquoDataform tabbed pages with subsets and supertypesrdquo )
3 Use the Query Editor to create a query and then attach it to a subset using the Attach
Query command (or the Attach Set Query command if available) on the Schema menu
Using the Attach Query command replaces any existing subset query There is also a
menu item to Detach Subset Query
The result of a subset query must be a set of instances of the same type as the superset
type For example a subset query to define the type Married Person as a subset of
Person must return a set of instances of the type Person
A subset query must always use the superset type as its root node You cannot use another
subset of the same superset type as the root node The subset query can be edited from the
Subset properties page Subset queries appear with other queries in the All Queries folder
of the schema pane and can be edited from there in the same way as any other query
(Subset set queries appear in the Subset Queries sub-folder under the Set queries folder
of the schema pane)
Sentences displays an expand button next to subset queries in the schema pane Clicking
the expand button displays details of the type to which the subset query applies
After you define the subset query the subset type appears with all the other defined types
in the All types folder of the schema pane The superset and subset are both marked as
such in the schema pane by the addition of the system associations has subset and
subset of Examples of the use of subsets and supertypes are given in Chapter 6
ldquoAdvanced techniquesrdquo
Comparison of subsets and supertypes
In general a supertype should be used when the relationship between the instances of the
type and the parent supertype is a permanent one As an example of a permanent
relationship consider a schema which defined the entity types domestic dogs wild dogs
and wolves as subtypes of a supertype called canines In this case the status of an entity
instance is unlikely to change
A subset relationship is suitable where the status of entity instance is likely to change As
an example of this consider a schema in which the entity type customers with overdue
accounts is defined as a subset of the entity type customers In this case it is expected
that an entity instancersquos membership of the subset customers with overdue accounts is
temporary
There are some relationships that are less easy to define as being either permanent or
temporary and these need to be considered on a case-by-case basis bearing in mind the
requirements of the Sentences application you are developing
The relationship between the entity types Employee and Person is an example of this
An Employee is clearly a Person but may be an Employee for as long as 40 years or
for as little as 4 weeks In a business application you may need to record significant
Properties
Working with Sentences
204
information for an Employee and for a former Employee but not for any other Person
It is possible that some individuals entered in the database as Persons may go on to
become Employees In these circumstances it is appropriate to create a schema in which
the Person entity type is a supertype of the Employee entity type This has been done in
the Human resources example application (see ldquoThe Human resources example
applicationrdquo )
Dataform behaviour with subsets and supertypes
There are important differences between the behaviour of Dataforms when using
supertypes and subsets For a description of the differences for the base Dataform see the
section ldquoDataform tabbed pages with subsets and supertypesrdquo 9
Where custom Dataforms have been defined a type and its supertypes may have different
custom Dataforms selected as their default Dataform However where subsets are used all
the subsets will use the default Dataform set for the base type For more information on
custom Dataforms see the sections ldquoCreating a custom Dataformrdquo and ldquoCustom
Dataforms with subsets and supertypesrdquo
Subsets of association types
You can define subsets of association types in the same way you define them for entity
types using the Subsets tabbed page of the Properties dialog
The name that you enter when you create the association subset is its verb name The
subset association type uses the same source and target types as its superset type
Subset association types are displayed in the Explorer schema pane with yellow arrows
Where a subset association type is the source of one or more further association types the
base dataform for the superset association type has an additional tabbed page named for
the subset association type to display those associations
Viewing subset type instances
When instances of subset types are displayed in the data pane of the Sentences Explorer
they are identical in appearance to the instances of any other types
If the subset includes all the instances of its superset then the list of instances displayed
for the subset and the superset is identical You must remember that such listings are not
duplicates They are the result of the same instance being valid for display as an instance
of a type and as an instance of a subset type
Properties
Working with Sentences
205
Supertypes properties page
Figure 5-22 The Supertypes properties page
Supertypes are one of the two mechanisms that allow multiple types in a database to share
common behaviour The other mechanism is Subsets
The supertype mechanism allows you to define a hierarchy of types with certain
associations common to more than one subtype Supertypes should be used when the
correspondence between a type and its parent is permanent and subsets should be used
where the correspondence is temporary
Association types sourced on supersets and supertypes are shared by the respective
subsets and subtypes
An entity type can be a subset or a supertype of another entity type and an association
type can be a subset or a supertype of another association type
Supersets and subtypes are created in the database schema and are stored in the schema
changes chapter Subset entity types are displayed in the Sentences Explorer schema pane
with yellow icons
The Supertypes properties page allows you to associate a type with another existing type
in a hierarchical relationship A type that is defined as a subtype implements all the source
and target behaviour of its supertype This means that all association types that have the
supertype as their source or their target exist in the same form for the subtype A type may
be a subtype of more than one Supertypes A subtype may be the supertype for further
subtypes
To define a supertype
1 Click the Addhellip button to select an existing type as the supertype
After you define the supertype the supertype and subtype are both marked as such in the
schema pane by the addition of the system associations supertype of and subtype of
Properties
Working with Sentences
206
You can create instances of a subtype directly These instances are also members ofthe set
of instances for the supertype
Using supertypes with association types
You can define supertypes for association types as well as for entity types
Both the source and the target of the subordinate association type must be either the same
as or a subtype of or a subset of or a subset of a subtype of the source or target
respectively of the supertype association type
Examples of the use of subsets and supertypes are given in Chapter 6 ldquoAdvanced
techniquesrdquo
Equivalence properties page
You can use the Equivalence properties page to define two or more types as the same
This can be useful if you wish to merge databases and for example one database uses a
type named Clients and the other uses a type named Customers The types being linked
in this way must either be both association types or both entity types If they are value
types (entity types with defined datatypes) they must both have the same datatype
If you wish to make two association types equivalent they must share the same source and
the same target
The result of creating an equivalence between two types is similar to the result of creating
a supertype-subtype link between two types Instances of each of the two types share all
the associations of both types A Dataform display for either type or any instance of either
type shows a page for each of the equivalent types
To make two types equivalent
1 Open the Equivalence page of the Properties dialog for one type and click Add
2 Select the equivalent type from the picker list
To cancel an equivalence highlight the equivalent type and click Remove
You can also define equivalent instances (see ldquoInstance equivalencerdquo )
Triggers properties page
Figure 5-24 The Triggers properties page
Properties
Working with Sentences
207
Triggers are elements of custom Java classes and methods that users can add to
Sentences A trigger generally performs an action in the database whenever a specified
action called a trigger event takes place
You can view a list of available triggers by selecting Triggers from the View menu To
use a trigger you must write your own Java code compile the code into a Java archive
(JAR) file and place the JAR file in the directory listed in the TriggerPath property in
the Serverproperties file You can then use the Triggers properties page to assign the
trigger to a particular entity or association type The detailed steps for attaching a trigger
to an entity or association type and how to edit trigger assignments are given in the
section ldquoAttaching a triggerrdquo
There are examples of how triggers may be used in Chapter 11 ldquoWorked examplesrdquo
Description properties page
Figure 5-25 The Description properties page
The Description properties page allows you to add a free text description to any entity or
association type
Properties
Working with Sentences
208
Custom Dataform properties page
Figure 5-26 The Custom Dataform properties page
You can use the Query Editor to design a custom Dataform (see ldquoCreating a custom
Dataformrdquo ) You can use the Custom Dataform properties page to delete or rename an
existing custom Dataform and to create a new custom Dataform
Sentences displays the existing custom Dataforms for a type using an expandable tree
display
When you create a custom Dataform you can either attach an existing query or launch the
Query Editor to create a new query
You can also choose which Dataform should be used as the default Dataform for the type
Properties
Working with Sentences
209
State Domains properties page
Figure 5-27 The State Domains properties page
This property page is used to view and edit the tree of User and System State Domains for
this Type By default only System and Inherited Domains that are in use are displayed
You can select the Inherited and System checkboxes to include all Domains in the tree
See ldquoBusiness Rulesrdquo for details of Business Rule and State Domain functionality
Business Rules properties page
Figure 5-28a The Business Rules properties page
This property page is used to view and edit the list of Business for this Type See
ldquoBusiness Rulesrdquo for details of Business Rule and State Domain functionality
Properties
Working with Sentences
210
Diagram Images properties page
Figure 5-28b The Diagram Images properties page
You can use these properties to specify how this Type will appear on Sentences Diagrams
by default
The available options are
bull Image Image link
You can specify either an image from the available images on the server or a URL that
specifies an image accessible from the Sentences client
bull Use default images
If you select to use default images the images specified in the ldquoPresentation Propertiesrdquo
will be used in preference to the images specified above
bull Text and Image
You can specify whether to display just text just an image or both If you choose both
then you can also specify whether to align the Text at the top bottom left or right of the
image
bull Hide border
You can specify whether to display a border around the diagram item or not by selecting
or deselecting Hide border
bull Background Colour
You can specify use of the default colour (the Sentences system colous) a transparent
background or a specific colour Click on the Change colourhellip button to select a custom
colour
Properties
Working with Sentences
211
Default Sorting properties page
The Default Sorting properties allows you to set how the Type will be sorted by default
when used in a Dataform or Custom Dataform
Sorting can use any of the nodes that will be available in the query used to display the
base Dataform You can have multiple sort nodes with different sort directions
Properties
Working with Sentences
212
Dataform (Navigation) properties page
Figure 5-28c The Dataform properties page
You can set the following properties on this dialog for both navigation to the target and
navigation to the source (if included on a dataform in the inverse direction) Only the
forward direction is described here but the same behaviour and rules apply to both
directions and can be set independently from one another
Can select lttargetgt checkbox
Select this property to allow users to select a target instance from an appropriate list of
instances
Can create lttargetgt checkbox
Select this property to allow users to create a target instance of the appropriate type
Navigation
Select the navigation behaviour for links from the target field The options are
Prohibited Default Dataform or where a custom Dataforms exists for the target type a
Specific custom Dataform
If no custom Dataforms exist for the target type a message is displayed on the dialog as
illustrated in Figure 5-28c
If navigation is Prohibited you cannot open a child dataform for an existing target
instance although you may be able to create a new child instance if the Can create
lttargetgt checkbox is selected
lttargetgt Dataform is read only checkbox
If the Dataform for the target instance is read only you may view the target Dataform but
not alter any of the fields on it
If navigation is Prohibited this option is not available
Interaction between properties
If the Navigation property is set to Prohibited then the lttargetgt Dataform is read only
checkbox is unavailable
If the association type is read only or has a derivation that is not editable (see ldquoDerivation
propertiesrdquo ) then neither the Can select lttargetgtcheckbox nor the Can create lttargetgt
checkbox is available
Properties
Working with Sentences
213
Dataform Filter properties page
AssociationTypes that are presented as a column in a table can be used as a filter when
the target is an Entity Type
The default filter can be either a specific instance or an expression
This peoperty is used as the default when creating a base or Custom Dataform that
includes the Association Type For more information see ldquoFiltering Dataform Tablesrdquo
Retrieval Methods properties page
EntityTypes only have one retrieval property
bull Determine if child associations are present
For very large databases and for Dynamic LazyView databases it is an expensive
operation to fetch not just the instances but also to check whether they have any child
associations This property can be unchecked to improve performance when knowledge of
whether the instances have children is unimportant When unchecked instance appear
with a plus sign and only when they are expanded are the children fetched If there are no
children then the plus sign is removed to indicate no child associations
Association Type properties page
Figure 5-29 The association type properties page
Properties
Working with Sentences
214
The association type properties page resembles Create Association Type dialog You can
change the properties you set when you created the association type
Changing the properties of an association type may affect the properties appearance or
visibility of association instances based on it For example changing the cardinality of an
association type from Singular to Multiple allows you to use a list input field instead of a
single line input
If you change the cardinality of an association type from Multiple to Singular after
creating multiple associations for a source entity only the last association you created can
be seen in the Dataform All the created associations remain visible in the Explorer data
pane
If you change the cardinality of an association type you should always click OK on the
Association Type properties page before you make any other changes on any of the
other tabbed pages in this dialog
For more details on association type properties please see the section ldquoCreating
association typesrdquo
Target Parameters properties page
Figure 5-30 The Target Parameters properties page
The Target Parameters properties page allows you to restrict the targets for an
association type This properties page is not displayed on an entity type properties dialog
This mechanism is only available when the target of an association type is a subset
This properties page displays a list of the possible common source associations You can
define the association from which the target for the current association type may be
chosen
For an explanation of the use of Target Parameters see ldquoTarget parametersrdquo
Properties
Working with Sentences
215
Derived target properties page
Figure 5-31a The derived target properties page - default instance
Figure 5-31b The derived target properties page - derived expression
Properties
Working with Sentences
216
The Derived target properties page is available for association types only
As an aid to data entry you can define a default or derived target for an association type
When you open a create Dataform any default targets defined for the associations on that
Dataform are displayed If the target is derived then the target may be subsequently re-
calculated
This property page combines two previous mechanisms used in Custom Dataforms for
deriving a target if none already exists when the dataform is saved or always The
simpler mechanism simply specifies an existing instance to use
On a Custom Dataform there is an additional property to make the field read-only which
does not apply to the schema properties The derived target definition set for this
Association Type will be used as the default if it is used in a Custom Dataform Query
The derived target setting may be none an instance or an expression
bull Instance
Select an instance of the target type
bull Expression
Enter a valid expression The expression is validated in the context of the query that will
be generated to make the base dataform This means that other nodes can be referenced
For further information on expressions (see ldquoUsing expressions in queriesrdquo )
If the schema subsequently changes such that the expression is invalid then no target will
be derived until the expression is updated to reflect those schema changes
Retrieval Methods properties page
Figure 5-32 The Retrieval Methods property page for Entity Types and Association Types
The Retrieval Methods properties page allows you to specify two things
For Entity Type and Association types you can specify whether the server should try to
determine whether child associations are present (usually indicated by a plus sign to show
that the instance has children)
For Association Types only you can specify the way in which association instances are
retrieved from the database These settings can influence server response times
These properties determine the default behaviour when an association type is selected in
the schema pane and when a folder is expanded in the data pane You can override this
Properties
Working with Sentences
217
default behaviour by selecting a different option from the association type shortcut menu
or the View menu The shortcut menu is also available on data pane folders for multiple
instances You can define different settings for forward and inverse instances
The available options are
bull By source (forward associations) By target (inverse associations) (default)
When you select the association type in the schema pane Sentences finds all the instances
of the source or target type and then searches for associations This option provides a
good response where most source or target instances have associations If only a few
source or target instances have associations this option can provide a slow response
bull Sorted
When you select the association type in the schema pane Sentences finds all suitable
instances of the association type and then sorts them by their source or target type and
displays the first 50 instances If there are a large number of associations this can be very
slow If there are a large number of source or target instances but only a small number of
associations this option can provide the fastest response
bull Unsorted
When you select the association type in the schema pane Sentences finds the first 50
suitable instances of the association type and displays them without sorting This option
can be used to display a sample of the available associations relatively quickly or where
neither of the other options provides a good response
bull Determine if child associations are present
For very large databases and for Dynamic LazyView databases it is an expensive
operation to fetch not just the instances but also to check whether they have any child
associations This property can be unchecked to improve performance when knowledge of
whether the instances have children is unimportant When unchecked instance appear
with a plus sign and only when they are expanded are the children fetched If there are no
children then the plus sign is removed to indicate no child associations
Operations on instances
There are a number of operations that can be carried out directly on instances in the data
pane of the Sentences Explorer
These operations allow you to make one instance supersede another and to define one
instance as the equivalent of another It is also possible to create an association type
which has an instance rather than a type as its source
Properties
Working with Sentences
218
Supersedes
Figure 5-33 The supersedes dialog in the data pane
You can replace an instance with another instance of the same type using the supersedes
command Both instances must exist in the database before you use this command After
using this command the instance that has been superseded no longer exists in the
database
Supersedes is not available for value instances
To supersede one instance by another follow these steps
1 Highlight the instance to be superseded and select Superseded by from the shortcut
menu Sentences displays the Superseded by dialog box for the instance
2 Select the name of the superseding instance from the picker list and click OK
Sentences displays the Impact of supersession dialog listing the associations in which
the instance being superseded is involved
3 Click Supersede to continue or click Close to cancel the supersedes action
When you use Supersedes with a singular association type you may create a situation in
which a singular association has multiple instances If this occurs Sentences displays an
error message when you open the Dataform To remedy this error you must view the
association in the Sentences Explorer and delete the additional instances that are no
longer required When you use Supersedes with a multiple association type the lists of
associations from the superseding and superseded associations are merged
After a supersedes action the original instance no longer exists in the database in contrast
to instance equivalence where both equivalent instances persist in the database A
Supersedes action cannot be undone
Instance equivalence
You can define two entity or two association instances as being equivalent For example
you can make the instance International Business Machines equivalent to the instance
IBM The instances must be of the same or equivalent entity type or association type but
Properties
Working with Sentences
219
may be from different data chapters Equivalent instances have identical behaviour that is
all the associations of either instance are displayed as associations of both
Equivalent instances are displayed in the Explorer data pane in an instance subfolder
labelled equivalent to Instance
Where an instance is equivalent to more than one other instance then the same behaviour
is displayed by all the equivalent instances
Equivalent instances persist in the database in contrast to superseded instances which do
not Equivalence is not available for value instances
To make one instance equivalent to another follow these steps
1 Highlight an instance that you wish to make equivalent and select Equivalents from
the shortcut menu Sentences displays the Instances equivalent to dialog box for the
instance If any equivalent instances are already defined they are displayed in the list box
2 Click Add to display a picker showing suitable instances (instances of the same or of
an equivalent type) select an instance and click OK Repeat this step if necessary to
make more instances equivalent to the selected instance
3 Click OK to close the dialog
The following table lists the buttons on the Instances equivalent to dialog box and their
meanings
Button Action
Add Displays a picker so that you can select an existing
instance to be added to the list
Remove
Removes a selected instance from the list
(The selected instance is no longer equivalent to any of
the other instances shown)
Remove All
Clears the list This has the same effect as using the
Remove button on the current instance in the dialog for
another instance
OK Implements the selected changes and closes the
dialog
Cancel Discards the selected changes and closes the dialog
You can also define equivalent types (see ldquoEquivalence properties pagerdquo)
Instance-specific association types
If you select an existing entity instance or association instance as the source of an
association type that association type applies only to that instance This allows you to add
information that is specific to a particular instance
For example in a customer relationship management system you may wish to record the
golf handicap of only one customer You can do this in Sentences by adding an instance-
specific association type for example Bill Smith golf handicap golf handicap This
association type does not exist for other customers in your database
If you later decide that an instance-specific association type is relevant for other instances
of the same type you can change the associationrsquos source to the type for example to
Customer golf handicap golf handicap When you make this change Sentences
preserves the original data you entered
The Dataform for an instance that has instance-specific association types includes an
additional tabbed page for the instance-specific associations The title of the tab is the
name of the instance
Business rules
Working with Sentences
220
To create an instance-specific association type highlight an instance in the explorer data
pane and select Create Association Type from the shortcut menu or click the Create
Association Type button on the Toolbar
Business rules
Version 40 of Sentences introduces Business Rules
Introduction
You may define State Domains for Sentences Types Each of these Domains has a set of
States that instances of the Type can exist in together with an assumed ldquoundefinedrdquo State
The way an instances State is determined is defined in a special Query called a Predicate
Query You can define rules stimulated by changes in State that either prohibit the change
or effect further changes mandated by them
There are two sorts of change those that alter an instance from a specified state to its new
state and those that alter an instance to its new state without regard for its prior state In
the latter case there must have been some change so all we can say is that the prior state
was not previously the ldquotordquo state
change = [state to] state
Sentences utilises two kinds of Business Rule State Rules and Change Rules A State
Rule prohibits a change
state rule =
ltchangegt prohibited
[when [not] state and | or [not] state] | Always]
The rule is created to stop a particular change from happening in specified situations
A Change Rule detects when a particular change has occurred and mandates further
changes
change rule =
ltchangegt mandates ltchange actiongt [ ltchange actiongt]
[when [not] state and | or [not] state] | Always
The changes you may wish to action are as follows
Create instance(s)
Delete instance(s)
Change association target(s)
Display a message to the user
Send a simple email
Fire a Sentences Trigger
Request that an instance changes to a specified state
Sentences V40 introduces new functionality to queries to facilitate such actions Queries
that include these actions must do so in the context of a Transaction For Business Rules
such queries are called Effector Queries
Business rules
Working with Sentences
221
Independently from Change Rules you may define an Effector Query and specify that it
will be executed when an instance changes to a given State When you create a Change
Rule you specify the change actions by specifying one or more States If the Change Rule
is stimulated then the Effector Queries of each mandated state are executed
System state domains
As well as user-defined Domains Sentences has built-in System State Domains These
allow you to define Business Rules and Effectors that are stimulated by changes managed
by the Sentences Database For example when an instance of a type comes into existence
the instances System Domain Existence changes to the System State of
ExistenceExistent You could use this state change to stimulate a Business Rule that
performs further actions when instances of that type are created
The full set of System State Domains is as follows
Domain State Cause Applies
Attributes Changed The attributes of an instance have been changed
ETs ATs
Equivalents EquivalentsAdded An instance has been made equivalent to another instance
ETs ATs
EquivalentsRemoved An instance has been made no longer equivalent to other instances
ETs ATs
Existence Nonexistent An instance has been deleted
ETs ATs
Existent An instance has been created
ETs ATs
Superseded An instance has been superseded by another instance
ETs ATs
Name Renamed An entity instance has been renamed
ETs
Sequence Resequenced An association instance has been moved within a sequence
ATs
Target Changed The target of an association instance has been changed
ATs
Uniqueness Violated An instance has been duplicated
ETs ATs
You must also be aware of timing issues when these state changes will be recognised
Once an instance has been deleted or superseded it is no longer visible even in the
context of the transaction that deleted or superseded it For this reason the
ExistenceNonexistent and ExistenceSuperseded states stimulate rules and fire their
Effector Queries just prior to them being deleted or superseded so that the effector
queries still have visibility of the instance in question
Domains and states
You may define any number of Domains for each Entity Type or Association Type
Types inherit Domains and their States from their supertypes and supersets Each Domain
can have any number of States States must have unique names within any Domain
Naming
Business rules
Working with Sentences
222
You cannot name a Domain with one of the System Domain names Duplicate Domain
names are not allowed on any one type but unrelated types can have Domains of the
same name
Generally for readability when naming Domains and States domain names should be
nouns and state names should be adjectives
The undefined state
The Undefined State is a ldquocatch allrdquo that is automatically included in all Domains It is the
state that is returned if none of the other states are valid
The Undefined State can be renamed to better reflect the Domain For example if you
have a Domain Archival with only two possible states of Ready and Pending you can
add the State Ready which you can define using an expression and rename the Undefined
State to Pending Anything that is not evaluated as Ready will have the state Pending
Viewing a types state domains
To view the State Domains for a type follow these steps
1 In the Sentences Explorer select the type that you wish to view the Domains for
in the Schema Pane and open its properties by Selecting Properties hellip from the
Edit menu
2 The Properties dialog will open Select the State Domains tab
3 The tab shows a list of all user-defined domains for that type
4 By default it will also include any inherited domains and the system domains
You may hide these domains by deselecting the Inherited and System
checkboxes on the page Inherited Domains can only be edited from the type that
they belong to
State Domains that are visible will also appear on the base Dataform
To change whether a State Domain is visible on a Dataform follow these steps
1 In the Sentences Explorer open the properies of the Type with the State Domain
and select the State Domains tab
2 Select the State Domain Node and open itrsquos pop-up menu
3 Select either ldquoSet hidden on dataformsrdquo or ldquoSet visible on dataformsrdquo
depending upon the current visibility
The same property determines whether each instance state is included in the data pane
If you are displaying State Domains in the Schema Pane then this menu option is also
available from the Schema menu in the Sentences Explorer See the ldquoUser Preferencesrdquo
section for how to change whether State Domains are displayed in the Schema Pane
Creating a state domain
To create a State Domain follow these steps
1 From the State Domains tab of the types Properties select the Create State
Domain button to open a Create State Domain Dialog
2 Enter the name of the new Domain you wish to create and select OK
3 The new Domain will be created and added to the list A blank Predicate Query
and the Undefined ldquocatch allrdquo State are also created for the new Domain
Creating states
To create one or more States for a Domain follow these steps
Business rules
Working with Sentences
223
1 From the State Domains tab of the types Properties select the State Domain that
you wish to add a State to and select the Create State button to open a Create
State Dialog
2 Enter the name of the new State you wish to create and press Enter or Select
OK The Create State Dialog does not close
3 You can enter several States by typing in the names and pressing Enter
4 When you have finished adding States select Close to close the Create State
Dialog
Editing the predicate query to define states
The Predicate Query attached to each user-defined Domain is a specialised query for the
purpose of defining how Sentences determines which state an instance of that type is in
States are not set They are transient and are interpreted at a moment in time by their
Domains Predicate Query
You cannot delete a Domains Predicate Query and it does not appear in the list of
standard queries in the Sentences Explorer
To edit a predicate query follow these steps
1 From the State Domains tab of the types Properties select the State Domain that
you wish to edit and select the Edit Query button to open a Request Query
Editor
2 If you have not edited the Predicate Query before then it will contain a data
request node for the type a domain definition request node and the undefined
state definition
3 For each State you may add a state definition request node and define its
expression such that when evaluated it will indicate whether each instance has
that State
4 To add individual states select Add State from the context menu of the domain
definition node and then the desired state from the child menu
5 To add all state definition nodes for all the states not already added select Add
all State Definition Nodes from the context menu of the domain definition node
6 The expressions entered will depend on your needs In the example below we
are concerned with an employee bonus scheme and the state of an individual
Employee
Business rules
Working with Sentences
224
The states are not necessarily mutually exclusive Ideally they would be but this is not
always practical
In the above Predicate Query the Validity can be both Close to retirement age and Invalid
at the same time In this case it is the order of the predicate expressions that determines
the state If none of these conditional statements evaluate to true then the ldquocatch allrdquo state
of Undefined becomes the instances State for the Validity Domain In this example it has
been renamed to Invalid to be more meaningful than Undefined
State Domain Analysis
When designing the State Domain and its predicate query on an existing set of data it is
useful to be able to see what the current states are There is a tool to perform this in the
Query Editor
To analyse the instances for a State Domain follow these steps
1 When editing the State Domain predicate query select the State Domain
Analysis menu item from the Tools top level menu
2 The Schema tab on the right hand side will display a panel showing the progress
and then results of the analysis This may take some time depending upon the
volume of data
3 You can select the Copy Details button to copy this summary to the clipboard
4 You can use the List button against each state count to list the individual
instances in the results pane
5 You can use the Query button against each state count to open a new query that
will return only instances with that state This is inteded to be used to manipulate
those instances For example to find all the invalid instances and perform actions
on them to make them valid Note that the predicate query must be saved before
the generated query will produce the correct results
Business rules
Working with Sentences
225
Using states in regular queries and dataforms
An instances state can be obtained in a regular query in two ways You may add a state
request node or use the GetState function in an expression
To add a State Request Node follow these steps
1 Select the Node you wish to request the State for From the context menu select
Add and then Stateshellip
2 In the dialog that opens select one or more Domain that you wish to request the
State of
3 The State Request Nodes will be added to the query node
The GetState Function for use in Query Expressions takes two parameters The first
parameter is a reference to the node for which the state is required The second parameter
should resolve to the name of the Domain for which the state is required
Note that only one state will be returned per instance If several of the State definition
expressions evaluate to true then the first one will be returned so the order of the State
definitions is important Only if none of the state definition expressions evaluate to true
will the Undefined State be returned
If a State request is included in the query that defines a Custom Dataform then the state
will be displayed as a read-only field on the dataform
Business rules
Working with Sentences
226
If the state request is bound to an instance and a Button Text attribute is specified then
the state will be represented as a button Clicking the button will fire the effecters for that
state on the dataform instance
Effector queries
Effector Queries like Predicate Queries are extensions to the standard Sentences Queries
They do not appear in the list of regular queries as their use is very specific to Business
Rules functionality
An Effector Query is a special kind of Update Query which has the ability to modify data
Its execution is intended to effect one or more changes By attaching an Effector Query to
a State you are instructing Sentences to execute the query when an instance changes to
that state In a Change Rule when you specify a State as mandated by a change you are
instructing Sentences to execute all the Effector Queries attached to that state for the
given instance
In a Change Rule the inference is that you desire one change to lead to a particular state
but this does not mean that the instance will necessarily gain that particular state or that an
Effector Query will bring about that state
Sentences V40 introduces Sandbox Modes that can be used when creating and testing
Update Queries or Effector Queries This allows you to try your Query explore and check
the results and then revert to the state the database was in before execution In this way
you can experiment without fear of corrupting your data See the section on Sandbox
Modes for details
Because an Effector Query can modify data those changes may lead to further state
changes and thus further Effector Queries being executed in the transaction
Effector query parameters
Effector queries have three built-in parameters that are populated depending upon the
kind of change that led to their execution
bull update_subject
The update_subject is populated with the instance that has been affected For
example the new instance the instance about to be deleted the instance that has been
renamed the association that has had its target changed and so on
bull update_old_name
For the special situation where an entity has been renamed it may be useful to know the
name before it was renamed The update_old_name is populated with the old name
bull update_old_target
For the special situation where an association has its target changed it may be useful to
know what the old target is The update_old_target is populated with this old target
Business rules
Working with Sentences
227
Creating an effector query
To create a new Effector Query follow these steps
1 From the State Domains tab of the types Properties select the State that you
wish to add an Effector Query to and select the Add an Effector Query button
A new blank Effector Query will be created and opened in a Query Editor for
you to define
By default the query will be based on the Domains type with a Data Request
renamed to ldquoupdate_subjectrdquo so that it is bound to the parameter of the same
name
2 You can now construct the query to include relevant data and action the changes
you desire See the next sections for each kind of change Select the Save toolbar
button and close the Query Editor once you are finished
3 The name of the query will be derived from the domain and state that you are
creating it for but you are free to rename it from the State Domains tab of the
types Properties Select the query you wish to rename and select the Rename
button or press F2
An Effector query has the same functionality as an Update Query For details of Update
Query abilities see the ldquoUpdate Queriesrdquo section
Effector triggers
Sentences Triggers provide the maximum possible flexibility when manipulating data and
were the only available mechanism to do so prior to Version 40
As well as executing one or more Effector Query when a State is mandated you may also
fire one or more Sentences Trigger
Prior to Version 40 when a trigger is fired it is passed an update object that contains
details of what was changed and why If a trigger is fired in this way then this information
is included
Creating an effector trigger
To create a new Effector Trigger follow these steps
1 From the State Domains tab of the types Properties select the State that you
wish to add an Effector Trigger to and select the Add an Effector Trigger
button The Add Effector Trigger dialog showing the available triggers will be
opened
2 Type in all or part of the trigger name to filter the list of available triggers
3 Select the desired trigger and click the Add button
4 Select another trigger or Close when done
Business rules
Business Rules allow you to define the behaviour of your application without the need for
specialist programming knowledge Once you have designed and created your State
Domains to define the states that your application entities may exist in you can use
Business Rules to prohibit undesirable behaviour and mandate desired actions when
suitably stimulated
Creating a state rule
You may use State rules to prevent undesirable behaviour
To create a State Rule follow these steps
Business rules
Working with Sentences
228
1 From the Business Rules tab of the types Properties select the Create State
Rule button A New State Rule dialog will open
2 Define the change that will be prohibited You may optionally specify the
starting state You must specify the final state
3 You may enter a name for the rule or once you have chosen From and To states
selecting the Default button will generate an appropriate name
4 Select Always to specify that the change will always be prohibited
OR
5 Select When to specify how the change will be prohibited You must enter the
condition that needs to be fulfilled for the change to be prohibited
In the example below when a Projects Name System Domain changes to the Renamed
state then that renaming is prohibited only when the instances user defined Cycle
Domain is in the Closed or Progressing states
Creating a change rule
You may use Change rules to define mandated changes as a result of suitable stimulus
To create a Change Rule follow these steps
1 From the Business Rules tab of the types Properties select the Create Change
Rule button A New Change Rule dialog will open
2 Define the change that will stimulate this rule You may optionally specify the
starting state You must specify the final state
3 You may enter a name for the rule or once you have chosen From and To states
selecting the Default button will generate an appropriate name
4 Select one or more States to be mandated You may add as many States to the
selected list as required Each will have their effector queries executed when this
rule is fired
Business rules
Working with Sentences
229
States with a red background do not have any associated Effector Queries or
Effector Triggers As such they will not affect anything You are not stopped
from adding these as you may later add effectors to them
5 Select Always to specify that the change will always mandate these states
OR
6 Select From to specify under which conditions the states will be mandated You
must enter the condition that needs to be fulfilled
The From State
When a User Defined State change triggers a business rule there are several ways to
determine if a change has taken place If you specify a specific change from state and a
different change to state then it is obvious to the system how to act You may wish to
trigger a rule to fire whenever an instance ends up in a state such as invalid regardless of
its initial state even if it started in that state You may wish to trigger a rule even if there
was no previous state before the transaction started (because the instance did not exist)
Because of this there are four predefined Change From states that you can use to
indicate the desired behaviour
bull ltAny Stategt triggers the rule when the initial state is any state including the change to
state including no previous state Any instances already in the change to state will be
triggered
bull ltAny Other Stategt triggers the rule when the initial state is any state except the
change to state including no previous state Any instances already in the change to state
will not be triggered
bull ltAny Existing Stategt triggers the rule when the initial state is any state including the
change to state except for no previous state Any instances already in the change to
state will be triggered
bull ltAny Other Existing Stategt triggers the rule when the initial state is any state except
for the change to state or no previous state Any instances already in the change to state
will not be triggered
Business rules
Working with Sentences
230
Disabling individual rules
All Business Rules or individual Business Rules can be enabled or disabled in the
properties for that Type
Business rules reference
This section gives reference information that may be useful for system designers and
administrators
Business rules parameters in the Serverproperties file
The following parameters in the Serverproperties file are used by Business Rules
bull MaxConcurrentEffectorMessages
You may use this property to specify the maximum number of Messages generated by an
Effector Query before we curtail reporting to the client (to avoid overwhelming the client)
bull MaxConcurrentEffectorSMTPEmails
You may use this property to specify the maximum number of Simple Emails generated
by an Effector Query
bull BusinessRulesDisabled
You may use this property to disable the Business Rules functionality By default
Business Rules are not disabled
bull MailSMTPHost
The MailSMTPHost property must be specified in order to send simple emails from
Effector Queries If the server requires authentication then you will also need to provide
details
bull MailSMTPUser
bull MailSMTPPassword
bull NotifyUserOfSMTPMailFailures
If the simple email SMTP details are not set up or fail for another reason the user will be
informed This property is true by default You may use this property to stop such
information being displayed by setting it to false
bull MailSMTPValidFromList
Business rules
Working with Sentences
231
As it will be an application rather than an individual that is sending the email one or more
such ldquonoreplyrdquo accounts will need to be set up for this use This property can be set to a
list of accounts that you wish to allow the users to send email from Multiple addresses
are separated by semi-colons
Browsing state domains
The Sentences Explorer Schema Panel can contain a folder that allows you to browse all
the State Domains in your Schema at once You can also use the position and filter tools
to narrow your search
The State Domains Schema Folder is displayed according to your User Preferences See
the section on User Preferences for details
Browsing business rules
The Sentences Explorer Schema Panel can contain a folder that allows you to browse all
the Business Rules in your Schema at once You can also use the position and filter tools
to narrow your search
The Sentences Dataform
Working with Sentences
232
The Business Rules Schema Folder is displayed according to your User Preferences See
the section on User Preferences for details
The Sentences Dataform
The Sentences Dataform is a dynamically generated data viewing and data entry window
In the Sentences client all entity value and association instances are created using a
Dataform
You can open a Dataform either on an association or entity type to create new instances
and optionally create the associations for those instances (see ldquoThe create Dataformrdquo ) or
on an association or entity instance to edit or update the associations for that instance (see
ldquoThe update Dataformrdquo )
The base Dataform for an entity or an association displays associations which have that
entity or association type as their source Each association is represented by a labelled
field The field label is the same as the verb of the association type and the field itself
allows you to view or define a target Each target defined in the Dataform represents an
association instance
If you defined an association type as singular then the Dataform field for that type only
allows a single entry If you defined an association type as multiple then the Dataform
field for that type allows multiple entries You can control the display of Dataform fields
using the Properties dialog or panel for each entity and association type as described in
the section ldquoPropertiesrdquo
Dataform Layout Systems
There are two systems for laying out fields in dataforms Page Layout and Section
Layout The original Page Layout system has been replaced with the more flexible and
sophisticated Sections Layout system The Section Layout system is the default but can be
changed by setting a server property See the Server properties section for details
Dataform Page Layout System
The original Dataform Page Layout System for dataforms uses a single column of fields
on multiple tabbed pages Tabbed pages are automatically generated according to the
schema structure Different supertypes subsets equivalent types and schema groups
The Sentences Dataform
Working with Sentences
233
The order in which the fields are displayed in the Dataform depends on the order in which
they appear in the schema pane If there are any association types sourced on instances of
a type the instances are displayed on their own tabbed pages as well
For further information see ldquoDataform tabbed pages with subsets and supertypesrdquo
Dataform Section Layout System
The Dataform Section Layout system uses a separate structure of Sections to define the
layout of forward and inverse Association Types and State Domains For a Custom
Dataform Derived Types can also be included in Sections
Each Section can be a logical grouping of fields but can also define presentation
attributes A Section can represent a tabbed page a bordered panel or allow the designer
to place multiple columns of fields on one dataform These Sections can themselves be
added to other Sections and so sophisticated dataform layouts can be defined
Each Entity Type and Association Type has an associated set of Sections that define the
default (base) layout for Association Types sourced on it To organise the child
Association Types and Sections select Organise Dataform Sections from the Schema
menu
The organiser dialog allows you to move child schema around create delete and modify
sections and alter some of the dataform presentation attributes common to the standard
schema properties For example whether an inverse association should be visible on
dataforms by default Hidden Association Types are shown in grey
Unlike the Page Layout System the inclusion and location of inverse associations and
State Domains can be defined
The Sections have attributes to affect the way that these children are displayed in-line
new-line or tabs There are attributes to give the section a border a title some
introductory text or footer text and how to fill the available space The title attribute is
used for a bordered panel and tabs If no title is set for a tab then the section name is used
as a default If no title is given for a bordered panel then the panel simply has a plain
border
Schema Section defaults are generated when schema is created and modified
1 When an ET or Subset is created no sections are generated
The Sentences Dataform
Working with Sentences
234
2 When an AT is created then both the source and target have Sections added (if
not already there) and then the AT is included (forwards for the source and
inverse for the target) Inverse ATs are still hidden by default Note they appear
greyed out in the Section Organiser
3 When a State Domain is created a section is added to the owning Type (if not
already there) and the domain is included in that section
4 When an AT changes its Schema Group (including being included in a group for
the first time and including being removed from all Groups) then the AT is
removed from the previous Section and included in the new Section Any
required new Section will be created (with the Group name or SourceTarget
name) If a Section is now empty after the AT is removed then the Section is
deleted
5 When an AT is deleted then it is automatically removed from the source and
target Sections created in item 2 If a Section is now empty after the AT is
removed then the Section is deleted
6 If a Type is renamed then if it has an existing Section with the old name it is
renamed to match
7 If a Schema Group is renamed then if it has an existing Section with the old
name it is renamed to match
8 If a Schema Group is deleted then the contents are moved to the appropriate type
Section (if available) If the Section for the Schema Group is empty then it is
also removed
9 If an AT has its source or target changed then any Sections for the old
sourcetarget have the AT removed and if now empty the sections are removed
The new AT is included in the new relevant Section creating a new Section if
needed
The default Schema Sections created for types will be formatted as Tab Pages that will fill
the available space vertically and horizontally by default For an Association Type that is
to be represented as a Table for Associations the default Section will be an in-line
section
In the Sentences Explorer a new schema menu item View Base Dataform Query
opens up the Query Editor with the request that is generated from the Dataform Section
metaschema This query can be saved as the starting point for a Custom Dataform
This includes the second-level requests required for tables and nested panels
Dataform Field Formatting
The way fields are displayed in the Dataform is defined in the properties for the
association type concerned For example an association that has been defined as multiple
has by default a list-box display in the Dataform
Mandatory association types are marked with an asterisk () on the Dataform You cannot
save a Dataform unless you supply a value for every mandatory association
If a dataform contains fields which are calculated then it will automatically refresh these
calculations whenever a field is changed by default This ldquoauto-refreshrdquo function can be
turned off by unchecking the box at the bottom of the dataform
For the Section Layout system there is an additional attribute for Association Types and
State Requests The Label positioning of Top Left or None can be specified
The Sentences Dataform
Working with Sentences
235
The base Dataform and the default Dataform
Sentences can always create a Dataform which automatically displays all the associations
belonging to a particular source type This is known as the base Dataform State
Domains that are viusible will also appear on the base Dataform
To change whether a State Domain is visible on a Dataform follow these steps
4 In the Sentences Explorer open the properies of the Type with the State Domain
and select the State Domains tab
5 Select the State Domain Node and open itrsquos pop-up menu
6 Select either ldquoSet hidden on dataformsrdquo or ldquoSet visible on dataformsrdquo
depending upon the current visibility
The same property determines whether each instance state is included in the data pane
If you are displaying State Domains in the Schema Pane then this menu option is also
available from the Schema menu in the Sentences Explorer See the ldquoUser Preferencesrdquo
section for how to change whether State Domains are displayed in the Schema Pane
You can use the Query Editor to design and save a custom Dataform that may only
display a selection of the available associations or inverse associations For information
see ldquoCreating a custom Dataformrdquo
You may define either the base Dataform or a custom Dataform as the default Dataform
for a source type
Sentences displays the default Dataform whenever you select the Dataform for a type
either from the Explorer or from another Dataform If you do not define a default
Dataform Sentences uses the base Dataform
To define a Dataform as the default Dataform follow these steps
1 In the Sentences Explorer highlight the entity or association type
2 Select Properties from the shortcut menu or click the Properties button on the Toolbar
3 Select the Custom Dataforms tab
4 Highlight the Dataform that you want to use as the default and click Set as Default
Create and update Dataforms
You can open a Dataform on a source entity type and use it to create new associations
This is known as a create Dataform You can also open a Dataform on any source type
or instance which can be used to update existing associations This is known as an update
Dataform
The create Dataform
You can display a create Dataform from the shortcut menu on an entity type in the
schema pane or by highlighting an entity type and clicking the Dataform button on the
toolbar An example of a create Dataform is shown in Figure 5-34 If you open a create
Dataform on a subset entity type Sentences displays the create Dataform for the subsetrsquos
superset type
Create Dataforms always show the words New xxx in their title bar (where xxx is the
name of the entity type) You can use this Dataform to create an entity and its
associations and optionally create new entities to be the targets for its associations all in
one operation
The Sentences Dataform
Working with Sentences
236
Figure 5-34 A Create Dataform
The first field on the Dataform has the name of the entity type as its label Type in the
name of the new entity you want to create in this field
You can type in new names in other fields to create additional new entities as targets of
the associations shown on the Dataform as long as those new names are valid for the
target type Alternatively you can select the association targets from existing instances of
the appropriate type
Some of the association target fields on the create Dataform include an ellipsis button
which you can click to display a picker list showing the existing instances If the display
format of the association target field does not include an ellipsis button you can right-
click on the field and choose the Select Existing Instance command from the shortcut
menu
The buttons on a parent create Dataform are Save amp Reset which updates the Dataform
contents to the database and displays a new blank Dataform Save amp Edit which updates
the Dataform contents to the database and allows you to continue to update the same
Dataform and Close which closes the Dataform If you make changes to the Dataform
the label for this button changes to Cancel
Selecting Cancel closes the Dataform without updating the database Sentences displays a
warning message that any new information in the Dataform is not saved A child
Dataform has an Apply command button which temporarily saves the Dataform contents
and allows you to continue to update the same Dataform and an Apply amp Reset button
which allows you to add additional child associations before returning to the parent
dataform Changes made on a child Dataform are only saved to the Sentences database
when you select a Save button on the parent Dataform from which it was called (see
ldquoParent Dataforms and child Dataformsrdquo)
When you open a create Dataform that includes any association type defined as
mandatory you cannot save the Dataform if you do not supply a target for that association
The update Dataform
The update Dataform is displayed when you select Dataform from the shortcut menu on
an entity or association instance in the data pane An example of an update Dataform is
shown in Figure 5-35
The Sentences Dataform
Working with Sentences
237
Figure 5-35 An entity instance update Dataform
When you open a Dataform on an entity instance the name of the entity is shown as the
first field in the window The only shortcut menu options for that field are Rename and
in the case of a Hyperlink Follow Hyperlink When you open a Dataform on an
association instance the identifying source verb and target of the subject are shown in the
window title bar
You can use the Dataform to rename the entity that appears in the first Dataform field
This field has the entity type name as its label To change the name of an entity select
Rename from the shortcut menu on this field
The Rename command is not available for value instances To change a value instance
either select a different instance from the picker list or delete the current instance and type
in a new one
Some association target fields on the update Dataform include an ellipsis button which
allows you to choose an existing entity as the target for each association Alternatively
you can create a new target entity by typing in a valid value (depending on the datatype
selected for this entity type)
The buttons on the update Dataform are Save (or Apply on a child Dataform) which
updates the Dataform contents to the database and allows you to continue to update the
same Dataform and Close which closes the Dataform If you make changes to the
Dataform the label for this button changes to Cancel Selecting Cancel closes the
Dataform without updating the database
Parent Dataforms and child Dataforms
A Dataform can be a parent or a child depending on how it was opened Any Dataform
opened from the Explorer is a parent Dataform A parent Dataform is modeless
Any Dataform opened from another Dataform is a child Dataform except in two specific
cases listed below A child Dataform is modal with respect to its own parent Dataform
but modeless with respect to any other parent Dataform the Explorer or the Query
Editor
The only cases in which a Dataform opened from another Dataform is a new parent
Dataform are
bull if the target of an association shown on the Dataform is an association and you open a
Dataform on the source of the target association
bull if the target of an association shown on the Dataform is displayed as a tree and you
open a Dataform on any level of that tree below the top level
Creating an association in the Dataform
To create an association instance using the Dataform you must first select an instance of
the required associationrsquos source and then open the Dataform for that instance
The Sentences Dataform
Working with Sentences
238
To open the Dataform you can either
bull highlight an entity type entity instance or association instance in the Sentences Explorer
and select Default Dataform from the shortcut menu or
bull highlight an entity type entity instance or association instance in the Sentences Explorer
and select the Default Dataform command on the View menu or
bull highlight an entity type entity instance or association instance in the Sentences Explorer
and select the Dataform button on the toolbar
You create an association in the Dataform by entering data in the target field As an
alternative to typing in a new value you can select from existing instances of the
appropriate type
To select an existing instance click the ellipsis button to the right of the entry field
Sentences displays a picker list from which you can select the target You canalso display
the picker list by right-clicking on the entry field and selecting Select lttarget typegt from
the shortcut menu or by pressing Alt + down arrow on the keyboard
If you select an entity or value instance from the picker list for a multiple association
Sentences first places the value in the edit field where you can edit it When you press
Enter or move to another field Sentences moves the value to the main list If you select
an association Sentences places it directly in the main list
Association type targets and metatype targets
If the target of an association type is an association type you cannot create a new instance
of the target by typing into the target field on a Dataform You can only create a new
instance by clicking the ellipsis button and selecting a target from the list displayed
Similarly if the target of an association type is a metatype you cannot create a new
instance of the target by typing into the target field on a Dataform You can only create a
new instance by clicking the ellipsis button and selecting a target from the list displayed
Dataform shortcut menu
When you right-click on a field in the Dataform Sentences displays a shortcut menu The
text of the shortcut menu commands includes the name of the association or the target
concerned This is indicated by the text in square brackets in the table below Not all
commands are available at all times for example the Create Select and Delete options
are not available if the presentation format is Radio Button or Check box
Command When Available Action
Follow Hyperlink If the target is a hyperlink
Opens browser or mail
program as required by
Hyperlink
View [association with this
target] Always
Displays a child Dataform for
the association If no
association exists the
displayed Dataform shows
the target only
View [target] Always Displays a child Dataform for
the target
View [source] When target is an
association type
Displays a parent Dataform
on the source of the target
association
The Sentences Dataform
Working with Sentences
239
Command When Available Action
Create [new association]
If this association is the
source of a further
association
Displays a child create
Dataform for the association
Create [new target] If this target is an entity type Displays a child create
Dataform for the target
Select [existing target Always Displays a picker list
Delete [association] When an association exists Deletes the association
Note The options Create [new target] Select [existing target] and Delete [association] may
be restricted or disabled by the query defining a custom Dataform
Selecting targets in the Dataform
The display of an association target in the Dataform varies according to the datatype of
the target type and the Format and Presentation options defined for the association type
and the target type
If an association target in a Dataform field is underlined this means either that the target is
a Hyperlink or that the association is itself the source of one or more further associations
If you double click a Hyperlink Sentences displays the target page for that Hyperlink in
your Web browser mail program or other application depending on the protocol being
used
If you double click an underlined target that is not a Hyperlink Sentences displays a
Dataform that has that association as its source
Double-clicking a word in a multi-line edit field selects that word
When association targets are displayed in a Table for target or Table for associations
format each field may be edited directly in the table This property can be disabled by
selecting the Disable in-place editing checkbox on the Format page of the Properties
dialog To open a child Dataform for the row displayed in a Dataform table double-click
any cell in the row The source of the child Dataform is the instance displayed first
column of the table
Creating an entity instance in the Dataform
Entity instances are always created in a Dataform When you are working in the
Sentences Explorer and want to create an entity instance follow these steps
1 Highlight an entity type name in the All types folder and select Dataform from the
shortcut menu
Note You cannot open a Dataform for a value type
Sentences displays a create Dataform (see ldquoCreate and update Dataformsrdquo ) which has the
selected entity type as its source
2 Enter the entity instance name in the first Dataform field This field has the entity type
name as its label
3 If there are any association types defined for the entity type the appropriate association
fields are displayed on the dataform and you can create the corresponding associations at
the same time as you create the entity To create an association either select an existing
instance from a Picker list or type in a new entity name Sentences automatically creates a
new entity instance of the appropriate type with the name you have used
The Sentences Dataform
Working with Sentences
240
Note Only the base Dataform contains all the associations for a type If you have defined a
custom Dataform as the default for the entity type it is possible that some associations may not
be displayed
4 Click Save amp Edit or Save amp Reset
Targets with duplicate names
Sentences uses unique hidden identifiers for entities (and for many other elements) This
means that you can create entities with duplicate names and rename entities as needed
Sentences always prompts you to confirm that you want to create a duplicate entity when
an entity with the name you are using already exists
If you type in a target name for which duplicate instances already exist Sentences
prompts you to select the correct instance by displaying the Resolve Instances dialog
This dialog displays all the identically named instances in a tree picker window which
allows you to expand the names and view their associations so that you can select the
correct instance Highlight the correct instance and click OK to make your selection
The Resolve Instances dialog is not displayed if you select a target instance from a picker
list
Targets that are subsets
The target of an association type may be a subset If you enter a new target instance for an
association type whose target is a subset Sentences checks that the instance you have
entered is a valid member of the subset
If the instance is not a valid member of the subset Sentences displays an error message
For more information on subsets see ldquoSubsets propertiesrdquo
Changing the target in a Dataform
You can change the target of an association in a Dataform either by selecting an existing
instance from a picker list or by typing in a new entity name
When you change a target Sentences checks whether the association you are changing is
the source of further associations If it is then Sentences treats changing the target in the
same way as it treats deleting a target Sentences may display a Deletion Impact dialog
listing showing what else is deleted when the target is changed
If you change the target in an association and that target is the source of a mandatory
association you must provide a value for the mandatory association before you save your
changes to the database Sentences displays an error message if you try and save without
completing all the mandatory associations
When you save a changed target on a dataform Sentences automatically checks whether
the change has affected membership of subsets
Instance specific Dataforms
When you open a Dataform on an instance that has instance specific association types
sourced on it the Dataform includes additional fields for those association types (see
ldquoInstance-specific association typesrdquo )
Picker list initial selection
Whenever you open a picker on a field in which you have started to type a new value the
picker puts the text that you have already entered into the Positioner field and performs a
positioning operation on that text
The Sentences Dataform
Working with Sentences
241
Business rules and states
Sentences Dataforms can display instance states These are displayed as read-only fields
They are not present in a Base Dataform but can be added as part of a Custom Dataform
query When a dataform is saved and not reset any states that have changed will be
updated
If a dataform field requires a particular input format or is mandatory and these
requirements have not been met then the field is highlighted in red to indicate this when
you attempt to save the changes With the introduction of Business Rules if by changing
or entering data on a dataform you directly or indirectly cause a state change that is
prohibited then the field in question will be similarly highlighted if possible
Display names
Sentences Dataforms show types display names in the dataform title and in fields if they
have Display Name Queries attached to their types Custom Dataforms can override the
Display Name Query to use (or none) for individual fields
Table and list buttons
Sentences Version 40 enhances dataform tables and lists with convenience buttons for
viewing adding and deleting items in the list or table
Creating a custom Dataform
The base Dataform for an entity or association type automatically includes all the
associations that have that type as their source When using the Section Layout system
the schema sections are used to layout the fields on the base dataform A custom
Dataform displays only those associations you choose to display Creating a custom
Dataform involves two steps
bull defining the custom Dataform on the Custom Dataform page of the Properties dialog
for the type
bull developing a query in the Query Editor which defines the associations to be displayed
on the custom Dataform and attaching it to the custom Dataform definition You may
also attach an existing query to a custom Dataform definition
Full details about using the Query Editor are given in Chapter 7 ldquoSentences queriesrdquo
The Sentences Dataform
Working with Sentences
242
To create a custom Dataform follow these steps
1 Open the Properties dialog for the entity or association type and select the Custom
Dataforms tab All the dataforms for the current type are listed including the base
dataform which always has the name of the type inside angle brackets The default
dataform is marked ltdefaultgt
2 Click Createhellip and name the custom Dataform
Figure 5-36 Selecting a query to attach to a subset
3 If you have not created a query click Edit Query Sentences creates a new query with
the current type is automatically selected as its data request node saves it with the name
you gave to the custom Dataform attaches the query to the custom Dataform definition
and opens it in the Query Editor for you to customise
4 Use the Query Editor to customise the query that includes the associations you want on
your Dataform as nodes in the request tree You can use forward and inverse associations
in the query tree Hidden nodes in the query tree are not shown in a custom Dataform
The Query Editor offers a number of options that are not suitable for use in custom
Dataforms For example select and sort nodes would generally not be appropriate for
custom Dataforms Similarly the use of parameters or the use of required nodes in the
query would not be appropriate for custom Dataform use
In addition derived type nodes are displayed as a read-only fields Sentences displays an
error message if you try to create a custom Dataform using an unsuitable query
5 Save the query and close the Query Editor
6 If you have already created a query to use for the custom Dataform definition click
Attach Query Sentences displays a list of suitable queries for the current type as shown
in Figure 5-36 For details of how Sentences determines which queries are suitable see
ldquoCustom Dataform restrictionsrdquo Select the saved query you created from the list and
click OK
The Sentences Dataform
Working with Sentences
243
7 If you want the custom Dataform to be used as the default Dataform click Set as
Default
Using the Dataform Section Layout system custom dataforms can arrange their fields in
sophisticated ways See the Human resources example profile for examples like the
Employee Custom Dataform
Refresh button on custom Dataforms
If a custom Dataform is based on a query that includes a derived type or a derivation an
additional button Refresh appears on the dataform (see ldquoDerived types and derivationsrdquo
) When this button is selected Sentences calculates the values for the derived types or
derivations shown on the Dataform The recalculation of a derivation is dependent on the
setting of its calculation option in the Derivation properties dialog (see ldquoDerivation
propertiesrdquo )
Custom Dataform restrictions
You can only use a query as the basis for a custom Dataform if it conforms to certain
rules The following conditions apply to any query that you want to use as the basis of a
custom Dataform
bull the query must have a data request node
bull the queryrsquos data request node must have a type
bull the type of the queryrsquos data request node must be related to the type that thecustom
Dataform is intended for
bull the queryrsquos data request node must not be hidden
bull the queryrsquos data request node must not be bound to an instance
bull the query may not have any parameters
bull the query may not use recursive closure or transitive closure
Triggers are not invoked when you click the Refresh button on a custom DataformThey
are invoked as normal when you click the Save button (see ldquoTrigger invocationrdquo )
Selecting a custom Dataform
You can select a custom Dataform instead of the Default Dataform from the Dataform
sub-menu of the Explorer shortcut menu
Sentences uses the first character of the custom Dataformrsquos name as a keyboard shortcut
key for the custom Dataform If the names of two or more custom Dataforms begin with
the same letter you cannot use the keyboard shortcut key to select the second or
The Dataform applet
Working with Sentences
244
subsequent custom Dataform as the key sequence always selects the first custom
Dataform
Where one or more custom Dataforms are defined for a type or for any of its supertypes
there is a choice of Dataforms that may be used to view and to create instances Define
the Dataform to be used as the default for a type using the Custom Dataforms page on
the Properties dialog
Custom Dataforms with subsets and supertypes
You cannot define a default Dataform for a subset type independently of its base type
The pages that appear on a dataform for a subset are always the same as those that appear
on the Dataform for the base type and all the criteria for the subset must be met before
the Dataform and its data can be saved
You can define different custom Dataforms for an entity type and its related supertype
and select different default Dataforms The pages displayed on these Dataforms may vary
If a Dataform includes an association that is not relevant for the selected type the field
remains blank
For more information about subsets and supertypes see the section ldquoComparison of
subsets and supertypesrdquo
The Dataform applet
You can display a Sentences Dataform as a stand-alone Java applet This is known as the
Dataform applet You can embed the Dataform applet in an HTML page on a Web server
to create a customised user interface for your Sentences database When you use the
Dataform applet you can specify the Dataform you want to use which may be either the
base Dataform or a custom Dataform for a named entity type
The dataform applet is controlled by an HTML page that supplies parameters to the applet
specifying the host and profile to use the type to open a Dataform on and (optionally) the
specific Dataform to display
An example of the Dataform applet is distributed with Sentences and can be found in the
ltSentences_homegtExamplesHTML directory To run this example with the Sentences
Enterprise Edition copy the file DataformApplethtml to your Sentences Web
application directory ltSentences_homegtTomcat4webappsSentences and open it
using your Web browser If you are using the default installation of Sentences with
Tomcat the URL is as follows
httplocalhost8090SentencesDataformApplethtml
The Dataform applet
Working with Sentences
245
Figure 5-37 Example of a Dataform applet in a browser page
The Dataform is displayed as part of the HTML page as shown in Figure 5-37 and
behaves like any other Dataform If you open other Dataforms from a Dataform applet
they are displayed in separate windows
Dataform applet code example
When you create an HTML page to launch a Sentences applet such as the Dataform
applet you can use a helper javascript library that facilitates deployment on various
browser and platform combinations See ldquoSentences client configurationrdquo for details
Applet parameters for the Dataform applet
The following parameters are used by the Dataform applet in addition to the standard
ldquoSentences applet parametersrdquo
Note that the value of the code parameter is different for each applet
bull ServletPort
The Dataform applet attempts to connect to the Sentences servlet using the host name and
port from which it was downloaded If the applet was downloaded from a URL that
included an explicit port number that port number is used for the servlet port If the
applet was downloaded from a URL that did not include an explicit port number the
servlet port defaults to 80 which is the default port for HTTP If the applet needs to
access the Sentences servlet on a different port you must specify that port number with
the ServletPort parameter
bull ServletContext
The Dataform applet
Working with Sentences
246
The first part of the URL required to access the servlet The default is Sentences This
parameter depends on the configuration of the servlet container being used For example
with ServletExec you would normally use ldquoservletrdquo This parameter is optional
bull Profile
The Profile parameter defines the default profile opened when the Dataform applet is
started The name of your profile must not contain any special characters that need to be
represented by escape sequences in HTML This parameter is mandatory
bull EditOption
The EditOption parameter specifies what parts of the database can be edited by users
The possible values for the Dataform applet are schema data and none
Parameter value Editing actions allowed
schema allows the user to edit schema queries and data
data allows the user to edit data
none no editing actions allowed
If this parameter is set to none the Dataform is read-only This optional parameter is case-
sensitive and the default is schema
bull LazyType
This parameter specifies which entity or association type to open the Dataform on The
parameter is mandatory All of the following examples are valid uses of the LazyType
parameter
ltparam name=LazyType value=Employeegt
ltparam name=LazyType value=(Employee salary Money)gt
ltparam name=LazyType value=((Person bought Car) on Date)gt
Note The LazyType parameter replaces the EntityType parameter used in Sentences
Version 20
bull LazyInstance
This is an optional parameter which specifies an instance of the specified LazyType to
open the Dataform on If it is not specified the Dataform opens as a blank create Dataform
based on the specified LazyType All of the following examples are valid uses of the
LazyInstance parameter
ltparam name=LazyInstance value=Bill Jupitergt
ltparam name=LazyInstance value=(Bill Jupiter salary20000)gt
The LazyInstance parameter is locale-sensitive so care must be taken when using it with
locale-sensitive value datatypes such as Date or Time The HTML which gives the value
of the LazyInstance parameter must be stated in a format which is valid for that datatype
in the locale of the Sentences client For example on a client running with en_GB locale
the format for a Date datatype is as follows
ltparam name= LazyInstance value=((Bill Jupiterboughtpizza) on 22012000)gt
In contrast on a client running with en_US the format for a Date datatype is as follows
ltparam name= LazyInstance value=((Bill Jupiterboughtpizza) sect
on Jan 222000)gt
Failure to use the correct format results in an error stating that the instance cannot be
found
Note The LazyInstance parameter replaces the Entity parameter used in Sentences
Version 20
The Dataform applet
Working with Sentences
247
bull LazyId
This is an optional parameter which may be used instead of the LazyInstance parameter
The LazyId parameter specifies the internal identifier of a Sentences element The
internal identifier may be useful in identifying distinct instances which share the same
name (for example where a customer list includes more than one instance named John
Smith) The format for the LazyId parameter is
ltparam name=LazyId value=12012gt
You can retrieve the internal identifiers when you run an XML Export command (see
ldquoInclude Sentences IDsrdquo )
Do not use the LazyInstance parameter and the LazyId parameter together as this
causes an error
bull EnablePickers
This parameter disables the display of picker lists in the Dataform This prevents a user
from viewing data entered by a previous user The possible values for this parameter are
Yes which allows the display of picker lists and No which disables the use of picker lists
This parameter is optional and the default value is No If you set this parameter to No to
disable the use of picker lists you can still make use of the combo box presentation
method to allow users to select from an existing list
bull SaveButtonText
This is an optional parameter that allows you to set the text on the Dataformrsquos save
button The default value for this parameter is Save (language dependent)
bull ImageURLBase
The ImageURLBase parameter specifies the URL base for the location of image files This
can either be a full format URL (for example
httpwwwanywebsiteaddresscomImages) or a relative URL Whatever is specified
in this parameter is prefixed to the image file names to allow Sentences to locate and
display images By default this is the Images subdirectory created in the
ltSentences_datagt location you chose during installation For more information see
ldquoAbout the ImageURLBase parameterrdquo
bull RequestSize
This optional parameter sets the number of data items retrieved from the Sentences
database for each request If more items exist Sentences displays the Morehellip prompt in
the relevant multiple association field in the Dataform If this parameter is not set the
dataform applet uses the value for the RequestSize parameter that has been set for the
Sentences client (see ldquoSentences Applet Parametersrdquo) The default value is 500
bull Dataform
This is an optional parameter that instructs the applet to use a specific custom Dataform
for the entity type or entity specified If this parameter is not specified the applet uses the
default Dataform If the value given for this parameter is the entity type name enclosed in
angle brackets for example ltPersongt the applet uses the base Dataform for the type
bull DisplayStatus
This parameter determines whether a status bar is shown when the applet is displayed
Possible values are yes and no The default value is yes
bull Border
This is an optional parameter which specifies a border decoration style on the Dataform
Possible values are line bevel etch and none The default value is none
bull BackgroundColour
The Picker applet
Working with Sentences
248
bull ForegroundColour
These two optional parameters allow you to specify the foreground and background
colours of the Dataform panel using the standard HTML hexadecimal coding for colours
The dataform controls are not affected If these parameters are not set the applet uses the
default system colours
Note Sentences accepts the American spelling of these parameters (BackgroundColor and
ForegroundColor) as well as the British spelling shown above
As an alternative to using only the BackgroundColour and ForegroundColour
parameters you can specify colours for a number of system features
The Picker applet
You can display a Sentences picker as an individual Java applet This is known as the
Picker applet and is illustrated in Figure 5-39 You can embed the Picker applet in an
HTML page on a Web server to create a customised user interface for your Sentences
database
An example of the picker applet is distributed with Sentences and can be found in the
ltSentences_homegtExamplesHTML directory To run this example with the Sentences
Enterprise Edition copy the file PickerApplethtml to your Sentences Web application
directory ltSentences_homegtTomcat4webappsSentences and open it using your Web
browser If you are using the default installation of Sentences with Tomcat the URL is as
follows
httplocalhost8090SentencesPickerApplethtml
The Picker applet displays a list of instances of a specified entity type or association type
from a specified profile as defined in the appletrsquos parameters
When using any of the Sentences Applets you will be asked to log in (unless anonymous
access is enabled)
The Picker applet
Working with Sentences
249
Figure 5-39 Example of Picker applet in a browser page
The picker applet is controlled by an HTML page that supplies parameters to the applet
specifying the host and profile to use and the entity or association type to open a picker
on
When you double-click on an item from the Picker applet or highlight the item and click
the Edit or the View button Sentences opens a Dataform for the selected item The
Dataform opened is a standard client dataform and not a Dataform applet
If the picker applet cannot find the profile you specify or if you specify a LazyType for
the applet that does not exist or has a duplicate in the database the applet displays an
error in the Message Log and does not run
Picker applet code example
When you create an HTML page to launch a Sentences applet such as the Picker applet
you can use a helper javascript library that facilitates deployment on various browser and
platform combinations See ldquoSentences client configurationrdquo for details
In the example of the picker applet ltSentences_homegtExamplesHTML
PickerApplethtml the instances displayed in the picker are defined by these
parameters
ProfileHuman resources
EditOptiondata
FixedProfileno
LazyTypeEmployee
CreateButtonyes
ImageURLBaseImagesForSentences
Borderetch
The Picker applet
Working with Sentences
250
This means the picker displays instances of the Person entity type from the Human
resources profile A create button will be included and there will be an etched border
around the applet
Applet parameters for the Picker applet
In some cases the parameters used by the Picker applet are identical to those supported by
the Dataform applet (see ldquoApplet parameters for the Dataform appletrdquo ) In other cases
there are variations in the way the parameters are used and there are also some
parameters that are unique to the Picker applet
The following parameters are used by the Picker applet in addition to these and the
standard ldquoSentences applet parametersrdquo
Note that the value of the code parameter is different for each applet
All the parameters used by the Picker applet are case-insensitive for both the parameter
name and the parameter value except for the value of the LazyType parameter which is
case-sensitive
The following parameters are used by the Picker applet in exactly the same way as they
are used by the Dataform applet
bull ServletPort
bull ServletContext
bull Profile
bull ImageURLBase
bull LazyType
bull Dataform
bull DisplayStatus
bull Border
bull BackgroundColour
bull ForegroundColour
The following parameters are used by the Picker applet with variations from the way they
are used for the Dataform applet
bull EditOption
The EditOption parameter specifies what parts of the database can be edited by users
The possible values for the Picker applet are data and none
Parameter Value Editing Actions Allowed
data allows the user to edit data
none no editing actions allowed
If this parameter is set to none users may only view existing values from the Picker
applet The default setting for this parameter is none
The setting of this parameter affects the display of pickers in any Dataform opened from
the Picker applet and the display of buttons on the Picker applet If the EditOption
parameter is set to none the Picker applet displays a View button and the Create and
Edit buttons are not displayed
bull EnablePickers
The Query applet
Working with Sentences
251
This parameter determines the display of picker lists in any Dataform launched from the
Picker applet The possible values for this parameter are Yes which allows the display of
picker lists and No which disables the use of picker lists
The default value is Yes unless the EditOption parameter is set to none in which case
picker list use is disabled irrespective of the setting for this parameter
The following parameters used by the Dataform applet are not supported by the Picker
applet
bull LazyInstance
bull LazyId
bull SaveButtonText
The following parameters are unique to the Picker applet
bull Picker
This parameter defines the style of picker displayed It has a similar function to the
Picker options on the Format properties page The possible values for this parameter are
Tree and List The Calendar picker is not available If this parameter is not specified
the style of picker defined for the type is used
bull ShowTitle
This parameter defines whether or not there is a title embedded at the top of the applet
The possible values are yes or no If this parameter is not supplied the default value is
yes The title displayed is the name of the type on which the Picker applet is opened
bull CreateButton
This parameter determines whether a Create button is displayed in the Picker applet
which allows users to create new instances of the displayed type The possible values for
this parameter are Yes and No The default value is Yes The Create button is not
displayed if any of the following conditions are met irrespective of the setting of this
parameter
bull the Profile opened by the Picker applet does not allow data changes
bull the EditOption parameter is set to none
bull the Picker applet is used on an association type
bull the Picker applet is used on a type which has Prohibit New Instances set
bull the Picker applet is used on a type which is a subset
bull DeleteButton
This parameter determines whether a Delete button is displayed in the Picker applet
which allows users to delete existing instances of the displayed type The possible values
for this parameter are Yes and No The default value is No
The Delete button is not displayed if the Profile opened by the Picker applet does not
allow data changes
The Query applet
You can access query results using a Java applet known as the Query applet When you
use the Query applet with a query that makes use of query parameters the applet display
which is illustrated in Figure 5-41 resembles the Query parameters dialog (see
ldquoExecuting a query which has parametersrdquo ) If the query does not makes use of query
parameters Sentences displays a dialog similar to the Query parameters dialog which
does not have any fields
The Query applet cannot be used with Set Queries
The Query applet
Working with Sentences
252
An example of the Query applet is distributed with Sentences and can be found in the
ltSentences_homegtExamplesHTML directory To run this example with the Sentences
Enterprise Edition copy the file QueryApplethtml to your Sentences Web application
directory ltSentences_homegtTomcat4webappsSentences and open it using your Web
browser If you are using the default installation of Sentences with Tomcat the URL is as
follows
httplocalhost8090SentencesQueryApplethtml
Figure 5-41 Example of the Query applet display for a query with parameters
You can embed the Query applet in an HTML page on a Web server to create a
customised user interface for query results from your Sentences database
To run the query select the appropriate parameter values and click OK While Sentences
executes the query it displays a Cancel button This button may not be visible if the query
is executed very quickly
By default the query results are displayed in the same way as they are if you select the
View XML results option for the same query using the XML parameters attached to the
query You cannot specify different XML parameters when running the Query Applet
The resulting data may be either XML or HTML data depending on whether the XML
parameters specify a stylesheet to be used and which kind of data such a stylesheet
generates (see ldquoView query results as XMLrdquo )
Query applet code example
When you create an HTML page to launch a Sentences applet such as the Query applet
you can use a helper javascript library that facilitates deployment on various browser and
platform combinations See ldquoSentences client configurationrdquo for details
In the example of the query applet ltSentences_homegtExamplesHTML
QueryApplethtml the instances displayed in the query applet are defined by these
parameters
ProfileHuman resources
LazyQueryProject resources
Bordernone
ImageURLBaseImagesForSentences